diff --git a/CMakeLists.txt b/CMakeLists.txt index c93eba23ce..6fd7f9370f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # Verify minimum required version -cmake_minimum_required(VERSION 3.6.2) +cmake_minimum_required(VERSION 3.15) cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH is enabled by default. @@ -13,18 +13,19 @@ project(diagnostics) include(eng/native/configurepaths.cmake) include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake) -# override some global configs -if (MSVC) - add_compile_options(/wd4960 /wd4961 /wd4603 /wd4627 /wd4838 /wd4456 /wd4457 /wd4458 /wd4459 /wd4091 /we4640) - add_compile_options($<$:/EHsc>) - add_compile_options($<$,$>:/MT>) - add_compile_options($<$,$>:/MTd>) -else (MSVC) - add_compile_options(-Wno-unused-parameter) - add_compile_options(-Wno-unused-variable) - add_compile_options(-Wno-implicit-fallthrough) +if(CLR_CMAKE_HOST_UNIX) + # The -fms-extensions enable the stuff like __if_exists, __declspec(uuid()), etc. + add_compile_options(-fms-extensions) + #-fms-compatibility Enable full Microsoft Visual C++ compatibility + #-fms-extensions Accept some non-standard constructs supported by the Microsoft compiler add_compile_options(-fvisibility=default) -endif (MSVC) +endif(CLR_CMAKE_HOST_UNIX) + +if (CMAKE_VERSION VERSION_LESS "3.16") + # Provide a no-op polyfill for precompiled headers on old CMake versions + function(target_precompile_headers) + endfunction() +endif() # Register the default component set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME diagnostics) @@ -48,7 +49,7 @@ endif(CLR_CMAKE_HOST_UNIX) # Where _version.h for Windows is generated if(CLR_CMAKE_HOST_WIN32) -include_directories(${CLR_ARTIFACTS_OBJ_DIR}) + include_directories(${CLR_ARTIFACTS_OBJ_DIR}) endif(CLR_CMAKE_HOST_WIN32) set(CORECLR_SET_RPATH ON) @@ -100,6 +101,11 @@ elseif (CLR_CMAKE_HOST_ARCH_RISCV64) add_definitions(-DRISCV64) add_definitions(-D_WIN64) add_definitions(-DBIT64=1) +elseif (CLR_CMAKE_HOST_ARCH_LOONGARCH64) + add_definitions(-D_LOONGARCH64_) + add_definitions(-DLOONGARCH64) + add_definitions(-D_WIN64) + add_definitions(-DBIT64=1) else () clr_unknown_arch() endif () @@ -156,6 +162,14 @@ elseif (CLR_CMAKE_TARGET_ARCH_RISCV64) add_definitions(-DDBG_TARGET_64BIT=1) add_definitions(-DDBG_TARGET_WIN64=1) add_definitions(-DFEATURE_MULTIREG_RETURN) +elseif (CLR_CMAKE_TARGET_ARCH_LOONGARCH64) + add_definitions(-DDBG_TARGET_LOONGARCH64_UNIX) + add_definitions(-D_TARGET_LOONGARCH64_=1) + add_definitions(-D_TARGET_64BIT_=1) + add_definitions(-DDBG_TARGET_LOONGARCH64=1) + add_definitions(-DDBG_TARGET_64BIT=1) + add_definitions(-DDBG_TARGET_WIN64=1) + add_definitions(-DFEATURE_MULTIREG_RETURN) else () clr_unknown_arch() endif (CLR_CMAKE_TARGET_ARCH_AMD64) @@ -169,42 +183,14 @@ if(CLR_CMAKE_HOST_WIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif(CLR_CMAKE_HOST_WIN32) -add_definitions(-DUNICODE) -add_definitions(-D_UNICODE) - #-------------------------------------- # FEATURE Defines #-------------------------------------- -add_definitions(-DFEATURE_CORESYSTEM) - if(CLR_CMAKE_HOST_UNIX) - add_definitions(-DPLATFORM_UNIX=1) add_definitions(-DFEATURE_PAL) - add_definitions(-DFEATURE_PAL_ANSI) endif(CLR_CMAKE_HOST_UNIX) -if(CLR_CMAKE_HOST_WIN32) - add_definitions(-DFEATURE_COMINTEROP) -endif(CLR_CMAKE_HOST_WIN32) - -if(NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD) - add_definitions(-DFEATURE_HIJACK) -endif(NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD) - -if(FEATURE_EVENT_TRACE) - add_definitions(-DFEATURE_EVENT_TRACE=1) - add_definitions(-DFEATURE_PERFTRACING=1) -endif(FEATURE_EVENT_TRACE) - -if(CLR_CMAKE_HOST_UNIX_AMD64) - add_definitions(-DFEATURE_MULTIREG_RETURN) -endif (CLR_CMAKE_HOST_UNIX_AMD64) - -if(CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_ARCH_AMD64) - add_definitions(-DUNIX_AMD64_ABI) -endif(CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_ARCH_AMD64) - #----------------------------------------- # Native Projects #----------------------------------------- diff --git a/debuggees.sln b/debuggees.sln index 731e71af09..8786ab4f78 100644 --- a/debuggees.sln +++ b/debuggees.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29019.234 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35309.182 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDebuggee", "src\SOS\lldbplugin.tests\TestDebuggee\TestDebuggee.csproj", "{6C43BE85-F8C3-4D76-8050-F25CE953A7FD}" EndProject @@ -39,6 +39,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GCPOH", "src\SOS\SOS.UnitTe EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotnetDumpCommands", "src\SOS\SOS.UnitTests\Debuggees\DotnetDumpCommands\DotnetDumpCommands.csproj", "{F9A69812-DC52-428D-9DB1-8B831A8FF776}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DynamicMethod", "src\SOS\SOS.UnitTests\Debuggees\DynamicMethod\DynamicMethod.csproj", "{2F9AA5A9-D42A-42C6-B483-1B9284C62F91}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Checked|Any CPU = Checked|Any CPU @@ -663,6 +665,46 @@ Global {F9A69812-DC52-428D-9DB1-8B831A8FF776}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {F9A69812-DC52-428D-9DB1-8B831A8FF776}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {F9A69812-DC52-428D-9DB1-8B831A8FF776}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|Any CPU.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|ARM.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|ARM.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|ARM64.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|ARM64.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|x64.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|x64.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|x86.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Checked|x86.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|ARM.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|ARM.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|ARM64.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|x64.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|x64.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|x86.ActiveCfg = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Debug|x86.Build.0 = Debug|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|Any CPU.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|ARM.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|ARM.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|ARM64.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|ARM64.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|x64.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|x64.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|x86.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.Release|x86.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|ARM.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|ARM.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|ARM64.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|ARM64.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91}.RelWithDebInfo|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -685,6 +727,7 @@ Global {84881FB8-37E1-4D9B-B27E-9831C30DCC04} = {C3072949-6D24-451B-A308-2F3621F858B0} {0A34CA51-8B8C-41A1-BE24-AB2C574EA144} = {C3072949-6D24-451B-A308-2F3621F858B0} {F9A69812-DC52-428D-9DB1-8B831A8FF776} = {C3072949-6D24-451B-A308-2F3621F858B0} + {2F9AA5A9-D42A-42C6-B483-1B9284C62F91} = {C3072949-6D24-451B-A308-2F3621F858B0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {46465737-C938-44FC-BE1A-4CE139EBB5E0} diff --git a/diagnostics.sln b/diagnostics.sln index b9a9784095..91ac02996f 100644 --- a/diagnostics.sln +++ b/diagnostics.sln @@ -106,7 +106,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "inc", "inc", "{41BDFD6D-D16 src\shared\inc\dacprivate.h = src\shared\inc\dacprivate.h src\shared\inc\dbgenginemetrics.h = src\shared\inc\dbgenginemetrics.h src\shared\inc\dbgportable.h = src\shared\inc\dbgportable.h - src\shared\inc\dbgtargetcontext.h = src\shared\inc\dbgtargetcontext.h src\shared\inc\dbgutil.h = src\shared\inc\dbgutil.h src\shared\inc\debugmacros.h = src\shared\inc\debugmacros.h src\shared\inc\debugmacrosext.h = src\shared\inc\debugmacrosext.h @@ -156,7 +155,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "inc", "inc", "{41BDFD6D-D16 src\shared\inc\readytoruninstructionset.h = src\shared\inc\readytoruninstructionset.h src\shared\inc\regdisp.h = src\shared\inc\regdisp.h src\shared\inc\registrywrapper.h = src\shared\inc\registrywrapper.h - src\shared\inc\releaseholder.h = src\shared\inc\releaseholder.h src\shared\inc\resource.h = src\shared\inc\resource.h src\shared\inc\runtimeinfo.h = src\shared\inc\runtimeinfo.h src\shared\inc\safemath.h = src\shared\inc\safemath.h @@ -187,15 +185,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "inc", "inc", "{41BDFD6D-D16 src\shared\inc\yieldprocessornormalized.h = src\shared\inc\yieldprocessornormalized.h EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "clr_std", "clr_std", "{33239640-6F4B-4DA4-A780-2F5B26D57EAD}" - ProjectSection(SolutionItems) = preProject - src\shared\inc\clr_std\algorithm = src\shared\inc\clr_std\algorithm - src\shared\inc\clr_std\string = src\shared\inc\clr_std\string - src\shared\inc\clr_std\type_traits = src\shared\inc\clr_std\type_traits - src\shared\inc\clr_std\utility = src\shared\inc\clr_std\utility - src\shared\inc\clr_std\vector = src\shared\inc\clr_std\vector - EndProjectSection -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "llvm", "llvm", "{06730767-421B-465F-BB63-A3A07D72D7A2}" ProjectSection(SolutionItems) = preProject src\shared\inc\llvm\Dwarf.def = src\shared\inc\llvm\Dwarf.def @@ -221,10 +210,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "inc", "inc", "{BE45F03E-D70 ProjectSection(SolutionItems) = preProject src\SOS\inc\clrma.h = src\SOS\inc\clrma.h src\SOS\inc\clrma.idl = src\SOS\inc\clrma.idl + src\SOS\inc\clrmaservice.h = src\SOS\inc\clrmaservice.h src\SOS\inc\debuggerservices.h = src\SOS\inc\debuggerservices.h src\SOS\inc\host.h = src\SOS\inc\host.h src\SOS\inc\hostservices.h = src\SOS\inc\hostservices.h src\SOS\inc\lldbservices.h = src\SOS\inc\lldbservices.h + src\SOS\inc\outputservice.h = src\SOS\inc\outputservice.h src\SOS\inc\remotememoryservice.h = src\SOS\inc\remotememoryservice.h src\SOS\inc\runtime.h = src\SOS\inc\runtime.h src\SOS\inc\specialdiaginfo.h = src\SOS\inc\specialdiaginfo.h @@ -252,15 +243,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{7852ED src\shared\README.txt = src\shared\README.txt EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dbgutil", "src\shared\dbgutil\dbgutil.vcxproj", "{A9A7C879-C320-3327-BB84-16E1322E17AE}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gcdump", "src\shared\gcdump\gcdump.vcxproj", "{20EBC3C4-917C-402D-B778-9A6E3742BF5A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utilcode", "src\shared\utilcode\utilcode.vcxproj", "{8C35FEF8-1101-38F6-ACD0-462A1EA53A7D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "minipal", "minipal", "{795B7A50-1B1F-406E-94E0-F9B35104EF22}" ProjectSection(SolutionItems) = preProject - src\shared\minipal\utils.h = src\shared\minipal\utils.h + src\shared\minipal\CMakeLists.txt = src\shared\minipal\CMakeLists.txt + src\shared\minipal\dn-u16.h = src\shared\minipal\dn-u16.h EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DbgShim.UnitTests", "src\tests\DbgShim.UnitTests\DbgShim.UnitTests.csproj", "{DD60B7C4-BECC-4C7D-A53B-FCDD4C92B728}" @@ -287,6 +277,81 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SymbolStore.UnitT EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.SymbolManifestGenerator", "src\Microsoft.SymbolManifestGenerator\Microsoft.SymbolManifestGenerator.csproj", "{28B55114-88C0-44B6-BBD8-50C14ED59EE2}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dbgutil", "src\shared\debug\dbgutil\dbgutil.vcxproj", "{A9A7C879-C320-3327-BB84-16E1322E17AE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "debug", "debug", "{00D9021E-A202-4BCB-9A59-13D5BEEBF423}" + ProjectSection(SolutionItems) = preProject + src\shared\debug\CMakeLists.txt = src\shared\debug\CMakeLists.txt + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "inc", "inc", "{19663AE5-3EEA-472E-B157-37C2C7C6BACB}" + ProjectSection(SolutionItems) = preProject + src\shared\debug\inc\dbgtargetcontext.h = src\shared\debug\inc\dbgtargetcontext.h + src\shared\debug\inc\dbgutil.h = src\shared\debug\inc\dbgutil.h + src\shared\debug\inc\runtimeinfo.h = src\shared\debug\inc\runtimeinfo.h + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dump", "dump", "{3B26AB4F-8129-4DAF-8BB0-A6075663F6D2}" + ProjectSection(SolutionItems) = preProject + src\shared\debug\inc\dump\dumpcommon.h = src\shared\debug\inc\dump\dumpcommon.h + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Unix", "Unix", "{8944D9BF-69ED-4798-B533-559CAB011B07}" + ProjectSection(SolutionItems) = preProject + src\shared\minipal\Unix\CMakeLists.txt = src\shared\minipal\Unix\CMakeLists.txt + src\shared\minipal\Unix\dn-u16.cpp = src\shared\minipal\Unix\dn-u16.cpp + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Windows", "Windows", "{06FB18BC-F4DD-4DB9-A566-551254CD1064}" + ProjectSection(SolutionItems) = preProject + src\shared\minipal\Windows\CMakeLists.txt = src\shared\minipal\Windows\CMakeLists.txt + src\shared\minipal\Windows\dn-u16.cpp = src\shared\minipal\Windows\dn-u16.cpp + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "native", "native", "{641F00F0-2693-451B-A96A-13E4E115BF0F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "minipal", "minipal", "{D9A91544-CDF8-4C68-BAD2-47F4968A8652}" + ProjectSection(SolutionItems) = preProject + src\shared\native\minipal\asansupport.cpp = src\shared\native\minipal\asansupport.cpp + src\shared\native\minipal\configure.cmake = src\shared\native\minipal\configure.cmake + src\shared\native\minipal\cpufeatures.c = src\shared\native\minipal\cpufeatures.c + src\shared\native\minipal\cpufeatures.h = src\shared\native\minipal\cpufeatures.h + src\shared\native\minipal\cpuid.h = src\shared\native\minipal\cpuid.h + src\shared\native\minipal\entrypoints.h = src\shared\native\minipal\entrypoints.h + src\shared\native\minipal\getexepath.h = src\shared\native\minipal\getexepath.h + src\shared\native\minipal\minipalconfig.h.in = src\shared\native\minipal\minipalconfig.h.in + src\shared\native\minipal\random.c = src\shared\native\minipal\random.c + src\shared\native\minipal\random.h = src\shared\native\minipal\random.h + src\shared\native\minipal\strings.h = src\shared\native\minipal\strings.h + src\shared\native\minipal\time.c = src\shared\native\minipal\time.c + src\shared\native\minipal\time.h = src\shared\native\minipal\time.h + src\shared\native\minipal\types.h = src\shared\native\minipal\types.h + src\shared\native\minipal\unicodedata.c = src\shared\native\minipal\unicodedata.c + src\shared\native\minipal\utf8.c = src\shared\native\minipal\utf8.c + src\shared\native\minipal\utf8.h = src\shared\native\minipal\utf8.h + src\shared\native\minipal\utils.h = src\shared\native\minipal\utils.h + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "inc", "inc", "{9E51C821-4095-4250-BD8A-2A29396DB1B4}" + ProjectSection(SolutionItems) = preProject + src\inc\corcompile.h = src\inc\corcompile.h + src\inc\ntimageex.h = src\inc\ntimageex.h + src\inc\releaseholder.h = src\inc\releaseholder.h + src\inc\stacktrace.h = src\inc\stacktrace.h + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rt", "rt", "{D2D76252-D225-4B79-9DDB-A36867A4720E}" + ProjectSection(SolutionItems) = preProject + src\inc\rt\intsafe.h = src\inc\rt\intsafe.h + src\inc\rt\oaidl.h = src\inc\rt\oaidl.h + src\inc\rt\psapi.h = src\inc\rt\psapi.h + src\inc\rt\tchar.h = src\inc\rt\tchar.h + src\inc\rt\tlhelp32.h = src\inc\rt\tlhelp32.h + src\inc\rt\winapifamily.h = src\inc\rt\winapifamily.h + src\inc\rt\winternl.h = src\inc\rt\winternl.h + src\inc\rt\winver.h = src\inc\rt\winver.h + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Checked|Any CPU = Checked|Any CPU @@ -412,7 +477,6 @@ Global {D52C65C4-2C7D-45E6-9F5C-6F3A96796018}.Release|ARM.ActiveCfg = Release|x86 {D52C65C4-2C7D-45E6-9F5C-6F3A96796018}.Release|ARM64.ActiveCfg = Release|x86 {D52C65C4-2C7D-45E6-9F5C-6F3A96796018}.Release|x64.ActiveCfg = Release|x64 - {D52C65C4-2C7D-45E6-9F5C-6F3A96796018}.Release|x64.Build.0 = Release|x64 {D52C65C4-2C7D-45E6-9F5C-6F3A96796018}.Release|x86.ActiveCfg = Release|x86 {D52C65C4-2C7D-45E6-9F5C-6F3A96796018}.RelWithDebInfo|Any CPU.ActiveCfg = Release|x64 {D52C65C4-2C7D-45E6-9F5C-6F3A96796018}.RelWithDebInfo|Any CPU.Build.0 = Release|x64 @@ -520,7 +584,6 @@ Global {41F59D85-FC36-3015-861B-F177863252BC}.Release|ARM.ActiveCfg = Release|x64 {41F59D85-FC36-3015-861B-F177863252BC}.Release|ARM64.ActiveCfg = Release|x64 {41F59D85-FC36-3015-861B-F177863252BC}.Release|x64.ActiveCfg = Release|x64 - {41F59D85-FC36-3015-861B-F177863252BC}.Release|x64.Build.0 = Release|x64 {41F59D85-FC36-3015-861B-F177863252BC}.Release|x86.ActiveCfg = Release|x64 {41F59D85-FC36-3015-861B-F177863252BC}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|x64 {41F59D85-FC36-3015-861B-F177863252BC}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|x64 @@ -1504,7 +1567,6 @@ Global {EEC90A42-CDCD-4EE3-B47D-C109D604E7E2}.Release|ARM.ActiveCfg = Release|x64 {EEC90A42-CDCD-4EE3-B47D-C109D604E7E2}.Release|ARM64.ActiveCfg = Release|x64 {EEC90A42-CDCD-4EE3-B47D-C109D604E7E2}.Release|x64.ActiveCfg = Release|x64 - {EEC90A42-CDCD-4EE3-B47D-C109D604E7E2}.Release|x64.Build.0 = Release|x64 {EEC90A42-CDCD-4EE3-B47D-C109D604E7E2}.Release|x86.ActiveCfg = Release|x64 {EEC90A42-CDCD-4EE3-B47D-C109D604E7E2}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|x64 {EEC90A42-CDCD-4EE3-B47D-C109D604E7E2}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|x64 @@ -1688,7 +1750,6 @@ Global {BD779298-8631-3F5D-AA59-82897E5454A7}.Release|ARM.ActiveCfg = Release|x64 {BD779298-8631-3F5D-AA59-82897E5454A7}.Release|ARM64.ActiveCfg = Release|x64 {BD779298-8631-3F5D-AA59-82897E5454A7}.Release|x64.ActiveCfg = Release|x64 - {BD779298-8631-3F5D-AA59-82897E5454A7}.Release|x64.Build.0 = Release|x64 {BD779298-8631-3F5D-AA59-82897E5454A7}.Release|x86.ActiveCfg = Release|x64 {BD779298-8631-3F5D-AA59-82897E5454A7}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|x64 {BD779298-8631-3F5D-AA59-82897E5454A7}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|x64 @@ -1696,30 +1757,6 @@ Global {BD779298-8631-3F5D-AA59-82897E5454A7}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 {BD779298-8631-3F5D-AA59-82897E5454A7}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 {BD779298-8631-3F5D-AA59-82897E5454A7}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|Any CPU.ActiveCfg = Checked|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|ARM.ActiveCfg = Checked|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|ARM64.ActiveCfg = Checked|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|x64.ActiveCfg = Checked|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|x64.Build.0 = Checked|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|x86.ActiveCfg = Checked|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|Any CPU.ActiveCfg = Debug|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|ARM.ActiveCfg = Debug|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|ARM64.ActiveCfg = Debug|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|x64.ActiveCfg = Debug|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|x64.Build.0 = Debug|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|x86.ActiveCfg = Debug|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|Any CPU.ActiveCfg = Release|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|ARM.ActiveCfg = Release|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|ARM64.ActiveCfg = Release|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|x64.ActiveCfg = Release|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|x64.Build.0 = Release|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|x86.ActiveCfg = Release|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.Checked|Any CPU.ActiveCfg = Checked|x64 {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.Checked|ARM.ActiveCfg = Checked|x64 {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.Checked|ARM64.ActiveCfg = Checked|x64 @@ -1736,7 +1773,6 @@ Global {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.Release|ARM.ActiveCfg = Release|x64 {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.Release|ARM64.ActiveCfg = Release|x64 {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.Release|x64.ActiveCfg = Release|x64 - {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.Release|x64.Build.0 = Release|x64 {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.Release|x86.ActiveCfg = Release|x64 {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|x64 {20EBC3C4-917C-402D-B778-9A6E3742BF5A}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|x64 @@ -1760,7 +1796,6 @@ Global {8C35FEF8-1101-38F6-ACD0-462A1EA53A7D}.Release|ARM.ActiveCfg = Release|x64 {8C35FEF8-1101-38F6-ACD0-462A1EA53A7D}.Release|ARM64.ActiveCfg = Release|x64 {8C35FEF8-1101-38F6-ACD0-462A1EA53A7D}.Release|x64.ActiveCfg = Release|x64 - {8C35FEF8-1101-38F6-ACD0-462A1EA53A7D}.Release|x64.Build.0 = Release|x64 {8C35FEF8-1101-38F6-ACD0-462A1EA53A7D}.Release|x86.ActiveCfg = Release|x64 {8C35FEF8-1101-38F6-ACD0-462A1EA53A7D}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|x64 {8C35FEF8-1101-38F6-ACD0-462A1EA53A7D}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|x64 @@ -1869,13 +1904,9 @@ Global {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Debug|x86.Build.0 = Debug|Any CPU {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Release|Any CPU.ActiveCfg = Release|Any CPU {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Release|ARM.ActiveCfg = Release|Any CPU - {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Release|ARM.Build.0 = Release|Any CPU {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Release|ARM64.ActiveCfg = Release|Any CPU - {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Release|ARM64.Build.0 = Release|Any CPU {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Release|x64.ActiveCfg = Release|Any CPU - {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Release|x64.Build.0 = Release|Any CPU {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Release|x86.ActiveCfg = Release|Any CPU - {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.Release|x86.Build.0 = Release|Any CPU {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU {E8F133F8-4D20-475D-9D16-2BA236DAB65F}.RelWithDebInfo|ARM.ActiveCfg = Release|Any CPU @@ -2246,6 +2277,40 @@ Global {28B55114-88C0-44B6-BBD8-50C14ED59EE2}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {28B55114-88C0-44B6-BBD8-50C14ED59EE2}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {28B55114-88C0-44B6-BBD8-50C14ED59EE2}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|Any CPU.ActiveCfg = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|Any CPU.Build.0 = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|ARM.ActiveCfg = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|ARM.Build.0 = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|ARM64.ActiveCfg = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|ARM64.Build.0 = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|x64.ActiveCfg = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|x64.Build.0 = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|x86.ActiveCfg = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Checked|x86.Build.0 = Checked|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|Any CPU.ActiveCfg = Debug|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|ARM.ActiveCfg = Debug|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|ARM.Build.0 = Debug|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|ARM64.ActiveCfg = Debug|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|ARM64.Build.0 = Debug|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|x64.ActiveCfg = Debug|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|x64.Build.0 = Debug|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|x86.ActiveCfg = Debug|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Debug|x86.Build.0 = Debug|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|Any CPU.ActiveCfg = Release|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|ARM.ActiveCfg = Release|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|ARM64.ActiveCfg = Release|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|x64.ActiveCfg = Release|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.Release|x86.ActiveCfg = Release|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|ARM.ActiveCfg = RelWithDebInfo|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|ARM.Build.0 = RelWithDebInfo|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|ARM64.ActiveCfg = RelWithDebInfo|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|ARM64.Build.0 = RelWithDebInfo|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 + {A9A7C879-C320-3327-BB84-16E1322E17AE}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2279,7 +2344,6 @@ Global {C457CBCD-3A8D-4402-9A2B-693A0390D3F9} = {298AE119-6625-4604-BDE5-0765DC34C856} {CFCF90E5-91CF-44FD-819D-97F530AEF769} = {19FAB78C-3351-4911-8F0C-8C6056401740} {41BDFD6D-D165-4D67-BEF6-4E539040D30A} = {7852EDE4-93DF-4DB1-8A86-C521703811AF} - {33239640-6F4B-4DA4-A780-2F5B26D57EAD} = {41BDFD6D-D165-4D67-BEF6-4E539040D30A} {06730767-421B-465F-BB63-A3A07D72D7A2} = {41BDFD6D-D165-4D67-BEF6-4E539040D30A} {6419BA04-6F1A-4D2F-8DE4-5C359E0364A3} = {03479E19-3F18-49A6-910A-F5041E27E7C0} {870A7AD0-B808-491E-92F6-433BE990B374} = {03479E19-3F18-49A6-910A-F5041E27E7C0} @@ -2297,7 +2361,6 @@ Global {2BD55143-B102-4FEC-84AD-DC3B330FA9AC} = {B62728C8-1267-4043-B46F-5537BBAEC692} {BD779298-8631-3F5D-AA59-82897E5454A7} = {19FAB78C-3351-4911-8F0C-8C6056401740} {7852EDE4-93DF-4DB1-8A86-C521703811AF} = {19FAB78C-3351-4911-8F0C-8C6056401740} - {A9A7C879-C320-3327-BB84-16E1322E17AE} = {7852EDE4-93DF-4DB1-8A86-C521703811AF} {20EBC3C4-917C-402D-B778-9A6E3742BF5A} = {7852EDE4-93DF-4DB1-8A86-C521703811AF} {8C35FEF8-1101-38F6-ACD0-462A1EA53A7D} = {7852EDE4-93DF-4DB1-8A86-C521703811AF} {795B7A50-1B1F-406E-94E0-F9B35104EF22} = {7852EDE4-93DF-4DB1-8A86-C521703811AF} @@ -2313,6 +2376,16 @@ Global {44F93947-8FD4-4946-8AE5-EF6D25970CC7} = {03479E19-3F18-49A6-910A-F5041E27E7C0} {C2422836-BA25-4751-9060-7C7890085869} = {03479E19-3F18-49A6-910A-F5041E27E7C0} {28B55114-88C0-44B6-BBD8-50C14ED59EE2} = {19FAB78C-3351-4911-8F0C-8C6056401740} + {A9A7C879-C320-3327-BB84-16E1322E17AE} = {00D9021E-A202-4BCB-9A59-13D5BEEBF423} + {00D9021E-A202-4BCB-9A59-13D5BEEBF423} = {7852EDE4-93DF-4DB1-8A86-C521703811AF} + {19663AE5-3EEA-472E-B157-37C2C7C6BACB} = {00D9021E-A202-4BCB-9A59-13D5BEEBF423} + {3B26AB4F-8129-4DAF-8BB0-A6075663F6D2} = {19663AE5-3EEA-472E-B157-37C2C7C6BACB} + {8944D9BF-69ED-4798-B533-559CAB011B07} = {795B7A50-1B1F-406E-94E0-F9B35104EF22} + {06FB18BC-F4DD-4DB9-A566-551254CD1064} = {795B7A50-1B1F-406E-94E0-F9B35104EF22} + {641F00F0-2693-451B-A96A-13E4E115BF0F} = {7852EDE4-93DF-4DB1-8A86-C521703811AF} + {D9A91544-CDF8-4C68-BAD2-47F4968A8652} = {641F00F0-2693-451B-A96A-13E4E115BF0F} + {9E51C821-4095-4250-BD8A-2A29396DB1B4} = {19FAB78C-3351-4911-8F0C-8C6056401740} + {D2D76252-D225-4B79-9DDB-A36867A4720E} = {9E51C821-4095-4250-BD8A-2A29396DB1B4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {46465737-C938-44FC-BE1A-4CE139EBB5E0} diff --git a/documentation/clrma.md b/documentation/clrma.md new file mode 100644 index 0000000000..11fefb5a6f --- /dev/null +++ b/documentation/clrma.md @@ -0,0 +1,75 @@ +## SOS Watson/!analyze support + +This document summarizes what functionality is needed by Watson/!analyze to properly bucket crash dumps. The audience is the runtime devs working on the cDAC. Historically !analyze wrapped calls to SOS with an internal interface called CLRMA. This set of interfaces abstracted how !analyze obtained the crash information like managed threads, thread stack traces, managed exception and exception stack traces, etc. from SOS on a crash dump. Now the CLRMA interfaces are a public contract between SOS and !analyze. + +CLRMA interface definition: https://github.com/dotnet/diagnostics/blob/main/src/SOS/inc/clrma.idl + +### CLRMA interfaces + +SOS now exposes new exports (CLRMACreateInstance/CLRMAReleaseInstance) that !analyze looks for to create the top level CLRMA instance (ICLRManagedAnalysis). SOS supports Native AOT runtime crashes via the crash info JSON blob in a runtime global buffer and other .NET runtimes with the direct DAC support under the "SOS/clrma" directory. + +#### ICLRManagedAnalysis + +This root interface contains some setup functions like ProviderName/AssociateClient and also functions to get the thread (GetThread) and exception (GetException) interface instances. This implementation calls the managed clrma service first to see if there is Native AOT crash info, otherwise, it enables the direct DAC support. + +#### ICLRMAClrThread + +Provides the details about a specific or the current managed thread like managed stack trace and the current exceptions. If the stack trace isn't implemented (as in the Native AOT case), !analyze uses the native stack trace for the bucketing. + +#### ICLRMAClrException + +Provides all the details about a specific or current thread's managed exception like the type, message string, stack trace and inner exceptions. + +#### ICLRMAObjectInspection + +The object inspection interface is a set of optional functions to get an object's type or field's value. It used to get more detailed information about an exception object like the file path field from a FileNotFoundException. They are used to refine the bucketing for exception and other types. + +Here are some examples of !analyze object field inspection (this is not exhaustive list): + +- FileNotFoundException: _fileName, _fusionLog +- BadImageFormatException._fileName +- Exception._remoteStackTraceString +- IOException._maybeFullPath +- SocketException.nativeErrorCode +- TypeInitializationException._typeName +- TypeLoadException: ClassName, AssemblyName +- WebException: m_Response.m_Uri.m_String, m_Response.m_StatusDescription, m_Response.m_StatusCode + +Not implemented at this time for Native AOT or .NET Core. + +### DAC interfaces used by CLRMA + +``` +ISOSDacInterface::GetUsefulGlobals() +ISOSDacInterface::GetThreadStoreData() +ISOSDacInterface::GetThreadData() +ISOSDacInterface::GetNestedExceptionData() +ISOSDacInterface::GetObjectData() +ISOSDacInterface2::GetObjectExceptionData() +ISOSDacInterface::GetMethodTableName() +ISOSDacInterface::GetMethodTableData() +ISOSDacInterface::GetObjectStringData() +ISOSDacInterface::GetMethodDescData() +ISOSDacInterface::GetMethodDescName() +ISOSDacInterface::GetModuleData() +ISOSDacInterface::GetPEFileBase() +ISOSDacInterface::GetPEFileName() +ISOSDacInterface::GetMethodDescPtrFromIP() + +// Module name fallback if debugger and GetPEFileName() can't get the name. +ISOSDacInterface::GetModule() +IXCLRDataModule::GetFileName + +// Managed stack walking +IXCLRDataProcess::GetTaskByOSThreadID() +IXCLRDataTask::CreateStackWalk() +IXCLRDataStackWalk::Request(DACSTACKPRIV_REQUEST_FRAME_DATA, ...) +IXCLRDataStackWalk::GetContext() +IXCLRDataStackWalk::Next() +``` + +### References + +SOS CLRMA export code: https://github.com/dotnet/diagnostics/blob/main/src/SOS/Strike/clrma/clrma.cpp. + +SOS CLRMA wrapper code: https://github.com/dotnet/diagnostics/blob/main/src/SOS/SOS.Extensions/Clrma/ClrmaServiceWrapper.cs. diff --git a/documentation/privatebuildtesting.md b/documentation/privatebuildtesting.md index 1b5af9b11c..83440d092e 100644 --- a/documentation/privatebuildtesting.md +++ b/documentation/privatebuildtesting.md @@ -1,36 +1,51 @@ Private runtime build testing ============================= -Here are some instructions on how to run the diagnostics repo's tests against a locally build private .NET Core runtime based on CoreCLR. These directions will work on Windows, Linux and MacOS. +Here are some instructions on how to run the diagnostics repo's tests against a locally built private .NET Core runtime based on CoreCLR. These directions will work on Windows, Linux and MacOS. The testing is currently scoped to just the runtime not the libraries and not single-file apps. -1. Build the runtime repo (see [Workflow Guide](https://github.com/dotnet/runtime/blob/main/docs/workflow/README.md)). +1. Build the runtime repo (see [Workflow Guide](https://github.com/dotnet/runtime/blob/main/docs/workflow/README.md)) with `-configuration release -subset clr`. A release build is highly recommended. 2. Build the diagnostics repo (see [Building the Repository](../README.md)). -3. Run the diagnostics repo tests with the -privatebuildpath option. +3. Run the `eng\privatebuild.cmd` or `eng/privatebuild.sh` test runtime install script. This installs and sets up to run (just) the latest test runtimes (currently 9.0) into the `.dotnet-test` directory. +4. On Windows 11 (this doesn't work on Windows 10), add the following DWORD registry key: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MiniDumpSettings\DisableAuxProviderSignatureCheck` and set it to 1. This allows the unsigned privately built DAC to be used to generate dumps. +5. Copy the private runtime binaries over the test SDK/runtimes installed in `.dotnet-test`. This step is hard to automate because there are usually 3 versions of the runtime installed: one as part of the .NET SDK, one as part of the AspNetCore runtime and one from latest runtime DARC update. +6. Run the diagnostics repo tests either: + a. `test.cmd` or `test.sh` - this runs all the diagnostics tests including SOS's. A html test report will be generated in `artifacts/TestResults/{Debug,Release}/SOS.UnitTests_net6.0_x64.html`. + b. Use the VS Test Explorer to run all the SOS tests or a specific one. + c. Use `eng\testsos.cmd` or `eng/testsos.sh` to run just the SOS tests. The html test report isn't generated in this case, but the SOS test logs are in artifacts/TestResults/{Debug,Release}/sos_*. -The following examples assume a Debug build of the runtime and diagnsotics. However any flavor can be used with the following steps: +The following examples assume a release build of the runtime. The runtime version numbers will vary. + +#### Windows x64 Example Script -On Windows: -``` -C:\diagnostics> test -privatebuildpath c:\runtime\artifacts\bin\coreclr\Windows_NT.x64.Debug ``` +copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\sharedFramework\* c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.7.24366.18 +copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\System.Private.CoreLib.dll c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.7.24366.18 -When you are all done with the private runtime testing, run this command to remove the Windows registry entries added in the above steps. +copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\sharedFramework\* c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.7.24365.2 +copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\System.Private.CoreLib.dll c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.7.24365.2 -``` -C:\diagnostics> test -cleanupprivatebuild +copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\sharedFramework\* c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.4.24251.3 +copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\System.Private.CoreLib.dll c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.4.24251.3 ``` -There will be some popups from regedit asking for administrator permission to edit the registry (press Yes), warning about adding registry keys from AddPrivateTesting.reg (press Yes) and that the edit was successful (press OK). +#### Linux x64 Example Script -On Linux/MacOS: ``` -~/diagnostics$ ./test.sh --privatebuildpath /home/user/runtime/artifacts/bin/coreclr/Linux.x64.Debug +cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/sharedFramework/* $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.7.24366.18 +cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/System.Private.CoreLib.dll $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.7.24366.18 + +cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/sharedFramework/* $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.7.24365.2 +cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/System.Private.CoreLib.dll $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.7.24365.2 + +cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/sharedFramework/* $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.4.24251.3 +cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/System.Private.CoreLib.dll $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.4.24251.3 ``` -The private runtime will be copied to the diagnostics repo and the tests started. It can be just the runtime binaries but this assumes that the private build is close to the latest published main build. If not, you can pass the runtime's testhost directory containing all the shared runtime bits i.e. `c:\runtime\artifacts\bin\coreclr\testhost\netcoreapp5.0-Windows_NT-Debug-x64\shared\Microsoft.NETCore.App\5.0.0` or `/home/user/runtime/artifacts/bin/coreclr/testhost/netcoreapp5.0-Linux-Release-x64/shared/Microsoft.NETCore.App/5.0.0` On Linux/MacOS it is recommended to test against Release runtime builds because of a benign assert in DAC (tracked by issue #[31897](https://github.com/dotnet/runtime/issues/31897)) that causes the tests to fail. -On Windows the DAC is not properly signed for a private runtime build so there are a couple of registry keys that need to be added so Windows will load the DAC and the tests can create proper mini-dumps. An example of the registry key values added are: +#### Note for Windows 10 + +Because the DAC is not properly signed for a private runtime build there are a couple of registry keys that need to be added so Windows will load the DAC and the tests can create proper mini-dumps. An example of the registry key values added are: ``` [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\KnownManagedDebuggingDlls] diff --git a/documentation/symbols/SSQP_Key_Conventions.md b/documentation/symbols/SSQP_Key_Conventions.md index 34d5e4f753..e5a7205474 100644 --- a/documentation/symbols/SSQP_Key_Conventions.md +++ b/documentation/symbols/SSQP_Key_Conventions.md @@ -49,6 +49,25 @@ Example: **Lookup key**: `foo.pdb/497b72f6390a44fc878e5a2d63b6cc4b1/foo.pdb` +### PDZ-Signature-Age + +This applies to the Microsoft C++ Symbol Format with compressed streams, known as PDZ or msfz, also commonly saved with the pdb extension. + +Like regular C++ PDBs, the key also uses values extracted from the GUID stream which is uncompressed. Additionally, the index contains a marker for the type ('msfz') and version (currently only '0'): + +`//msfz/` + +Example: + +**File name:** `Foo.pdb` + +**Signature field:** `{ 0x497B72F6, 0x390A, 0x44FC, { 0x87, 0x8E, 0x5A, 0x2D, 0x63, 0xB6, 0xCC, 0x4B } }` + +**Age field:** `0x1` + +**Format version:** `0` + +**Lookup key**: `foo.pdb/497b72f6390a44fc878e5a2d63b6cc4b1/msfz0/foo.pdb` ### Portable-Pdb-Signature diff --git a/eng/Build-Native.cmd b/eng/Build-Native.cmd index 7af07daa6d..ea1af987fa 100644 --- a/eng/Build-Native.cmd +++ b/eng/Build-Native.cmd @@ -29,16 +29,17 @@ if defined VS160COMNTOOLS ( :: Set the default arguments for build -set __BuildArch=x64 -if /i "%PROCESSOR_ARCHITECTURE%" == "amd64" set __BuildArch=x64 -if /i "%PROCESSOR_ARCHITECTURE%" == "x86" set __BuildArch=x86 +set __TargetArch=x64 +if /i "%PROCESSOR_ARCHITECTURE%" == "amd64" set __TargetArch=x64 +if /i "%PROCESSOR_ARCHITECTURE%" == "arm64" set __TargetArch=arm64 +if /i "%PROCESSOR_ARCHITECTURE%" == "x86" set __TargetArch=x86 +set __HostArch= set __BuildType=Debug -set __BuildOS=Windows_NT -set __Build=1 +set __TargetOS=Windows_NT +set __BuildNative=1 set __CI=0 set __Verbosity=minimal -set __BuildCrossArch=0 -set __CrossArch= +set __Ninja=0 :: Set the various build properties here so that CMake and MSBuild can pick them up set "__ProjectDir=%~dp0" @@ -61,7 +62,7 @@ if /i "%1" == "-help" goto Usage if /i "%1" == "--help" goto Usage if /i "%1" == "-configuration" (set __BuildType=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) -if /i "%1" == "-architecture" (set __BuildArch=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) +if /i "%1" == "-architecture" (set __TargetArch=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) if /i "%1" == "-verbosity" (set __Verbosity=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop) if /i "%1" == "-ci" (set __CI=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) @@ -88,18 +89,7 @@ if [!processedArgs!] == [] ( :ArgsDone -:: Determine if this is a cross-arch build - -if /i "%__BuildArch%" == "arm64" ( - set __BuildCrossArch=%__Build% - set __CrossArch=x64 -) - -if /i "%__BuildArch%" == "arm" ( - set __BuildCrossArch=%__Build% - set __CrossArch=x86 -) - +if "%__HostArch%" == "" set __HostArch=%__TargetArch% if /i "%__BuildType%" == "debug" set __BuildType=Debug if /i "%__BuildType%" == "release" set __BuildType=Release @@ -115,22 +105,18 @@ echo %NUGET_PACKAGES% :: Set the remaining variables based upon the determined build configuration set "__RootBinDir=%__ProjectDir%\artifacts" -set "__BinDir=%__RootBinDir%\bin\%__BuildOS%.%__BuildArch%.%__BuildType%" -set "__LogDir=%__RootBinDir%\log\%__BuildOS%.%__BuildArch%.%__BuildType%" +set "__BinDir=%__RootBinDir%\bin\%__TargetOS%.%__TargetArch%.%__BuildType%" +set "__LogDir=%__RootBinDir%\log\%__TargetOS%.%__TargetArch%.%__BuildType%" set "__ArtifactsIntermediatesDir=%__RootBinDir%\obj" -set "__IntermediatesDir=%__ArtifactsIntermediatesDir%\%__BuildOS%.%__BuildArch%.%__BuildType%" +set "__IntermediatesDir=%__ArtifactsIntermediatesDir%\%__TargetOS%.%__TargetArch%.%__BuildType%" set "__PackagesBinDir=%__RootBinDir%\packages\%__BuildType%\Shipping" -set "__CrossComponentBinDir=%__BinDir%" -set "__CrossCompIntermediatesDir=%__IntermediatesDir%\crossgen" -if NOT "%__CrossArch%" == "" set __CrossComponentBinDir=%__CrossComponentBinDir%\%__CrossArch% - :: Generate path to be set for CMAKE_INSTALL_PREFIX to contain forward slash set "__CMakeBinDir=%__BinDir%" set "__CMakeBinDir=%__CMakeBinDir:\=/%" :: Common msbuild arguments -set "__CommonBuildArgs=/v:!__Verbosity! /p:Configuration=%__BuildType% /p:BuildArch=%__BuildArch% %__UnprocessedBuildArgs%" +set "__CommonBuildArgs=/v:!__Verbosity! /p:Configuration=%__BuildType% /p:BuildArch=%__TargetArch% %__UnprocessedBuildArgs%" if not exist "%__BinDir%" md "%__BinDir%" if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%" @@ -155,91 +141,27 @@ REM ============================================================================ :: Parse the optdata package versions out of msbuild so that we can pass them on to CMake set __DotNetCli=%__ProjectDir%\dotnet.cmd -REM ========================================================================================= -REM === -REM === Build Cross-Architecture Native Components (if applicable) -REM === -REM ========================================================================================= - -if /i %__BuildCrossArch% EQU 1 ( - rem Scope environment changes start { - setlocal - - echo %__MsgPrefix%Commencing build of cross architecture native components for %__BuildOS%.%__BuildArch%.%__BuildType% - - :: Set the environment for the native build - set __VCBuildArch=x86_amd64 - if /i "%__CrossArch%" == "x86" ( set __VCBuildArch=x86 ) - - echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch! - call "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch! - @if defined _echo @echo on - - if not exist "%__CrossCompIntermediatesDir%" md "%__CrossCompIntermediatesDir%" - - echo Generating Version Header - set __GenerateVersionLog="%__LogDir%\GenerateVersion.binlog" - powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__ProjectDir%\eng\common\msbuild.ps1" "%__ProjectDir%\eng\CreateVersionFile.proj" /bl:!__GenerateVersionLog! /t:GenerateVersionFiles /restore /p:FileVersionFile=%__RootBinDir%\bin\FileVersion.txt /p:GenerateVersionHeader=true /p:NativeVersionHeaderFile=%__ArtifactsIntermediatesDir%\_version.h %__CommonBuildArgs% - if not !errorlevel! == 0 ( - echo Generate Version Header FAILED - goto ExitWithError - ) - if defined __SkipConfigure goto SkipConfigureCrossBuild - - set __CMakeBinDir=%__CrossComponentBinDir% - set "__CMakeBinDir=!__CMakeBinDir:\=/!" - - set "__ManagedBinaryDir=%__RootBinDir%\bin" - set "__ManagedBinaryDir=!__ManagedBinaryDir:\=/!" - set __ExtraCmakeArgs="-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCMAKE_SYSTEM_VERSION=10.0" "-DNUGET_PACKAGES=%NUGET_PACKAGES:\=/%" - - pushd "%__CrossCompIntermediatesDir%" - call "%__ProjectDir%\eng\native\gen-buildsys.cmd" "%__ProjectDir%" "%__CrossCompIntermediatesDir%" %__VSVersion% %__CrossArch% %__BuildOS% !__ExtraCmakeArgs! - @if defined _echo @echo on - popd - -:SkipConfigureCrossBuild - if not exist "%__CrossCompIntermediatesDir%\CMakeCache.txt" ( - echo %__MsgPrefix%Error: failed to generate cross-arch components build project! - goto ExitWithError - ) - if defined __ConfigureOnly goto SkipCrossCompBuild - - set __BuildLog="%__LogDir%\Cross.Build.binlog" - - echo running "%CMakePath%" --build %__CrossCompIntermediatesDir% --target install --config %__BuildType% -- /bl:!__BuildLog! !__CommonBuildArgs! - "%CMakePath%" --build %__CrossCompIntermediatesDir% --target install --config %__BuildType% -- /bl:!__BuildLog! !__CommonBuildArgs! - - if not !ERRORLEVEL! == 0 ( - echo %__MsgPrefix%Error: cross-arch components build failed. Refer to the build log files for details: - echo !__BuildLog! - goto ExitWithError - ) - -:SkipCrossCompBuild - rem } Scope environment changes end - endlocal -) - REM ========================================================================================= REM === REM === Build the native code REM === REM ========================================================================================= -if %__Build% EQU 1 ( +if %__BuildNative% EQU 1 ( rem Scope environment changes start { setlocal - echo %__MsgPrefix%Commencing build of native components for %__BuildOS%.%__BuildArch%.%__BuildType% + echo %__MsgPrefix%Commencing build of native components for %__TargetOS%.%__TargetArch%.%__BuildType% - set __VCBuildArch=x86_amd64 - if /i "%__BuildArch%" == "x86" ( set __VCBuildArch=x86 ) - if /i "%__BuildArch%" == "arm" ( - set __VCBuildArch=x86_arm - ) - if /i "%__BuildArch%" == "arm64" ( - set __VCBuildArch=x86_arm64 + REM Set the environment for the native build + if /i "%PROCESSOR_ARCHITECTURE%" == "ARM64" ( + set __VCBuildArch=arm64 + if /i "%__HostArch%" == "x64" ( set __VCBuildArch=arm64_amd64 ) + if /i "%__HostArch%" == "x86" ( set __VCBuildArch=arm64_x86 ) + ) else ( + set __VCBuildArch=amd64 + if /i "%__HostArch%" == "x86" ( set __VCBuildArch=amd64_x86 ) + if /i "%__HostArch%" == "arm64" ( set __VCBuildArch=amd64_arm64 ) ) echo %__MsgPrefix%Using environment: "%__VCToolsRoot%\vcvarsall.bat" !__VCBuildArch! @@ -251,9 +173,13 @@ if %__Build% EQU 1 ( goto ExitWithError ) + if %__Ninja% EQU 1 ( + set __ExtraCmakeArgs="-DCMAKE_BUILD_TYPE=!__BuildType!" + ) + echo Generating Version Header set __GenerateVersionLog="%__LogDir%\GenerateVersion.binlog" - powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__ProjectDir%\eng\common\msbuild.ps1" "%__ProjectDir%\eng\CreateVersionFile.proj" /bl:!__GenerateVersionLog! /t:GenerateVersionFiles /restore /p:FileVersionFile=%__RootBinDir%\bin\FileVersion.txt /p:GenerateVersionHeader=true /p:NativeVersionHeaderFile=%__ArtifactsIntermediatesDir%\_version.h %__CommonBuildArgs% + powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__ProjectDir%\eng\common\msbuild.ps1" "%__ProjectDir%\eng\native-prereqs.proj" /bl:!__GenerateVersionLog! /t:BuildPrereqs /restore %__CommonBuildArgs% if not !errorlevel! == 0 ( echo Generate Version Header FAILED goto ExitWithError @@ -264,10 +190,10 @@ if %__Build% EQU 1 ( set "__ManagedBinaryDir=%__RootBinDir%\bin" set "__ManagedBinaryDir=!__ManagedBinaryDir:\=/!" - set __ExtraCmakeArgs="-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DNUGET_PACKAGES=%NUGET_PACKAGES:\=/%" + set __ExtraCmakeArgs=!__ExtraCmakeArgs! "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_MANAGED_BINARY_DIR=!__ManagedBinaryDir!" "-DCLR_BUILD_TYPE=%__BuildType%" "-DCLR_CMAKE_TARGET_ARCH=%__TargetArch%" "-DNUGET_PACKAGES=%NUGET_PACKAGES:\=/%" pushd "%__IntermediatesDir%" - call "%__ProjectDir%\eng\native\gen-buildsys.cmd" "%__ProjectDir%" "%__IntermediatesDir%" %__VSVersion% %__BuildArch% %__BuildOS% !__ExtraCmakeArgs! + call "%__ProjectDir%\eng\native\gen-buildsys.cmd" "%__ProjectDir%" "%__IntermediatesDir%" %__VSVersion% %__HostArch% %__TargetOS% !__ExtraCmakeArgs! @if defined _echo @echo on popd @@ -299,14 +225,14 @@ REM Copy the native SOS binaries to where these tools expect for CI & VS testing set "__targetRid=net6.0" set "__dotnet_sos=%__RootBinDir%\bin\dotnet-sos\%__BuildType%\%__targetRid%" set "__dotnet_dump=%__RootBinDir%\bin\dotnet-dump\%__BuildType%\%__targetRid%" -mkdir %__dotnet_sos%\win-%__BuildArch% -mkdir %__dotnet_sos%\publish\win-%__BuildArch% -mkdir %__dotnet_dump%\win-%__BuildArch% -mkdir %__dotnet_dump%\publish\win-%__BuildArch% -xcopy /y /q /i %__BinDir% %__dotnet_sos%\win-%__BuildArch% -xcopy /y /q /i %__BinDir% %__dotnet_sos%\publish\win-%__BuildArch% -xcopy /y /q /i %__BinDir% %__dotnet_dump%\win-%__BuildArch% -xcopy /y /q /i %__BinDir% %__dotnet_dump%\publish\win-%__BuildArch% +mkdir %__dotnet_sos%\win-%__TargetArch% +mkdir %__dotnet_sos%\publish\win-%__TargetArch% +mkdir %__dotnet_dump%\win-%__TargetArch% +mkdir %__dotnet_dump%\publish\win-%__TargetArch% +xcopy /y /q /i %__BinDir% %__dotnet_sos%\win-%__TargetArch% +xcopy /y /q /i %__BinDir% %__dotnet_sos%\publish\win-%__TargetArch% +xcopy /y /q /i %__BinDir% %__dotnet_dump%\win-%__TargetArch% +xcopy /y /q /i %__BinDir% %__dotnet_dump%\publish\win-%__TargetArch% REM ========================================================================================= REM === diff --git a/eng/CreateVersionFile.proj b/eng/CreateVersionFile.proj deleted file mode 100644 index 0ebcdee497..0000000000 --- a/eng/CreateVersionFile.proj +++ /dev/null @@ -1,100 +0,0 @@ - - - - netstandard2.0 - false - false - - - - - - - - - - $(FileVersion.Replace(".", ",")) - - - - - - - - - - - - - - - - - - - - - - - $(USERNAME) - - - - - - - - - $(COMPUTERNAME) - - - - - - - - $(BuiltByString) %40BuiltBy: $(VersionUserName)-$(VersionHostName) - - - - - - - - - - - - - - - - - - diff --git a/eng/GalleryManifest.xml b/eng/GalleryManifest.xml deleted file mode 100644 index cfa84037bc..0000000000 --- a/eng/GalleryManifest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - SOS - X.X.X.X - Debugging aid for .NET Core programs and runtimes - - - - - - - - - - - - - - - - !clrstack - Provides a stack trace of managed code only - - - - - !clrthreads - List the managed threads running - - - - - !soshelp - Displays all available SOS commands or details about the command - - - - - - diff --git a/eng/InstallRuntimes.proj b/eng/InstallRuntimes.proj index 9238b5ac40..0c67ad6fa6 100644 --- a/eng/InstallRuntimes.proj +++ b/eng/InstallRuntimes.proj @@ -5,8 +5,9 @@ From Versions.props: - $(MicrosoftDotnetSdkInternalVersion) - .NET SDK to use for testing + $(MicrosoftDotnetSdkVersion) - .NET SDK to use for testing $(InternalReleaseTesting) - if true, internal service release testing + $(PrivateBuildTesting) - if true, test against a locally built runtime @(RuntimeTestVersions) - runtime/aspnetcore versions to install and test against From Arcade: @@ -35,9 +36,6 @@ -NoPath -SkipNonVersionedFiles -Architecture $(BuildArch) -InstallDir $(DotNetInstallRoot) $([MSBuild]::NormalizeDirectory('$(DotNetInstallRoot)', 'shared', 'Microsoft.NETCore.App', '$(MicrosoftNETCoreAppRuntimewinx64Version)')) $(DotNetInstallRoot)Debugger.Tests.Versions.txt - $(DotNetInstallRoot)AddPrivateTesting.reg - $(DotNetInstallRoot)RemovePrivateTesting.reg - regedit.exe @@ -58,7 +56,7 @@ Installs the runtimes for the SOS tests, handles private runtime build support or cleans up the private build registry keys --> - - @@ -113,6 +111,7 @@ $(InternalReleaseTesting) + $(PrivateBuildTesting) ]]> @@ -132,7 +131,7 @@ - + @@ -147,7 +146,7 @@ --> + Condition="$(InternalReleaseTesting) or $(PrivateBuildTesting)"> diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 06d254502a..059c9b813f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,57 +1,57 @@ - + https://github.com/microsoft/clrmd - d5923fbec06fc227cde5e5a2d7ea58c02802e971 + 496892ecb1b05a72df368493b49ea08ea0876149 - + https://github.com/microsoft/clrmd - d5923fbec06fc227cde5e5a2d7ea58c02802e971 + 496892ecb1b05a72df368493b49ea08ea0876149 - + https://github.com/dotnet/arcade - 92a725aa4d9d6c13dc5229597b51b0b165b8b535 + 9ba9980c4996a540387b9a0ef0d68accf00689c0 - + https://github.com/dotnet/arcade - 92a725aa4d9d6c13dc5229597b51b0b165b8b535 + 9ba9980c4996a540387b9a0ef0d68accf00689c0 - + https://github.com/dotnet/arcade - 92a725aa4d9d6c13dc5229597b51b0b165b8b535 + 9ba9980c4996a540387b9a0ef0d68accf00689c0 https://github.com/dotnet/arcade ccfe6da198c5f05534863bbb1bff66e830e0c6ab - - https://github.com/dotnet/installer - fa261b952d702c6bd604728fcbdb58ac071a22b1 + + https://github.com/dotnet/sdk + 1a658dfc714a5064eea57af48d5fd68a3ffab7ef - + https://github.com/dotnet/aspnetcore - cd92ed12476de4e03ae5293d81362f2eb07b4f80 + d962763e8e7d1efb409f9688d6dd7c87aab93b3d - + https://github.com/dotnet/aspnetcore - cd92ed12476de4e03ae5293d81362f2eb07b4f80 + d962763e8e7d1efb409f9688d6dd7c87aab93b3d - + https://github.com/dotnet/runtime - 8fac5af2b11dc98fa0504f6fd06df790164ec958 + db95ac47f72d605e7676ad155db2bab00be889ed - + https://github.com/dotnet/runtime - 8fac5af2b11dc98fa0504f6fd06df790164ec958 + db95ac47f72d605e7676ad155db2bab00be889ed - + https://github.com/dotnet/source-build-reference-packages - 9ae78a4e6412926d19ba97cfed159bf9de70b538 + 38a050f3b80b4dfdd0e8f6c772a3e9835674d3b4 diff --git a/eng/Versions.props b/eng/Versions.props index 018effe870..4d0750f5d2 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -16,25 +16,26 @@ - 9.0.0-preview.6.24307.2 - 9.0.0-preview.6.24307.2 + 9.0.0-rtm.24468.5 + 9.0.0-rtm.24468.5 - 9.0.0-preview.6.24320.2 - 9.0.0-preview.6.24320.2 + 9.0.0-rtm.24468.6 + 9.0.0-rtm.24468.6 - 9.0.100-preview.5.24253.16 + 9.0.100-rc.1.24409.1 false + 1.12.0 - 5.0.0 - 6.0.0 + 8.0.0 + 8.0.0 6.0.0 - 3.1.525101 + 4.0.0-beta.24463.1 17.10.0-beta1.24272.1 3.0.7 6.0.0 @@ -48,15 +49,16 @@ 4.5.1 4.5.5 4.3.0 - 6.0.0 - 6.0.8 + 4.5.4 + 8.0.0 + 8.0.4 2.0.3 - 9.0.0-beta.24314.1 + 10.0.0-beta.24463.4 1.2.0-beta.406 7.0.0-beta.22316.2 - 10.0.18362 + 10.0.26100.1 13.0.1 - 9.0.0-alpha.1.24304.1 + 10.0.0-alpha.1.24467.1 + + + $(VSRedistCommonNetCoreSharedFrameworkx6490Version) + $(MicrosoftNETCoreAppRuntimewinx64Version) + $(MicrosoftAspNetCoreAppRefInternalVersion) + $(MicrosoftAspNetCoreAppRefVersion) + net9.0 + + diff --git a/eng/build.ps1 b/eng/build.ps1 index 3c8b222ed9..72886ed021 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -4,6 +4,8 @@ Param( [ValidateSet("Debug","Release")][string][Alias('c')] $configuration = "Debug", [string][Alias('v')] $verbosity = "minimal", [switch][Alias('t')] $test, + [switch] $installruntimes, + [switch] $privatebuild, [switch] $ci, [switch] $skipmanaged, [switch] $skipnative, @@ -65,6 +67,22 @@ if (-not $skipnative) { } } +if ($installruntimes -or $privatebuild) { + $privatebuildtesting = "false" + if ($privatebuild) { + $privatebuildtesting = "true" + } + Remove-Item -Force -Recurse -ErrorAction SilentlyContinue "$reporoot\.dotnet-test" + & "$engroot\common\msbuild.ps1" ` + $engroot\InstallRuntimes.proj ` + -verbosity $verbosity ` + /t:InstallTestRuntimes ` + /bl:$logdir\InstallRuntimes.binlog ` + /p:PrivateBuildTesting=$privatebuildtesting ` + /p:BuildArch=$architecture ` + /p:TestArchitectures=$architecture +} + # Run the xunit tests if ($test) { if (-not $crossbuild) { diff --git a/eng/build.sh b/eng/build.sh index 02a1ebcc17..3c5cd02179 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -26,6 +26,8 @@ __RuntimeSourceFeed= __RuntimeSourceFeedKey= __SkipConfigure=0 __SkipGenerateVersion=0 +__InstallRuntimes=0 +__PrivateBuild=0 __Test=0 __UnprocessedBuildArgs= @@ -85,6 +87,14 @@ handle_arguments() { __NativeBuild=0 ;; + installruntimes|-installruntimes) + __InstallRuntimes=1 + ;; + + privatebuild|-privatebuild) + __PrivateBuild=1 + ;; + test|-test) __Test=1 ;; @@ -146,12 +156,10 @@ if [[ "$__ManagedBuild" == 1 ]]; then __GenerateVersionLog="$__LogsDir/GenerateVersion.binlog" "$__RepoRootDir/eng/common/msbuild.sh" \ - $__RepoRootDir/eng/CreateVersionFile.proj \ + $__RepoRootDir/eng/native-prereqs.proj \ /bl:$__GenerateVersionLog \ - /t:GenerateVersionFiles \ + /t:BuildPrereqs \ /restore \ - /p:GenerateVersionSourceFile=true \ - /p:NativeVersionSourceFile="$__ArtifactsIntermediatesDir/_version.c" \ /p:Configuration="$__BuildType" \ /p:Platform="$__TargetArch" \ $__UnprocessedBuildArgs @@ -224,6 +232,25 @@ if [[ "$__NativeBuild" == 1 || "$__Test" == 1 ]]; then echo "Copied SOS to $__dotnet_dump" fi +# +# Install test runtimes and set up for private runtime build +# + +if [[ "$__InstallRuntimes" == 1 || "$__PrivateBuild" == 1 ]]; then + __privateBuildTesting=false + if [[ "$__PrivateBuild" == 1 ]]; then + __privateBuildTesting=true + fi + rm -fr "$__RepoRootDir/.dotnet-test" || true + "$__RepoRootDir/eng/common/msbuild.sh" \ + $__RepoRootDir/eng/InstallRuntimes.proj \ + /t:InstallTestRuntimes \ + /bl:"$__LogsDir/InstallRuntimes.binlog" \ + /p:PrivateBuildTesting="$__privateBuildTesting" \ + /p:BuildArch="$__TargetArch" \ + /p:TestArchitectures="$__TargetArch" +fi + # # Run xunit tests # diff --git a/eng/common/SetupNugetSources.ps1 b/eng/common/SetupNugetSources.ps1 index c07f6a5260..5db4ad71ee 100644 --- a/eng/common/SetupNugetSources.ps1 +++ b/eng/common/SetupNugetSources.ps1 @@ -1,32 +1,31 @@ # This script adds internal feeds required to build commits that depend on internal package sources. For instance, # dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables # disabled internal Maestro (darc-int*) feeds. -# -# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. This credential -# is added via the standard environment variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS. See -# https://github.com/microsoft/artifacts-credprovider/tree/v1.1.1?tab=readme-ov-file#environment-variables for more details +# +# Optionally, this script also adds a credential entry for each of the internal feeds if supplied. # # See example call for this script below. # # - task: PowerShell@2 -# displayName: Setup Internal Feeds +# displayName: Setup Private Feeds Credentials # condition: eq(variables['Agent.OS'], 'Windows_NT') # inputs: # filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 -# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -# - task: NuGetAuthenticate@1 -# +# arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token +# env: +# Token: $(dn-bot-dnceng-artifact-feeds-rw) +# # Note that the NuGetAuthenticate task should be called after SetupNugetSources. # This ensures that: # - Appropriate creds are set for the added internal feeds (if not supplied to the scrupt) -# - The credential provider is installed +# - The credential provider is installed. # # This logic is also abstracted into enable-internal-sources.yml. [CmdletBinding()] param ( [Parameter(Mandatory = $true)][string]$ConfigFile, - [string]$Password + $Password ) $ErrorActionPreference = "Stop" @@ -35,23 +34,12 @@ Set-StrictMode -Version 2.0 . $PSScriptRoot\tools.ps1 -$feedEndpoints = $null - -# If a credential is provided, ensure that we don't overwrite the current set of -# credentials that may have been provided by a previous call to the credential provider. -if ($Password -and $null -ne $env:VSS_NUGET_EXTERNAL_FEED_ENDPOINTS) { - $feedEndpoints = $env:VSS_NUGET_EXTERNAL_FEED_ENDPOINTS | ConvertFrom-Json -} elseif ($Password) { - $feedEndpoints = @{ endpointCredentials = @() } -} - # Add source entry to PackageSources -function AddPackageSource($sources, $SourceName, $SourceEndPoint, $pwd) { +function AddPackageSource($sources, $SourceName, $SourceEndPoint, $creds, $Username, $pwd) { $packageSource = $sources.SelectSingleNode("add[@key='$SourceName']") - if ($null -eq $packageSource) + if ($packageSource -eq $null) { - Write-Host "`tAdding package source" $SourceName $packageSource = $doc.CreateElement("add") $packageSource.SetAttribute("key", $SourceName) $packageSource.SetAttribute("value", $SourceEndPoint) @@ -61,33 +49,63 @@ function AddPackageSource($sources, $SourceName, $SourceEndPoint, $pwd) { Write-Host "Package source $SourceName already present." } - if ($pwd) { - $feedEndpoints.endpointCredentials = AddCredential -endpointCredentials $feedEndpoints.endpointCredentials -source $SourceEndPoint -pwd $pwd - } + AddCredential -Creds $creds -Source $SourceName -Username $Username -pwd $pwd } -# Add a new feed endpoint credential -function AddCredential([array]$endpointCredentials, $source, $pwd) { - $endpointCredentials += @{ - endpoint = $source; - password = $pwd +# Add a credential node for the specified source +function AddCredential($creds, $source, $username, $pwd) { + # If no cred supplied, don't do anything. + if (!$pwd) { + return; } - return $endpointCredentials + + # Looks for credential configuration for the given SourceName. Create it if none is found. + $sourceElement = $creds.SelectSingleNode($Source) + if ($sourceElement -eq $null) + { + $sourceElement = $doc.CreateElement($Source) + $creds.AppendChild($sourceElement) | Out-Null + } + + # Add the node to the credential if none is found. + $usernameElement = $sourceElement.SelectSingleNode("add[@key='Username']") + if ($usernameElement -eq $null) + { + $usernameElement = $doc.CreateElement("add") + $usernameElement.SetAttribute("key", "Username") + $sourceElement.AppendChild($usernameElement) | Out-Null + } + $usernameElement.SetAttribute("value", $Username) + + # Add the to the credential if none is found. + # Add it as a clear text because there is no support for encrypted ones in non-windows .Net SDKs. + # -> https://github.com/NuGet/Home/issues/5526 + $passwordElement = $sourceElement.SelectSingleNode("add[@key='ClearTextPassword']") + if ($passwordElement -eq $null) + { + $passwordElement = $doc.CreateElement("add") + $passwordElement.SetAttribute("key", "ClearTextPassword") + $sourceElement.AppendChild($passwordElement) | Out-Null + } + + $passwordElement.SetAttribute("value", $pwd) } -function InsertMaestroInternalFeedCredentials($Sources, $pwd) { - $maestroInternalSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]") +function InsertMaestroPrivateFeedCredentials($Sources, $Creds, $Username, $pwd) { + $maestroPrivateSources = $Sources.SelectNodes("add[contains(@key,'darc-int')]") - ForEach ($PackageSource in $maestroInternalSources) { - Write-Host "`tAdding credential for Maestro's feed:" $PackageSource.Key - $feedEndpoints.endpointCredentials = AddCredential -endpointCredentials $feedEndpoints.endpointCredentials -source $PackageSource.value -pwd $pwd + Write-Host "Inserting credentials for $($maestroPrivateSources.Count) Maestro's private feeds." + + ForEach ($PackageSource in $maestroPrivateSources) { + Write-Host "`tInserting credential for Maestro's feed:" $PackageSource.Key + AddCredential -Creds $creds -Source $PackageSource.Key -Username $Username -pwd $pwd } } -function EnableInternalPackageSources($DisabledPackageSources) { - $maestroInternalSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]") - ForEach ($DisabledPackageSource in $maestroInternalSources) { - Write-Host "`tEnsuring internal source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource" +function EnablePrivatePackageSources($DisabledPackageSources) { + $maestroPrivateSources = $DisabledPackageSources.SelectNodes("add[contains(@key,'darc-int')]") + ForEach ($DisabledPackageSource in $maestroPrivateSources) { + Write-Host "`tEnsuring private source '$($DisabledPackageSource.key)' is enabled by deleting it from disabledPackageSource" # Due to https://github.com/NuGet/Home/issues/10291, we must actually remove the disabled entries $DisabledPackageSources.RemoveChild($DisabledPackageSource) } @@ -105,46 +123,49 @@ $doc.Load($filename) # Get reference to or create one if none exist already $sources = $doc.DocumentElement.SelectSingleNode("packageSources") -if ($null -eq $sources) { +if ($sources -eq $null) { $sources = $doc.CreateElement("packageSources") $doc.DocumentElement.AppendChild($sources) | Out-Null } +$creds = $null +if ($Password) { + # Looks for a node. Create it if none is found. + $creds = $doc.DocumentElement.SelectSingleNode("packageSourceCredentials") + if ($creds -eq $null) { + $creds = $doc.CreateElement("packageSourceCredentials") + $doc.DocumentElement.AppendChild($creds) | Out-Null + } +} + # Check for disabledPackageSources; we'll enable any darc-int ones we find there $disabledSources = $doc.DocumentElement.SelectSingleNode("disabledPackageSources") -if ($null -ne $disabledSources) { +if ($disabledSources -ne $null) { Write-Host "Checking for any darc-int disabled package sources in the disabledPackageSources node" - EnableInternalPackageSources -DisabledPackageSources $disabledSources + EnablePrivatePackageSources -DisabledPackageSources $disabledSources } -if ($Password) { - InsertMaestroInternalFeedCredentials -Sources $sources -pwd $Password -} +$userName = "dn-bot" + +# Insert credential nodes for Maestro's private feeds +InsertMaestroPrivateFeedCredentials -Sources $sources -Creds $creds -Username $userName -pwd $Password # 3.1 uses a different feed url format so it's handled differently here $dotnet31Source = $sources.SelectSingleNode("add[@key='dotnet3.1']") -if ($null -ne $dotnet31Source) { - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v3/index.json" -pwd $Password - AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json" -pwd $Password +if ($dotnet31Source -ne $null) { + AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password + AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password } -$dotnetVersions = @('5','6','7','8') +$dotnetVersions = @('5','6','7','8','9') foreach ($dotnetVersion in $dotnetVersions) { $feedPrefix = "dotnet" + $dotnetVersion; $dotnetSource = $sources.SelectSingleNode("add[@key='$feedPrefix']") - if ($dotnetSource) { - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedprefix-internal/nuget/v3/index.json" -pwd $Password - AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v3/index.json" -pwd $Password + if ($dotnetSource -ne $null) { + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal/nuget/v2" -Creds $creds -Username $userName -pwd $Password + AddPackageSource -Sources $sources -SourceName "$feedPrefix-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/internal/_packaging/$feedPrefix-internal-transport/nuget/v2" -Creds $creds -Username $userName -pwd $Password } } $doc.Save($filename) - -# If any credentials were added or altered, update the VSS_NUGET_EXTERNAL_FEED_ENDPOINTS environment variable -if ($null -ne $feedEndpoints) { - # ci is set to true so vso logging commands will be used. - $ci = $true - Write-PipelineSetVariable -Name 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' -Value $($feedEndpoints | ConvertTo-Json) -IsMultiJobVariable $false - Write-PipelineSetVariable -Name 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED' -Value "False" -IsMultiJobVariable $false -} \ No newline at end of file diff --git a/eng/common/SetupNugetSources.sh b/eng/common/SetupNugetSources.sh index 16c1e29ea3..4604b61b03 100644 --- a/eng/common/SetupNugetSources.sh +++ b/eng/common/SetupNugetSources.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# This script adds internal feeds required to build commits that depend on intenral package sources. For instance, +# This script adds internal feeds required to build commits that depend on internal package sources. For instance, # dotnet6-internal would be added automatically if dotnet6 was found in the nuget.config file. In addition also enables # disabled internal Maestro (darc-int*) feeds. # @@ -99,7 +99,7 @@ if [ "$?" == "0" ]; then PackageSources+=('dotnet3.1-internal-transport') fi -DotNetVersions=('5' '6' '7' '8') +DotNetVersions=('5' '6' '7' '8' '9') for DotNetVersion in ${DotNetVersions[@]} ; do FeedPrefix="dotnet${DotNetVersion}"; diff --git a/eng/common/core-templates/job/job.yml b/eng/common/core-templates/job/job.yml index 7df5852797..ba53ebfbd5 100644 --- a/eng/common/core-templates/job/job.yml +++ b/eng/common/core-templates/job/job.yml @@ -24,21 +24,15 @@ parameters: enablePublishTestResults: false enablePublishUsingPipelines: false enableBuildRetry: false - disableComponentGovernance: '' - componentGovernanceIgnoreDirectories: '' mergeTestResults: false testRunTitle: '' testResultsFormat: '' name: '' + componentGovernanceSteps: [] preSteps: [] artifactPublishSteps: [] runAsPublic: false -# Sbom related params - enableSbom: true - PackageVersion: 9.0.0 - BuildDropPath: '$(Build.SourcesDirectory)/artifacts' - # 1es specific parameters is1ESPipeline: '' @@ -170,17 +164,8 @@ jobs: uploadRichNavArtifacts: ${{ coalesce(parameters.richCodeNavigationUploadArtifacts, false) }} continueOnError: true - - template: /eng/common/core-templates/steps/component-governance.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - ${{ if eq(parameters.disableComponentGovernance, '') }}: - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.runAsPublic, 'false'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dotnet/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/microsoft/'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}: - disableComponentGovernance: false - ${{ else }}: - disableComponentGovernance: true - ${{ else }}: - disableComponentGovernance: ${{ parameters.disableComponentGovernance }} - componentGovernanceIgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} + - ${{ each step in parameters.componentGovernanceSteps }}: + - ${{ step }} - ${{ if eq(parameters.enableMicrobuild, 'true') }}: - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: @@ -190,14 +175,6 @@ jobs: continueOnError: ${{ parameters.continueOnError }} env: TeamName: $(_TeamName) - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}: - - template: /eng/common/core-templates/steps/generate-sbom.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - PackageVersion: ${{ parameters.packageVersion}} - BuildDropPath: ${{ parameters.buildDropPath }} - IgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} - publishArtifacts: false # Publish test results - ${{ if or(and(eq(parameters.enablePublishTestResults, 'true'), eq(parameters.testResultsFormat, '')), eq(parameters.testResultsFormat, 'xunit')) }}: diff --git a/eng/common/core-templates/job/publish-build-assets.yml b/eng/common/core-templates/job/publish-build-assets.yml index 8fe9299542..3d3356e319 100644 --- a/eng/common/core-templates/job/publish-build-assets.yml +++ b/eng/common/core-templates/job/publish-build-assets.yml @@ -87,13 +87,15 @@ jobs: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Build Assets inputs: - filePath: eng\common\sdk-task.ps1 + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1 arguments: -task PublishBuildAssets -restore -msbuildEngine dotnet /p:ManifestsPath='$(Build.StagingDirectory)/Download/AssetManifests' - /p:BuildAssetRegistryToken=$(MaestroAccessToken) /p:MaestroApiEndpoint=https://maestro.dot.net /p:PublishUsingPipelines=${{ parameters.publishUsingPipelines }} /p:OfficialBuildId=$(Build.BuildNumber) @@ -111,38 +113,19 @@ jobs: Add-Content -Path $filePath -Value "$(DefaultChannels)" Add-Content -Path $filePath -Value $(IsStableBuild) - - template: /eng/common/core-templates/steps/publish-build-artifacts.yml - parameters: - is1ESPipeline: ${{ parameters.is1ESPipeline }} - args: - displayName: Publish ReleaseConfigs Artifact - pathToPublish: '$(Build.StagingDirectory)/ReleaseConfigs' - publishLocation: Container - artifactName: ReleaseConfigs - - - task: powershell@2 - displayName: Check if SymbolPublishingExclusionsFile.txt exists - inputs: - targetType: inline - script: | $symbolExclusionfile = "$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt" - if(Test-Path -Path $symbolExclusionfile) + if (Test-Path -Path $symbolExclusionfile) { Write-Host "SymbolExclusionFile exists" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]true" - } - else{ - Write-Host "Symbols Exclusion file does not exist" - Write-Host "##vso[task.setvariable variable=SymbolExclusionFile]false" + Copy-Item -Path $symbolExclusionfile -Destination "$(Build.StagingDirectory)/ReleaseConfigs" } - template: /eng/common/core-templates/steps/publish-build-artifacts.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} args: - displayName: Publish SymbolPublishingExclusionsFile Artifact - condition: eq(variables['SymbolExclusionFile'], 'true') - pathToPublish: '$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt' + displayName: Publish ReleaseConfigs Artifact + pathToPublish: '$(Build.StagingDirectory)/ReleaseConfigs' publishLocation: Container artifactName: ReleaseConfigs @@ -153,14 +136,17 @@ jobs: PromoteToChannelIds: ${{ parameters.PromoteToChannelIds }} is1ESPipeline: ${{ parameters.is1ESPipeline }} - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + arguments: > + -BuildId $(BARBuildId) -PublishingInfraVersion 3 - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/core-templates/job/source-index-stage1.yml b/eng/common/core-templates/job/source-index-stage1.yml index 8328e52ab1..30530359a5 100644 --- a/eng/common/core-templates/job/source-index-stage1.yml +++ b/eng/common/core-templates/job/source-index-stage1.yml @@ -1,8 +1,5 @@ parameters: runAsPublic: false - sourceIndexUploadPackageVersion: 2.0.0-20240522.1 - sourceIndexProcessBinlogPackageVersion: 1.0.1-20240522.1 - sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci" preSteps: [] binlogPath: artifacts/log/Debug/Build.binlog @@ -16,12 +13,6 @@ jobs: dependsOn: ${{ parameters.dependsOn }} condition: ${{ parameters.condition }} variables: - - name: SourceIndexUploadPackageVersion - value: ${{ parameters.sourceIndexUploadPackageVersion }} - - name: SourceIndexProcessBinlogPackageVersion - value: ${{ parameters.sourceIndexProcessBinlogPackageVersion }} - - name: SourceIndexPackageSource - value: ${{ parameters.sourceIndexPackageSource }} - name: BinlogPath value: ${{ parameters.binlogPath }} - template: /eng/common/core-templates/variables/pool-providers.yml @@ -45,47 +36,9 @@ jobs: - ${{ each preStep in parameters.preSteps }}: - ${{ preStep }} - - - task: UseDotNet@2 - displayName: Use .NET 8 SDK - inputs: - packageType: sdk - version: 8.0.x - installationPath: $(Agent.TempDirectory)/dotnet - workingDirectory: $(Agent.TempDirectory) - - - script: | - $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version $(sourceIndexProcessBinlogPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools - $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version $(sourceIndexUploadPackageVersion) --add-source $(SourceIndexPackageSource) --tool-path $(Agent.TempDirectory)/.source-index/tools - displayName: Download Tools - # Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk. - workingDirectory: $(Agent.TempDirectory) - - script: ${{ parameters.sourceIndexBuildCommand }} displayName: Build Repository - - script: $(Agent.TempDirectory)/.source-index/tools/BinLogToSln -i $(BinlogPath) -r $(Build.SourcesDirectory) -n $(Build.Repository.Name) -o .source-index/stage1output - displayName: Process Binlog into indexable sln - - - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - task: AzureCLI@2 - displayName: Get stage 1 auth token - inputs: - azureSubscription: 'SourceDotNet Stage1 Publish' - addSpnToEnvironment: true - scriptType: 'ps' - scriptLocation: 'inlineScript' - inlineScript: | - echo "##vso[task.setvariable variable=ARM_CLIENT_ID]$env:servicePrincipalId" - echo "##vso[task.setvariable variable=ARM_ID_TOKEN]$env:idToken" - echo "##vso[task.setvariable variable=ARM_TENANT_ID]$env:tenantId" - - - script: | - echo "Client ID: $(ARM_CLIENT_ID)" - echo "ID Token: $(ARM_ID_TOKEN)" - echo "Tenant ID: $(ARM_TENANT_ID)" - az login --service-principal -u $(ARM_CLIENT_ID) --tenant $(ARM_TENANT_ID) --allow-no-subscriptions --federated-token $(ARM_ID_TOKEN) - displayName: "Login to Azure" - - - script: $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1 - displayName: Upload stage1 artifacts to source index + - template: /eng/common/core-templates/steps/source-index-stage1-publish.yml + parameters: + binLogPath: ${{ parameters.binLogPath }} \ No newline at end of file diff --git a/eng/common/core-templates/post-build/common-variables.yml b/eng/common/core-templates/post-build/common-variables.yml index b9ede10bf0..d5627a994a 100644 --- a/eng/common/core-templates/post-build/common-variables.yml +++ b/eng/common/core-templates/post-build/common-variables.yml @@ -8,8 +8,6 @@ variables: # Default Maestro++ API Endpoint and API Version - name: MaestroApiEndPoint value: "https://maestro.dot.net" - - name: MaestroApiAccessToken - value: $(MaestroAccessToken) - name: MaestroApiVersion value: "2020-02-20" diff --git a/eng/common/core-templates/post-build/post-build.yml b/eng/common/core-templates/post-build/post-build.yml index fb15c40c03..454fd75c7a 100644 --- a/eng/common/core-templates/post-build/post-build.yml +++ b/eng/common/core-templates/post-build/post-build.yml @@ -300,14 +300,17 @@ stages: - task: NuGetAuthenticate@1 - - task: PowerShell@2 + - task: AzureCLI@2 displayName: Publish Using Darc inputs: - filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 - arguments: -BuildId $(BARBuildId) + azureSubscription: "Darc: Maestro Production" + scriptType: ps + scriptLocation: scriptPath + scriptPath: $(Build.SourcesDirectory)/eng/common/post-build/publish-using-darc.ps1 + arguments: > + -BuildId $(BARBuildId) -PublishingInfraVersion ${{ parameters.publishingInfraVersion }} - -AzdoToken '$(publishing-dnceng-devdiv-code-r-build-re)' - -MaestroToken '$(MaestroApiAccessToken)' + -AzdoToken '$(System.AccessToken)' -WaitPublishingFinish true -ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}' -SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}' diff --git a/eng/common/core-templates/post-build/setup-maestro-vars.yml b/eng/common/core-templates/post-build/setup-maestro-vars.yml index 8d56b57267..f7602980db 100644 --- a/eng/common/core-templates/post-build/setup-maestro-vars.yml +++ b/eng/common/core-templates/post-build/setup-maestro-vars.yml @@ -15,19 +15,20 @@ steps: artifactName: ReleaseConfigs checkDownloadedFiles: true - - task: PowerShell@2 + - task: AzureCLI@2 name: setReleaseVars displayName: Set Release Configs Vars inputs: - targetType: inline - pwsh: true - script: | + azureSubscription: "Darc: Maestro Production" + scriptType: pscore + scriptLocation: inlineScript + inlineScript: | try { if (!$Env:PromoteToMaestroChannels -or $Env:PromoteToMaestroChannels.Trim() -eq '') { $Content = Get-Content $(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt $BarId = $Content | Select -Index 0 - $Channels = $Content | Select -Index 1 + $Channels = $Content | Select -Index 1 $IsStableBuild = $Content | Select -Index 2 $AzureDevOpsProject = $Env:System_TeamProject @@ -35,15 +36,16 @@ steps: $AzureDevOpsBuildId = $Env:Build_BuildId } else { - $buildApiEndpoint = "${Env:MaestroApiEndPoint}/api/builds/${Env:BARBuildId}?api-version=${Env:MaestroApiVersion}" + . $(Build.SourcesDirectory)\eng\common\tools.ps1 + $darc = Get-Darc + $buildInfo = & $darc get-build ` + --id ${{ parameters.BARBuildId }} ` + --extended ` + --output-format json ` + --ci ` + | convertFrom-Json - $apiHeaders = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' - $apiHeaders.Add('Accept', 'application/json') - $apiHeaders.Add('Authorization',"Bearer ${Env:MAESTRO_API_TOKEN}") - - $buildInfo = try { Invoke-WebRequest -Method Get -Uri $buildApiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } - - $BarId = $Env:BARBuildId + $BarId = ${{ parameters.BARBuildId }} $Channels = $Env:PromoteToMaestroChannels -split "," $Channels = $Channels -join "][" $Channels = "[$Channels]" @@ -69,6 +71,4 @@ steps: exit 1 } env: - MAESTRO_API_TOKEN: $(MaestroApiAccessToken) - BARBuildId: ${{ parameters.BARBuildId }} PromoteToMaestroChannels: ${{ parameters.PromoteToChannelIds }} diff --git a/eng/common/core-templates/steps/component-governance.yml b/eng/common/core-templates/steps/component-governance.yml index df449a34c1..cf0649aa95 100644 --- a/eng/common/core-templates/steps/component-governance.yml +++ b/eng/common/core-templates/steps/component-governance.yml @@ -2,7 +2,8 @@ parameters: disableComponentGovernance: false componentGovernanceIgnoreDirectories: '' is1ESPipeline: false - + displayName: 'Component Detection' + steps: - ${{ if eq(parameters.disableComponentGovernance, 'true') }}: - script: echo "##vso[task.setvariable variable=skipComponentGovernanceDetection]true" @@ -10,5 +11,6 @@ steps: - ${{ if ne(parameters.disableComponentGovernance, 'true') }}: - task: ComponentGovernanceComponentDetection@0 continueOnError: true + displayName: ${{ parameters.displayName }} inputs: - ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} \ No newline at end of file + ignoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} diff --git a/eng/common/core-templates/steps/enable-internal-sources.yml b/eng/common/core-templates/steps/enable-internal-sources.yml index 80deddafb1..64f881bffc 100644 --- a/eng/common/core-templates/steps/enable-internal-sources.yml +++ b/eng/common/core-templates/steps/enable-internal-sources.yml @@ -6,30 +6,42 @@ parameters: - name: is1ESPipeline type: boolean default: false +# Legacy parameters to allow for PAT usage +- name: legacyCredential + type: string + default: '' steps: - ${{ if ne(variables['System.TeamProject'], 'public') }}: - # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate. - # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that - # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token. - - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - ${{ if ne(parameters.legacyCredential, '') }}: - task: PowerShell@2 displayName: Setup Internal Feeds inputs: filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 - arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config - - task: NuGetAuthenticate@1 + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token + env: + Token: ${{ parameters.legacyCredential }} + # If running on dnceng (internal project), just use the default behavior for NuGetAuthenticate. + # If running on DevDiv, NuGetAuthenticate is not really an option. It's scoped to a single feed, and we have many feeds that + # may be added. Instead, we'll use the traditional approach (add cred to nuget.config), but use an account token. - ${{ else }}: - - template: /eng/common/templates/steps/get-federated-access-token.yml - parameters: - federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }} - outputVariableName: 'dnceng-artifacts-feeds-read-access-token' - - task: PowerShell@2 - displayName: Setup Internal Feeds - inputs: - filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 - arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token) - # This is required in certain scenarios to install the ADO credential provider. - # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others - # (e.g. dotnet msbuild). - - task: NuGetAuthenticate@1 + - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - task: PowerShell@2 + displayName: Setup Internal Feeds + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config + - ${{ else }}: + - template: /eng/common/templates/steps/get-federated-access-token.yml + parameters: + federatedServiceConnection: ${{ parameters.nugetFederatedServiceConnection }} + outputVariableName: 'dnceng-artifacts-feeds-read-access-token' + - task: PowerShell@2 + displayName: Setup Internal Feeds + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $(dnceng-artifacts-feeds-read-access-token) + # This is required in certain scenarios to install the ADO credential provider. + # It installed by default in some msbuild invocations (e.g. VS msbuild), but needs to be installed for others + # (e.g. dotnet msbuild). + - task: NuGetAuthenticate@1 diff --git a/eng/common/core-templates/steps/get-federated-access-token.yml b/eng/common/core-templates/steps/get-federated-access-token.yml index c8c49cc0e8..3a4d4410c4 100644 --- a/eng/common/core-templates/steps/get-federated-access-token.yml +++ b/eng/common/core-templates/steps/get-federated-access-token.yml @@ -3,6 +3,14 @@ parameters: type: string - name: outputVariableName type: string +- name: is1ESPipeline + type: boolean +- name: stepName + type: string + default: 'getFederatedAccessToken' +- name: condition + type: string + default: '' # Resource to get a token for. Common values include: # - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps # - 'https://storage.azure.com/' for storage @@ -10,10 +18,16 @@ parameters: - name: resource type: string default: '499b84ac-1321-427f-aa17-267ca6975798' +- name: isStepOutputVariable + type: boolean + default: false steps: - task: AzureCLI@2 displayName: 'Getting federated access token for feeds' + name: ${{ parameters.stepName }} + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} inputs: azureSubscription: ${{ parameters.federatedServiceConnection }} scriptType: 'pscore' @@ -25,4 +39,4 @@ steps: exit 1 } Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value" - Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken" \ No newline at end of file + Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true;isOutput=${{ parameters.isStepOutputVariable }}]$accessToken" \ No newline at end of file diff --git a/eng/common/core-templates/steps/publish-logs.yml b/eng/common/core-templates/steps/publish-logs.yml index 8c5ea77b58..173bcfe5ce 100644 --- a/eng/common/core-templates/steps/publish-logs.yml +++ b/eng/common/core-templates/steps/publish-logs.yml @@ -32,7 +32,6 @@ steps: '$(MaestroAccessToken)' '$(dn-bot-all-orgs-artifact-feeds-rw)' '$(akams-client-id)' - '$(akams-client-secret)' '$(microsoft-symbol-server-pat)' '$(symweb-symbol-server-pat)' '$(dn-bot-all-orgs-build-rw-code-rw)' @@ -46,6 +45,7 @@ steps: SourceFolder: '$(Build.SourcesDirectory)/PostBuildLogs' Contents: '**' TargetFolder: '$(Build.ArtifactStagingDirectory)/PostBuildLogs' + condition: always() - template: /eng/common/core-templates/steps/publish-build-artifacts.yml parameters: diff --git a/eng/common/core-templates/steps/source-build.yml b/eng/common/core-templates/steps/source-build.yml index 16c778d92c..2915d29bb7 100644 --- a/eng/common/core-templates/steps/source-build.yml +++ b/eng/common/core-templates/steps/source-build.yml @@ -121,7 +121,9 @@ steps: # a nupkg cache of input packages (a local feed). # This path must match the upstream cache path in property 'CurrentRepoSourceBuiltNupkgCacheDir' # in src\Microsoft.DotNet.Arcade.Sdk\tools\SourceBuild\SourceBuildArcade.targets -- task: ComponentGovernanceComponentDetection@0 - displayName: Component Detection (Exclude upstream cache) - inputs: - ignoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache' +- template: /eng/common/core-templates/steps/component-governance.yml + parameters: + displayName: Component Detection (Exclude upstream cache) + is1ESPipeline: ${{ parameters.is1ESPipeline }} + componentGovernanceIgnoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache' + disableComponentGovernance: ${{ eq(variables['System.TeamProject'], 'public') }} diff --git a/eng/common/core-templates/steps/source-index-stage1-publish.yml b/eng/common/core-templates/steps/source-index-stage1-publish.yml new file mode 100644 index 0000000000..473a22c471 --- /dev/null +++ b/eng/common/core-templates/steps/source-index-stage1-publish.yml @@ -0,0 +1,35 @@ +parameters: + sourceIndexUploadPackageVersion: 2.0.0-20240522.1 + sourceIndexProcessBinlogPackageVersion: 1.0.1-20240522.1 + sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json + binlogPath: artifacts/log/Debug/Build.binlog + +steps: +- task: UseDotNet@2 + displayName: "Source Index: Use .NET 8 SDK" + inputs: + packageType: sdk + version: 8.0.x + installationPath: $(Agent.TempDirectory)/dotnet + workingDirectory: $(Agent.TempDirectory) + +- script: | + $(Agent.TempDirectory)/dotnet/dotnet tool install BinLogToSln --version ${{parameters.sourceIndexProcessBinlogPackageVersion}} --add-source ${{parameters.SourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools + $(Agent.TempDirectory)/dotnet/dotnet tool install UploadIndexStage1 --version ${{parameters.sourceIndexUploadPackageVersion}} --add-source ${{parameters.SourceIndexPackageSource}} --tool-path $(Agent.TempDirectory)/.source-index/tools + displayName: "Source Index: Download netsourceindex Tools" + # Set working directory to temp directory so 'dotnet' doesn't try to use global.json and use the repo's sdk. + workingDirectory: $(Agent.TempDirectory) + +- script: $(Agent.TempDirectory)/.source-index/tools/BinLogToSln -i ${{parameters.BinlogPath}} -r $(Build.SourcesDirectory) -n $(Build.Repository.Name) -o .source-index/stage1output + displayName: "Source Index: Process Binlog into indexable sln" + +- ${{ if and(ne(parameters.runAsPublic, 'true'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - task: AzureCLI@2 + displayName: "Source Index: Upload Source Index stage1 artifacts to Azure" + inputs: + azureSubscription: 'SourceDotNet Stage1 Publish' + addSpnToEnvironment: true + scriptType: 'ps' + scriptLocation: 'inlineScript' + inlineScript: | + $(Agent.TempDirectory)/.source-index/tools/UploadIndexStage1 -i .source-index/stage1output -n $(Build.Repository.Name) -s netsourceindexstage1 -b stage1 diff --git a/eng/common/cross/arm/sources.list.bionic b/eng/common/cross/arm/sources.list.bionic deleted file mode 100644 index 2109557409..0000000000 --- a/eng/common/cross/arm/sources.list.bionic +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.focal b/eng/common/cross/arm/sources.list.focal deleted file mode 100644 index 4de2600c17..0000000000 --- a/eng/common/cross/arm/sources.list.focal +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.jammy b/eng/common/cross/arm/sources.list.jammy deleted file mode 100644 index 6bb0453029..0000000000 --- a/eng/common/cross/arm/sources.list.jammy +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.jessie b/eng/common/cross/arm/sources.list.jessie deleted file mode 100644 index 4d142ac9b1..0000000000 --- a/eng/common/cross/arm/sources.list.jessie +++ /dev/null @@ -1,3 +0,0 @@ -# Debian (sid) # UNSTABLE -deb http://ftp.debian.org/debian/ sid main contrib non-free -deb-src http://ftp.debian.org/debian/ sid main contrib non-free diff --git a/eng/common/cross/arm/sources.list.xenial b/eng/common/cross/arm/sources.list.xenial deleted file mode 100644 index 56fbb36a59..0000000000 --- a/eng/common/cross/arm/sources.list.xenial +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse diff --git a/eng/common/cross/arm/sources.list.zesty b/eng/common/cross/arm/sources.list.zesty deleted file mode 100644 index ea2c14a787..0000000000 --- a/eng/common/cross/arm/sources.list.zesty +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.bionic b/eng/common/cross/arm64/sources.list.bionic deleted file mode 100644 index 2109557409..0000000000 --- a/eng/common/cross/arm64/sources.list.bionic +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.buster b/eng/common/cross/arm64/sources.list.buster deleted file mode 100644 index 7194ac64a9..0000000000 --- a/eng/common/cross/arm64/sources.list.buster +++ /dev/null @@ -1,11 +0,0 @@ -deb http://deb.debian.org/debian buster main -deb-src http://deb.debian.org/debian buster main - -deb http://deb.debian.org/debian-security/ buster/updates main -deb-src http://deb.debian.org/debian-security/ buster/updates main - -deb http://deb.debian.org/debian buster-updates main -deb-src http://deb.debian.org/debian buster-updates main - -deb http://deb.debian.org/debian buster-backports main contrib non-free -deb-src http://deb.debian.org/debian buster-backports main contrib non-free diff --git a/eng/common/cross/arm64/sources.list.focal b/eng/common/cross/arm64/sources.list.focal deleted file mode 100644 index 4de2600c17..0000000000 --- a/eng/common/cross/arm64/sources.list.focal +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.jammy b/eng/common/cross/arm64/sources.list.jammy deleted file mode 100644 index 6bb0453029..0000000000 --- a/eng/common/cross/arm64/sources.list.jammy +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.stretch b/eng/common/cross/arm64/sources.list.stretch deleted file mode 100644 index 0e12157743..0000000000 --- a/eng/common/cross/arm64/sources.list.stretch +++ /dev/null @@ -1,12 +0,0 @@ -deb http://deb.debian.org/debian stretch main -deb-src http://deb.debian.org/debian stretch main - -deb http://deb.debian.org/debian-security/ stretch/updates main -deb-src http://deb.debian.org/debian-security/ stretch/updates main - -deb http://deb.debian.org/debian stretch-updates main -deb-src http://deb.debian.org/debian stretch-updates main - -deb http://deb.debian.org/debian stretch-backports main contrib non-free -deb-src http://deb.debian.org/debian stretch-backports main contrib non-free - diff --git a/eng/common/cross/arm64/sources.list.xenial b/eng/common/cross/arm64/sources.list.xenial deleted file mode 100644 index 56fbb36a59..0000000000 --- a/eng/common/cross/arm64/sources.list.xenial +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse diff --git a/eng/common/cross/arm64/sources.list.zesty b/eng/common/cross/arm64/sources.list.zesty deleted file mode 100644 index ea2c14a787..0000000000 --- a/eng/common/cross/arm64/sources.list.zesty +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse diff --git a/eng/common/cross/armel/sources.list.jessie b/eng/common/cross/armel/sources.list.jessie deleted file mode 100644 index 3d9c3059d8..0000000000 --- a/eng/common/cross/armel/sources.list.jessie +++ /dev/null @@ -1,3 +0,0 @@ -# Debian (jessie) # Stable -deb http://ftp.debian.org/debian/ jessie main contrib non-free -deb-src http://ftp.debian.org/debian/ jessie main contrib non-free diff --git a/eng/common/cross/armv6/sources.list.bookworm b/eng/common/cross/armv6/sources.list.bookworm deleted file mode 100644 index 1016113526..0000000000 --- a/eng/common/cross/armv6/sources.list.bookworm +++ /dev/null @@ -1,2 +0,0 @@ -deb http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi -deb-src http://raspbian.raspberrypi.org/raspbian/ bookworm main contrib non-free rpi diff --git a/eng/common/cross/armv6/sources.list.buster b/eng/common/cross/armv6/sources.list.buster deleted file mode 100644 index f27fc4fb34..0000000000 --- a/eng/common/cross/armv6/sources.list.buster +++ /dev/null @@ -1,2 +0,0 @@ -deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi -deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 8bb233ba25..4b5e8d7166 100644 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -30,7 +30,8 @@ __IllumosArch=arm7 __HaikuArch=arm __QEMUArch=arm __UbuntuArch=armhf -__UbuntuRepo="http://ports.ubuntu.com/" +__UbuntuRepo= +__UbuntuSuites="updates security backports" __LLDB_Package="liblldb-3.9-dev" __SkipUnmount=0 @@ -71,7 +72,7 @@ __AlpinePackages+=" krb5-dev" __AlpinePackages+=" openssl-dev" __AlpinePackages+=" zlib-dev" -__FreeBSDBase="13.2-RELEASE" +__FreeBSDBase="13.3-RELEASE" __FreeBSDPkg="1.17.0" __FreeBSDABI="13" __FreeBSDPackages="libunwind" @@ -129,9 +130,9 @@ __AlpineKeys=' 616db30d:MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnpUpyWDWjlUk3smlWeA0\nlIMW+oJ38t92CRLHH3IqRhyECBRW0d0aRGtq7TY8PmxjjvBZrxTNDpJT6KUk4LRm\na6A6IuAI7QnNK8SJqM0DLzlpygd7GJf8ZL9SoHSH+gFsYF67Cpooz/YDqWrlN7Vw\ntO00s0B+eXy+PCXYU7VSfuWFGK8TGEv6HfGMALLjhqMManyvfp8hz3ubN1rK3c8C\nUS/ilRh1qckdbtPvoDPhSbTDmfU1g/EfRSIEXBrIMLg9ka/XB9PvWRrekrppnQzP\nhP9YE3x/wbFc5QqQWiRCYyQl/rgIMOXvIxhkfe8H5n1Et4VAorkpEAXdsfN8KSVv\nLSMazVlLp9GYq5SUpqYX3KnxdWBgN7BJoZ4sltsTpHQ/34SXWfu3UmyUveWj7wp0\nx9hwsPirVI00EEea9AbP7NM2rAyu6ukcm4m6ATd2DZJIViq2es6m60AE6SMCmrQF\nwmk4H/kdQgeAELVfGOm2VyJ3z69fQuywz7xu27S6zTKi05Qlnohxol4wVb6OB7qG\nLPRtK9ObgzRo/OPumyXqlzAi/Yvyd1ZQk8labZps3e16bQp8+pVPiumWioMFJDWV\nGZjCmyMSU8V6MB6njbgLHoyg2LCukCAeSjbPGGGYhnKLm1AKSoJh3IpZuqcKCk5C\n8CM1S15HxV78s9dFntEqIokCAwEAAQ== ' __Keyring= +__KeyringFile="/usr/share/keyrings/ubuntu-archive-keyring.gpg" __SkipSigCheck=0 __UseMirror=0 -__UseDeb822Format=0 __UnprocessedBuildArgs= while :; do @@ -163,6 +164,7 @@ while :; do __UbuntuArch=armel __UbuntuRepo="http://ftp.debian.org/debian/" __CodeName=jessie + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" ;; armv6) __BuildArch=armv6 @@ -170,10 +172,12 @@ while :; do __QEMUArch=arm __UbuntuRepo="http://raspbian.raspberrypi.org/raspbian/" __CodeName=buster + __KeyringFile="/usr/share/keyrings/raspbian-archive-keyring.gpg" __LLDB_Package="liblldb-6.0-dev" + __UbuntuSuites= - if [[ -e "/usr/share/keyrings/raspbian-archive-keyring.gpg" ]]; then - __Keyring="--keyring /usr/share/keyrings/raspbian-archive-keyring.gpg" + if [[ -e "$__KeyringFile" ]]; then + __Keyring="--keyring $__KeyringFile" fi ;; riscv64) @@ -184,10 +188,6 @@ while :; do __UbuntuArch=riscv64 __UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}" unset __LLDB_Package - - if [[ -e "/usr/share/keyrings/debian-archive-keyring.gpg" ]]; then - __Keyring="--keyring /usr/share/keyrings/debian-archive-keyring.gpg --include=debian-archive-keyring" - fi ;; ppc64le) __BuildArch=ppc64le @@ -292,10 +292,13 @@ while :; do if [[ "$__CodeName" != "jessie" ]]; then __CodeName=noble fi - __UseDeb822Format=1 + if [[ -n "$__LLDB_Package" ]]; then + __LLDB_Package="liblldb-18-dev" + fi ;; jessie) # Debian 8 __CodeName=jessie + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -304,6 +307,7 @@ while :; do stretch) # Debian 9 __CodeName=stretch __LLDB_Package="liblldb-6.0-dev" + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -312,6 +316,7 @@ while :; do buster) # Debian 10 __CodeName=buster __LLDB_Package="liblldb-6.0-dev" + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -319,6 +324,7 @@ while :; do ;; bullseye) # Debian 11 __CodeName=bullseye + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -326,6 +332,7 @@ while :; do ;; bookworm) # Debian 12 __CodeName=bookworm + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -333,6 +340,7 @@ while :; do ;; sid) # Debian sid __CodeName=sid + __KeyringFile="/usr/share/keyrings/debian-archive-keyring.gpg" if [[ -z "$__UbuntuRepo" ]]; then __UbuntuRepo="http://ftp.debian.org/debian/" @@ -442,6 +450,10 @@ fi __UbuntuPackages+=" ${__LLDB_Package:-}" +if [[ -z "$__UbuntuRepo" ]]; then + __UbuntuRepo="http://ports.ubuntu.com/" +fi + if [[ -n "$__LLVM_MajorVersion" ]]; then __UbuntuPackages+=" libclang-common-${__LLVM_MajorVersion}${__LLVM_MinorVersion:+.$__LLVM_MinorVersion}-dev" fi @@ -593,18 +605,18 @@ elif [[ "$__CodeName" == "illumos" ]]; then fi echo "Building binutils. Please wait.." if [[ "$__hasWget" == 1 ]]; then - wget -O- https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf - + wget -O- https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz | tar -xJf - else - curl -SL https://ftp.gnu.org/gnu/binutils/binutils-2.33.1.tar.bz2 | tar -xjf - + curl -SL https://ftp.gnu.org/gnu/binutils/binutils-2.42.tar.xz | tar -xJf - fi mkdir build-binutils && cd build-binutils - ../binutils-2.33.1/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" + ../binutils-2.42/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.11" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" make -j "$JOBS" && make install && cd .. echo "Building gcc. Please wait.." if [[ "$__hasWget" == 1 ]]; then - wget -O- https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf - + wget -O- https://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz | tar -xJf - else - curl -SL https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz | tar -xJf - + curl -SL https://ftp.gnu.org/gnu/gcc/gcc-13.3.0/gcc-13.3.0.tar.xz | tar -xJf - fi CFLAGS="-fPIC" CXXFLAGS="-fPIC" @@ -612,7 +624,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then CFLAGS_FOR_TARGET="-fPIC" export CFLAGS CXXFLAGS CXXFLAGS_FOR_TARGET CFLAGS_FOR_TARGET mkdir build-gcc && cd build-gcc - ../gcc-8.4.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.10" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ + ../gcc-13.3.0/configure --prefix="$__RootfsDir" --target="${__illumosArch}-sun-solaris2.11" --program-prefix="${__illumosArch}-illumos-" --with-sysroot="$__RootfsDir" --with-gnu-as \ --with-gnu-ld --disable-nls --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libcilkrts --disable-libada --disable-libsanitizer \ --disable-libquadmath-support --disable-shared --enable-tls make -j "$JOBS" && make install && cd .. @@ -620,7 +632,7 @@ elif [[ "$__CodeName" == "illumos" ]]; then if [[ "$__UseMirror" == 1 ]]; then BaseUrl=https://pkgsrc.smartos.skylime.net fi - BaseUrl="$BaseUrl/packages/SmartOS/trunk/${__illumosArch}/All" + BaseUrl="$BaseUrl/packages/SmartOS/2019Q4/${__illumosArch}/All" echo "Downloading manifest" if [[ "$__hasWget" == 1 ]]; then wget "$BaseUrl" @@ -740,9 +752,16 @@ elif [[ -n "$__CodeName" ]]; then # shellcheck disable=SC2086 echo running debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" debootstrap "--variant=minbase" $__Keyring --arch "$__UbuntuArch" "$__CodeName" "$__RootfsDir" "$__UbuntuRepo" + mkdir -p "$__RootfsDir/etc/apt/sources.list.d/" - grep -q "Types:" "$__CrossDir/$__BuildArch/sources.list.$__CodeName" && filename="$__CodeName.sources" || filename="$__CodeName.list" - cp "$__CrossDir/$__BuildArch/sources.list.$__CodeName" "$__RootfsDir/etc/apt/sources.list.d/$filename" + cat > "$__RootfsDir/etc/apt/sources.list.d/$__CodeName.sources" < 0 ]]; do diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh index a2fba47038..7b9d97e3bd 100755 --- a/eng/common/dotnet-install.sh +++ b/eng/common/dotnet-install.sh @@ -71,6 +71,9 @@ case $cpuname in i[3-6]86) buildarch=x86 ;; + riscv64) + buildarch=riscv64 + ;; *) echo "Unknown CPU $cpuname detected, treating it as x64" buildarch=x64 diff --git a/eng/common/internal/Tools.csproj b/eng/common/internal/Tools.csproj index e925952d56..32f79dfb34 100644 --- a/eng/common/internal/Tools.csproj +++ b/eng/common/internal/Tools.csproj @@ -4,6 +4,7 @@ net472 false + false diff --git a/eng/common/native/CommonLibrary.psm1 b/eng/common/native/CommonLibrary.psm1 index ca38268c44..f71f6af6cd 100644 --- a/eng/common/native/CommonLibrary.psm1 +++ b/eng/common/native/CommonLibrary.psm1 @@ -277,7 +277,8 @@ function Get-MachineArchitecture { if (($ProcessorArchitecture -Eq "AMD64") -Or ($ProcessorArchitecture -Eq "IA64") -Or ($ProcessorArchitecture -Eq "ARM64") -Or - ($ProcessorArchitecture -Eq "LOONGARCH64")) { + ($ProcessorArchitecture -Eq "LOONGARCH64") -Or + ($ProcessorArchitecture -Eq "RISCV64")) { return "x64" } return "x86" diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 62900e12b2..9a0e1f2b45 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -19,11 +19,9 @@ case "$compiler" in # clangx.y or clang-x.y version="$(echo "$compiler" | tr -d '[:alpha:]-=')" majorVersion="${version%%.*}" - [ -z "${version##*.*}" ] && minorVersion="${version#*.}" - if [ -z "$minorVersion" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -le 6 ]; then - minorVersion=0; - fi + # LLVM based on v18 released in early 2024, with two releases per year + maxVersion="$((18 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 6)))" compiler=clang ;; @@ -31,7 +29,9 @@ case "$compiler" in # gccx.y or gcc-x.y version="$(echo "$compiler" | tr -d '[:alpha:]-=')" majorVersion="${version%%.*}" - [ -z "${version##*.*}" ] && minorVersion="${version#*.}" + + # GCC based on v14 released in early 2024, with one release per year + maxVersion="$((14 + ((($(date +%Y) - 2024) * 12 + $(date +%-m) - 3) / 12)))" compiler=gcc ;; esac @@ -49,12 +49,10 @@ check_version_exists() { desired_version=-1 # Set up the environment to be used for building with the desired compiler. - if command -v "$compiler-$1.$2" > /dev/null; then - desired_version="-$1.$2" - elif command -v "$compiler$1$2" > /dev/null; then - desired_version="$1$2" - elif command -v "$compiler-$1$2" > /dev/null; then - desired_version="-$1$2" + if command -v "$compiler-$1" > /dev/null; then + desired_version="-$1" + elif command -v "$compiler$1" > /dev/null; then + desired_version="$1" fi echo "$desired_version" @@ -75,7 +73,7 @@ set_compiler_version_from_CC() { fi # gcc and clang often display 3 part versions. However, gcc can show only 1 part in some environments. - IFS=. read -r majorVersion minorVersion _ < /dev/null; then - echo "Error: No usable version of $compiler found." + echo "Error: No compatible version of $compiler was found within the range of $minVersion to $maxVersion. Please upgrade your toolchain or specify the compiler explicitly using CLR_CC and CLR_CXX environment variables." exit 1 fi CC="$(command -v "$compiler" 2> /dev/null)" CXX="$(command -v "$cxxCompiler" 2> /dev/null)" set_compiler_version_from_CC - else - if [ "$compiler" = "clang" ] && [ "$majorVersion" -lt 5 ] && { [ "$build_arch" = "arm" ] || [ "$build_arch" = "armel" ]; }; then - # If a major version was provided explicitly, and it was too old, find a newer compiler instead - if ! command -v "$compiler" > /dev/null; then - echo "Error: Found clang version $majorVersion which is not supported on arm/armel architectures, and there is no clang in PATH." - exit 1 - fi - - CC="$(command -v "$compiler" 2> /dev/null)" - CXX="$(command -v "$cxxCompiler" 2> /dev/null)" - set_compiler_version_from_CC - fi fi else - desired_version="$(check_version_exists "$majorVersion" "$minorVersion")" + desired_version="$(check_version_exists "$majorVersion")" if [ "$desired_version" = "-1" ]; then - echo "Error: Could not find specific version of $compiler: $majorVersion $minorVersion." + echo "Error: Could not find specific version of $compiler: $majorVersion." exit 1 fi fi diff --git a/eng/common/post-build/publish-using-darc.ps1 b/eng/common/post-build/publish-using-darc.ps1 index 8bc107fa73..90b58e32a8 100644 --- a/eng/common/post-build/publish-using-darc.ps1 +++ b/eng/common/post-build/publish-using-darc.ps1 @@ -2,7 +2,6 @@ param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $PublishingInfraVersion, [Parameter(Mandatory=$true)][string] $AzdoToken, - [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net', [Parameter(Mandatory=$true)][string] $WaitPublishingFinish, [Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters, @@ -36,14 +35,14 @@ try { } & $darc add-build-to-channel ` - --id $buildId ` - --publishing-infra-version $PublishingInfraVersion ` - --default-channels ` - --source-branch main ` - --azdev-pat $AzdoToken ` - --bar-uri $MaestroApiEndPoint ` - --password $MaestroToken ` - --ci ` + --id $buildId ` + --publishing-infra-version $PublishingInfraVersion ` + --default-channels ` + --source-branch main ` + --azdev-pat "$AzdoToken" ` + --bar-uri "$MaestroApiEndPoint" ` + --ci ` + --verbose ` @optionalParams if ($LastExitCode -ne 0) { diff --git a/eng/common/templates-official/job/job.yml b/eng/common/templates-official/job/job.yml index 0c2928d5c7..3d16b41c78 100644 --- a/eng/common/templates-official/job/job.yml +++ b/eng/common/templates-official/job/job.yml @@ -1,8 +1,22 @@ +parameters: +# Sbom related params + enableSbom: true + PackageVersion: 9.0.0 + BuildDropPath: '$(Build.SourcesDirectory)/artifacts' + jobs: - template: /eng/common/core-templates/job/job.yml parameters: is1ESPipeline: true + componentGovernanceSteps: + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}: + - template: /eng/common/templates/steps/generate-sbom.yml + parameters: + PackageVersion: ${{ parameters.packageVersion }} + BuildDropPath: ${{ parameters.buildDropPath }} + publishArtifacts: false + # publish artifacts # for 1ES managed templates, use the templateContext.output to handle multiple outputs. templateContext: diff --git a/eng/common/templates-official/steps/source-index-stage1-publish.yml b/eng/common/templates-official/steps/source-index-stage1-publish.yml new file mode 100644 index 0000000000..9b8b80942b --- /dev/null +++ b/eng/common/templates-official/steps/source-index-stage1-publish.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/source-index-stage1-publish.yml + parameters: + is1ESPipeline: true + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index 5920952c5b..07d317bf8f 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -1,5 +1,11 @@ parameters: enablePublishBuildArtifacts: false + disableComponentGovernance: '' + componentGovernanceIgnoreDirectories: '' +# Sbom related params + enableSbom: true + PackageVersion: 9.0.0 + BuildDropPath: '$(Build.SourcesDirectory)/artifacts' jobs: - template: /eng/common/core-templates/job/job.yml @@ -14,50 +20,62 @@ jobs: - ${{ each step in parameters.steps }}: - ${{ step }} - artifactPublishSteps: - - ${{ if ne(parameters.artifacts.publish, '') }}: - - ${{ if and(ne(parameters.artifacts.publish.artifacts, 'false'), ne(parameters.artifacts.publish.artifacts, '')) }}: - - template: /eng/common/core-templates/steps/publish-build-artifacts.yml - parameters: - is1ESPipeline: false - args: - displayName: Publish pipeline artifacts - pathToPublish: '$(Build.ArtifactStagingDirectory)/artifacts' - publishLocation: Container - artifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }} - continueOnError: true - condition: always() - - ${{ if and(ne(parameters.artifacts.publish.logs, 'false'), ne(parameters.artifacts.publish.logs, '')) }}: - - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml - parameters: - is1ESPipeline: false - args: - targetPath: '$(Build.ArtifactStagingDirectory)/artifacts/log' - artifactName: ${{ coalesce(parameters.artifacts.publish.logs.name, 'Logs_Build_$(Agent.Os)_$(_BuildConfig)') }} - displayName: 'Publish logs' - continueOnError: true - condition: always() - sbomEnabled: false # we don't need SBOM for logs + componentGovernanceSteps: + - template: /eng/common/templates/steps/component-governance.yml + parameters: + ${{ if eq(parameters.disableComponentGovernance, '') }}: + ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.runAsPublic, 'false'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/dotnet/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/microsoft/'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}: + disableComponentGovernance: false + ${{ else }}: + disableComponentGovernance: true + ${{ else }}: + disableComponentGovernance: ${{ parameters.disableComponentGovernance }} + componentGovernanceIgnoreDirectories: ${{ parameters.componentGovernanceIgnoreDirectories }} - - ${{ if ne(parameters.enablePublishBuildArtifacts, 'false') }}: + artifactPublishSteps: + - ${{ if ne(parameters.artifacts.publish, '') }}: + - ${{ if and(ne(parameters.artifacts.publish.artifacts, 'false'), ne(parameters.artifacts.publish.artifacts, '')) }}: - template: /eng/common/core-templates/steps/publish-build-artifacts.yml parameters: is1ESPipeline: false args: - displayName: Publish Logs - pathToPublish: '$(Build.ArtifactStagingDirectory)/artifacts/log/$(_BuildConfig)' + displayName: Publish pipeline artifacts + pathToPublish: '$(Build.ArtifactStagingDirectory)/artifacts' publishLocation: Container - artifactName: ${{ coalesce(parameters.enablePublishBuildArtifacts.artifactName, '$(Agent.Os)_$(Agent.JobName)' ) }} + artifactName: ${{ coalesce(parameters.artifacts.publish.artifacts.name , 'Artifacts_$(Agent.Os)_$(_BuildConfig)') }} continueOnError: true condition: always() - - - ${{ if eq(parameters.enableBuildRetry, 'true') }}: + - ${{ if and(ne(parameters.artifacts.publish.logs, 'false'), ne(parameters.artifacts.publish.logs, '')) }}: - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml parameters: is1ESPipeline: false args: - targetPath: '$(Build.SourcesDirectory)\eng\common\BuildConfiguration' - artifactName: 'BuildConfiguration' - displayName: 'Publish build retry configuration' + targetPath: '$(Build.ArtifactStagingDirectory)/artifacts/log' + artifactName: ${{ coalesce(parameters.artifacts.publish.logs.name, 'Logs_Build_$(Agent.Os)_$(_BuildConfig)') }} + displayName: 'Publish logs' continueOnError: true - sbomEnabled: false # we don't need SBOM for BuildConfiguration + condition: always() + sbomEnabled: false # we don't need SBOM for logs + + - ${{ if ne(parameters.enablePublishBuildArtifacts, 'false') }}: + - template: /eng/common/core-templates/steps/publish-build-artifacts.yml + parameters: + is1ESPipeline: false + args: + displayName: Publish Logs + pathToPublish: '$(Build.ArtifactStagingDirectory)/artifacts/log/$(_BuildConfig)' + publishLocation: Container + artifactName: ${{ coalesce(parameters.enablePublishBuildArtifacts.artifactName, '$(Agent.Os)_$(Agent.JobName)' ) }} + continueOnError: true + condition: always() + + - ${{ if eq(parameters.enableBuildRetry, 'true') }}: + - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml + parameters: + is1ESPipeline: false + args: + targetPath: '$(Build.SourcesDirectory)\eng\common\BuildConfiguration' + artifactName: 'BuildConfiguration' + displayName: 'Publish build retry configuration' + continueOnError: true + sbomEnabled: false # we don't need SBOM for BuildConfiguration diff --git a/eng/common/templates/steps/source-index-stage1-publish.yml b/eng/common/templates/steps/source-index-stage1-publish.yml new file mode 100644 index 0000000000..182cec33a7 --- /dev/null +++ b/eng/common/templates/steps/source-index-stage1-publish.yml @@ -0,0 +1,7 @@ +steps: +- template: /eng/common/core-templates/steps/source-index-stage1-publish.yml + parameters: + is1ESPipeline: false + + ${{ each parameter in parameters }}: + ${{ parameter.key }}: ${{ parameter.value }} diff --git a/eng/empty.csproj b/eng/empty.csproj deleted file mode 100644 index 23ebe5a900..0000000000 --- a/eng/empty.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - net6.0 - - - - - diff --git a/eng/installruntimes.cmd b/eng/installruntimes.cmd new file mode 100644 index 0000000000..b3347a8ee3 --- /dev/null +++ b/eng/installruntimes.cmd @@ -0,0 +1,3 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" -installruntimes -skipmanaged -skipnative %*" +exit /b %ErrorLevel% diff --git a/eng/installruntimes.sh b/eng/installruntimes.sh new file mode 100755 index 0000000000..fee153f507 --- /dev/null +++ b/eng/installruntimes.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $SOURCE until the file is no longer a symlink +while [[ -h $source ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done + +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" +"$scriptroot/../eng/build.sh" -installruntimes -skipmanaged -skipnative $@ + diff --git a/eng/native-prereqs.proj b/eng/native-prereqs.proj new file mode 100644 index 0000000000..bea0af21d1 --- /dev/null +++ b/eng/native-prereqs.proj @@ -0,0 +1,72 @@ + + + + + netstandard2.0 + false + false + + + + $(ArtifactsObjDir)_version.h + $(ArtifactsObjDir)_version.c + $(ArtifactsObjDir)runtime_version.h + .NET Diagnostics + + + + + $(ArtifactsObjDir)runtime_version.h + + <_RuntimeVersionFileContents> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index ba561ed6e7..2cf33442a9 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -109,7 +109,7 @@ build_native() # set default iOS simulator deployment target # keep in sync with SetOSTargetMinVersions in the root Directory.Build.props - cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs" + cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs" if [[ "$__TargetArch" == x64 ]]; then cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs" elif [[ "$__TargetArch" == arm64 ]]; then @@ -123,7 +123,7 @@ build_native() # set default iOS device deployment target # keep in sync with SetOSTargetMinVersions in the root Directory.Build.props - cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs" + cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs" if [[ "$__TargetArch" == arm64 ]]; then cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs" else @@ -135,7 +135,7 @@ build_native() # set default tvOS simulator deployment target # keep in sync with SetOSTargetMinVersions in the root Directory.Build.props - cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs" + cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs" if [[ "$__TargetArch" == x64 ]]; then cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs" elif [[ "$__TargetArch" == arm64 ]]; then @@ -149,7 +149,7 @@ build_native() # set default tvOS device deployment target # keep in sync with SetOSTargetMinVersions in the root Directory.Build.props - cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs" + cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs" if [[ "$__TargetArch" == arm64 ]]; then cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs" else @@ -282,7 +282,7 @@ usage() exit 1 } -source "$__RepoRootDir/eng/native/init-os-and-arch.sh" +source "$__RepoRootDir/eng/common/native/init-os-and-arch.sh" __TargetArch=$arch __TargetOS=$os @@ -311,7 +311,7 @@ while :; do lowerI="$(echo "${1/--/-}" | tr "[:upper:]" "[:lower:]")" case "$lowerI" in - -\?|-h|--help) + -\?|-h|-help) usage exit 1 ;; diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index df012111d9..35367f9605 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -12,8 +12,16 @@ set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# We need to set this to Release as there's no way to intercept configuration-specific linker flags +# for try_compile-style tests (like check_c_source_compiles) and some of the default Debug flags +# (ie. /INCREMENTAL) conflict with our own flags. +set(CMAKE_TRY_COMPILE_CONFIGURATION Release) + include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) +if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.18") + include(CheckLinkerFlag) +endif() # "configureoptimization.cmake" must be included after CLR_CMAKE_HOST_UNIX has been set. include(${CMAKE_CURRENT_LIST_DIR}/configureoptimization.cmake) @@ -28,7 +36,6 @@ if (CLR_CMAKE_HOST_UNIX) add_compile_options(-Wno-null-conversion) add_compile_options(-glldb) else() - add_compile_options($<$:-Werror=conversion-null>) add_compile_options(-g) endif() endif() @@ -54,7 +61,20 @@ add_compile_definitions("$<$:DEBUG;_DEBUG;_DBG;URTBLDENV_FRIENDL add_compile_definitions("$<$,$>:NDEBUG;URTBLDENV_FRIENDLY=Retail>") if (MSVC) - add_linker_flag(/guard:cf) + + define_property(TARGET PROPERTY CLR_CONTROL_FLOW_GUARD INHERITED BRIEF_DOCS "Controls the /guard:cf flag presence" FULL_DOCS "Set this property to ON or OFF to indicate if the /guard:cf compiler and linker flag should be present") + define_property(TARGET PROPERTY CLR_EH_CONTINUATION INHERITED BRIEF_DOCS "Controls the /guard:ehcont flag presence" FULL_DOCS "Set this property to ON or OFF to indicate if the /guard:ehcont compiler flag should be present") + define_property(TARGET PROPERTY CLR_EH_OPTION INHERITED BRIEF_DOCS "Defines the value of the /EH option" FULL_DOCS "Set this property to one of the valid /EHxx options (/EHa, /EHsc, /EHa-, ...)") + define_property(TARGET PROPERTY MSVC_WARNING_LEVEL INHERITED BRIEF_DOCS "Define the warning level for the /Wn option" FULL_DOCS "Set this property to one of the valid /Wn options (/W0, /W1, /W2, /W3, /W4)") + + set_property(GLOBAL PROPERTY CLR_CONTROL_FLOW_GUARD ON) + + # Remove the /EHsc from the CXX flags so that the compile options are the only source of truth for that + string(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set_property(GLOBAL PROPERTY CLR_EH_OPTION /EHsc) + + add_compile_options($<$:$>) + add_link_options($<$>:/guard:cf>) # Linker flags # @@ -103,7 +123,7 @@ if (MSVC) # The Ninja generator doesn't appear to have the default `/INCREMENTAL:ON` that # the Visual Studio generator has. Therefore we will override the default for Visual Studio only. add_linker_flag(/INCREMENTAL:NO DEBUG) - add_linker_flag(/OPT:REF DEBUG) + add_linker_flag(/OPT:NOREF DEBUG) add_linker_flag(/OPT:NOICF DEBUG) endif (CMAKE_GENERATOR MATCHES "^Visual Studio.*$") @@ -199,8 +219,8 @@ if (CLR_CMAKE_ENABLE_SANITIZERS) # Disable the use-after-return check for ASAN on Clang. This is because we have a lot of code that # depends on the fact that our locals are not saved in a parallel stack, so we can't enable this today. # If we ever have a way to detect a parallel stack and track its bounds, we can re-enable this check. - add_compile_options($<$:-fsanitize-address-use-after-return=never>) - add_compile_options($<$:-fsanitize-address-use-after-return=never>) + add_compile_options($<$:-fsanitize-address-use-after-return=never>) + add_compile_options($<$:-fsanitize-address-use-after-return=never>) endif() endif() @@ -289,7 +309,13 @@ elseif(CLR_CMAKE_HOST_SUNOS) add_definitions(-D__EXTENSIONS__ -D_XPG4_2 -D_POSIX_PTHREAD_SEMANTICS) elseif(CLR_CMAKE_HOST_OSX AND NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS) add_definitions(-D_XOPEN_SOURCE) - add_linker_flag("-Wl,-bind_at_load") + + # the new linker in Xcode 15 (ld_new/ld_prime) deprecated the -bind_at_load flag for macOS which causes a warning + # that fails the build since we build with -Werror. Only pass the flag if we need it, i.e. older linkers. + check_linker_flag(C "-Wl,-bind_at_load,-fatal_warnings" LINKER_SUPPORTS_BIND_AT_LOAD_FLAG) + if(LINKER_SUPPORTS_BIND_AT_LOAD_FLAG) + add_linker_flag("-Wl,-bind_at_load") + endif() elseif(CLR_CMAKE_HOST_HAIKU) add_compile_options($<$:-Wa,--noexecstack>) add_linker_flag("-Wl,--no-undefined") @@ -413,8 +439,12 @@ if (CLR_CMAKE_HOST_UNIX) message("Detected SunOS amd64") elseif(CLR_CMAKE_HOST_HAIKU) message("Detected Haiku x86_64") - endif(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_MACCATALYST) -endif(CLR_CMAKE_HOST_UNIX) + elseif(CLR_CMAKE_HOST_BROWSER) + add_definitions(-DHOST_BROWSER) + endif() +elseif(CLR_CMAKE_HOST_WASI) + add_definitions(-DHOST_WASI) +endif() if (CLR_CMAKE_HOST_WIN32) add_definitions(-DHOST_WINDOWS) @@ -427,6 +457,8 @@ endif(CLR_CMAKE_HOST_WIN32) # Unconditionally define _FILE_OFFSET_BITS as 64 on all platforms. add_definitions(-D_FILE_OFFSET_BITS=64) +# Unconditionally define _TIME_BITS as 64 on all platforms. +add_definitions(-D_TIME_BITS=64) # Architecture specific files folder name if (CLR_CMAKE_TARGET_ARCH_AMD64) @@ -496,11 +528,6 @@ if (CLR_CMAKE_HOST_UNIX) # Disable frame pointer optimizations so profilers can get better call stacks add_compile_options(-fno-omit-frame-pointer) - # The -fms-extensions enable the stuff like __if_exists, __declspec(uuid()), etc. - add_compile_options(-fms-extensions) - #-fms-compatibility Enable full Microsoft Visual C++ compatibility - #-fms-extensions Accept some non-standard constructs supported by the Microsoft compiler - # Make signed arithmetic overflow of addition, subtraction, and multiplication wrap around # using twos-complement representation (this is normally undefined according to the C++ spec). add_compile_options(-fwrapv) @@ -645,28 +672,27 @@ if (CLR_CMAKE_HOST_UNIX) set(DISABLE_OVERRIDING_MIN_VERSION_ERROR -Wno-overriding-t-option) add_link_options(-Wno-overriding-t-option) if(CLR_CMAKE_HOST_ARCH_ARM64) - set(MACOS_VERSION_MIN_FLAGS "-target arm64-apple-ios14.2-macabi") - add_link_options(-target arm64-apple-ios14.2-macabi) + set(CLR_CMAKE_MACCATALYST_COMPILER_TARGET "arm64-apple-ios15.0-macabi") + add_link_options(-target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET}) elseif(CLR_CMAKE_HOST_ARCH_AMD64) - set(MACOS_VERSION_MIN_FLAGS "-target x86_64-apple-ios13.5-macabi") - add_link_options(-target x86_64-apple-ios13.5-macabi) + set(CLR_CMAKE_MACCATALYST_COMPILER_TARGET "x86_64-apple-ios15.0-macabi") + add_link_options(-target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET}) else() clr_unknown_arch() endif() # These options are intentionally set using the CMAKE_XXX_FLAGS instead of # add_compile_options so that they take effect on the configuration functions # in various configure.cmake files. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MACOS_VERSION_MIN_FLAGS} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MACOS_VERSION_MIN_FLAGS} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") - set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${MACOS_VERSION_MIN_FLAGS} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") - set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${MACOS_VERSION_MIN_FLAGS} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") - set(CMAKE_OBJCXX_FLAGS "${CMAKE_OBJCXX_FLAGS} ${MACOS_VERSION_MIN_FLAGS} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") + set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") + set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS}-target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") + set(CMAKE_OBJCXX_FLAGS "${CMAKE_OBJCXX_FLAGS} -target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}") elseif(CLR_CMAKE_HOST_OSX) + set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0") if(CLR_CMAKE_HOST_ARCH_ARM64) - set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0") add_compile_options(-arch arm64) elseif(CLR_CMAKE_HOST_ARCH_AMD64) - set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15") add_compile_options(-arch x86_64) else() clr_unknown_arch() @@ -696,9 +722,6 @@ if(CLR_CMAKE_TARGET_UNIX) add_compile_definitions($<$>>:TARGET_ANDROID>) elseif(CLR_CMAKE_TARGET_LINUX) add_compile_definitions($<$>>:TARGET_LINUX>) - if(CLR_CMAKE_TARGET_BROWSER) - add_compile_definitions($<$>>:TARGET_BROWSER>) - endif() if(CLR_CMAKE_TARGET_LINUX_MUSL) add_compile_definitions($<$>>:TARGET_LINUX_MUSL>) endif() @@ -712,6 +735,9 @@ if(CLR_CMAKE_TARGET_UNIX) elseif(CLR_CMAKE_TARGET_HAIKU) add_compile_definitions($<$>>:TARGET_HAIKU>) endif() + if(CLR_CMAKE_TARGET_BROWSER) + add_compile_definitions($<$>>:TARGET_BROWSER>) + endif() elseif(CLR_CMAKE_TARGET_WASI) add_compile_definitions($<$>>:TARGET_WASI>) else(CLR_CMAKE_TARGET_UNIX) @@ -758,13 +784,11 @@ if (MSVC) # Compile options for targeting windows add_compile_options($<$:/nologo>) # Suppress Startup Banner - # /W3 is added by default by CMake, so remove it - string(REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - string(REPLACE "/W3" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") # [[! Microsoft.Security.SystemsADM.10086 !]] - SDL required warnings # set default warning level to 4 but allow targets to override it. - add_compile_options($<$:/W$>,$,4>>>) + set_property(GLOBAL PROPERTY MSVC_WARNING_LEVEL 4) + add_compile_options($<$:/W$>) add_compile_options($<$:/WX>) # treat warnings as errors add_compile_options($<$:/Oi>) # enable intrinsics add_compile_options($<$:/Oy->) # disable suppressing of the creation of frame pointers on the call stack for quicker function calls @@ -774,9 +798,7 @@ if (MSVC) add_compile_options($<$:/GS>) # Explicitly enable the buffer security checks add_compile_options($<$:/fp:precise>) # Enable precise floating point - # disable C++ RTTI - # /GR is added by default by CMake, so remove it manually. - string(REPLACE "/GR " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + # Disable C++ RTTI set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") add_compile_options($<$:/FC>) # use full pathnames in diagnostics @@ -824,14 +846,12 @@ if (MSVC) add_compile_options($<$:/we4013>) # 'function' undefined - assuming extern returning int. add_compile_options($<$:/we4102>) # "'%$S' : unreferenced label". add_compile_options($<$:/we4551>) # Function call missing argument list. - add_compile_options($<$:/we4700>) # Local used w/o being initialized. add_compile_options($<$:/we4640>) # 'instance' : construction of local static object is not thread-safe add_compile_options($<$:/we4806>) # Unsafe operation involving type 'bool'. # SDL requires the below warnings to be treated as errors: # More info: https://liquid.microsoft.com/Web/Object/Read/ms.security/Requirements/Microsoft.Security.SystemsADM.10086 # (Access to that URL restricted to Microsoft employees.) - add_compile_options($<$:/we4018>) # 'expression' : signed/unsigned mismatch add_compile_options($<$:/we4055>) # 'conversion' : from data pointer 'type1' to function pointer 'type2' add_compile_options($<$:/we4146>) # unary minus operator applied to unsigned type, result still unsigned add_compile_options($<$:/we4242>) # 'identifier' : conversion from 'type1' to 'type2', possible loss of data @@ -873,7 +893,9 @@ if (MSVC) add_compile_options($<$:/Gz>) endif (CLR_CMAKE_HOST_ARCH_I386) - add_compile_options($<$,$,$>>:/GL>) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_CHECKED OFF) if (CLR_CMAKE_HOST_ARCH_AMD64) # The generator expression in the following command means that the /homeparams option is added only for debug builds for C and C++ source files @@ -882,16 +904,15 @@ if (MSVC) # enable control-flow-guard support for native components for non-Arm64 builds # Added using variables instead of add_compile_options to let individual projects override it - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /guard:cf") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:cf") + add_compile_options($<$,$>>:/guard:cf>) # Enable EH-continuation table and CET-compatibility for native components for amd64 builds except for components of the Mono # runtime. Added some switches using variables instead of add_compile_options to let individual projects override it. if (CLR_CMAKE_HOST_ARCH_AMD64 AND NOT CLR_CMAKE_RUNTIME_MONO) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /guard:ehcont") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /guard:ehcont") - set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /guard:ehcont") - add_linker_flag(/guard:ehcont) + set_property(GLOBAL PROPERTY CLR_EH_CONTINUATION ON) + + add_compile_options($<$,$>>:/guard:ehcont>) + add_link_options($<$>:/guard:ehcont>) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /CETCOMPAT") endif (CLR_CMAKE_HOST_ARCH_AMD64 AND NOT CLR_CMAKE_RUNTIME_MONO) @@ -920,7 +941,9 @@ if (MSVC) endif (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64) # Don't display the output header when building RC files. - add_compile_options($<$:/nologo>) + set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /nologo") + # Don't display the output header when building asm files. + set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /nologo") endif (MSVC) # Configure non-MSVC compiler flags that apply to all platforms (unix-like or otherwise) @@ -955,27 +978,13 @@ endif() # Ensure other tools are present if (CLR_CMAKE_HOST_WIN32) - if(CLR_CMAKE_HOST_ARCH_ARM) - - # Explicitly specify the assembler to be used for Arm32 compile - file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX86\\arm\\armasm.exe" CMAKE_ASM_COMPILER) - - set(CMAKE_ASM_MASM_COMPILER ${CMAKE_ASM_COMPILER}) - message("CMAKE_ASM_MASM_COMPILER explicitly set to: ${CMAKE_ASM_MASM_COMPILER}") - - # Enable generic assembly compilation to avoid CMake generate VS proj files that explicitly - # use ml[64].exe as the assembler. - enable_language(ASM) - set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "") - set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "") - set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "") - set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "") - set(CMAKE_ASM_COMPILE_OBJECT " -g -o ") - - elseif(CLR_CMAKE_HOST_ARCH_ARM64) - + if(CLR_CMAKE_HOST_ARCH_ARM64) # Explicitly specify the assembler to be used for Arm64 compile - file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX86\\arm64\\armasm64.exe" CMAKE_ASM_COMPILER) + if (CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\Hostarm64\\arm64\\armasm64.exe" CMAKE_ASM_COMPILER) + else() + file(TO_CMAKE_PATH "$ENV{VCToolsInstallDir}\\bin\\HostX64\\arm64\\armasm64.exe" CMAKE_ASM_COMPILER) + endif() set(CMAKE_ASM_MASM_COMPILER ${CMAKE_ASM_COMPILER}) message("CMAKE_ASM_MASM_COMPILER explicitly set to: ${CMAKE_ASM_MASM_COMPILER}") diff --git a/eng/native/configurepaths.cmake b/eng/native/configurepaths.cmake index 7d6851d1cf..0ffe4ebfa1 100644 --- a/eng/native/configurepaths.cmake +++ b/eng/native/configurepaths.cmake @@ -1,9 +1,10 @@ get_filename_component(CLR_REPO_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../.. ABSOLUTE) set(CLR_ENG_NATIVE_DIR ${CMAKE_CURRENT_LIST_DIR}) -get_filename_component(CLR_SRC_NATIVE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../src/native ABSOLUTE) +get_filename_component(CLR_SRC_NATIVE_DIR ${CMAKE_CURRENT_LIST_DIR}/../../src/shared/native ABSOLUTE) set (CLR_ARTIFACTS_OBJ_DIR "${CLR_REPO_ROOT_DIR}/artifacts/obj") set (CLR_SOURCELINK_FILE_PATH "${CLR_ARTIFACTS_OBJ_DIR}/native.sourcelink.json") set(VERSION_HEADER_PATH "${CLR_ARTIFACTS_OBJ_DIR}/_version.h") set(VERSION_FILE_PATH "${CLR_ARTIFACTS_OBJ_DIR}/_version.c") set(VERSION_FILE_RC_PATH "${CLR_ARTIFACTS_OBJ_DIR}/NativeVersion.rc") set(RUNTIME_VERSION_HEADER_PATH "${CLR_ARTIFACTS_OBJ_DIR}/runtime_version.h") +set(CLR_SHARED_DIR ${CLR_REPO_ROOT_DIR}/src/shared) diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index 2f6ca03db8..10f623e6d5 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -27,6 +27,8 @@ if(CLR_CMAKE_HOST_OS STREQUAL linux) endif() elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL i686) set(CLR_CMAKE_HOST_UNIX_X86 1) + elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL aarch64) + set(CLR_CMAKE_HOST_UNIX_ARM64 1) else() clr_unknown_arch() endif() @@ -45,7 +47,11 @@ if(CLR_CMAKE_HOST_OS STREQUAL linux) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv6 OR CMAKE_SYSTEM_PROCESSOR STREQUAL armv6l) set(CLR_CMAKE_HOST_UNIX_ARMV6 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm64) - set(CLR_CMAKE_HOST_UNIX_ARM64 1) + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CLR_CMAKE_HOST_UNIX_ARM64 1) + else() + set(CLR_CMAKE_HOST_UNIX_ARM 1) + endif() elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL loongarch64) set(CLR_CMAKE_HOST_UNIX_LOONGARCH64 1) elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL riscv64) @@ -423,7 +429,6 @@ endif(CLR_CMAKE_TARGET_OS STREQUAL haiku) if(CLR_CMAKE_TARGET_OS STREQUAL emscripten) set(CLR_CMAKE_TARGET_UNIX 1) - set(CLR_CMAKE_TARGET_LINUX 1) set(CLR_CMAKE_TARGET_BROWSER 1) endif(CLR_CMAKE_TARGET_OS STREQUAL emscripten) @@ -489,9 +494,23 @@ if(NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI) set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() +if (CLR_CMAKE_TARGET_ANDROID) + # Google requires all the native libraries to be aligned to 16 bytes (for 16k memory page size) + # This applies only to 64-bit binaries + if(CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) + add_link_options(LINKER:-z,max-page-size=16384) + endif() +endif() string(TOLOWER "${CMAKE_BUILD_TYPE}" LOWERCASE_CMAKE_BUILD_TYPE) if(LOWERCASE_CMAKE_BUILD_TYPE STREQUAL debug) # Clear _FORTIFY_SOURCE=2, if set string(REPLACE "-D_FORTIFY_SOURCE=2 " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "-D_FORTIFY_SOURCE=2 " "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") endif() + +if (CLR_CMAKE_TARGET_ANDROID OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS OR CLR_CMAKE_HOST_ARCH_ARMV6) + # Some platforms are opted-out from using the in-tree zlib-ng by default: + # - Android and iOS-like platforms: concerns about extra binary size + # - Armv6: zlib-ng has build breaks + set(CLR_CMAKE_USE_SYSTEM_ZLIB 1) +endif() diff --git a/eng/native/configuretools.cmake b/eng/native/configuretools.cmake index 6b23f2bb1e..6898f88578 100644 --- a/eng/native/configuretools.cmake +++ b/eng/native/configuretools.cmake @@ -77,10 +77,10 @@ endif() if (NOT CLR_CMAKE_HOST_WIN32) # detect linker - separate_arguments(ldVersion UNIX_COMMAND "${CMAKE_C_COMPILER} ${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version") - execute_process(COMMAND ${ldVersion} + execute_process(COMMAND sh -c "${CMAKE_C_COMPILER} ${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version | head -1" ERROR_QUIET - OUTPUT_VARIABLE ldVersionOutput) + OUTPUT_VARIABLE ldVersionOutput + OUTPUT_STRIP_TRAILING_WHITESPACE) if("${ldVersionOutput}" MATCHES "LLD") set(LD_LLVM 1) @@ -91,6 +91,7 @@ if (NOT CLR_CMAKE_HOST_WIN32) else(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_MACCATALYST) set(LD_OSX 1) endif() + message("-- The linker identification is ${ldVersionOutput}") endif() # This introspection depends on CMAKE_STRINGS, which is why it's in this file instead of configureplatform diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index d5ef9ed625..b1cb09d662 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -1,8 +1,8 @@ function(clr_unknown_arch) if (WIN32) - message(FATAL_ERROR "Only AMD64, ARM64, ARM and I386 are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}") + message(FATAL_ERROR "Only AMD64, ARM64, ARM and I386 hosts are supported. Found: ${CMAKE_SYSTEM_PROCESSOR}") elseif(CLR_CROSS_COMPONENTS_BUILD) - message(FATAL_ERROR "Only AMD64, I386 host are supported for linux cross-architecture component. Found: ${CMAKE_SYSTEM_PROCESSOR}") + message(FATAL_ERROR "Only AMD64, ARM64 and I386 hosts are supported for linux cross-architecture component. Found: ${CMAKE_SYSTEM_PROCESSOR}") else() message(FATAL_ERROR "'${CMAKE_SYSTEM_PROCESSOR}' is an unsupported architecture.") endif() @@ -220,6 +220,12 @@ endfunction(convert_to_absolute_path) function(preprocess_file inputFilename outputFilename) get_compile_definitions(PREPROCESS_DEFINITIONS) get_include_directories(PREPROCESS_INCLUDE_DIRECTORIES) + get_source_file_property(SOURCE_FILE_DEFINITIONS ${inputFilename} COMPILE_DEFINITIONS) + + foreach(DEFINITION IN LISTS SOURCE_FILE_DEFINITIONS) + list(APPEND PREPROCESS_DEFINITIONS -D${DEFINITION}) + endforeach() + if (MSVC) add_custom_command( OUTPUT ${outputFilename} @@ -228,9 +234,12 @@ function(preprocess_file inputFilename outputFilename) COMMENT "Preprocessing ${inputFilename}. Outputting to ${outputFilename}" ) else() + if (CMAKE_CXX_COMPILER_TARGET AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(_LOCAL_CROSS_TARGET "--target=${CMAKE_CXX_COMPILER_TARGET}") + endif() add_custom_command( OUTPUT ${outputFilename} - COMMAND ${CMAKE_CXX_COMPILER} -E -P ${PREPROCESS_DEFINITIONS} ${PREPROCESS_INCLUDE_DIRECTORIES} -o ${outputFilename} -x c ${inputFilename} + COMMAND ${CMAKE_CXX_COMPILER} ${_LOCAL_CROSS_TARGET} -E -P ${PREPROCESS_DEFINITIONS} ${PREPROCESS_INCLUDE_DIRECTORIES} -o ${outputFilename} -x c ${inputFilename} DEPENDS ${inputFilename} COMMENT "Preprocessing ${inputFilename}. Outputting to ${outputFilename}" ) @@ -369,7 +378,11 @@ endfunction() function (get_symbol_file_name targetName outputSymbolFilename) if (CLR_CMAKE_HOST_UNIX) if (CLR_CMAKE_TARGET_APPLE) - set(strip_destination_file $.dwarf) + if (CLR_CMAKE_APPLE_DSYM) + set(strip_destination_file $.dSYM) + else () + set(strip_destination_file $.dwarf) + endif () else () set(strip_destination_file $.dbg) endif () @@ -416,7 +429,9 @@ function(strip_symbols targetName outputFilename) OUTPUT_VARIABLE DSYMUTIL_HELP_OUTPUT ) - set(DSYMUTIL_OPTS "--flat") + if (NOT CLR_CMAKE_APPLE_DSYM) + set(DSYMUTIL_OPTS "--flat") + endif () if ("${DSYMUTIL_HELP_OUTPUT}" MATCHES "--minimize") list(APPEND DSYMUTIL_OPTS "--minimize") endif () @@ -493,7 +508,7 @@ function(install_static_library targetName destination component) if (WIN32) set_target_properties(${targetName} PROPERTIES COMPILE_PDB_NAME "${targetName}" - COMPILE_PDB_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}" + COMPILE_PDB_OUTPUT_DIRECTORY "$" ) install (FILES "$/${targetName}.pdb" DESTINATION ${destination} COMPONENT ${component}) endif() @@ -588,21 +603,6 @@ function(disable_pax_mprotect targetName) endif(CLR_CMAKE_HOST_LINUX OR CLR_CMAKE_HOST_FREEBSD OR CLR_CMAKE_HOST_NETBSD OR CLR_CMAKE_HOST_SUNOS) endfunction() -if (CMAKE_VERSION VERSION_LESS "3.12") - # Polyfill add_compile_definitions when it is unavailable - function(add_compile_definitions) - get_directory_property(DIR_COMPILE_DEFINITIONS COMPILE_DEFINITIONS) - list(APPEND DIR_COMPILE_DEFINITIONS ${ARGV}) - set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "${DIR_COMPILE_DEFINITIONS}") - endfunction() -endif() - -if (CMAKE_VERSION VERSION_LESS "3.16") - # Provide a no-op polyfill for precompiled headers on old CMake versions - function(target_precompile_headers) - endfunction() -endif() - # add_linker_flag(Flag [Config1 Config2 ...]) function(add_linker_flag Flag) if (ARGN STREQUAL "") @@ -664,3 +664,16 @@ function(add_library_clr targetName kind) strip_symbols(${ARGV0} symbolFile) endif() endfunction() + +# Adhoc sign targetName with the entitlements in entitlementsFile. +function(adhoc_sign_with_entitlements targetName entitlementsFile) + # Add a dependency from a source file for the target on the entitlements file to ensure that the target is rebuilt if only the entitlements file changes. + get_target_property(sources ${targetName} SOURCES) + list(GET sources 0 firstSource) + set_source_files_properties(${firstSource} PROPERTIES OBJECT_DEPENDS ${entitlementsFile}) + + add_custom_command( + TARGET ${targetName} + POST_BUILD + COMMAND codesign -s - -f --entitlements ${entitlementsFile} $) +endfunction() diff --git a/eng/native/gen-buildsys.cmd b/eng/native/gen-buildsys.cmd index 78bf2b4e9a..83682d69cf 100644 --- a/eng/native/gen-buildsys.cmd +++ b/eng/native/gen-buildsys.cmd @@ -45,24 +45,26 @@ if /i "%__Arch%" == "wasm" ( ) if /i "%__Os%" == "browser" ( if "%EMSDK_PATH%" == "" ( - if not exist "%__repoRoot%\src\mono\wasm\emsdk" ( + if not exist "%__repoRoot%\src\mono\browser\emsdk" ( echo Error: Should set EMSDK_PATH environment variable pointing to emsdk root. exit /B 1 ) - set "EMSDK_PATH=%__repoRoot%\src\mono\wasm\emsdk" + set "EMSDK_PATH=%__repoRoot%\src\mono\browser\emsdk" ) :: replace backslash with forward slash and append last slash set "EMSDK_PATH=!EMSDK_PATH:\=/!" if not "!EMSDK_PATH:~-1!" == "/" set "EMSDK_PATH=!EMSDK_PATH!/" - set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_TOOLCHAIN_FILE=!EMSDK_PATH!/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" + set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_TOOLCHAIN_FILE=!EMSDK_PATH!/emscripten/cmake/Modules/Platform/Emscripten.cmake" set __UseEmcmake=1 ) if /i "%__Os%" == "wasi" ( + set "__repoRoot=!__repoRoot:\=/!" + if not "!__repoRoot:~-1!" == "/" set "__repoRoot=!__repoRoot!/" if "%WASI_SDK_PATH%" == "" ( if not exist "%__repoRoot%\src\mono\wasi\wasi-sdk" ( - echo Error: Should set WASI_SDK_PATH environment variable pointing to emsdk root. + echo Error: Should set WASI_SDK_PATH environment variable pointing to WASI SDK root. exit /B 1 ) @@ -72,7 +74,7 @@ if /i "%__Arch%" == "wasm" ( set "WASI_SDK_PATH=!WASI_SDK_PATH:\=/!" if not "!WASI_SDK_PATH:~-1!" == "/" set "WASI_SDK_PATH=!WASI_SDK_PATH!/" set __CmakeGenerator=Ninja - set __ExtraCmakeParams=%__ExtraCmakeParams% -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm "-DWASI_SDK_PREFIX=!WASI_SDK_PATH!" "-DCMAKE_TOOLCHAIN_FILE=!WASI_SDK_PATH!/share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=!WASI_SDK_PATH!/share/wasi-sysroot" + set __ExtraCmakeParams=%__ExtraCmakeParams% -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm "-DWASI_SDK_PREFIX=!WASI_SDK_PATH!" "-DCMAKE_TOOLCHAIN_FILE=!WASI_SDK_PATH!/share/cmake/wasi-sdk-p2.cmake" "-DCMAKE_SYSROOT=!WASI_SDK_PATH!share/wasi-sysroot" "-DCMAKE_CROSSCOMPILING_EMULATOR=node --experimental-wasm-bigint --experimental-wasi-unstable-preview1" ) ) else ( set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_SYSTEM_VERSION=10.0" @@ -101,19 +103,21 @@ if not "%__ConfigureOnly%" == "1" ( exit /B 0 ) else ( echo The CMake command line differs from the last run. Running CMake again. - echo %__ExtraCmakeParams% > %__CmdLineOptionsUpToDateFile% ) - ) else ( - echo %__ExtraCmakeParams% > %__CmdLineOptionsUpToDateFile% ) ) ) if /i "%__UseEmcmake%" == "1" ( - call "!EMSDK_PATH!/emsdk_env.bat" > nul 2>&1 && emcmake "%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir% + call "!EMSDK_PATH!/emsdk_env.cmd" > nul 2>&1 && emcmake "%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir% ) else ( "%CMakePath%" %__ExtraCmakeParams% --no-warn-unused-cli -G "%__CmakeGenerator%" -B %__IntermediatesDir% -S %__SourceDir% ) + +if "%errorlevel%" == "0" ( + echo %__ExtraCmakeParams% > %__CmdLineOptionsUpToDateFile% +) + endlocal exit /B %errorlevel% diff --git a/eng/native/gen-buildsys.sh b/eng/native/gen-buildsys.sh index b39448626f..d4028cb957 100755 --- a/eng/native/gen-buildsys.sh +++ b/eng/native/gen-buildsys.sh @@ -4,6 +4,7 @@ # scriptroot="$( cd -P "$( dirname "$0" )" && pwd )" +reporoot="$(cd "$scriptroot"/../..; pwd -P)" if [[ "$#" -lt 4 ]]; then echo "Usage..." @@ -93,20 +94,18 @@ if [[ "$scan_build" == "ON" && -n "$SCAN_BUILD_COMMAND" ]]; then cmake_command="$SCAN_BUILD_COMMAND $cmake_command" fi +cmake_extra_defines_wasm=() if [[ "$host_arch" == "wasm" ]]; then if [[ "$target_os" == "browser" ]]; then cmake_command="emcmake $cmake_command" elif [[ "$target_os" == "wasi" ]]; then - true + cmake_extra_defines_wasm=("-DCLR_CMAKE_TARGET_OS=wasi" "-DCLR_CMAKE_TARGET_ARCH=wasm" "-DWASI_SDK_PREFIX=$WASI_SDK_PATH" "-DCMAKE_TOOLCHAIN_FILE=${WASI_SDK_PATH}/share/cmake/wasi-sdk-p2.cmake" "-DCMAKE_SYSROOT=${WASI_SDK_PATH}/share/wasi-sysroot" "-DCMAKE_CROSSCOMPILING_EMULATOR=node --experimental-wasm-bigint --experimental-wasi-unstable-preview1") else echo "target_os was not specified" exit 1 fi fi -# We have to be able to build with CMake 3.6.2, so we can't use the -S or -B options -pushd "$2" - $cmake_command \ --no-warn-unused-cli \ -G "$generator" \ @@ -114,6 +113,8 @@ $cmake_command \ "-DCMAKE_INSTALL_PREFIX=$__CMakeBinDir" \ $cmake_extra_defines \ $__UnprocessedCMakeArgs \ - "$1" + "${cmake_extra_defines_wasm[@]}" \ + -S "$1" \ + -B "$2" -popd +# don't add anything after this line so the cmake exit code gets propagated correctly diff --git a/eng/native/ijw/IJW.cmake b/eng/native/ijw/IJW.cmake index 9ef90525dd..4d145a6847 100644 --- a/eng/native/ijw/IJW.cmake +++ b/eng/native/ijw/IJW.cmake @@ -2,19 +2,13 @@ if (CLR_CMAKE_HOST_WIN32) function(remove_ijw_incompatible_options options updatedOptions) # IJW isn't compatible with Ehsc, which CMake enables by default - if(options MATCHES "/EHsc") - string(REPLACE "/EHsc" "" options "${options}") - endif() + set_property(DIRECTORY PROPERTY CLR_EH_OPTION "") # IJW isn't compatible with CFG - if(options MATCHES "/guard:cf") - string(REPLACE "/guard:cf" "" options "${options}") - endif() + set_property(DIRECTORY PROPERTY CLR_CONTROL_FLOW_GUARD OFF) # IJW isn't compatible with EHCONT, which requires CFG - if(options MATCHES "/guard:ehcont") - string(REPLACE "/guard:ehcont" "" options "${options}") - endif() + set_property(DIRECTORY PROPERTY CLR_EH_CONTINUATION OFF) # IJW isn't compatible with GR- if(options MATCHES "/GR-") @@ -99,6 +93,12 @@ if (CLR_CMAKE_HOST_WIN32) add_compile_options(/AI${CLR_SDK_REF_PACK}) + file(GLOB CLR_SDK_REF_PACK_LIBS "${CLR_SDK_REF_PACK}/*.dll") + + foreach(lib ${CLR_SDK_REF_PACK_LIBS}) + add_compile_options(/FU${lib}) + endforeach() + list(APPEND LINK_LIBRARIES_ADDITIONAL ijwhost) endif() diff --git a/eng/native/init-os-and-arch.sh b/eng/native/init-os-and-arch.sh deleted file mode 100644 index e693617a6c..0000000000 --- a/eng/native/init-os-and-arch.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env bash - -# Use uname to determine what the OS is. -OSName=$(uname -s | tr '[:upper:]' '[:lower:]') - -if command -v getprop && getprop ro.product.system.model 2>&1 | grep -qi android; then - OSName="android" -fi - -case "$OSName" in -freebsd|linux|netbsd|openbsd|sunos|android|haiku) - os="$OSName" ;; -darwin) - os=osx ;; -*) - echo "Unsupported OS $OSName detected!" - exit 1 ;; -esac - -# On Solaris, `uname -m` is discouraged, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html -# and `uname -p` returns processor type (e.g. i386 on amd64). -# The appropriate tool to determine CPU is isainfo(1) https://docs.oracle.com/cd/E36784_01/html/E36870/isainfo-1.html. -if [ "$os" = "sunos" ]; then - if uname -o 2>&1 | grep -q illumos; then - os="illumos" - else - os="solaris" - fi - CPUName=$(isainfo -n) -else - # For the rest of the operating systems, use uname(1) to determine what the CPU is. - CPUName=$(uname -m) -fi - -case "$CPUName" in - arm64|aarch64) - arch=arm64 - ;; - - loongarch64) - arch=loongarch64 - ;; - - riscv64) - arch=riscv64 - ;; - - amd64|x86_64) - arch=x64 - ;; - - armv7l|armv8l) - if (NAME=""; . /etc/os-release; test "$NAME" = "Tizen"); then - arch=armel - else - arch=arm - fi - ;; - - armv6l) - arch=armv6 - ;; - - i[3-6]86) - echo "Unsupported CPU $CPUName detected, build might not succeed!" - arch=x86 - ;; - - s390x) - arch=s390x - ;; - - ppc64le) - arch=ppc64le - ;; - *) - echo "Unknown CPU $CPUName detected!" - exit 1 - ;; -esac diff --git a/eng/native/init-vs-env.cmd b/eng/native/init-vs-env.cmd index 273f49b339..0d28cac989 100644 --- a/eng/native/init-vs-env.cmd +++ b/eng/native/init-vs-env.cmd @@ -4,11 +4,17 @@ :: as an argument, it also initializes VC++ build environment and CMakePath. set "__VCBuildArch=" -if /i "%~1" == "x86" (set __VCBuildArch=x86) -if /i "%~1" == "x64" (set __VCBuildArch=x86_amd64) -if /i "%~1" == "arm" (set __VCBuildArch=x86_arm) -if /i "%~1" == "arm64" (set __VCBuildArch=x86_arm64) -if /i "%~1" == "wasm" (if /i "%PROCESSOR_ARCHITECTURE%" == "ARM64" (set __VCBuildArch=x86_arm64) else (set __VCBuildArch=x86_amd64)) +if /i "%PROCESSOR_ARCHITECTURE%" == "ARM64" ( + if /i "%~1" == "x64" ( set __VCBuildArch=arm64_amd64 ) + if /i "%~1" == "x86" ( set __VCBuildArch=arm64_x86 ) + if /i "%~1" == "arm64" ( set __VCBuildArch=arm64 ) + if /i "%~1" == "wasm" ( set __VCBuildArch=arm64 ) +) else ( + if /i "%~1" == "x64" ( set __VCBuildArch=amd64 ) + if /i "%~1" == "x86" ( set __VCBuildArch=amd64_x86 ) + if /i "%~1" == "arm64" ( set __VCBuildArch=amd64_arm64 ) + if /i "%~1" == "wasm" ( set __VCBuildArch=amd64 ) +) :: Default to highest Visual Studio version available that has Visual C++ tools. :: @@ -26,6 +32,8 @@ if defined VisualStudioVersion goto :VSDetected set "__VSWhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" set "__VSCOMNTOOLS=" +if not exist "%__VSWhere%" goto :VSWhereMissing + if exist "%__VSWhere%" ( for /f "tokens=*" %%p in ( '"%__VSWhere%" -latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath' @@ -56,6 +64,10 @@ echo %__MsgPrefix%Error: Visual Studio 2022 with C++ tools required. ^ Please see https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/windows-requirements.md for build requirements. exit /b 1 +:VSWhereMissing +echo %__MsgPrefix%Error: vswhere couldn not be found in Visual Studio Installer directory at "%__VSWhere%" +exit /b 1 + :SetVCEnvironment if "%__VCBuildArch%"=="" exit /b 0 diff --git a/eng/native/sanitizer-ignorelist.txt b/eng/native/sanitizer-ignorelist.txt index ecc8bef9bf..8e89d3ca96 100644 --- a/eng/native/sanitizer-ignorelist.txt +++ b/eng/native/sanitizer-ignorelist.txt @@ -10,5 +10,5 @@ fun:_ZN11CMiniMdBase19UsesAllocatedMemoryEP11CMiniColDef # 2 0x4e8051 in __ubsan_handle_dynamic_type_cache_miss # 3 0x7f02ce676cd8 in JIT_InitPInvokeFrame(InlinedCallFrame*, void*) /home/steveharter/git/dotnet_coreclr/vm/jithelpers.cpp:6491:9 # 4 0x7f0252bbceb2 () -fun:_Z20JIT_InitPInvokeFrameP16InlinedCallFramePv +fun:_Z20JIT_InitPInvokeFrameP16InlinedCallFrame diff --git a/eng/native/tryrun.cmake b/eng/native/tryrun.cmake index a5a8b51ac6..187037d79b 100644 --- a/eng/native/tryrun.cmake +++ b/eng/native/tryrun.cmake @@ -49,35 +49,21 @@ endif() if(DARWIN) if(TARGET_ARCH_NAME MATCHES "^(arm64|x64)$") - set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1) set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 1) set_cache_value(HAVE_BROKEN_FIFO_KEVENT_EXITCODE 1) set_cache_value(HAVE_BROKEN_FIFO_SELECT_EXITCODE 1) set_cache_value(HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE 1) set_cache_value(HAVE_CLOCK_MONOTONIC_EXITCODE 0) set_cache_value(HAVE_CLOCK_REALTIME_EXITCODE 0) - set_cache_value(HAVE_CLOCK_THREAD_CPUTIME_EXITCODE 0) set_cache_value(HAVE_CLOCK_GETTIME_NSEC_NP_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_ACOS_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_ASIN_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_ATAN2_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_EXP_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_ILOGB0_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_ILOGBNAN_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_LOG10_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_LOG_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_POW_EXITCODE 0) set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 1) - set_cache_value(HAVE_LARGE_SNPRINTF_SUPPORT_EXITCODE 0) set_cache_value(HAVE_MMAP_DEV_ZERO_EXITCODE 1) set_cache_value(HAVE_PROCFS_CTL_EXITCODE 1) set_cache_value(HAVE_PROCFS_MAPS_EXITCODE 1) - set_cache_value(HAVE_PROCFS_STATUS_EXITCODE 1) set_cache_value(HAVE_PROCFS_STAT_EXITCODE 1) + set_cache_value(HAVE_PROCFS_STATM_EXITCODE 1) set_cache_value(HAVE_SCHED_GETCPU_EXITCODE 1) set_cache_value(HAVE_SCHED_GET_PRIORITY_EXITCODE 0) - set_cache_value(HAVE_VALID_NEGATIVE_INF_POW_EXITCODE 0) - set_cache_value(HAVE_VALID_POSITIVE_INF_POW_EXITCODE 0) set_cache_value(HAVE_WORKING_CLOCK_GETTIME_EXITCODE 0) set_cache_value(HAVE_WORKING_GETTIMEOFDAY_EXITCODE 0) set_cache_value(MMAP_ANON_IGNORES_PROTECTION_EXITCODE 1) @@ -85,57 +71,33 @@ if(DARWIN) set_cache_value(PTHREAD_CREATE_MODIFIES_ERRNO_EXITCODE 1) set_cache_value(REALPATH_SUPPORTS_NONEXISTENT_FILES_EXITCODE 1) set_cache_value(SEM_INIT_MODIFIES_ERRNO_EXITCODE 1) - set_cache_value(SSCANF_SUPPORT_ll_EXITCODE 0) - set_cache_value(UNGETC_NOT_RETURN_EOF_EXITCODE 1) set_cache_value(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP_EXITCODE 1) - set_cache_value(SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE 1) else() message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!") endif() elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|riscv64|s390x|ppc64le|x86|x64)$" OR FREEBSD OR ILLUMOS OR TIZEN OR HAIKU) - set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1) set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0) set_cache_value(HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE 0) set_cache_value(HAVE_CLOCK_MONOTONIC_EXITCODE 0) set_cache_value(HAVE_CLOCK_REALTIME_EXITCODE 0) - set_cache_value(HAVE_CLOCK_THREAD_CPUTIME_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_ACOS_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_ASIN_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_ATAN2_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_ILOGB0_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_ILOGBNAN_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_LOG10_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_LOG_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_POW_EXITCODE 0) - set_cache_value(HAVE_LARGE_SNPRINTF_SUPPORT_EXITCODE 0) set_cache_value(HAVE_MMAP_DEV_ZERO_EXITCODE 0) set_cache_value(HAVE_PROCFS_CTL_EXITCODE 1) set_cache_value(HAVE_PROCFS_STAT_EXITCODE 0) + set_cache_value(HAVE_PROCFS_STATM_EXITCODE 0) set_cache_value(HAVE_SCHED_GETCPU_EXITCODE 0) set_cache_value(HAVE_SCHED_GET_PRIORITY_EXITCODE 0) - set_cache_value(HAVE_VALID_NEGATIVE_INF_POW_EXITCODE 0) - set_cache_value(HAVE_VALID_POSITIVE_INF_POW_EXITCODE 0) set_cache_value(HAVE_WORKING_CLOCK_GETTIME_EXITCODE 0) set_cache_value(HAVE_WORKING_GETTIMEOFDAY_EXITCODE 0) set_cache_value(ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS_EXITCODE 1) set_cache_value(PTHREAD_CREATE_MODIFIES_ERRNO_EXITCODE 1) set_cache_value(REALPATH_SUPPORTS_NONEXISTENT_FILES_EXITCODE 1) set_cache_value(SEM_INIT_MODIFIES_ERRNO_EXITCODE 1) - set_cache_value(HAVE_TERMIOS2_EXITCODE 0) - set_cache_value(SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE 0) set_cache_value(HAVE_PROCFS_MAPS_EXITCODE 0) - set_cache_value(HAVE_PROCFS_STATUS_EXITCODE 0) if(ALPINE_LINUX) set_cache_value(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP_EXITCODE 1) - set_cache_value(SSCANF_SUPPORT_ll_EXITCODE 1) - set_cache_value(UNGETC_NOT_RETURN_EOF_EXITCODE 1) - set_cache_value(SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE 0) else() set_cache_value(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP_EXITCODE 0) - set_cache_value(SSCANF_SUPPORT_ll_EXITCODE 0) - set_cache_value(UNGETC_NOT_RETURN_EOF_EXITCODE 0) - set_cache_value(SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE 1) endif() if (FREEBSD) @@ -145,36 +107,20 @@ elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|riscv64|s39 set_cache_value(HAVE_BROKEN_FIFO_KEVENT_EXITCODE 1) set_cache_value(HAVE_PROCFS_MAPS 0) set_cache_value(HAVE_PROCFS_STAT 0) - set_cache_value(HAVE_PROCFS_STATUS_EXITCODE 1) - set_cache_value(UNGETC_NOT_RETURN_EOF 0) - set_cache_value(HAVE_COMPATIBLE_ILOGBNAN 1) + set_cache_value(HAVE_PROCFS_STATM 0) set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0) - set_cache_value(HAVE_TERMIOS2_EXITCODE 1) elseif(ILLUMOS) - set_cache_value(HAVE_COMPATIBLE_ACOS_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_ASIN_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_ATAN2_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_POW_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_ILOGBNAN_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_LOG10_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_LOG_EXITCODE 1) - set_cache_value(HAVE_LARGE_SNPRINTF_SUPPORT_EXITCODE 1) set_cache_value(HAVE_PROCFS_CTL_EXITCODE 0) - set_cache_value(SSCANF_SUPPORT_ll_EXITCODE 1) - set_cache_value(UNGETC_NOT_RETURN_EOF_EXITCODE 0) set_cache_value(COMPILER_SUPPORTS_W_CLASS_MEMACCESS 1) set_cache_value(HAVE_SET_MAX_VARIABLE 1) set_cache_value(HAVE_FULLY_FEATURED_PTHREAD_MUTEXES 1) set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0) - set_cache_value(HAVE_TERMIOS2_EXITCODE 1) - set_cache_value(SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE 1) elseif (TIZEN) set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0) elseif(HAIKU) set_cache_value(HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE 1) - set_cache_value(HAVE_COMPATIBLE_EXP_EXITCODE 0) - set_cache_value(HAVE_COMPATIBLE_ILOGBNAN_EXITCODE 0) set_cache_value(HAVE_PROCFS_STAT_EXITCODE 1) + set_cache_value(HAVE_PROCFS_STATM_EXITCODE 1) endif() else() message(FATAL_ERROR "Unsupported platform. OS: ${CMAKE_SYSTEM_NAME}, arch: ${TARGET_ARCH_NAME}") diff --git a/eng/native/tryrun_ios_tvos.cmake b/eng/native/tryrun_ios_tvos.cmake index 378af96da1..cb82c7af06 100644 --- a/eng/native/tryrun_ios_tvos.cmake +++ b/eng/native/tryrun_ios_tvos.cmake @@ -10,30 +10,17 @@ set_cache_value(HAVE_CLOCK_MONOTONIC_EXITCODE 0) # TODO: these are taken from macOS, check these whether they're correct for iOS # some of them are probably not used by what we use from NativeAOT so could be reduced -set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1) set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 1) set_cache_value(HAVE_BROKEN_FIFO_KEVENT_EXITCODE 1) set_cache_value(HAVE_BROKEN_FIFO_SELECT_EXITCODE 1) set_cache_value(HAVE_CLOCK_REALTIME_EXITCODE 0) -set_cache_value(HAVE_CLOCK_THREAD_CPUTIME_EXITCODE 0) set_cache_value(HAVE_CLOCK_GETTIME_NSEC_NP_EXITCODE 0) -set_cache_value(HAVE_COMPATIBLE_ACOS_EXITCODE 0) -set_cache_value(HAVE_COMPATIBLE_ASIN_EXITCODE 0) -set_cache_value(HAVE_COMPATIBLE_ATAN2_EXITCODE 0) -set_cache_value(HAVE_COMPATIBLE_EXP_EXITCODE 1) -set_cache_value(HAVE_COMPATIBLE_ILOGB0_EXITCODE 0) -set_cache_value(HAVE_COMPATIBLE_ILOGBNAN_EXITCODE 1) -set_cache_value(HAVE_COMPATIBLE_LOG10_EXITCODE 0) -set_cache_value(HAVE_COMPATIBLE_LOG_EXITCODE 0) -set_cache_value(HAVE_COMPATIBLE_POW_EXITCODE 0) set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 1) -set_cache_value(HAVE_LARGE_SNPRINTF_SUPPORT_EXITCODE 0) set_cache_value(HAVE_MMAP_DEV_ZERO_EXITCODE 1) set_cache_value(HAVE_PROCFS_CTL_EXITCODE 1) set_cache_value(HAVE_PROCFS_STAT_EXITCODE 1) +set_cache_value(HAVE_PROCFS_STATM_EXITCODE 1) set_cache_value(HAVE_SCHED_GET_PRIORITY_EXITCODE 0) -set_cache_value(HAVE_VALID_NEGATIVE_INF_POW_EXITCODE 0) -set_cache_value(HAVE_VALID_POSITIVE_INF_POW_EXITCODE 0) set_cache_value(HAVE_WORKING_CLOCK_GETTIME_EXITCODE 0) set_cache_value(HAVE_WORKING_GETTIMEOFDAY_EXITCODE 0) set_cache_value(MMAP_ANON_IGNORES_PROTECTION_EXITCODE 1) @@ -41,6 +28,4 @@ set_cache_value(ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS_EXITCODE 1) set_cache_value(PTHREAD_CREATE_MODIFIES_ERRNO_EXITCODE 1) set_cache_value(REALPATH_SUPPORTS_NONEXISTENT_FILES_EXITCODE 1) set_cache_value(SEM_INIT_MODIFIES_ERRNO_EXITCODE 1) -set_cache_value(SSCANF_SUPPORT_ll_EXITCODE 0) -set_cache_value(UNGETC_NOT_RETURN_EOF_EXITCODE 1) set_cache_value(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP_EXITCODE 1) diff --git a/eng/pipelines/pipeline-resources.yml b/eng/pipelines/pipeline-resources.yml index 34a2799895..066fe70d13 100644 --- a/eng/pipelines/pipeline-resources.yml +++ b/eng/pipelines/pipeline-resources.yml @@ -31,7 +31,7 @@ extends: ROOTFS_DIR: /crossrootfs/arm64 linux_musl_x64: - image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-amd64-alpine-net8.0 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64-alpine env: ROOTFS_DIR: /crossrootfs/x64 diff --git a/eng/pipelines/prepare-release.yml b/eng/pipelines/prepare-release.yml index eb8579b388..a7bff089f3 100644 --- a/eng/pipelines/prepare-release.yml +++ b/eng/pipelines/prepare-release.yml @@ -15,7 +15,6 @@ stages: variables: - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) }}: - group: DotNet-Diagnostics-Storage - - group: DotNetBuilds storage account read tokens - group: Release-Pipeline steps: - ${{ if in(variables['Build.Reason'], 'PullRequest') }}: @@ -30,6 +29,29 @@ stages: version: 6.x installationPath: '$(Build.Repository.LocalPath)\.dotnet' - template: /eng/common/templates/post-build/setup-maestro-vars.yml + + # Populate dotnetbuilds-internal-container-read-token + - template: /eng/common/templates-official/steps/get-delegation-sas.yml + parameters: + federatedServiceConnection: 'dotnetbuilds-internal-read' + outputVariableName: 'dotnetbuilds-internal-checksums-container-read-token' + expiryInHours: 1 + base64Encode: false + storageAccount: dotnetbuilds + container: internal-checksums + permissions: rl + + # Populate dotnetbuilds-internal-container-read-token + - template: /eng/common/templates-official/steps/get-delegation-sas.yml + parameters: + federatedServiceConnection: 'dotnetbuilds-internal-read' + outputVariableName: 'dotnetbuilds-internal-container-read-token' + expiryInHours: 1 + base64Encode: false + storageAccount: dotnetbuilds + container: internal + permissions: rl + - task: AzureCLI@2 displayName: 'DARC Gather build' inputs: diff --git a/eng/privatebuild.cmd b/eng/privatebuild.cmd new file mode 100644 index 0000000000..e70e07373a --- /dev/null +++ b/eng/privatebuild.cmd @@ -0,0 +1,3 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" -privatebuild -skipmanaged -skipnative %*" +exit /b %ErrorLevel% diff --git a/eng/privatebuild.sh b/eng/privatebuild.sh new file mode 100755 index 0000000000..61b77e7630 --- /dev/null +++ b/eng/privatebuild.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $SOURCE until the file is no longer a symlink +while [[ -h $source ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done + +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" +"$scriptroot/../eng/build.sh" -privatebuild -skipmanaged -skipnative $@ diff --git a/eng/release/Scripts/FixupManifestToLocal.ps1 b/eng/release/Scripts/FixupManifestToLocal.ps1 new file mode 100644 index 0000000000..544ecb102f --- /dev/null +++ b/eng/release/Scripts/FixupManifestToLocal.ps1 @@ -0,0 +1,86 @@ +param( + [Parameter(Mandatory=$true)][string] $ManifestPath, + [Parameter(Mandatory=$true)][string] $StagingPath, + [Parameter(Mandatory=$false)][string] $DelegationSasToken, + [switch] $help, + [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties +) + +function Write-Help() { + Write-Host "Publish packages specified in a manifest. This should not be used for large manifests." + Write-Host "Common settings:" + Write-Host " -ManifestPath Path to a publishing manifest where the NuGet packages to publish can be found." + Write-Host " -StagingPath Directory containing the staged assets from blob storage." + Write-Host "" +} + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $properties.Contains('/?')))) { + Write-Help + exit 1 +} + +if ($null -ne $properties) { + Write-Error "Unexpected extra parameters: $properties." + exit 1 +} + +if (!(Test-Path $ManifestPath)) +{ + Write-Error "Error: unable to find manifest at '$ManifestPath'." + exit 1 +} + +$manifestSize = $(Get-ChildItem $ManifestPath).length / 1kb + +# Limit size. For large manifests +if ($manifestSize -gt 500) +{ + Write-Error "Error: Manifest $ManifestPath too large." + exit 1 +} + +$manifestJson = Get-Content -Raw -Path $ManifestPath | ConvertFrom-Json + +foreach ($nugetPack in $manifestJson.NugetAssets) +{ + $packagePath = Join-Path $StagingPath $nugetPack.PublishRelativePath + if (!(Test-Path $packagePath)) + { + Write-Error "Error: unable to find package at '$packagePath'." + continue + } + Add-Member -InputObject $nugetPack -MemberType NoteProperty -Name LocalPath -Value $packagePath +} + +$toolHashToLocalPath = @{} + +foreach ($tool in $manifestJson.ToolBundleAssets) +{ + $toolPath = Join-Path $StagingPath $tool.PublishRelativePath + if (!(Test-Path $toolPath)) + { + Write-Error "Error: unable to find package at '$toolPath'." + continue + } + Add-Member -InputObject $tool -MemberType NoteProperty -Name LocalPath -Value $toolPath + $toolHashToLocalPath.Add($tool.Sha512, $toolPath) +} + +foreach ($asset in $manifestJson.PublishInstructions) +{ + $remotePath = $asset.FilePath + + if ($DelegationSasToken -ne "") + { + $remotePath = "$remotePath?$DelegationSasToken" + } + + Add-Member -InputObject $asset -MemberType NoteProperty -Name RemotePath -Value $remotePath + $asset.FilePath = $toolHashToLocalPath[$asset.Sha512] +} + +Copy-Item $ManifestPath "$ManifestPath.bak" +$manifestJson | ConvertTo-Json | %{ $_.Replace('\u0026' ,'&') } | Set-Content -Path $ManifestPath diff --git a/eng/release/Scripts/GenerateGithubRelease.ps1 b/eng/release/Scripts/GenerateGithubRelease.ps1 index 49c24b1e9c..8b3a30768d 100644 --- a/eng/release/Scripts/GenerateGithubRelease.ps1 +++ b/eng/release/Scripts/GenerateGithubRelease.ps1 @@ -3,7 +3,7 @@ param( [Parameter(Mandatory=$false)][string] $ReleaseNotes, [Parameter(Mandatory=$true)][string] $GhOrganization, [Parameter(Mandatory=$true)][string] $GhRepository, - [Parameter(Mandatory=$false)][string] $GhCliLink = "https://github.com/cli/cli/releases/download/v1.2.0/gh_1.2.0_windows_amd64.zip", + [Parameter(Mandatory=$false)][string] $GhCliLink = "https://github.com/cli/cli/releases/download/v2.52.0/gh_2.52.0_windows_amd64.zip", [Parameter(Mandatory=$true)][string] $TagName, [bool] $DraftRelease = $false, [switch] $help, @@ -50,7 +50,7 @@ function Get-DownloadLinksAndChecksums($manifest) $linkTable += "`n`n" $filePublishData = @{} - $manifest.PublishInstructions | %{ $filePublishData.Add($_.FilePath, $_) } + $manifest.PublishInstructions | %{ $filePublishData.Add($_.Sha512, $_) } $sortedTools = $manifest.ToolBundleAssets | Sort-Object -Property @{ Expression = "Rid" }, @{ Expression = "ToolName" } @@ -65,11 +65,11 @@ function Get-DownloadLinksAndChecksums($manifest) foreach ($toolBundle in $sortedTools) { - $hash = $filePublishData[$toolBundle.PublishedPath].Sha512 + $hash = $toolBundle.Sha512 $name = $toolBundle.ToolName $rid = $toolBundle.Rid - $link = "https://download.visualstudio.microsoft.com/download/pr/" + $filePublishData[$toolBundle.PublishedPath].PublishUrlSubPath + $link = "https://download.visualstudio.microsoft.com/download/pr/" + $filePublishData[$hash].PublishUrlSubPath $linkTable += "| $name | $rid | [Download]($link) |`n"; $checksumCsv += "`"$name`",`"$rid`",`"$link`",`"$hash`"`n" @@ -93,7 +93,7 @@ function Post-GithubRelease($manifest, [string]$releaseBody, [string]$checksumCs Expand-Archive -Path $zipPath -DestinationPath $extractionPath $progressPreference = 'Continue' } - catch + catch { Write-Error "Unable to get GitHub CLI for release" exit 1 diff --git a/eng/release/Scripts/PublishToNuget.ps1 b/eng/release/Scripts/PublishToNuget.ps1 index ae9c6bdaaa..16d4848745 100644 --- a/eng/release/Scripts/PublishToNuget.ps1 +++ b/eng/release/Scripts/PublishToNuget.ps1 @@ -1,6 +1,5 @@ param( [Parameter(Mandatory=$true)][string] $ManifestPath, - [Parameter(Mandatory=$true)][string] $StagingPath, [Parameter(Mandatory=$true)][string] $FeedEndpoint, [Parameter(Mandatory=$true)][string] $FeedPat, [switch] $help, @@ -10,7 +9,6 @@ function Write-Help() { Write-Host "Publish packages specified in a manifest. This should not be used for large manifests." Write-Host "Common settings:" Write-Host " -ManifestPath Path to a publishing manifest where the NuGet packages to publish can be found." - Write-Host " -StagingPath Path where the assets in the manifests are laid out." Write-Host " -FeedEndpoint NuGet feed to publish the packages to." Write-Host " -FeedPat PAT to use in the publish process." Write-Host "" @@ -31,14 +29,14 @@ if ($null -ne $properties) { if (!(Test-Path $ManifestPath)) { - Write-Error "Error: unable to find maifest at $ManifestPath." + Write-Error "Error: unable to find manifest at '$ManifestPath'." exit 1 } $manifestSize = $(Get-ChildItem $ManifestPath).length / 1kb # Limit size. For large manifests -if ($manifestSize -gt 500) +if ($manifestSize -gt 500) { Write-Error "Error: Manifest $ManifestPath too large." exit 1 @@ -49,15 +47,19 @@ $manifestJson = Get-Content -Raw -Path $ManifestPath | ConvertFrom-Json $failedToPublish = 0 foreach ($nugetPack in $manifestJson.NugetAssets) { - $packagePath = Join-Path $StagingPath $nugetPack.PublishRelativePath + if (!($nugetPack.PSobject.Properties.Name.Contains("LocalPath"))) + { + Write-Error "Error: unable to find LocalPath for '$nugetPack'. Ensure local manifest translation happened." + exit 1 + + continue + } + try { - Write-Host "Downloading: $nugetPack." - $progressPreference = 'silentlyContinue' - Invoke-WebRequest -Uri $nugetPack.PublishedPath -OutFile (New-Item -Path $packagePath -Force) - $progressPreference = 'Continue' + $packagePath = $nugetPack.LocalPath; - if ($nugetPack.PSobject.Properties.Name.Contains("Sha512")-and $(Get-FileHash -Algorithm sha512 $packagePath).Hash -ne $nugetPack.Sha512) { + if ($nugetPack.PSobject.Properties.Name.Contains("Sha512") -and $(Get-FileHash -Algorithm sha512 $packagePath).Hash -ne $nugetPack.Sha512) { Write-Host "Sha512 verification failed for $($nugetPack.PublishRelativePath)." $failedToPublish++ continue diff --git a/eng/testsos.cmd b/eng/testsos.cmd new file mode 100644 index 0000000000..949e583534 --- /dev/null +++ b/eng/testsos.cmd @@ -0,0 +1 @@ +%~dp0..\.dotnet\dotnet.exe test --no-build --logger "console;verbosity=detailed" %~dp0..\src\SOS\SOS.UnitTests\SOS.UnitTests.csproj diff --git a/eng/testsos.sh b/eng/testsos.sh new file mode 100755 index 0000000000..273455e2fd --- /dev/null +++ b/eng/testsos.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +# resolve $SOURCE until the file is no longer a symlink +while [[ -h $source ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done + +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" +export LLDB_PATH=/usr/bin/lldb +$scriptroot/../.dotnet/dotnet test --no-build --logger "console;verbosity=detailed" $scriptroot/../src/SOS/SOS.UnitTests/SOS.UnitTests.csproj diff --git a/global.json b/global.json index d20c13aa3d..efc66dd06a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "9.0.100-preview.5.24307.3", + "dotnet": "9.0.100-rc.1.24452.12", "runtimes": { "dotnet": [ "$(MicrosoftNETCoreApp60Version)", @@ -16,6 +16,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.5.0", - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24314.1" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.24463.4" } } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 90f3537ef5..bcc839a522 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,22 +1,9 @@ -set(CLR_SHARED_DIR ${ROOT_DIR}/src/shared) +include_directories(inc) if (CLR_CMAKE_HOST_UNIX) - include_directories("${CLR_SHARED_DIR}/pal/inc") - include_directories("${CLR_SHARED_DIR}/pal/inc/rt") - include_directories("${CLR_SHARED_DIR}/pal/src/safecrt") + include_directories("inc/rt") endif (CLR_CMAKE_HOST_UNIX) -include_directories(${CLR_SHARED_DIR}) -include_directories(${CLR_SHARED_DIR}/inc) -include_directories(${CLR_SHARED_DIR}/pal/prebuilt/inc) - add_subdirectory(shared) add_subdirectory(SOS) - -if (CLR_CMAKE_HOST_UNIX) - # This prevents inclusion of standard C compiler headers - add_compile_options(-nostdinc) - include_directories(${CLR_SHARED_DIR}/pal/inc/rt/cpp) -endif(CLR_CMAKE_HOST_UNIX) - add_subdirectory(dbgshim) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 08dabceea2..ed7c3a0764 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -7,23 +7,8 @@ false true true - $(ArtifactsDir)bundledtools/ - - - - true - - - true - - - - full - - - - portable + $(ArtifactsDir)bundledtools/ diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/CaptureConsoleService.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/CaptureConsoleService.cs new file mode 100644 index 0000000000..7fbedebeea --- /dev/null +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/CaptureConsoleService.cs @@ -0,0 +1,43 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Microsoft.Diagnostics.DebugServices.Implementation +{ + public sealed class CaptureConsoleService : IConsoleService + { + private readonly CharToLineConverter _charToLineConverter; + private readonly List _builder = new(); + + public CaptureConsoleService() => _charToLineConverter = new((line) => _builder.Add(line)); + + public void Clear() => _builder.Clear(); + + public IReadOnlyList OutputLines => _builder; + + public override string ToString() => string.Concat(_builder); + + #region IConsoleService + + public void Write(string text) => _charToLineConverter.Input(text); + + public void WriteWarning(string text) => _charToLineConverter.Input(text); + + public void WriteError(string text) => _charToLineConverter.Input(text); + + public bool SupportsDml => false; + + public void WriteDml(string text) => throw new NotSupportedException(); + + public void WriteDmlExec(string text, string _) => throw new NotSupportedException(); + + public CancellationToken CancellationToken { get; set; } = CancellationToken.None; + + int IConsoleService.WindowWidth => int.MaxValue; + + #endregion + } +} diff --git a/src/Microsoft.Diagnostics.TestHelpers/CharToLineConverter.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/CharToLineConverter.cs similarity index 96% rename from src/Microsoft.Diagnostics.TestHelpers/CharToLineConverter.cs rename to src/Microsoft.Diagnostics.DebugServices.Implementation/CharToLineConverter.cs index 9fceacf668..ca6e2b0690 100644 --- a/src/Microsoft.Diagnostics.TestHelpers/CharToLineConverter.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/CharToLineConverter.cs @@ -4,7 +4,7 @@ using System; using System.Text; -namespace Microsoft.Diagnostics.TestHelpers +namespace Microsoft.Diagnostics.DebugServices.Implementation { public sealed class CharToLineConverter { diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/CommandService.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/CommandService.cs index 07c7ef52a5..69887c97b7 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/CommandService.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/CommandService.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.CommandLine; using System.CommandLine.Builder; using System.CommandLine.Help; @@ -36,6 +37,25 @@ public CommandService(string commandPrompt = null) _commandGroups.Add(new CommandGroup(_commandPrompt)); } + /// + /// Execute the command line and return the captured console output. + /// + /// command line text + /// services for the command + /// Array of console output lines + /// empty command line + /// command not found + /// parsing error + /// other errors + public IReadOnlyList ExecuteAndCapture(string commandLine, IServiceProvider services) + { + CaptureConsoleService consoleService = new(); + ServiceContainer serviceContainer = new(services); + serviceContainer.AddService(consoleService); + Execute(commandLine, services); + return consoleService.OutputLines; + } + /// /// Parse and execute the command line. /// diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/Microsoft.Diagnostics.DebugServices.Implementation.csproj b/src/Microsoft.Diagnostics.DebugServices.Implementation/Microsoft.Diagnostics.DebugServices.Implementation.csproj index 5f17fb0a49..cbb95d87ee 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/Microsoft.Diagnostics.DebugServices.Implementation.csproj +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/Microsoft.Diagnostics.DebugServices.Implementation.csproj @@ -21,6 +21,7 @@ + diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs index 351bd02df7..d3fffa53e0 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/Runtime.cs @@ -79,7 +79,6 @@ void IDisposable.Dispose() public string RuntimeModuleDirectory { get; set; } - public Version RuntimeVersion { get diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeProvider.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeProvider.cs index 3ea0ab90be..4639a0ebcf 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeProvider.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeProvider.cs @@ -26,15 +26,17 @@ public RuntimeProvider(IServiceProvider services) /// Returns the list of .NET runtimes in the target /// /// The starting runtime id for this provider - public IEnumerable EnumerateRuntimes(int startingRuntimeId) + /// Enumeration control flags + public IEnumerable EnumerateRuntimes(int startingRuntimeId, RuntimeEnumerationFlags flags) { // The ClrInfo and DataTarget instances are disposed when Runtime instance is disposed. Runtime instances are // not flushed when the Target/RuntimeService is flushed; they are all disposed and the list cleared. They are // all re-created the next time the IRuntime or ClrRuntime instance is queried. - DataTarget dataTarget = new(new CustomDataTarget(_services.GetService())) + DataTarget dataTarget = new(new CustomDataTarget(_services.GetService()) { + ForceCompleteRuntimeEnumeration = (flags & RuntimeEnumerationFlags.All) != 0, FileLocator = null - }; + }); for (int i = 0; i < dataTarget.ClrVersions.Length; i++) { yield return new Runtime(_services, startingRuntimeId + i, dataTarget.ClrVersions[i]); diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeService.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeService.cs index ef969eb2d2..b37c5d6f33 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeService.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/RuntimeService.cs @@ -47,7 +47,8 @@ private void Flush() /// /// Returns the list of runtimes in the target /// - public IEnumerable EnumerateRuntimes() + /// Enumeration control flags + public IEnumerable EnumerateRuntimes(RuntimeEnumerationFlags flags) { if (_runtimes is null) { @@ -55,7 +56,7 @@ public IEnumerable EnumerateRuntimes() foreach (ServiceFactory factory in _serviceManager.EnumerateProviderFactories(typeof(IRuntimeProvider))) { IRuntimeProvider provider = (IRuntimeProvider)factory(_services); - _runtimes.AddRange(provider.EnumerateRuntimes(_runtimes.Count)); + _runtimes.AddRange(provider.EnumerateRuntimes(_runtimes.Count, flags)); } } return _runtimes; diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/SymbolService.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/SymbolService.cs index 4ed23f8062..1247620b74 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/SymbolService.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/SymbolService.cs @@ -7,11 +7,15 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Net.Http.Headers; using System.Reflection.Metadata; using System.Reflection.PortableExecutable; using System.Runtime.InteropServices; using System.Text; using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; using Microsoft.FileFormats; using Microsoft.FileFormats.ELF; using Microsoft.FileFormats.MachO; @@ -32,6 +36,9 @@ public class SymbolService : ISymbolService /// Symbol server URLs /// public const string MsdlSymbolServer = "https://msdl.microsoft.com/download/symbols/"; + public const string SymwebSymbolServer = "https://symweb.azurefd.net/"; + + private static string _symwebHost = new Uri(SymwebSymbolServer).Host; private readonly IHost _host; private string _defaultSymbolCache; @@ -207,9 +214,20 @@ void ParseServer(int start) } if (symbolServerPath != null) { - if (!AddSymbolServer(symbolServerPath: symbolServerPath.Trim())) + symbolServerPath = symbolServerPath.Trim(); + if (IsSymweb(symbolServerPath)) { - return false; + if (!AddSymwebSymbolServer(includeInteractiveCredentials: false)) + { + return false; + } + } + else + { + if (!AddSymbolServer(symbolServerPath)) + { + return false; + } } } foreach (string symbolCachePath in symbolCachePaths.Reverse()) @@ -226,19 +244,89 @@ void ParseServer(int start) return true; } + /// + /// Add the cloud symweb symbol server with authentication. + /// + /// specifies whether credentials requiring user interaction will be included in the default authentication flow + /// symbol server timeout in minutes (optional uses if null) + /// number of retries (optional uses if null) + /// if false, failure + public bool AddSymwebSymbolServer( + bool includeInteractiveCredentials = false, + int? timeoutInMinutes = null, + int? retryCount = null) + { + TokenCredential tokenCredential = new DefaultAzureCredential(includeInteractiveCredentials); + AccessToken accessToken; + async ValueTask authenticationFunc(CancellationToken token) + { + try + { + if (accessToken.ExpiresOn <= DateTimeOffset.UtcNow.AddMinutes(2)) + { + accessToken = await tokenCredential.GetTokenAsync(new TokenRequestContext(["api://af9e1c69-e5e9-4331-8cc5-cdf93d57bafa/.default"]), token).ConfigureAwait(false); + } + return new AuthenticationHeaderValue("Bearer", accessToken.Token); + } + catch (Exception ex) when (ex is CredentialUnavailableException or AuthenticationFailedException) + { + Trace.TraceError($"AddSymwebSymbolServer: {ex}"); + return null; + } + } + return AddSymbolServer(SymwebSymbolServer, timeoutInMinutes, retryCount, authenticationFunc); + } + + /// + /// Add symbol server to search path. The server URL can be the cloud symweb. + /// + /// PAT or access token + /// symbol server url (optional, uses if null) + /// symbol server timeout in minutes (optional uses if null) + /// number of retries (optional uses if null) + /// if false, failure + public bool AddAuthenticatedSymbolServer( + string accessToken, + string symbolServerPath = null, + int? timeoutInMinutes = null, + int? retryCount = null) + { + if (accessToken == null) + { + throw new ArgumentNullException(nameof(accessToken)); + } + AuthenticationHeaderValue authenticationValue = new("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes($":{accessToken}"))); + return AddSymbolServer(symbolServerPath, timeoutInMinutes, retryCount, (_) => new ValueTask(authenticationValue)); + } + /// /// Add symbol server to search path. /// /// symbol server url (optional, uses if null) - /// PAT for secure symbol server (optional) /// symbol server timeout in minutes (optional uses if null) /// number of retries (optional uses if null) /// if false, failure public bool AddSymbolServer( string symbolServerPath = null, - string authToken = null, int? timeoutInMinutes = null, int? retryCount = null) + { + return AddSymbolServer(symbolServerPath, timeoutInMinutes, retryCount, authenticationFunc: null); + } + + /// + /// Add symbol server to search path. + /// + /// symbol server url (optional, uses if null) + /// symbol server timeout in minutes (optional uses if null) + /// number of retries (optional uses if null) + /// function that returns the authentication value for a request + /// if false, failure + public bool AddSymbolServer( + string symbolServerPath, + int? timeoutInMinutes, + int? retryCount, + Func> authenticationFunc) { // Add symbol server URL if exists symbolServerPath ??= DefaultSymbolPath; @@ -260,9 +348,11 @@ public bool AddSymbolServer( if (!IsDuplicateSymbolStore(store, (httpSymbolStore) => uri.Equals(httpSymbolStore.Uri))) { // Create http symbol server store - HttpSymbolStore httpSymbolStore = new(Tracer.Instance, store, uri, personalAccessToken: authToken); - httpSymbolStore.Timeout = TimeSpan.FromMinutes(timeoutInMinutes.GetValueOrDefault(DefaultTimeout)); - httpSymbolStore.RetryCount = retryCount.GetValueOrDefault(DefaultRetryCount); + HttpSymbolStore httpSymbolStore = new(Tracer.Instance, store, uri, authenticationFunc) + { + Timeout = TimeSpan.FromMinutes(timeoutInMinutes.GetValueOrDefault(DefaultTimeout)), + RetryCount = retryCount.GetValueOrDefault(DefaultRetryCount) + }; SetSymbolStore(httpSymbolStore); } } @@ -953,6 +1043,23 @@ public override string ToString() return sb.ToString(); } + /// + /// Returns true if cloud symweb server + /// + /// + private static bool IsSymweb(string server) + { + try + { + Uri uri = new(server); + return uri.Host.Equals(_symwebHost, StringComparison.OrdinalIgnoreCase); + } + catch (Exception ex) when (ex is UriFormatException or InvalidOperationException) + { + return false; + } + } + /// /// Attempts to download/retrieve from cache the key. /// diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/ThreadService.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/ThreadService.cs index de9149330d..2d0a95cbee 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/ThreadService.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/ThreadService.cs @@ -59,6 +59,12 @@ public ThreadService(IServiceProvider services) contextType = typeof(ArmContext); break; + case (Architecture)6 /* Architecture.LoongArch64 */: + _contextSize = LoongArch64Context.Size; + _contextFlags = LoongArch64Context.ContextControl | LoongArch64Context.ContextInteger | LoongArch64Context.ContextFloatingPoint; + contextType = typeof(LoongArch64Context); + break; + case (Architecture)9 /* Architecture.RiscV64 */: _contextSize = RiscV64Context.Size; _contextFlags = RiscV64Context.ContextControl | RiscV64Context.ContextInteger | RiscV64Context.ContextFloatingPoint; diff --git a/src/Microsoft.Diagnostics.DebugServices.Implementation/Utilities.cs b/src/Microsoft.Diagnostics.DebugServices.Implementation/Utilities.cs index fd231f2270..0fb9984ed2 100644 --- a/src/Microsoft.Diagnostics.DebugServices.Implementation/Utilities.cs +++ b/src/Microsoft.Diagnostics.DebugServices.Implementation/Utilities.cs @@ -9,8 +9,6 @@ using System.Reflection; using System.Reflection.PortableExecutable; using System.Runtime.InteropServices; -using System.Text; -using System.Threading; using Microsoft.FileFormats; using Microsoft.FileFormats.ELF; using Microsoft.FileFormats.MachO; @@ -414,46 +412,4 @@ private static object[] BuildArguments(MethodBase methodBase, IServiceProvider s return arguments; } } - - public class CaptureConsoleService : IConsoleService - { - private readonly StringBuilder _builder = new(); - - public CaptureConsoleService() - { - } - - public void Clear() => _builder.Clear(); - - public override string ToString() => _builder.ToString(); - - #region IConsoleService - - public void Write(string text) - { - _builder.Append(text); - } - - public void WriteWarning(string text) - { - _builder.Append(text); - } - - public void WriteError(string text) - { - _builder.Append(text); - } - - public bool SupportsDml => false; - - public void WriteDml(string text) => throw new NotSupportedException(); - - public void WriteDmlExec(string text, string _) => throw new NotSupportedException(); - - public CancellationToken CancellationToken { get; set; } = CancellationToken.None; - - int IConsoleService.WindowWidth => int.MaxValue; - - #endregion - } } diff --git a/src/Microsoft.Diagnostics.DebugServices/IRuntimeProvider.cs b/src/Microsoft.Diagnostics.DebugServices/IRuntimeProvider.cs index a81155d021..357bb63cfe 100644 --- a/src/Microsoft.Diagnostics.DebugServices/IRuntimeProvider.cs +++ b/src/Microsoft.Diagnostics.DebugServices/IRuntimeProvider.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; namespace Microsoft.Diagnostics.DebugServices @@ -14,6 +15,7 @@ public interface IRuntimeProvider /// Returns the list of runtimes in the target /// /// The starting runtime id for this provider - IEnumerable EnumerateRuntimes(int startingRuntimeId); + /// Enumeration control flags + IEnumerable EnumerateRuntimes(int startingRuntimeId, RuntimeEnumerationFlags flags); } } diff --git a/src/Microsoft.Diagnostics.DebugServices/IRuntimeService.cs b/src/Microsoft.Diagnostics.DebugServices/IRuntimeService.cs index 4f3863996e..3ba22b1ed7 100644 --- a/src/Microsoft.Diagnostics.DebugServices/IRuntimeService.cs +++ b/src/Microsoft.Diagnostics.DebugServices/IRuntimeService.cs @@ -13,6 +13,7 @@ public interface IRuntimeService /// /// Returns the list of runtimes in the target /// - IEnumerable EnumerateRuntimes(); + /// Enumeration control flags + IEnumerable EnumerateRuntimes(RuntimeEnumerationFlags flags = RuntimeEnumerationFlags.Default); } } diff --git a/src/Microsoft.Diagnostics.DebugServices/ISymbolService.cs b/src/Microsoft.Diagnostics.DebugServices/ISymbolService.cs index b32b19cde0..fb3c23bdc4 100644 --- a/src/Microsoft.Diagnostics.DebugServices/ISymbolService.cs +++ b/src/Microsoft.Diagnostics.DebugServices/ISymbolService.cs @@ -53,15 +53,43 @@ public interface ISymbolService /// if false, error parsing symbol path bool ParseSymbolPath(string symbolPath); + /// + /// Add the cloud symweb symbol server with authentication. + /// + /// specifies whether credentials requiring user interaction will be included in the default authentication flow + /// symbol server timeout in minutes (optional uses if null) + /// number of retries (optional uses if null) + /// if false, failure + public bool AddSymwebSymbolServer( + bool includeInteractiveCredentials = false, + int? timeoutInMinutes = null, + int? retryCount = null); + + /// + /// Add symbol server to search path with a PAT. + /// + /// PAT or access token + /// symbol server url (optional, uses if null) + /// symbol server timeout in minutes (optional uses if null) + /// number of retries (optional uses if null) + /// if false, failure + public bool AddAuthenticatedSymbolServer( + string accessToken, + string symbolServerPath = null, + int? timeoutInMinutes = null, + int? retryCount = null); + /// /// Add symbol server to search path. /// /// symbol server url (optional, uses if null) - /// PAT for secure symbol server (optional) - /// symbol server timeout in minutes (optional, uses if null) - /// number of retries (optional, uses if null) + /// symbol server timeout in minutes (optional uses if null) + /// number of retries (optional uses if null) /// if false, failure - bool AddSymbolServer(string symbolServerPath = null, string authToken = null, int? timeoutInMinutes = null, int? retryCount = null); + public bool AddSymbolServer( + string symbolServerPath = null, + int? timeoutInMinutes = null, + int? retryCount = null); /// /// Add cache path to symbol search path diff --git a/src/Microsoft.Diagnostics.DebugServices/RuntimeEnumerationFlags.cs b/src/Microsoft.Diagnostics.DebugServices/RuntimeEnumerationFlags.cs new file mode 100644 index 0000000000..ccf0ee5543 --- /dev/null +++ b/src/Microsoft.Diagnostics.DebugServices/RuntimeEnumerationFlags.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace Microsoft.Diagnostics.DebugServices +{ + /// + /// Enumeration control flags + /// + [Flags] + public enum RuntimeEnumerationFlags + { + /// + /// Providers can return only the runtimes they feel are important like ones involved in a crash. + /// + Default = 0x00, + + /// + /// Force enumeration of all runtimes. If set, all the possible runtimes in the target process are enumerated. + /// + All = 0x01, + } +} diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/Host/RuntimesCommand.cs b/src/Microsoft.Diagnostics.ExtensionCommands/Host/RuntimesCommand.cs index 1d678a23aa..561214e0b6 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/Host/RuntimesCommand.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/Host/RuntimesCommand.cs @@ -30,16 +30,28 @@ public class RuntimesCommand : CommandBase [Option(Name = "--netcore", Aliases = new string[] { "-netcore", "-c" }, Help = "Switches to the .NET Core or .NET 5+ runtime if exists.")] public bool NetCore { get; set; } + [Option(Name = "--all", Aliases = new string[] { "-a" }, Help = "Forces all runtimes to be enumerated.")] + public bool All { get; set; } + public override void Invoke() { if (NetFx && NetCore) { throw new DiagnosticsException("Cannot specify both -netfx and -netcore options"); } + RuntimeEnumerationFlags flags = RuntimeEnumerationFlags.Default; + + if (All) + { + // Force all runtimes to be enumerated. This requires a target flush. + flags = RuntimeEnumerationFlags.All; + Target.Flush(); + } + if (NetFx || NetCore) { string name = NetFx ? "desktop .NET Framework" : ".NET Core"; - foreach (IRuntime runtime in RuntimeService.EnumerateRuntimes()) + foreach (IRuntime runtime in RuntimeService.EnumerateRuntimes(flags)) { if (NetFx && runtime.RuntimeType == RuntimeType.Desktop || NetCore && runtime.RuntimeType == RuntimeType.NetCore) @@ -59,10 +71,10 @@ public override void Invoke() else { // Display the current runtime star ("*") only if there is more than one runtime and it is the current one - bool displayStar = RuntimeService.EnumerateRuntimes().Count() > 1; + bool displayStar = RuntimeService.EnumerateRuntimes(flags).Count() > 1; IRuntime currentRuntime = ContextService.GetCurrentRuntime(); - foreach (IRuntime runtime in RuntimeService.EnumerateRuntimes()) + foreach (IRuntime runtime in RuntimeService.EnumerateRuntimes(flags)) { string current = displayStar ? (runtime == currentRuntime ? "*" : " ") : ""; Write(current); diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/Host/SetSymbolServerCommand.cs b/src/Microsoft.Diagnostics.ExtensionCommands/Host/SetSymbolServerCommand.cs index 3d165d44eb..9c6ca4f4da 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/Host/SetSymbolServerCommand.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/Host/SetSymbolServerCommand.cs @@ -1,6 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; +using System.Net.Http.Headers; +using System.Text; using Microsoft.Diagnostics.DebugServices; namespace Microsoft.Diagnostics.ExtensionCommands @@ -18,7 +21,13 @@ public class SetSymbolServerCommand : CommandBase [Option(Name = "--ms", Aliases = new string[] { "-ms" }, Help = "Use the public Microsoft symbol server.")] public bool MicrosoftSymbolServer { get; set; } - [Option(Name = "--disable", Aliases = new string[] { "-disable" }, Help = "Clear or disable symbol download support.")] + [Option(Name = "--mi", Aliases = new string[] { "-mi" }, Help = "Use the internal symweb symbol server.")] + public bool InternalSymbolServer { get; set; } + + [Option(Name = "--interactive", Aliases = new string[] { "-interactive" }, Help = "Allows user interaction will be included in the authentication flow.")] + public bool Interactive { get; set; } + + [Option(Name = "--disable", Aliases = new string[] { "-disable", "-clear" }, Help = "Clear or disable symbol download support.")] public bool Disable { get; set; } [Option(Name = "--reset", Aliases = new string[] { "-reset" }, Help = "Reset the HTTP symbol servers clearing any cached failures.")] @@ -27,6 +36,9 @@ public class SetSymbolServerCommand : CommandBase [Option(Name = "--cache", Aliases = new string[] { "-cache" }, Help = "Specify a symbol cache directory.")] public string Cache { get; set; } + [Option(Name = "--nocache", Aliases = new string[] { "-nocache" }, Help = "Do not automatically add the default cache before a server.")] + public bool NoCache { get; set; } + [Option(Name = "--directory", Aliases = new string[] { "-directory" }, Help = "Specify a directory to search for symbols.")] public string Directory { get; set; } @@ -47,9 +59,13 @@ public class SetSymbolServerCommand : CommandBase public override void Invoke() { - if (MicrosoftSymbolServer && !string.IsNullOrEmpty(SymbolServerUrl)) + if (MicrosoftSymbolServer && InternalSymbolServer) { - throw new DiagnosticsException("Cannot have -ms option and a symbol server path"); + throw new DiagnosticsException("Cannot have both -ms and -mi options"); + } + if ((MicrosoftSymbolServer || InternalSymbolServer) && !string.IsNullOrEmpty(SymbolServerUrl)) + { + throw new DiagnosticsException("Cannot have -ms or -mi option and a symbol server path"); } if (Disable) { @@ -59,13 +75,24 @@ public override void Invoke() { SymbolService.Reset(); } - if (MicrosoftSymbolServer || !string.IsNullOrEmpty(SymbolServerUrl)) + if (MicrosoftSymbolServer || InternalSymbolServer || !string.IsNullOrEmpty(SymbolServerUrl)) { - if (string.IsNullOrEmpty(Cache)) + if (string.IsNullOrEmpty(Cache) && !NoCache) { Cache = SymbolService.DefaultSymbolCache; } - SymbolService.AddSymbolServer(SymbolServerUrl, AccessToken, Timeout, RetryCount); + if (InternalSymbolServer) + { + SymbolService.AddSymwebSymbolServer(includeInteractiveCredentials: Interactive, Timeout, RetryCount); + } + else if (AccessToken is not null) + { + SymbolService.AddAuthenticatedSymbolServer(AccessToken, SymbolServerUrl, Timeout, RetryCount); + } + else + { + SymbolService.AddSymbolServer(SymbolServerUrl, Timeout, RetryCount); + } } if (!string.IsNullOrEmpty(Cache)) { diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/LiveObjectService.cs b/src/Microsoft.Diagnostics.ExtensionCommands/LiveObjectService.cs index a77b997eba..3dee6f8fbd 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/LiveObjectService.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/LiveObjectService.cs @@ -85,7 +85,7 @@ private HashSet CreateObjectSet() } else { - Console.WriteLine($"Calculating live objects: {live.Count:n0} found - {(maxCount - todo.Count) * 100 / (float)maxCount:0.0}% complete"); + Console.WriteLine($"Calculating live objects: {live.Count:n0} found - {(maxCount - todo.Count) * 100.0f / maxCount:0.0}% complete"); } maxCount = Math.Max(maxCount, todo.Count); diff --git a/src/Microsoft.Diagnostics.ExtensionCommands/ParallelStacks.Runtime/RendererHelpers.cs b/src/Microsoft.Diagnostics.ExtensionCommands/ParallelStacks.Runtime/RendererHelpers.cs index e3f0cc1807..464e0f3eed 100644 --- a/src/Microsoft.Diagnostics.ExtensionCommands/ParallelStacks.Runtime/RendererHelpers.cs +++ b/src/Microsoft.Diagnostics.ExtensionCommands/ParallelStacks.Runtime/RendererHelpers.cs @@ -29,6 +29,19 @@ private static void RenderStack(ParallelStack stack, IRenderer visitor, int incr return; } + // Sometimes a stack can be shared in a way where some threads top frame is the current frame but there are still frames/threads present in the stack + // In this case print the unique thread ids in the current stack frame e.g. + // ~~ Thread_T1 - this one is the unique thread id for the current frame + // ~~ Thread_T2 + // 1 Next_Stack_Frame + // 2 Current_Stack_Frame + if (stack.Stacks.Count == 1 && stack.Stacks[0].ThreadIds.Count != stack.ThreadIds.Count) + { + List uniqueThreads = stack.ThreadIds.Except(stack.Stacks[0].ThreadIds).ToList(); + visitor.Write($"{Environment.NewLine}{alignment}"); + visitor.WriteFrameSeparator($" ~~~~ {FormatThreadIdList(visitor, uniqueThreads)}"); + } + foreach (ParallelStack nextStackFrame in stack.Stacks.OrderBy(s => s.ThreadIds.Count)) { RenderStack(nextStackFrame, visitor, diff --git a/src/Microsoft.Diagnostics.Monitoring.EventPipe/Counters/TraceEventExtensions.cs b/src/Microsoft.Diagnostics.Monitoring.EventPipe/Counters/TraceEventExtensions.cs index 7bd7e3611a..d6833da307 100644 --- a/src/Microsoft.Diagnostics.Monitoring.EventPipe/Counters/TraceEventExtensions.cs +++ b/src/Microsoft.Diagnostics.Monitoring.EventPipe/Counters/TraceEventExtensions.cs @@ -37,20 +37,64 @@ internal record struct ProviderAndCounter(string ProviderName, string CounterNam internal static class TraceEventExtensions { private static Dictionary counterMetadataByName = new(); + private static Dictionary counterMetadataById = new(); private static HashSet inactiveSharedSessions = new(StringComparer.OrdinalIgnoreCase); - // This assumes uniqueness of provider/counter combinations; - // this is currently a limitation (see https://github.com/dotnet/runtime/issues/93097 and https://github.com/dotnet/runtime/issues/93767) - public static CounterMetadata GetCounterMetadata(string providerName, string counterName, string meterTags = null, string instrumentTags = null, string scopeHash = null) + private static CounterMetadata AddCounterMetadata(string providerName, string counterName, int? id, string meterTags, string instrumentTags, string scopeHash) { + CounterMetadata metadata; + if (id.HasValue && counterMetadataById.TryGetValue(id.Value, out metadata)) + { + return metadata; + } + + // Its possible that we previously indexed this counter by name but it didn't have an ID at that point because we weren't + // listening to it then. + // Its also possible that we previously indexed a counter with the same name as this one but with different tags or scope hash. ProviderAndCounter providerAndCounter = new(providerName, counterName); - if (counterMetadataByName.TryGetValue(providerAndCounter, out CounterMetadata provider)) + if (counterMetadataByName.TryGetValue(providerAndCounter, out metadata)) { - return provider; + // we found a counter that matches the name, but it might not match everything + if (metadata.MeterTags == meterTags && metadata.InstrumentTags == instrumentTags && metadata.ScopeHash == scopeHash) + { + // add the ID index if it didn't exist before + if (id.HasValue) + { + counterMetadataById.TryAdd(id.Value, metadata); + } + return metadata; + } } - counterMetadataByName.Add(providerAndCounter, new CounterMetadata(providerName, counterName, meterTags, instrumentTags, scopeHash)); - return counterMetadataByName[providerAndCounter]; + // no pre-existing counter metadata was found, create a new one + metadata = new CounterMetadata(providerName, counterName, meterTags, instrumentTags, scopeHash); + if (id.HasValue) + { + counterMetadataById.TryAdd(id.Value, metadata); + } + counterMetadataByName.TryAdd(providerAndCounter, metadata); + return metadata; + } + + private static CounterMetadata GetCounterMetadata(string providerName, string counterName, int? id) + { + // Lookup by ID is preferred because it eliminates ambiguity in the case of duplicate provider/counter names. + // IDs are present starting in MetricsEventSource 9.0. + // Duplicate named providers/counters might still have different tags or scope hashes + CounterMetadata metadata; + if (id.HasValue && counterMetadataById.TryGetValue(id.Value, out metadata)) + { + return metadata; + } + ProviderAndCounter providerAndCounter = new(providerName, counterName); + if (counterMetadataByName.TryGetValue(providerAndCounter, out metadata)) + { + return metadata; + } + + // For EventCounter based events we expect to fall through here the first time a new counter is observed + // For MetricsEventSource events we should never reach here unless the BeginInstrumentRecording event was dropped. + return AddCounterMetadata(providerName, counterName, id, null, null, null); } public static bool TryGetCounterPayload(this TraceEvent traceEvent, CounterConfiguration counterConfiguration, out ICounterPayload payload) @@ -185,22 +229,29 @@ private static void HandleGauge(TraceEvent obj, CounterConfiguration counterConf string unit = (string)obj.PayloadValue(4); string tags = (string)obj.PayloadValue(5); string lastValueText = (string)obj.PayloadValue(6); + int? id = null; + + if (obj.Version >= 2) + { + id = (int)obj.PayloadValue(7); + } if (!counterConfiguration.CounterFilter.IsIncluded(meterName, instrumentName)) { return; } + CounterMetadata metadata = GetCounterMetadata(meterName, instrumentName, id); // the value might be an empty string indicating no measurement was provided this collection interval if (double.TryParse(lastValueText, NumberStyles.Number | NumberStyles.Float, CultureInfo.InvariantCulture, out double lastValue)) { - payload = new GaugePayload(GetCounterMetadata(meterName, instrumentName), null, unit, tags, lastValue, obj.TimeStamp); + payload = new GaugePayload(metadata, null, unit, tags, lastValue, obj.TimeStamp); } else { // for observable instruments we assume the lack of data is meaningful and remove it from the UI // this happens when the Gauge callback function throws an exception. - payload = new CounterEndedPayload(GetCounterMetadata(meterName, instrumentName), obj.TimeStamp); + payload = new CounterEndedPayload(metadata, obj.TimeStamp); } } @@ -223,18 +274,25 @@ private static void HandleBeginInstrumentReporting(TraceEvent traceEvent, Counte return; } - if (traceEvent.Version < 1) + string instrumentTags = null; + string meterTags = null; + string meterScopeHash = null; + int? instrumentID = null; + + if (traceEvent.Version >= 1) { - payload = new BeginInstrumentReportingPayload(GetCounterMetadata(meterName, instrumentName), traceEvent.TimeStamp); + instrumentTags = (string)traceEvent.PayloadValue(7); + meterTags = (string)traceEvent.PayloadValue(8); + meterScopeHash = (string)traceEvent.PayloadValue(9); } - else + if (traceEvent.Version >= 2) { - string instrumentTags = (string)traceEvent.PayloadValue(7); - string meterTags = (string)traceEvent.PayloadValue(8); - string meterScopeHash = (string)traceEvent.PayloadValue(9); - - payload = new BeginInstrumentReportingPayload(GetCounterMetadata(meterName, instrumentName, meterTags, instrumentTags, meterScopeHash), traceEvent.TimeStamp); + int id = (int)traceEvent.PayloadValue(10); + // ID zero is a sentinel value for MetricsEventSource events indicating no ID was provided because the instrument was not being listened to. + // Many different instruments may all share ID zero we don't want to index them by that ID. + instrumentID = (id != 0) ? id : null; } + payload = new BeginInstrumentReportingPayload(AddCounterMetadata(meterName, instrumentName, instrumentID, meterTags, instrumentTags, meterScopeHash), traceEvent.TimeStamp); } private static void HandleCounterRate(TraceEvent traceEvent, CounterConfiguration counterConfiguration, out ICounterPayload payload) @@ -256,27 +314,32 @@ private static void HandleCounterRate(TraceEvent traceEvent, CounterConfiguratio string rateText = (string)traceEvent.PayloadValue(6); //Starting in .NET 8 we also publish the absolute value of these counters string absoluteValueText = null; + int? id = null; if (traceEvent.Version >= 1) { absoluteValueText = (string)traceEvent.PayloadValue(7); } + if (traceEvent.Version >= 2) + { + id = (int)traceEvent.PayloadValue(8); + } if (!counterConfiguration.CounterFilter.IsIncluded(meterName, instrumentName)) { return; } - + CounterMetadata metadata = GetCounterMetadata(meterName, instrumentName, id); if (double.TryParse(rateText, NumberStyles.Number | NumberStyles.Float, CultureInfo.InvariantCulture, out double rate)) { if (absoluteValueText != null && counterConfiguration.UseCounterRateAndValuePayload && double.TryParse(absoluteValueText, NumberStyles.Number | NumberStyles.Float, CultureInfo.InvariantCulture, out double value)) { - payload = new CounterRateAndValuePayload(GetCounterMetadata(meterName, instrumentName), null, unit, tags, rate, value, traceEvent.TimeStamp); + payload = new CounterRateAndValuePayload(metadata, null, unit, tags, rate, value, traceEvent.TimeStamp); } else { - payload = new RatePayload(GetCounterMetadata(meterName, instrumentName), null, unit, tags, rate, counterConfiguration.CounterFilter.DefaultIntervalSeconds, traceEvent.TimeStamp); + payload = new RatePayload(metadata, null, unit, tags, rate, counterConfiguration.CounterFilter.DefaultIntervalSeconds, traceEvent.TimeStamp); } } else @@ -284,7 +347,7 @@ private static void HandleCounterRate(TraceEvent traceEvent, CounterConfiguratio // for observable instruments we assume the lack of data is meaningful and remove it from the UI // this happens when the ObservableCounter callback function throws an exception // or when the ObservableCounter doesn't include a measurement for a particular set of tag values. - payload = new CounterEndedPayload(GetCounterMetadata(meterName, instrumentName), traceEvent.TimeStamp); + payload = new CounterEndedPayload(metadata, traceEvent.TimeStamp); } } @@ -306,16 +369,22 @@ private static void HandleUpDownCounterValue(TraceEvent traceEvent, CounterConfi string tags = (string)traceEvent.PayloadValue(5); //string rateText = (string)traceEvent.PayloadValue(6); // Not currently using rate for UpDownCounters. string valueText = (string)traceEvent.PayloadValue(7); + int? id = null; + if (traceEvent.Version >= 2) + { + id = (int)traceEvent.PayloadValue(8); + } if (!configuration.CounterFilter.IsIncluded(meterName, instrumentName)) { return; } + CounterMetadata metadata = GetCounterMetadata(meterName, instrumentName, id); if (double.TryParse(valueText, NumberStyles.Number | NumberStyles.Float, CultureInfo.InvariantCulture, out double value)) { // UpDownCounter reports the value, not the rate - this is different than how Counter behaves. - payload = new UpDownCounterPayload(GetCounterMetadata(meterName, instrumentName), null, unit, tags, value, traceEvent.TimeStamp); + payload = new UpDownCounterPayload(metadata, null, unit, tags, value, traceEvent.TimeStamp); } else @@ -323,7 +392,7 @@ private static void HandleUpDownCounterValue(TraceEvent traceEvent, CounterConfi // for observable instruments we assume the lack of data is meaningful and remove it from the UI // this happens when the ObservableUpDownCounter callback function throws an exception // or when the ObservableUpDownCounter doesn't include a measurement for a particular set of tag values. - payload = new CounterEndedPayload(GetCounterMetadata(meterName, instrumentName), traceEvent.TimeStamp); + payload = new CounterEndedPayload(metadata, traceEvent.TimeStamp); } } @@ -344,6 +413,13 @@ private static void HandleHistogram(TraceEvent obj, CounterConfiguration configu string unit = (string)obj.PayloadValue(4); string tags = (string)obj.PayloadValue(5); string quantilesText = (string)obj.PayloadValue(6); + //int count - unused arg 7 + //double sum - unused arg 8 + int? id = null; + if (obj.Version >= 2) + { + id = (int)obj.PayloadValue(9); + } if (!configuration.CounterFilter.IsIncluded(meterName, instrumentName)) { @@ -352,8 +428,8 @@ private static void HandleHistogram(TraceEvent obj, CounterConfiguration configu //Note quantiles can be empty. IList quantiles = ParseQuantiles(quantilesText); - - payload = new AggregatePercentilePayload(GetCounterMetadata(meterName, instrumentName), null, unit, tags, quantiles, obj.TimeStamp); + CounterMetadata metadata = GetCounterMetadata(meterName, instrumentName, id); + payload = new AggregatePercentilePayload(metadata, null, unit, tags, quantiles, obj.TimeStamp); } private static void HandleHistogramLimitReached(TraceEvent obj, CounterConfiguration configuration, out ICounterPayload payload) diff --git a/src/Microsoft.Diagnostics.TestHelpers/AcquireDotNetTestStep.cs b/src/Microsoft.Diagnostics.TestHelpers/AcquireDotNetTestStep.cs index 359116156e..1bdb2cccbc 100644 --- a/src/Microsoft.Diagnostics.TestHelpers/AcquireDotNetTestStep.cs +++ b/src/Microsoft.Diagnostics.TestHelpers/AcquireDotNetTestStep.cs @@ -168,7 +168,12 @@ private static async Task Unzip(string zipPath, string expandedDirPath, ITestOut ZipArchive zip = new(zipStream); foreach (ZipArchiveEntry entry in zip.Entries) { - string extractedFilePath = Path.Combine(expandedDirPath, entry.FullName); + string extractedFilePath = Path.GetFullPath(Path.Combine(expandedDirPath, entry.FullName)); + string fullExtractedDirPath = Path.GetFullPath(expandedDirPath + Path.DirectorySeparatorChar); + if (!extractedFilePath.StartsWith(fullExtractedDirPath)) + { + throw new InvalidDataException("Entry is outside of the target dir: " + entry.FullName); + } Directory.CreateDirectory(Path.GetDirectoryName(extractedFilePath)); using (Stream zipFileStream = entry.Open()) { diff --git a/src/Microsoft.Diagnostics.TestHelpers/LoggingListener.cs b/src/Microsoft.Diagnostics.TestHelpers/LoggingListener.cs index ae48731d02..991325b862 100644 --- a/src/Microsoft.Diagnostics.TestHelpers/LoggingListener.cs +++ b/src/Microsoft.Diagnostics.TestHelpers/LoggingListener.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using Microsoft.Diagnostics.DebugServices.Implementation; using Xunit.Abstractions; namespace Microsoft.Diagnostics.TestHelpers diff --git a/src/Microsoft.Diagnostics.TestHelpers/TestConfiguration.cs b/src/Microsoft.Diagnostics.TestHelpers/TestConfiguration.cs index 49a54bf274..c499bac11f 100644 --- a/src/Microsoft.Diagnostics.TestHelpers/TestConfiguration.cs +++ b/src/Microsoft.Diagnostics.TestHelpers/TestConfiguration.cs @@ -382,6 +382,8 @@ public class TestConfiguration private const string DebugTypeKey = "DebugType"; private const string DebuggeeBuildRootKey = "DebuggeeBuildRoot"; + public static TestConfiguration Empty { get; } = new TestConfiguration(); + public static string BaseDir { get; set; } = Path.GetFullPath("."); private static readonly Regex versionRegex = new(@"^(\d+\.\d+\.\d+)(-.*)?", RegexOptions.Compiled); @@ -486,10 +488,9 @@ public string LogSuffix } } - public IReadOnlyDictionary AllSettings - { - get { return _settings; } - } + public bool IsEmpty => _settings.Count == 0; + + public IReadOnlyDictionary AllSettings => _settings; /// /// Creates a new test config with the new PDB type (full, portable or embedded) diff --git a/src/Microsoft.Diagnostics.TestHelpers/TestHost/TestDump.cs b/src/Microsoft.Diagnostics.TestHelpers/TestHost/TestDump.cs index 738320ee87..0829bbc4e6 100644 --- a/src/Microsoft.Diagnostics.TestHelpers/TestHost/TestDump.cs +++ b/src/Microsoft.Diagnostics.TestHelpers/TestHost/TestDump.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.IO; using System.Runtime.InteropServices; using Microsoft.Diagnostics.DebugServices; @@ -15,6 +16,8 @@ public class TestDump : TestHost, IHost { private readonly ServiceManager _serviceManager; private readonly ServiceContainer _serviceContainer; + private readonly ContextService _contextService; + private readonly CommandService _commandService; private readonly SymbolService _symbolService; private DataTarget _dataTarget; private int _targetIdFactory; @@ -34,10 +37,13 @@ public TestDump(TestConfiguration config) _serviceContainer.AddService(_serviceManager); _serviceContainer.AddService(this); - ContextService contextService = new(this); - _serviceContainer.AddService(contextService); + _contextService = new(this); + _serviceContainer.AddService(_contextService); - _symbolService = new SymbolService(this); + _commandService = new(); + _serviceContainer.AddService(_commandService); + + _symbolService = new(this); _serviceContainer.AddService(_symbolService); // Automatically enable symbol server support @@ -56,6 +62,10 @@ public override void Dispose() public ServiceContainer ServiceContainer => _serviceContainer; + public CommandService CommandService => _commandService; + + public override IReadOnlyList ExecuteHostCommand(string commandLine) => _commandService.ExecuteAndCapture(commandLine, _contextService.Services); + protected override ITarget GetTarget() { _dataTarget = DataTarget.LoadDump(DumpFile); diff --git a/src/Microsoft.Diagnostics.TestHelpers/TestHost/TestHost.cs b/src/Microsoft.Diagnostics.TestHelpers/TestHost/TestHost.cs index 93eea0eec2..45a50ea7ab 100644 --- a/src/Microsoft.Diagnostics.TestHelpers/TestHost/TestHost.cs +++ b/src/Microsoft.Diagnostics.TestHelpers/TestHost/TestHost.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Collections.Generic; +using System.Collections.Immutable; using Microsoft.Diagnostics.DebugServices; namespace Microsoft.Diagnostics.TestHelpers @@ -28,7 +30,7 @@ public TestDataReader TestData { get { - _testData ??= new TestDataReader(TestDataFile); + _testData ??= TestDataFile != null ? new TestDataReader(TestDataFile) : null; return _testData; } } @@ -42,19 +44,19 @@ public ITarget Target } } - public bool IsTestDbgEng => Config.AllSettings.TryGetValue("TestDbgEng", out string value) && value == "true"; + public abstract IReadOnlyList ExecuteHostCommand(string commandLine); protected abstract ITarget GetTarget(); public string DumpFile => TestConfiguration.MakeCanonicalPath(Config.AllSettings["DumpFile"]); - public string TestDataFile => TestConfiguration.MakeCanonicalPath(Config.AllSettings["TestDataFile"]); + public string TestDataFile => TestConfiguration.MakeCanonicalPath(Config.AllSettings.GetValueOrDefault("TestDataFile")); public override string ToString() => DumpFile; } public static class TestHostExtensions { - public static bool IsTestDbgEng(this TestConfiguration config) => config.AllSettings.TryGetValue("TestDbgEng", out string value) && value == "true"; + public static bool IsTestDbgEng(this TestConfiguration config) => config.AllSettings.GetValueOrDefault("TestDbgEng", string.Empty) == "true"; } } diff --git a/src/Microsoft.FileFormats/PDB/IMSFFile.cs b/src/Microsoft.FileFormats/PDB/IMSFFile.cs new file mode 100644 index 0000000000..b61502cb13 --- /dev/null +++ b/src/Microsoft.FileFormats/PDB/IMSFFile.cs @@ -0,0 +1,37 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Microsoft.FileFormats.PDB +{ + /// + /// An abstraction for reading both MSF (normal PDB files) and MSFZ files (compressed PDB files). + /// + internal interface IMSFFile + { + /// + /// The number of streams stored in the file. This will always be at least 1. + /// + uint NumStreams { get; } + + /// + /// Gets an object which can read the given stream. + /// + /// The index of the stream. This must be less than NumStreams. + /// A Reader which can read the stream. + Reader GetStream(uint stream); + + /// + /// Returns the container kind for this implementation. + /// + PDBContainerKind ContainerKind { get; } + + /// + /// Returns a string which identifies the container kind, using a backward-compatible naming scheme. + /// + /// + /// The existing PDB format is identified as "pdb", while PDZ (MSFZ) is identified as "msfz0". + /// This allows new versions of MSFZ to be identified and deployed without updating clients of this API. + /// + public string ContainerKindSpecString { get; } + } +} diff --git a/src/Microsoft.FileFormats/PDB/MSFFile.cs b/src/Microsoft.FileFormats/PDB/MSFFile.cs new file mode 100644 index 0000000000..2118932fe6 --- /dev/null +++ b/src/Microsoft.FileFormats/PDB/MSFFile.cs @@ -0,0 +1,81 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Collections.Generic; + +namespace Microsoft.FileFormats.PDB +{ + /// + /// This class can read from PDB files that use the MSF container format. + /// + internal sealed class MSFFile : IMSFFile + { + private Reader[] _streams; + + private MSFFile(Reader[] streams) + { + _streams = streams; + } + + internal static MSFFile OpenInternal(Reader fileReader, PDBFileHeader msfFileHeader) + { + // Read the Stream Directory and build the list of streams. + + uint pageSize = msfFileHeader.PageSize; + + uint secondLevelPageCount = ToPageCount(pageSize, msfFileHeader.DirectorySize); + ulong pageIndicesOffset = fileReader.SizeOf(); + PDBPagedAddressSpace secondLevelPageList = CreatePagedAddressSpace(fileReader.DataSource, fileReader.DataSource, msfFileHeader.PageSize, pageIndicesOffset, secondLevelPageCount * sizeof(uint)); + PDBPagedAddressSpace directoryContent = CreatePagedAddressSpace(fileReader.DataSource, secondLevelPageList, msfFileHeader.PageSize, 0, msfFileHeader.DirectorySize); + + Reader directoryReader = new(directoryContent); + ulong position = 0; + uint countStreams = directoryReader.Read(ref position); + uint[] streamSizes = directoryReader.ReadArray(ref position, countStreams); + Reader[] streams = new Reader[countStreams]; + for (uint i = 0; i < streamSizes.Length; i++) + { + uint streamSize = streamSizes[i]; + streams[i] = new Reader(CreatePagedAddressSpace(fileReader.DataSource, directoryContent, pageSize, position, streamSize)); + position += ToPageCount(pageSize, streamSizes[i]) * sizeof(uint); + } + + return new MSFFile(streams); + } + + private static PDBPagedAddressSpace CreatePagedAddressSpace(IAddressSpace fileData, IAddressSpace indicesData, uint pageSize, ulong offset, uint length) + { + uint[] indices = new Reader(indicesData).ReadArray(offset, ToPageCount(pageSize, length)); + return new PDBPagedAddressSpace(fileData, indices, pageSize, length); + } + + private static uint ToPageCount(uint pageSize, uint size) + { + return unchecked((pageSize + size - 1) / pageSize); + } + + public uint NumStreams + { + get + { + return (uint)_streams.Length; + } + } + + public Reader GetStream(uint index) + { + return _streams[index]; + } + + public PDBContainerKind ContainerKind + { + get { return PDBContainerKind.MSF; } + } + + public string ContainerKindSpecString + { + get { return "msf"; } + } + } +} diff --git a/src/Microsoft.FileFormats/PDB/MSFZFile.cs b/src/Microsoft.FileFormats/PDB/MSFZFile.cs new file mode 100644 index 0000000000..8f08437a0d --- /dev/null +++ b/src/Microsoft.FileFormats/PDB/MSFZFile.cs @@ -0,0 +1,430 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Diagnostics; +using System.Linq; + +namespace Microsoft.FileFormats.PDB +{ + /// + /// This class can read data from PDB files that use the MSFZ container format. + /// + internal sealed class MSFZFile : IMSFFile, IDisposable + { + /// + /// Provides access to the underlying MSFZ file. + /// + private readonly Reader _reader; + + /// + /// The number of streams. + /// + private readonly uint _numStreams; + + /// + /// The encoded Stream Directory. See the MSFZ specification for details on the encoding. + /// This is stored as an array of uint rather than an array of byte because the underlying + /// encoding stores uint32 values; there are no values larger than uint32 and no values + /// smaller. + /// + private readonly uint[] _streamDir; + + /// + /// _streamDirStarts[s] gives the index into _streamDir where the fragments for stream s begin. + /// _streamDirStarts.Length == _numStreams. + /// + private readonly uint[] _streamDirStarts; + + /// + /// The value of the "version" field from the MSFZ header. + /// + private readonly ulong _msfzVersion; + + private MSFZFile(Reader reader, uint numStreams, uint[] streamDir, uint[] streamDirStarts, ulong msfzVersion) + { + Debug.Assert(numStreams == streamDirStarts.Length); + this._numStreams = numStreams; + this._reader = reader; + this._streamDir = streamDir; + this._streamDirStarts = streamDirStarts; + this._msfzVersion = msfzVersion; + } + + public uint NumStreams + { + get { return _numStreams; } + } + + public Reader GetStream(uint stream) + { + if (stream == 0 || stream >= _numStreams) + { + throw new ArgumentException("Invalid stream index"); + } + + uint streamSize = GetStreamSize(stream); + return new Reader(new MsfzStream(this, stream, streamSize)); + } + + /// + /// Returns the size of the stream. The size is computed by iterating the fragments that + /// make up the stream and computing the sum of their sizes. + /// + /// The stream index. The caller must validate this value against + /// NumStreams. + /// The total size in bytes of the stream. + internal uint GetStreamSize(uint stream) + { + uint streamSize = 0; + + uint pos = _streamDirStarts[stream]; + while (pos < _streamDir.Length) + { + uint fragmentSize = _streamDir[pos]; + + // Nil streams do not have any fragments and are zero-length. + if (fragmentSize == MsfzConstants.NilFragmentSize) + { + return 0; + } + + // The fragment list (for a given stream) is terminated by a 0 value. + if (fragmentSize == 0) + { + break; + } + + streamSize += fragmentSize; + + // Step over this fragment record. + pos += MsfzConstants.UInt32PerFragmentRecord; + } + + return streamSize; + } + + // Can return null, on failure. + internal static MSFZFile Open(IAddressSpace dataSource) + { + Reader reader = new(dataSource); + + ulong pos = 0; + + MSFZFileHeader fileHeader = reader.Read(ref pos); + + if (!fileHeader.Signature.SequenceEqual(MSFZFileHeader.ExpectedSignature)) + { + // Wrong signature + return null; + } + + ulong headerVersion = fileHeader.Version; + uint numStreams = fileHeader.NumStreams; + ulong streamDirOffset = fileHeader.StreamDirOffset; + uint streamDirCompression = fileHeader.StreamDirCompression; + uint streamDirSizeCompressed = fileHeader.StreamDirSizeCompressed; + uint streamDirSizeUncompressed = fileHeader.StreamDirSizeUncompressed; + + // Validate the MSFZ file header version. We keep track of the version in a variable, + // even though the only version that is actually supported is V0. This is to minimize + // code changes in future versions of this code that would parse V1, V2, etc. + if (headerVersion != MSFZFileHeader.VersionV0) + { + // Wrong version + return null; + } + + if (streamDirCompression != MSFZConstants.COMPRESSION_NONE + || streamDirSizeCompressed != streamDirSizeUncompressed) + { + // Stream directory compression is not supported + return null; + } + + if (streamDirSizeUncompressed % 4 != 0) + { + // Stream directory length should be a multiple of uint32 size. + return null; + } + + // Read the contents of the stream dir, as a sequence of bytes. + byte[] streamDirBytes = reader.Read(streamDirOffset, streamDirSizeUncompressed); + + uint streamDirEncodedSize = streamDirSizeUncompressed; + uint[] streamDirEncoded = new uint[streamDirEncodedSize / 4]; + for (int i = 0; i < streamDirEncoded.Length; ++i) + { + streamDirEncoded[i] = BitConverter.ToUInt32(streamDirBytes, i * 4); + } + + uint[] streamStarts = FindStreamDirStarts(numStreams, streamDirEncoded); + + // We do not read the Chunk Table because this implementation does not support + // compression. Since the Chunk Table describes compressed chunks, we will never use it. + + return new MSFZFile(reader, numStreams, streamDirEncoded, streamStarts, headerVersion); + } + + /// + /// Scans through the encoded form of the Stream Directory (in uint32 form, not byte form) + /// and builds a table of the starting locations of the fragments of each stream. + /// + private static uint[] FindStreamDirStarts(uint numStreams, uint[] streamDir) + { + uint pos = 0; // index within streamDir where the fragments for the current stream begin + + uint[] starts = new uint[numStreams]; + + for (uint stream = 0; stream < numStreams; ++stream) + { + starts[stream] = pos; + + if (pos >= streamDir.Length) + { + throw new Exception("stream directory is too short to be valid"); + } + + uint fragmentSize = streamDir[pos]; + if (fragmentSize == MsfzConstants.NilFragmentSize) + { + // It's a nil stream. + ++pos; + continue; + } + + // Read all the fragments of this stream. There may be no fragments at all. + while (fragmentSize != 0) + { + // There should be at least 3 more words. The next 2 words form the fragment location + // of the current fragment. The next word is either the length of the next fragment + // or is 0, indicating the end of the fragment list. + if (pos + MsfzConstants.UInt32PerFragmentRecord >= streamDir.Length) + { + throw new Exception("MSFZ stream directory is too short to be valid"); + } + + // Advance our pointer and read the size of the next fragment. + pos += MsfzConstants.UInt32PerFragmentRecord; + fragmentSize = streamDir[pos]; + } + + // This steps over the 0 at the end of the fragment list. + ++pos; + } + + return starts; + } + + /// + /// Reads data from a stream. + /// + /// The stream index + /// The byte offset within the stream of the data. + /// The output buffer. + /// The location within the output buffer to write the data. + /// The number of bytes to transfer. + /// The number of bytes actually transferred. + /// Thrown if the data covers a compressed fragment. + /// + internal uint ReadStream(uint stream, ulong position, byte[] buffer, uint bufferOffset, uint count) + { + // Find the fragments for this stream. + uint fragmentIndex = _streamDirStarts[stream]; + uint totalBytesTransferred = 0; + + while (count != 0) + { + uint fragmentSize = _streamDir[fragmentIndex]; + if (fragmentSize == MsfzConstants.NilFragmentSize || fragmentSize == 0) + { + break; + } + + // We can safely index into _streamDir because we have already validated its contents, + // when we first opened the MSFZ file. + + MsfzFragmentLocation fragmentLocation; + fragmentLocation.Low = _streamDir[fragmentIndex + 1]; + fragmentLocation.High = _streamDir[fragmentIndex + 2]; + fragmentIndex += MsfzConstants.UInt32PerFragmentRecord; + + // If the position is beyond the range of bytes covered by this fragment, then skip + // this fragment and adjust our read position. + if (position >= fragmentSize) + { + position -= fragmentSize; + continue; + } + + // We found the fragment that we are going to read from. + uint transferSize = Math.Min(count, (uint)(fragmentSize - position)); + + // Is this fragment compressed or uncompressed? + if (fragmentLocation.IsCompressedChunk) + { + // Compressed fragments are not supported by this implementation. + throw new NotSupportedException($"This implementation does not support decompression of PDZ (compressed PDB) files. " + + $"It can only read data from uncompressed streams within PDZ files. (stream {stream}, position {position})"); + } + + ulong fileOffset = fragmentLocation.UncompressedFileOffset + position; + + uint fileBytesTransferred = _reader.Read(fileOffset, buffer, bufferOffset, transferSize); + if (fileBytesTransferred != transferSize) + { + // We expect the entire read to be satisfied. + throw new Exception("Internal error in MSFZ reader. The underlying file reader did not read enough data from the file."); + } + + count -= transferSize; + bufferOffset += transferSize; + position += transferSize; + totalBytesTransferred += transferSize; + } + + return totalBytesTransferred; + } + + public PDBContainerKind ContainerKind + { + get { return PDBContainerKind.MSFZ; } + } + + public string ContainerKindSpecString + { + get { return $"msfz{_msfzVersion}"; } + } + + public void Dispose() + { + if (_reader.DataSource is IDisposable disposable) + { + disposable.Dispose(); + } + } + } + + /// + /// Describes the MSFZ File Header on-disk data structure. + /// + internal sealed class MSFZFileHeader : TStruct + { + // 00000000 : 4d 69 63 72 6f 73 6f 66 74 20 4d 53 46 5a 20 43 : Microsoft MSFZ C + // 00000010 : 6f 6e 74 61 69 6e 65 72 0d 0a 1a 41 4c 44 00 00 : ontainer...ALD.. + + internal static readonly byte[] ExpectedSignature = + { + 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x4d, 0x53, 0x46, 0x5a, 0x20, 0x43, // : Microsoft MSFZ C + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x0d, 0x0a, 0x1a, 0x41, 0x4c, 0x44, 0x00, 0x00, // : ontainer...ALD.. + }; + + internal const ulong VersionV0 = 0; + + internal const int SizeOf = 80; + +#pragma warning disable 0649 // These fields are assigned via Reflection, so the C# compiler thinks they are never assigned. + + /// Identifies this as an MSFZ file. + [ArraySize(32)] + internal byte[] Signature; + /// specifies the version number of the MSFZ file format + internal ulong Version; + /// file offset of the stream directory + internal ulong StreamDirOffset; + /// file offset of the chunk table + internal ulong ChunkTableOffset; + /// the number of streams stored within this MSFZ file + internal uint NumStreams; + /// compression algorithm used for the stream directory + internal uint StreamDirCompression; + /// size in bytes of the stream directory when compressed (on disk) + internal uint StreamDirSizeCompressed; + /// size in bytes of the stream directory when uncompressed (in memory) + internal uint StreamDirSizeUncompressed; + /// number of compressed chunks + internal uint NumChunks; + /// size in bytes of the chunk table + internal uint ChunkTableSize; + +#pragma warning restore 0649 + + internal bool IsMagicValid + { + get { return Signature.SequenceEqual(ExpectedSignature); } + } + } + + internal static class MSFZConstants + { + internal const uint COMPRESSION_NONE = 0; + internal const uint COMPRESSION_ZSTD = 1; + } + + /// Allows reading data from an MSFZ stream. + internal sealed class MsfzStream : IAddressSpace + { + /// Provides access to the MSFZ file. + private readonly MSFZFile _msfzFile; + + /// The stream index. + private readonly uint _stream; + + /// The size of the stream, in bytes. + private readonly uint _size; + + internal MsfzStream(MSFZFile msfzFile, uint stream, uint size) + { + _msfzFile = msfzFile; + _stream = stream; + _size = size; + } + + public uint Read(ulong position, byte[] buffer, uint bufferOffset, uint count) + { + return _msfzFile.ReadStream(_stream, position, buffer, bufferOffset, count); + } + + public ulong Length { get { return _size; } } + } + + internal static class MsfzConstants + { + /// + /// The special value for the size of a fragment record that indicates the stream is a nil stream, + /// not an ordinary stream. + /// + public const uint NilFragmentSize = 0xffffffffu; + + /// + /// The bitmask that is applied to the FragmentLocation.High value, which specifies that + /// the fragment is compressed. 1 means compressed, 0 means not compressed. + /// + public const uint FragmentLocationChunkMaskInUInt32 = 1u << 31; + + /// + /// The number of uint32 values per fragment record. + /// + public const uint UInt32PerFragmentRecord = 3; + } + + internal struct MsfzFragmentLocation + { + public uint Low; + public uint High; + + public bool IsCompressedChunk + { + get { return (High & MsfzConstants.FragmentLocationChunkMaskInUInt32) != 0u; } + } + + public ulong UncompressedFileOffset + { + get + { + Debug.Assert(!IsCompressedChunk); + return (((ulong)High) << 32) | ((ulong)Low); + } + } + } +} diff --git a/src/Microsoft.FileFormats/PDB/PDBFile.cs b/src/Microsoft.FileFormats/PDB/PDBFile.cs index 0ccdda087e..a0318664a2 100644 --- a/src/Microsoft.FileFormats/PDB/PDBFile.cs +++ b/src/Microsoft.FileFormats/PDB/PDBFile.cs @@ -8,23 +8,110 @@ namespace Microsoft.FileFormats.PDB { public class PDBFile : IDisposable { - private readonly Reader _reader; - private readonly Lazy _header; + /// + /// This provides access to the container file, which may be either MSF (uncompressed PDB) + /// or MSFZ (compressed PDB). If this field is null, then this PDBFile is invalid. + /// + private readonly IMSFFile _msfFile; + private readonly Lazy _streams; private readonly Lazy _nameStream; private readonly Lazy _dbiStream; public PDBFile(IAddressSpace dataSource) { - _reader = new Reader(dataSource); - _header = new Lazy(() => _reader.Read(0)); + Reader reader = new(dataSource); _streams = new Lazy(ReadDirectory); - _nameStream = new Lazy(() => new PDBNameStream(Streams[1])); - _dbiStream = new Lazy(() => new DbiStream(Streams[3])); + _nameStream = new Lazy(() => { + CheckValid(); + return new PDBNameStream(_msfFile.GetStream(1)); + }); + _dbiStream = new Lazy(() => { + CheckValid(); + return new DbiStream(_msfFile.GetStream(3)); + }); + + if (reader.Length > reader.SizeOf()) + { + PDBFileHeader msfFileHeader = reader.Read(0); + if (msfFileHeader.IsMagicValid) + { + MSFFile msfFile = MSFFile.OpenInternal(reader, msfFileHeader); + if (msfFile != null) + { + _msfFile = msfFile; + return; + } + } + } + + if (reader.Length > reader.SizeOf()) + { + MSFZFileHeader msfzFileHeader = reader.Read(0); + if (msfzFileHeader.IsMagicValid) + { + MSFZFile msfzFile = MSFZFile.Open(dataSource); + if (msfzFile != null) + { + _msfFile = msfzFile; + return; + } + } + } } - public PDBFileHeader Header { get { return _header.Value; } } + /// + /// Opens a PDB file. If the operation is not successful, this method will throw an exception, rather + /// than return an invalid PDBFile object. + /// + public static PDBFile Open(IAddressSpace dataSource) + { + PDBFile pdbFile = new(dataSource); + if (pdbFile.IsValid()) + { + return pdbFile; + } + else + { + throw new BadInputFormatException("The specified file is not a PDB (uses neither MSF nor MSFZ container format)."); + } + } + + [Obsolete("Switch to using NumStreams and GetStream. The 'Streams' collection is inefficient.")] public IList Streams { get { return _streams.Value; } } + + private void CheckValid() + { + if (_msfFile == null) + { + throw new Exception("Object is not valid"); + } + } + + /// + /// The number of streams stored in the file. This will always be at least 1. + /// + public uint NumStreams + { + get + { + CheckValid(); + return _msfFile.NumStreams; + } + } + + /// + /// Gets an object which can read the given stream. + /// + /// The index of the stream. This must be less than NumStreams. + /// A Reader which can read the stream. + public Reader GetStream(uint stream) + { + CheckValid(); + return _msfFile.GetStream(stream); + } + + public PDBNameStream NameStream { get { return _nameStream.Value; } } public DbiStream DbiStream { get { return _dbiStream.Value; } } public uint Age { get { return NameStream.Header.Age; } } @@ -33,50 +120,59 @@ public PDBFile(IAddressSpace dataSource) public void Dispose() { - if (_reader.DataSource is IDisposable disposable) - { - disposable.Dispose(); - } + IDisposable msfFile = _msfFile as IDisposable; + msfFile?.Dispose(); } public bool IsValid() { - if (_reader.Length > _reader.SizeOf()) { - return Header.IsMagicValid.Check(); - } - return false; + return _msfFile != null; } private Reader[] ReadDirectory() { - Header.IsMagicValid.CheckThrowing(); - uint secondLevelPageCount = ToPageCount(Header.DirectorySize); - ulong pageIndicesOffset = _reader.SizeOf(); - PDBPagedAddressSpace secondLevelPageList = CreatePagedAddressSpace(_reader.DataSource, pageIndicesOffset, secondLevelPageCount * sizeof(uint)); - PDBPagedAddressSpace directoryContent = CreatePagedAddressSpace(secondLevelPageList, 0, Header.DirectorySize); - - Reader directoryReader = new(directoryContent); - ulong position = 0; - uint countStreams = directoryReader.Read(ref position); - uint[] streamSizes = directoryReader.ReadArray(ref position, countStreams); - Reader[] streams = new Reader[countStreams]; - for (uint i = 0; i < streamSizes.Length; i++) + // We have already read the Stream Directory, in the constructor of PDBFile. + // The purpose of this function is to provide backward compatibility with the old + // 'Streams' property. New code should not use `Streams`; instead, new code should + // directly call `ReadStream`. + + int numStreams = (int)this.NumStreams; + + Reader[] streamReaders = new Reader[numStreams]; + + for (int i = 1; i < numStreams; ++i) { - streams[i] = new Reader(CreatePagedAddressSpace(directoryContent, position, streamSizes[i])); - position += ToPageCount(streamSizes[i]) * sizeof(uint); + streamReaders[i] = GetStream((uint)i); } - return streams; + return streamReaders; } - private PDBPagedAddressSpace CreatePagedAddressSpace(IAddressSpace indicesData, ulong offset, uint length) + /// + /// Returns the container kind used for this PDB file. + /// + public PDBContainerKind ContainerKind { - uint[] indices = new Reader(indicesData).ReadArray(offset, ToPageCount(length)); - return new PDBPagedAddressSpace(_reader.DataSource, indices, Header.PageSize, length); + get + { + CheckValid(); + return _msfFile.ContainerKind; + } } - private uint ToPageCount(uint size) + /// + /// Returns a string which identifies the container kind, using a backward-compatible naming scheme. + /// + /// + /// The existing PDB format is identified as "pdb", while PDZ (MSFZ) is identified as "msfz0". + /// This allows new versions of MSFZ to be identified and deployed without updating clients of this API. + /// + public string ContainerKindSpecString { - return unchecked((Header.PageSize + size - 1) / Header.PageSize); + get + { + CheckValid(); + return _msfFile.ContainerKindSpecString; + } } } @@ -184,4 +280,20 @@ public bool IsValid() public DbiStreamHeader Header { get { _header.Value.IsHeaderValid.CheckThrowing(); return _header.Value; } } } + + /// + /// Specifies the kinds of PDB container formats. + /// + public enum PDBContainerKind + { + /// + /// An uncompressed PDB. + /// + MSF, + + /// + /// A compressed PDB, also known as a PDBZ or "PDB using MSFZ container". + /// + MSFZ, + } } diff --git a/src/Microsoft.FileFormats/PDB/PDBStructures.cs b/src/Microsoft.FileFormats/PDB/PDBStructures.cs index 7c082a6bed..2a6886f57e 100644 --- a/src/Microsoft.FileFormats/PDB/PDBStructures.cs +++ b/src/Microsoft.FileFormats/PDB/PDBStructures.cs @@ -33,9 +33,9 @@ private static byte[] ExpectedMagic public uint Reserved; #region Validation Rules - public ValidationRule IsMagicValid + public bool IsMagicValid { - get { return new ValidationRule("PDB header magic is invalid", () => Magic.SequenceEqual(ExpectedMagic)); } + get { return Magic.SequenceEqual(ExpectedMagic); } } #endregion } @@ -52,8 +52,8 @@ public class NameIndexStreamHeader : TStruct public class DbiStreamHeader : TStruct { - private const uint CurrentSignature = uint.MaxValue; - private const uint CurrentVersion = 19990903; // DBIImpvV70 + public const uint CurrentSignature = uint.MaxValue; + public const uint CurrentVersion = 19990903; // DBIImpvV70 public uint Signature; public uint Version; diff --git a/src/Microsoft.FileFormats/StreamAddressSpace.cs b/src/Microsoft.FileFormats/StreamAddressSpace.cs index 773c411dd3..278a2115e4 100644 --- a/src/Microsoft.FileFormats/StreamAddressSpace.cs +++ b/src/Microsoft.FileFormats/StreamAddressSpace.cs @@ -18,7 +18,10 @@ public sealed class StreamAddressSpace : IAddressSpace, IDisposable public StreamAddressSpace(Stream stream) { - System.Diagnostics.Debug.Assert(stream.CanSeek); + if (stream is null || !stream.CanSeek) + { + throw new ArgumentException("Stream null or not seekable", nameof(stream)); + } _stream = stream; Length = (ulong)stream.Length; } diff --git a/src/Microsoft.SymbolManifestGenerator/Microsoft.SymbolManifestGenerator.csproj b/src/Microsoft.SymbolManifestGenerator/Microsoft.SymbolManifestGenerator.csproj index af07aa8f47..e3928252b8 100644 --- a/src/Microsoft.SymbolManifestGenerator/Microsoft.SymbolManifestGenerator.csproj +++ b/src/Microsoft.SymbolManifestGenerator/Microsoft.SymbolManifestGenerator.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Microsoft.SymbolManifestGenerator/SymbolManifestGenerator.cs b/src/Microsoft.SymbolManifestGenerator/SymbolManifestGenerator.cs index e30c82d3fe..e70b927d39 100644 --- a/src/Microsoft.SymbolManifestGenerator/SymbolManifestGenerator.cs +++ b/src/Microsoft.SymbolManifestGenerator/SymbolManifestGenerator.cs @@ -14,7 +14,13 @@ namespace Microsoft.SymbolManifestGenerator; public static class SymbolManifestGenerator { - private const int Private = 340; + private const int TargetDebugLevel = 0x154 | 0x1 | 0x500; // Private | Binary | SourceIndexed + + private static readonly JsonSerializerOptions s_serializeOptions = new() + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + WriteIndented = true + }; public static bool GenerateManifest(ITracer tracer, DirectoryInfo dir, string manifestFileName, bool specialFilesRequireAdjacentRuntime = true) { @@ -58,26 +64,39 @@ public static bool GenerateManifest(ITracer tracer, DirectoryInfo dir, string ma return false; } - ManifestDataEntry manifestDataEntry = new() + // This is the special module for the runtime in runtimeCorrelatedKey that's under the special index. + manifestData.Entries.Add(new() { BasedirRelativePath = basedirRelativePath, SymbolKey = runtimeCorrelatedKey.Index, Sha512 = fileHash, - DebugInformationLevel = Private, - LegacyDebugInformationLevel = Private - }; + DebugInformationLevel = TargetDebugLevel + }); + + using FileStream fs = correlatedFile.OpenRead(); + SymbolStoreFile specialDiagnosticFile = new(fs, correlatedFile.FullName); + FileKeyGenerator correlatedGenerator = new(tracer, specialDiagnosticFile); + + if (!correlatedGenerator.IsValid()) + { + tracer.Error("Unable to get a key generator for special diagnostic file '{0}' of runtime '{1}'", file.FullName, correlatedFile.FullName); + return false; + } - manifestData.Entries.Add(manifestDataEntry); + SymbolStoreKey diagnosticFileIdentityKey = correlatedGenerator.GetKeys(KeyTypeFlags.IdentityKey).Single(); + // This is the special module for the runtime in runtimeCorrelatedKey that's under its own identity key + // with the upgraded debug information level. + manifestData.Entries.Add(new() + { + BasedirRelativePath = basedirRelativePath, + SymbolKey = diagnosticFileIdentityKey.Index, + Sha512 = fileHash, + DebugInformationLevel = TargetDebugLevel + }); } } - JsonSerializerOptions serializeOptions = new() - { - PropertyNamingPolicy = JsonNamingPolicy.CamelCase, - WriteIndented = true - }; - - string manifestDataContent = JsonSerializer.Serialize(manifestData, serializeOptions); + string manifestDataContent = JsonSerializer.Serialize(manifestData, s_serializeOptions); File.WriteAllText(manifestFileName, manifestDataContent); return true; @@ -121,20 +140,17 @@ private static string CalculateSHA512(FileInfo file) return BitConverter.ToString(hashValueBytes).Replace("-", ""); } - private class ManifestFileVersion + private interface IManifestFile { - public string Version { get; set; } + string Version { get; } } - private class ManifestDataV1 : ManifestFileVersion + private sealed class ManifestDataV1 : IManifestFile { - public List Entries { get; set; } + public List Entries { get; } = []; - public ManifestDataV1() - { - Version = "1"; - Entries = new List(); - } + [JsonInclude] + public string Version => "1"; } private class ManifestDataEntry @@ -143,7 +159,5 @@ private class ManifestDataEntry public string SymbolKey { get; set; } public string Sha512 { get; set; } public int DebugInformationLevel { get; set; } - [JsonPropertyName("DebugInformationLevel")] - public int LegacyDebugInformationLevel { get; set; } } } diff --git a/src/Microsoft.SymbolStore/KeyGenerators/ELFFileKeyGenerator.cs b/src/Microsoft.SymbolStore/KeyGenerators/ELFFileKeyGenerator.cs index 4dd81a3f21..c7de8cc2c3 100644 --- a/src/Microsoft.SymbolStore/KeyGenerators/ELFFileKeyGenerator.cs +++ b/src/Microsoft.SymbolStore/KeyGenerators/ELFFileKeyGenerator.cs @@ -38,8 +38,8 @@ public class ELFFileKeyGenerator : KeyGenerator public ELFFileKeyGenerator(ITracer tracer, ELFFile elfFile, string path) : base(tracer) { - _elfFile = elfFile; - _path = path; + _elfFile = elfFile ?? throw new ArgumentNullException(nameof(elfFile)); + _path = path ?? throw new ArgumentNullException(nameof(path)); } public ELFFileKeyGenerator(ITracer tracer, SymbolStoreFile file) diff --git a/src/Microsoft.SymbolStore/KeyGenerators/KeyGenerator.cs b/src/Microsoft.SymbolStore/KeyGenerators/KeyGenerator.cs index e2f51f2a9b..03307b909a 100644 --- a/src/Microsoft.SymbolStore/KeyGenerators/KeyGenerator.cs +++ b/src/Microsoft.SymbolStore/KeyGenerators/KeyGenerator.cs @@ -118,7 +118,7 @@ public virtual bool IsDump() protected static SymbolStoreKey BuildKey(string path, string id, bool clrSpecialFile = false, IEnumerable pdbChecksums = null) { string file = GetFileName(path).ToLowerInvariant(); - return BuildKey(path, null, id, file, clrSpecialFile, pdbChecksums); + return BuildKey(path, prefix: null, id, type: null, file, clrSpecialFile, pdbChecksums); } /// @@ -148,7 +148,7 @@ protected static SymbolStoreKey BuildKey(string path, string prefix, byte[] id, /// key protected static SymbolStoreKey BuildKey(string path, string prefix, byte[] id, string file, bool clrSpecialFile = false, IEnumerable pdbChecksums = null) { - return BuildKey(path, prefix, ToHexString(id), file, clrSpecialFile, pdbChecksums); + return BuildKey(path, prefix, ToHexString(id), type: null, file, clrSpecialFile, pdbChecksums); } /// @@ -163,15 +163,44 @@ protected static SymbolStoreKey BuildKey(string path, string prefix, byte[] id, /// key protected static SymbolStoreKey BuildKey(string path, string prefix, string id, string file, bool clrSpecialFile = false, IEnumerable pdbChecksums = null) { + return BuildKey(path, prefix, id, type: null, file, clrSpecialFile, pdbChecksums); + } + + /// + /// Base key building helper for "file/{prefix}-id/{type}/file" indexes. + /// + /// full path of file or binary + /// optional id prefix + /// build id or uuid + /// optional type or format piece + /// file name only + /// if true, the file is one the clr special files + /// Checksums of pdb file. May be null. + /// key + internal static SymbolStoreKey BuildKey(string path, string prefix, string id, string type, string file, bool clrSpecialFile, IEnumerable pdbChecksums) + { + if (id is null or "") + { + throw new ArgumentNullException(nameof(id)); + } + if (file is null or "") + { + throw new ArgumentNullException(nameof(file)); + } StringBuilder key = new(); key.Append(file); key.Append('/'); - if (prefix != null) + if (prefix is not null) { key.Append(prefix); key.Append('-'); } key.Append(id); + if (type is not null) + { + key.Append('/'); + key.Append(type); + } key.Append('/'); key.Append(file); return new SymbolStoreKey(key.ToString(), path, clrSpecialFile, pdbChecksums); @@ -181,7 +210,7 @@ protected static SymbolStoreKey BuildKey(string path, string prefix, string id, /// hex string public static string ToHexString(byte[] bytes) { - if (bytes == null) + if (bytes is null) { throw new ArgumentNullException(nameof(bytes)); } @@ -196,6 +225,10 @@ public static string ToHexString(byte[] bytes) /// just the file name internal static string GetFileName(string path) { + if (path is null or "") + { + throw new ArgumentNullException(nameof(path)); + } return Path.GetFileName(path.Replace('\\', '/')); } } diff --git a/src/Microsoft.SymbolStore/KeyGenerators/MachOKeyGenerator.cs b/src/Microsoft.SymbolStore/KeyGenerators/MachOKeyGenerator.cs index 02a89b9538..ae4f9106d1 100644 --- a/src/Microsoft.SymbolStore/KeyGenerators/MachOKeyGenerator.cs +++ b/src/Microsoft.SymbolStore/KeyGenerators/MachOKeyGenerator.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -33,8 +34,8 @@ public class MachOFileKeyGenerator : KeyGenerator public MachOFileKeyGenerator(ITracer tracer, MachOFile machoFile, string path) : base(tracer) { - _machoFile = machoFile; - _path = path; + _machoFile = machoFile ?? throw new ArgumentNullException(nameof(machoFile)); + _path = path ?? throw new ArgumentNullException(nameof(path)); } public MachOFileKeyGenerator(ITracer tracer, SymbolStoreFile file) diff --git a/src/Microsoft.SymbolStore/KeyGenerators/PDBFileKeyGenerator.cs b/src/Microsoft.SymbolStore/KeyGenerators/PDBFileKeyGenerator.cs index 79aa08ce8b..1e0e627650 100644 --- a/src/Microsoft.SymbolStore/KeyGenerators/PDBFileKeyGenerator.cs +++ b/src/Microsoft.SymbolStore/KeyGenerators/PDBFileKeyGenerator.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.IO; using Microsoft.FileFormats; using Microsoft.FileFormats.PDB; using Microsoft.FileFormats.PE; @@ -18,6 +19,10 @@ public class PDBFileKeyGenerator : KeyGenerator public PDBFileKeyGenerator(ITracer tracer, SymbolStoreFile file) : base(tracer) { + if (file is null) + { + throw new ArgumentNullException(nameof(file)); + } StreamAddressSpace dataSource = new(file.Stream); _pdbFile = new PDBFile(dataSource); _path = file.FileName; @@ -34,14 +39,10 @@ public override IEnumerable GetKeys(KeyTypeFlags flags) { if ((flags & KeyTypeFlags.IdentityKey) != 0) { - if (_pdbFile.DbiStream.IsValid()) - { - yield return GetKey(_path, _pdbFile.Signature, unchecked((int)_pdbFile.DbiAge)); - } - else - { - yield return GetKey(_path, _pdbFile.Signature, unchecked((int)_pdbFile.Age)); - } + uint age = _pdbFile.DbiStream.IsValid() ? _pdbFile.DbiAge : _pdbFile.Age; + // No format type if legacy Windows PDB (MSF), otherwise, pass container type string (i.e. msfz0) + string type = _pdbFile.ContainerKind == PDBContainerKind.MSF ? null : _pdbFile.ContainerKindSpecString; + yield return GetKey(_path, _pdbFile.Signature, unchecked((int)age), type, pdbChecksums: null); } } } @@ -52,12 +53,26 @@ public override IEnumerable GetKeys(KeyTypeFlags flags) /// file name and path /// mvid guid /// pdb age + /// Checksums of pdb file. May be null. /// symbol store key public static SymbolStoreKey GetKey(string path, Guid signature, int age, IEnumerable pdbChecksums = null) { - Debug.Assert(path != null); - Debug.Assert(signature != null); - return BuildKey(path, string.Format("{0}{1:x}", signature.ToString("N"), age)); + return GetKey(path, signature, age, type: null, pdbChecksums); + } + + /// + /// Create a symbol store key for a Windows PDB or PDZ. + /// + /// file name and path + /// mvid guid + /// pdb age + /// PDB format type like msfz0 or null + /// Checksums of pdb file. May be null. + /// symbol store key + public static SymbolStoreKey GetKey(string path, Guid signature, int age, string type, IEnumerable pdbChecksums = null) + { + string file = GetFileName(path).ToLowerInvariant(); + return BuildKey(path, prefix: null, string.Format("{0}{1:x}", signature.ToString("N"), age), type, file, clrSpecialFile: false, pdbChecksums); } } } diff --git a/src/Microsoft.SymbolStore/KeyGenerators/PEFileKeyGenerator.cs b/src/Microsoft.SymbolStore/KeyGenerators/PEFileKeyGenerator.cs index 55c95c13d9..5ccfd355a3 100644 --- a/src/Microsoft.SymbolStore/KeyGenerators/PEFileKeyGenerator.cs +++ b/src/Microsoft.SymbolStore/KeyGenerators/PEFileKeyGenerator.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -28,8 +29,8 @@ public class PEFileKeyGenerator : KeyGenerator public PEFileKeyGenerator(ITracer tracer, PEFile peFile, string path) : base(tracer) { - _peFile = peFile; - _path = path; + _peFile = peFile ?? throw new ArgumentNullException(nameof(peFile)); + _path = path ?? throw new ArgumentNullException(nameof(path)); } public PEFileKeyGenerator(ITracer tracer, SymbolStoreFile file) @@ -61,7 +62,7 @@ public override IEnumerable GetKeys(KeyTypeFlags flags) { pdbs = _peFile.Pdbs.ToArray(); } - catch (InvalidVirtualAddressException ex) + catch (Exception ex) when (ex is InvalidVirtualAddressException || ex is BadInputFormatException) { Tracer.Error("Reading PDB records for {0}: {1}", _path, ex.Message); } diff --git a/src/Microsoft.SymbolStore/KeyGenerators/PerfMapFileKeyGenerator.cs b/src/Microsoft.SymbolStore/KeyGenerators/PerfMapFileKeyGenerator.cs index 9ecc355fbf..f7efd4fab6 100644 --- a/src/Microsoft.SymbolStore/KeyGenerators/PerfMapFileKeyGenerator.cs +++ b/src/Microsoft.SymbolStore/KeyGenerators/PerfMapFileKeyGenerator.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -16,7 +17,7 @@ public class PerfMapFileKeyGenerator : KeyGenerator public PerfMapFileKeyGenerator(ITracer tracer, SymbolStoreFile file) : base(tracer) { - _file = file; + _file = file ?? throw new ArgumentNullException(nameof(file)); _perfmapFile = new PerfMapFile(_file.Stream); } diff --git a/src/Microsoft.SymbolStore/KeyGenerators/PortablePDBFileKeyGenerator.cs b/src/Microsoft.SymbolStore/KeyGenerators/PortablePDBFileKeyGenerator.cs index 7bc3536ed5..c11fb42b4e 100644 --- a/src/Microsoft.SymbolStore/KeyGenerators/PortablePDBFileKeyGenerator.cs +++ b/src/Microsoft.SymbolStore/KeyGenerators/PortablePDBFileKeyGenerator.cs @@ -16,7 +16,7 @@ public class PortablePDBFileKeyGenerator : KeyGenerator public PortablePDBFileKeyGenerator(ITracer tracer, SymbolStoreFile file) : base(tracer) { - _file = file; + _file = file ?? throw new ArgumentNullException(nameof(file)); } public override bool IsValid() @@ -56,7 +56,7 @@ public override IEnumerable GetKeys(KeyTypeFlags flags) else { // Force the Windows PDB index - key = PDBFileKeyGenerator.GetKey(_file.FileName, blob.Guid, 1); + key = PDBFileKeyGenerator.GetKey(_file.FileName, blob.Guid, age: 1); } } } diff --git a/src/Microsoft.SymbolStore/KeyGenerators/SourceFileKeyGenerator.cs b/src/Microsoft.SymbolStore/KeyGenerators/SourceFileKeyGenerator.cs index c9095b8ace..46fefb731a 100644 --- a/src/Microsoft.SymbolStore/KeyGenerators/SourceFileKeyGenerator.cs +++ b/src/Microsoft.SymbolStore/KeyGenerators/SourceFileKeyGenerator.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.Diagnostics; using System.Security.Cryptography; @@ -14,7 +15,7 @@ public class SourceFileKeyGenerator : KeyGenerator public SourceFileKeyGenerator(ITracer tracer, SymbolStoreFile file) : base(tracer) { - _file = file; + _file = file ?? throw new ArgumentNullException(nameof(file)); } public override bool IsValid() @@ -27,6 +28,7 @@ public override IEnumerable GetKeys(KeyTypeFlags flags) if ((flags & KeyTypeFlags.IdentityKey) != 0) { #pragma warning disable CA5350 // Do Not Use Weak Cryptographic Algorithms + // CodeQL [SM02196] SSQP protocol requires the use of SHA1 and this doesn't constitute a security boundary. byte[] hash = SHA1.Create().ComputeHash(_file.Stream); #pragma warning restore CA5350 // Do Not Use Weak Cryptographic Algorithms yield return GetKey(_file.FileName, hash); diff --git a/src/Microsoft.SymbolStore/Microsoft.SymbolStore.csproj b/src/Microsoft.SymbolStore/Microsoft.SymbolStore.csproj index 2f13376c6d..cd891449f7 100644 --- a/src/Microsoft.SymbolStore/Microsoft.SymbolStore.csproj +++ b/src/Microsoft.SymbolStore/Microsoft.SymbolStore.csproj @@ -15,10 +15,7 @@ - + diff --git a/src/Microsoft.SymbolStore/SymbolStoreFile.cs b/src/Microsoft.SymbolStore/SymbolStoreFile.cs index 3c6493d098..2e4f01e518 100644 --- a/src/Microsoft.SymbolStore/SymbolStoreFile.cs +++ b/src/Microsoft.SymbolStore/SymbolStoreFile.cs @@ -35,10 +35,14 @@ public sealed class SymbolStoreFile : IDisposable /// name of the file public SymbolStoreFile(Stream stream, string fileName) { - Debug.Assert(stream != null); - Debug.Assert(stream.CanSeek); - Debug.Assert(fileName != null); - + if (stream is null || !stream.CanSeek) + { + throw new ArgumentException("Stream null or not seekable", nameof(stream)); + } + if (fileName is null or "") + { + throw new ArgumentNullException(nameof(fileName)); + } Stream = stream; FileName = fileName; } diff --git a/src/Microsoft.SymbolStore/SymbolStoreKey.cs b/src/Microsoft.SymbolStore/SymbolStoreKey.cs index 8cb60f71ff..a7f57ff564 100644 --- a/src/Microsoft.SymbolStore/SymbolStoreKey.cs +++ b/src/Microsoft.SymbolStore/SymbolStoreKey.cs @@ -50,17 +50,17 @@ public sealed class SymbolStoreKey /// if true, the file is one the clr special files public SymbolStoreKey(string index, string fullPathName, bool clrSpecialFile = false, IEnumerable pdbChecksums = null) { - Debug.Assert(index != null && fullPathName != null); - Index = index; - FullPathName = fullPathName; + Index = index ?? throw new ArgumentNullException(nameof(index)); + FullPathName = fullPathName ?? throw new ArgumentNullException(nameof(fullPathName)); IsClrSpecialFile = clrSpecialFile; PdbChecksums = pdbChecksums ?? Enumerable.Empty(); } /// - /// Returns the first two parts of the index tuple. Allows a different file name + /// Returns the first two or three parts of the index. Allows a different file name /// to be appended to this symbol key. Includes the trailing "/". /// + [Obsolete] public string IndexPrefix { get { return Index.Substring(0, Index.LastIndexOf("/") + 1); } @@ -98,24 +98,28 @@ public override bool Equals(object obj) public static bool IsKeyValid(string index) { string[] parts = index.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); - if (parts.Length != 3) { + if (parts.Length < 3 || parts.Length > 4) + { return false; } - for (int i = 0; i < 3; i++) + for (int i = 0; i < parts.Length; i++) { foreach (char c in parts[i]) { - if (char.IsLetterOrDigit(c)) { + if (char.IsLetterOrDigit(c)) + { continue; } - if (!s_invalidChars.Contains(c)) { + if (!s_invalidChars.Contains(c)) + { continue; } return false; } // We need to support files with . in the name, but we don't want identifiers that // are meaningful to the filesystem - if (parts[i] == "." || parts[i] == "..") { + if (parts[i] == "." || parts[i] == "..") + { return false; } } diff --git a/src/Microsoft.SymbolStore/SymbolStores/HttpSymbolStore.cs b/src/Microsoft.SymbolStore/SymbolStores/HttpSymbolStore.cs index 9409babc98..5887261547 100644 --- a/src/Microsoft.SymbolStore/SymbolStores/HttpSymbolStore.cs +++ b/src/Microsoft.SymbolStore/SymbolStores/HttpSymbolStore.cs @@ -16,12 +16,12 @@ namespace Microsoft.SymbolStore.SymbolStores { /// - /// Basic http symbol store. The request can be authentication with a PAT for VSTS symbol stores. + /// Basic http symbol store. The request can be authentication with a PAT or bearer token. /// public class HttpSymbolStore : SymbolStore { private readonly HttpClient _client; - private readonly HttpClient _authenticatedClient; + private readonly Func> _authenticationFunc; private bool _clientFailure; /// @@ -41,10 +41,6 @@ public TimeSpan Timeout set { _client.Timeout = value; - if (_authenticatedClient != null) - { - _authenticatedClient.Timeout = value; - } } } @@ -59,36 +55,25 @@ public TimeSpan Timeout /// logger /// next symbol store or null /// symbol server url - /// flag to indicate to create an authenticatedClient if there is a PAT - private HttpSymbolStore(ITracer tracer, SymbolStore backingStore, Uri symbolServerUri, bool hasPAT) + /// function that returns the authentication value for a request + public HttpSymbolStore(ITracer tracer, SymbolStore backingStore, Uri symbolServerUri, Func> authenticationFunc) : base(tracer, backingStore) { Uri = symbolServerUri ?? throw new ArgumentNullException(nameof(symbolServerUri)); if (!symbolServerUri.IsAbsoluteUri || symbolServerUri.IsFile) { - throw new ArgumentException(nameof(symbolServerUri)); + throw new ArgumentException(null, nameof(symbolServerUri)); } + _authenticationFunc = authenticationFunc; - // Normal unauthenticated client + // Create client _client = new HttpClient { Timeout = TimeSpan.FromMinutes(4) }; - if (hasPAT) - { - HttpClientHandler handler = new() - { - AllowAutoRedirect = false - }; - HttpClient client = new(handler) - { - Timeout = TimeSpan.FromMinutes(4) - }; - client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - // Authorization is set in associated constructors. - _authenticatedClient = client; - } + // Force redirect logins to fail. + _client.DefaultRequestHeaders.Add("X-TFS-FedAuthRedirect", "Suppress"); } /// @@ -97,15 +82,10 @@ private HttpSymbolStore(ITracer tracer, SymbolStore backingStore, Uri symbolServ /// logger /// next symbol store or null /// symbol server url - /// optional Basic Auth PAT or null if no authentication - public HttpSymbolStore(ITracer tracer, SymbolStore backingStore, Uri symbolServerUri, string personalAccessToken = null) - : this(tracer, backingStore, symbolServerUri, !string.IsNullOrEmpty(personalAccessToken)) + /// optional Basic Auth PAT or null if no authentication + public HttpSymbolStore(ITracer tracer, SymbolStore backingStore, Uri symbolServerUri, string accessToken = null) + : this(tracer, backingStore, symbolServerUri, string.IsNullOrEmpty(accessToken) ? null : GetAuthenticationFunc("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes($":{accessToken}")))) { - // If PAT, create authenticated client with Basic Auth - if (!string.IsNullOrEmpty(personalAccessToken)) - { - _authenticatedClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "", personalAccessToken)))); - } } /// @@ -117,22 +97,22 @@ public HttpSymbolStore(ITracer tracer, SymbolStore backingStore, Uri symbolServe /// The scheme information to use for the AuthenticationHeaderValue /// The parameter information to use for the AuthenticationHeaderValue public HttpSymbolStore(ITracer tracer, SymbolStore backingStore, Uri symbolServerUri, string scheme, string parameter) - : this(tracer, backingStore, symbolServerUri, true) + : this(tracer, backingStore, symbolServerUri, GetAuthenticationFunc(scheme, parameter)) { if (string.IsNullOrEmpty(scheme)) { throw new ArgumentNullException(nameof(scheme)); } - if (string.IsNullOrEmpty(parameter)) { throw new ArgumentNullException(nameof(parameter)); } + } - // Create authenticated header with given SymbolAuthHeader - _authenticatedClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(scheme, parameter); - // Force redirect logins to fail. - _authenticatedClient.DefaultRequestHeaders.Add("X-TFS-FedAuthRedirect", "Suppress"); + private static Func> GetAuthenticationFunc(string scheme, string parameter) + { + AuthenticationHeaderValue authenticationValue = new(scheme, parameter); + return (_) => new ValueTask(authenticationValue); } /// @@ -149,13 +129,11 @@ protected override async Task GetFileInner(SymbolStoreKey key, Uri uri = GetRequestUri(key.Index); bool needsChecksumMatch = key.PdbChecksums.Any(); - if (needsChecksumMatch) { string checksumHeader = string.Join(";", key.PdbChecksums); - HttpClient client = _authenticatedClient ?? _client; Tracer.Information($"SymbolChecksum: {checksumHeader}"); - client.DefaultRequestHeaders.Add("SymbolChecksum", checksumHeader); + _client.DefaultRequestHeaders.Add("SymbolChecksum", checksumHeader); } Stream stream = await GetFileStream(key.FullPathName, uri, token).ConfigureAwait(false); @@ -193,7 +171,6 @@ protected async Task GetFileStream(string path, Uri requestUri, Cancella return null; } string fileName = Path.GetFileName(path); - HttpClient client = _authenticatedClient ?? _client; int retries = 0; while (true) { @@ -203,25 +180,19 @@ protected async Task GetFileStream(string path, Uri requestUri, Cancella { // Can not dispose the response (like via using) on success because then the content stream // is disposed and it is returned by this function. - HttpResponseMessage response = await client.GetAsync(requestUri, token).ConfigureAwait(false); - if (response.StatusCode == HttpStatusCode.OK) + using HttpRequestMessage request = new(HttpMethod.Get, requestUri); + if (_authenticationFunc is not null) { - return await response.Content.ReadAsStreamAsync().ConfigureAwait(false); + request.Headers.Authorization = await _authenticationFunc(token).ConfigureAwait(false); } - if (response.StatusCode == HttpStatusCode.Found) + using HttpResponseMessage response = await _client.SendAsync(request, token).ConfigureAwait(false); + if (response.StatusCode == HttpStatusCode.OK) { - Uri location = response.Headers.Location; - response.Dispose(); - - response = await _client.GetAsync(location, token).ConfigureAwait(false); - if (response.StatusCode == HttpStatusCode.OK) - { - return await response.Content.ReadAsStreamAsync().ConfigureAwait(false); - } + byte[] buffer = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); + return new MemoryStream(buffer); } HttpStatusCode statusCode = response.StatusCode; string reasonPhrase = response.ReasonPhrase; - response.Dispose(); // The GET failed @@ -287,7 +258,6 @@ protected async Task GetFileStream(string path, Uri requestUri, Cancella public override void Dispose() { _client.Dispose(); - _authenticatedClient?.Dispose(); base.Dispose(); } diff --git a/src/SOS/CMakeLists.txt b/src/SOS/CMakeLists.txt index ec58ca3239..e1de7aff33 100644 --- a/src/SOS/CMakeLists.txt +++ b/src/SOS/CMakeLists.txt @@ -1,3 +1,5 @@ +include(${CLR_SHARED_DIR}/shared.cmake) + if(CLR_CMAKE_HOST_UNIX) add_subdirectory(lldbplugin) endif(CLR_CMAKE_HOST_UNIX) @@ -9,23 +11,18 @@ if(CLR_CMAKE_HOST_WIN32) message(STATUS "VSInstallDir: $ENV{VSInstallDir}") include_directories("$ENV{VSInstallDir}/DIA SDK/include") - add_compile_options(/FIWarningControl.h) # force include of WarningControl.h add_compile_options(/Zl) # omit default library name in .OBJ add_subdirectory(runcommand) - if(NOT CLR_CMAKE_TARGET_ARCH_ARM64 AND NOT CLR_CMAKE_TARGET_ARCH_ARM) + if(NOT CLR_CMAKE_TARGET_ARCH_ARM) add_subdirectory(SOS.UnitTests/Debuggees/DesktopClrHost) - endif(NOT CLR_CMAKE_TARGET_ARCH_ARM64 AND NOT CLR_CMAKE_TARGET_ARCH_ARM) + endif(NOT CLR_CMAKE_TARGET_ARCH_ARM) endif(CLR_CMAKE_HOST_WIN32) -add_definitions(-D_SECURE_SCL=0) - add_compile_definitions(STRESS_LOG_ANALYZER) add_compile_definitions(DACCESS_COMPILE) - -if (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT CLR_CMAKE_TARGET_WIN32) - add_compile_definitions($<$>>:FEATURE_EH_FUNCLETS>) -endif (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT CLR_CMAKE_TARGET_WIN32) +add_compile_definitions(SOS_INCLUDE) +add_compile_definitions(DISABLE_CONTRACTS) add_subdirectory(extensions) add_subdirectory(SOS.Extensions) diff --git a/src/SOS/SOS.Extensions/Clrma/ClrmaServiceWrapper.cs b/src/SOS/SOS.Extensions/Clrma/ClrmaServiceWrapper.cs new file mode 100644 index 0000000000..dc47872586 --- /dev/null +++ b/src/SOS/SOS.Extensions/Clrma/ClrmaServiceWrapper.cs @@ -0,0 +1,137 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using Microsoft.Diagnostics.DebugServices; +using Microsoft.Diagnostics.Runtime.Utilities; +using SOS.Hosting; +using SOS.Hosting.DbgEng.Interop; + +namespace SOS.Extensions.Clrma +{ + public sealed class ClrmaServiceWrapper : COMCallableIUnknown + { + public static readonly Guid IID_ICLRMAService = new("1FCF4C14-60C1-44E6-84ED-20506EF3DC60"); + + public const int E_BOUNDS = unchecked((int)0x8000000B); + public const uint DEBUG_ANY_ID = uint.MaxValue; + + private readonly IServiceProvider _serviceProvider; + private readonly ServiceWrapper _serviceWrapper; + private ICrashInfoService _crashInfoService; + + public ClrmaServiceWrapper(ITarget target, IServiceProvider serviceProvider, ServiceWrapper serviceWrapper) + { + _serviceProvider = serviceProvider; + _serviceWrapper = serviceWrapper; + + target.OnFlushEvent.Register(() => _crashInfoService = null); + + VTableBuilder builder = AddInterface(IID_ICLRMAService, validate: false); + builder.AddMethod(new AssociateClientDelegate(AssociateClient)); + builder.AddMethod(new GetThreadDelegate(GetThread)); + builder.AddMethod(new GetExceptionDelegate(GetException)); + builder.AddMethod(new GetObjectInspectionDelegate(GetObjectInspection)); + builder.Complete(); + // Since this wrapper is only created through a ServiceWrapper factory, no AddRef() is needed. + } + + protected override void Destroy() + { + Trace.TraceInformation("ClrmaServiceWrapper.Destroy"); + _serviceWrapper.RemoveServiceWrapper(ClrmaServiceWrapper.IID_ICLRMAService); + _crashInfoService = null; + } + + private int AssociateClient( + IntPtr self, + IntPtr punk) + { + // If the crash info service doesn't exist, then tell Watson/CLRMA to go on to the next provider + return CrashInfoService is null ? HResult.E_NOINTERFACE : HResult.S_OK; + } + + private int GetThread( + IntPtr self, + uint osThreadId, + out IntPtr clrmaClrThread) + { + clrmaClrThread = IntPtr.Zero; + if (CrashInfoService is null) + { + return HResult.E_FAIL; + } + IThread thread = ThreadService?.GetThreadFromId(osThreadId); + if (thread is null) + { + return HResult.E_INVALIDARG; + } + ThreadWrapper threadWrapper = new(CrashInfoService, thread); + clrmaClrThread = threadWrapper.ICLRMACClrThread; + return HResult.S_OK; + } + + private int GetException( + IntPtr self, + ulong address, + out IntPtr clrmaClrException) + { + clrmaClrException = IntPtr.Zero; + IException exception = null; + try + { + exception = CrashInfoService?.GetException(address); + } + catch (ArgumentOutOfRangeException) + { + } + if (exception is null) + { + return HResult.E_INVALIDARG; + } + ExceptionWrapper exceptionWrapper = new(exception); + clrmaClrException = exceptionWrapper.ICLRMACClrException; + return HResult.S_OK; + } + + private int GetObjectInspection( + IntPtr self, + out IntPtr clrmaObjectInspection) + { + clrmaObjectInspection = IntPtr.Zero; + return HResult.E_NOTIMPL; + } + + private ICrashInfoService CrashInfoService => _crashInfoService ??= _serviceProvider.GetService(); + + private IThreadService ThreadService => _serviceProvider.GetService(); + + #region ICLRMAService delegates + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + private delegate int AssociateClientDelegate( + [In] IntPtr self, + [In] IntPtr punk); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + private delegate int GetThreadDelegate( + [In] IntPtr self, + [In] uint osThreadId, + [Out] out IntPtr clrmaClrThread); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + private delegate int GetExceptionDelegate( + [In] IntPtr self, + [In] ulong address, + [Out] out IntPtr clrmaClrException); + + [UnmanagedFunctionPointer(CallingConvention.Winapi)] + private delegate int GetObjectInspectionDelegate( + [In] IntPtr self, + [Out] out IntPtr objectInspection); + + #endregion + } +} diff --git a/src/SOS/SOS.Extensions/Clrma/ExceptionWrapper.cs b/src/SOS/SOS.Extensions/Clrma/ExceptionWrapper.cs index 7380306a69..c3b4eb4bd7 100644 --- a/src/SOS/SOS.Extensions/Clrma/ExceptionWrapper.cs +++ b/src/SOS/SOS.Extensions/Clrma/ExceptionWrapper.cs @@ -114,7 +114,7 @@ private int Frame( } catch (ArgumentOutOfRangeException) { - return ManagedAnalysisWrapper.E_BOUNDS; + return ClrmaServiceWrapper.E_BOUNDS; } ip = frame.InstructionPointer; sp = frame.StackPointer; @@ -140,7 +140,7 @@ private int InnerException( clrmaClrException = IntPtr.Zero; if (index >= InnerExceptions.Length) { - return ManagedAnalysisWrapper.E_BOUNDS; + return ClrmaServiceWrapper.E_BOUNDS; } ExceptionWrapper exception = InnerExceptions[index]; exception.AddRef(); diff --git a/src/SOS/SOS.Extensions/Clrma/ManagedAnalysisWrapper.cs b/src/SOS/SOS.Extensions/Clrma/ManagedAnalysisWrapper.cs deleted file mode 100644 index 9e4fb309aa..0000000000 --- a/src/SOS/SOS.Extensions/Clrma/ManagedAnalysisWrapper.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; -using Microsoft.Diagnostics.DebugServices; -using Microsoft.Diagnostics.Runtime.Utilities; -using SOS.Hosting; -using SOS.Hosting.DbgEng.Interop; - -namespace SOS.Extensions.Clrma -{ - public sealed class ManagedAnalysisWrapper : COMCallableIUnknown - { - public static readonly Guid IID_ICLRManagedAnalysis = new("8CA73A16-C017-4c8f-AD51-B758727478CA"); - - public const int E_BOUNDS = unchecked((int)0x8000000B); - public const uint DEBUG_ANY_ID = uint.MaxValue; - - private readonly IServiceProvider _serviceProvider; - private readonly ServiceWrapper _serviceWrapper; - private ICrashInfoService _crashInfoService; - private IDebugClient _debugClient; - private ThreadWrapper _thread; - private ExceptionWrapper _exception; - - public ManagedAnalysisWrapper(ITarget target, IServiceProvider serviceProvider, ServiceWrapper serviceWrapper) - { - _serviceProvider = serviceProvider; - _serviceWrapper = serviceWrapper; - - target.OnFlushEvent.Register(Flush); - - VTableBuilder builder = AddInterface(IID_ICLRManagedAnalysis, validate: false); - builder.AddMethod(new GetProviderNameDelegate(GetProviderName)); - builder.AddMethod(new AssociateClientDelegate(AssociateClient)); - builder.AddMethod(new GetThreadDelegate(GetThread)); - builder.AddMethod(new GetExceptionDelegate(GetException)); - builder.AddMethod(new ObjectInspectionDelegate(ObjectInspection)); - builder.Complete(); - // Since this wrapper is only created through a ServiceWrapper factory, no AddRef() is needed. - } - - protected override void Destroy() - { - Trace.TraceInformation("ManagedAnalysisWrapper.Destroy"); - _serviceWrapper.RemoveServiceWrapper(ManagedAnalysisWrapper.IID_ICLRManagedAnalysis); - Flush(); - } - - private void Flush() - { - _crashInfoService = null; - FlushDebugClient(); - FlushThread(); - FlushException(); - } - - private void FlushDebugClient() - { - if (_debugClient != null) - { - int count = Marshal.ReleaseComObject(_debugClient); - Debug.Assert(count >= 0); - _debugClient = null; - } - } - - private void FlushThread() - { - _thread?.ReleaseWithCheck(); - _thread = null; - } - - private void FlushException() - { - _exception?.ReleaseWithCheck(); - _exception = null; - } - - private int GetProviderName( - IntPtr self, - out string provider) - { - provider = "SOSCLRMA"; - return HResult.S_OK; - } - - private int AssociateClient( - IntPtr self, - IntPtr punk) - { - // If the crash info service doesn't exist, then tell Watson/CLRMA to go on to the next provider - if (CrashInfoService is null) - { - return HResult.E_NOINTERFACE; - } - FlushDebugClient(); - _debugClient = Marshal.GetObjectForIUnknown(punk) as IDebugClient; - if (_debugClient == null) - { - return HResult.E_NOINTERFACE; - } - // We don't currently need the IDebugClient instance passed this this function. - return HResult.S_OK; - } - - private int GetThread( - IntPtr self, - uint osThreadId, - out IntPtr clrmaClrThread) - { - clrmaClrThread = IntPtr.Zero; - if (CrashInfoService is null) - { - return HResult.E_FAIL; - } - // osThreadId == 0 is current thread and -1 is "last event thread". The only thread - // information we have currently is the crashing thread id so always return it. - if (osThreadId == 0) - { - HResult hr = ((IDebugSystemObjects)_debugClient).GetCurrentThreadSystemId(out osThreadId); - if (!hr.IsOK) - { - return hr; - } - } - else if (osThreadId == uint.MaxValue) - { - HResult hr = ((IDebugControl)_debugClient).GetLastEventInformation( - out DEBUG_EVENT _, - out uint _, - out uint threadIndex, - IntPtr.Zero, - 0, - out uint _, - null, - 0, - out uint _); - - if (!hr.IsOK) - { - return hr; - } - if (threadIndex == DEBUG_ANY_ID) - { - return HResult.E_INVALIDARG; - } - uint[] ids = new uint[1]; - uint[] sysIds = new uint[1]; - hr = ((IDebugSystemObjects)_debugClient).GetThreadIdsByIndex(threadIndex, 1, ids, sysIds); - if (!hr.IsOK) - { - return hr; - } - osThreadId = sysIds[0]; - } - if (_thread is null || _thread.ThreadId != osThreadId) - { - IThread thread = ThreadService?.GetThreadFromId(osThreadId); - if (thread is null) - { - return HResult.E_INVALIDARG; - } - FlushThread(); - _thread = new ThreadWrapper(CrashInfoService, thread); - } - _thread.AddRef(); - clrmaClrThread = _thread.ICLRMACClrThread; - return HResult.S_OK; - } - - private int GetException( - IntPtr self, - ulong address, - out IntPtr clrmaClrException) - { - clrmaClrException = IntPtr.Zero; - if (_exception is null || _exception.Exception.Address != address) - { - IException exception = null; - try - { - exception = CrashInfoService?.GetException(address); - } - catch (ArgumentOutOfRangeException) - { - } - if (exception is null) - { - return HResult.E_INVALIDARG; - } - FlushException(); - _exception = new ExceptionWrapper(exception); - } - _exception.AddRef(); - clrmaClrException = _exception.ICLRMACClrException; - return HResult.S_OK; - } - - private int ObjectInspection( - IntPtr self, - out IntPtr clrmaObjectInspection) - { - clrmaObjectInspection = IntPtr.Zero; - return HResult.E_NOTIMPL; - } - - private ICrashInfoService CrashInfoService => _crashInfoService ??= _serviceProvider.GetService(); - - private IThreadService ThreadService => _serviceProvider.GetService(); - - #region ICLRManagedAnalysis delegates - - [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate int GetProviderNameDelegate( - [In] IntPtr self, - [Out, MarshalAs(UnmanagedType.BStr)] out string provider); - - [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate int AssociateClientDelegate( - [In] IntPtr self, - [In] IntPtr punk); - - [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate int GetThreadDelegate( - [In] IntPtr self, - [In] uint osThreadId, - [Out] out IntPtr clrmaClrThread); - - [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate int GetExceptionDelegate( - [In] IntPtr self, - [In] ulong address, - [Out] out IntPtr clrmaClrException); - - [UnmanagedFunctionPointer(CallingConvention.Winapi)] - private delegate int ObjectInspectionDelegate( - [In] IntPtr self, - [Out] out IntPtr objectInspection); - - #endregion - } -} diff --git a/src/SOS/SOS.Extensions/Clrma/ThreadWrapper.cs b/src/SOS/SOS.Extensions/Clrma/ThreadWrapper.cs index 5c797ea201..cbfd2b1ed8 100644 --- a/src/SOS/SOS.Extensions/Clrma/ThreadWrapper.cs +++ b/src/SOS/SOS.Extensions/Clrma/ThreadWrapper.cs @@ -133,7 +133,7 @@ private int NestedException( clrmaClrException = IntPtr.Zero; if (index >= NestedExceptions.Length) { - return ManagedAnalysisWrapper.E_BOUNDS; + return ClrmaServiceWrapper.E_BOUNDS; } ExceptionWrapper exception = NestedExceptions[index]; exception.AddRef(); diff --git a/src/SOS/SOS.Extensions/DbgEngOutputHolder.cs b/src/SOS/SOS.Extensions/DbgEngOutputHolder.cs deleted file mode 100644 index 2963a766f9..0000000000 --- a/src/SOS/SOS.Extensions/DbgEngOutputHolder.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -using Microsoft.Diagnostics.Runtime.Utilities; -using SOS.Hosting.DbgEng.Interop; - -namespace SOS.Extensions -{ - /// - /// A helper class to capture output of DbgEng commands that will restore the previous output callbacks - /// when disposed. - /// - internal sealed class DbgEngOutputHolder : IDebugOutputCallbacksWide, IDisposable - { - private readonly IDebugClient5 _client; - private readonly IDebugOutputCallbacksWide _previous; - - public DEBUG_OUTPUT InterestMask { get; set; } - - /// - /// Event fired when we receive output from the debugger. - /// - public Action OutputReceived; - - public DbgEngOutputHolder(IDebugClient5 client, DEBUG_OUTPUT interestMask = DEBUG_OUTPUT.NORMAL) - { - _client = client; - InterestMask = interestMask; - - _client.GetOutputCallbacksWide(out _previous); - HResult hr = _client.SetOutputCallbacksWide(this); - if (!hr) - { - throw Marshal.GetExceptionForHR(hr); - } - } - - public void Dispose() - { - if (_previous is not null) - { - _client.SetOutputCallbacksWide(_previous); - } - } - - public int Output(DEBUG_OUTPUT Mask, [In, MarshalAs(UnmanagedType.LPStr)] string Text) - { - if ((InterestMask & Mask) != 0 && Text is not null) - { - OutputReceived?.Invoke(Mask, Text); - } - - return 0; - } - } -} diff --git a/src/SOS/SOS.Extensions/DebuggerServices.cs b/src/SOS/SOS.Extensions/DebuggerServices.cs index 9f4fe231f1..82cb8872dd 100644 --- a/src/SOS/SOS.Extensions/DebuggerServices.cs +++ b/src/SOS/SOS.Extensions/DebuggerServices.cs @@ -3,12 +3,14 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; using Microsoft.Diagnostics.DebugServices; +using Microsoft.Diagnostics.DebugServices.Implementation; using Microsoft.Diagnostics.Runtime; using Microsoft.Diagnostics.Runtime.Utilities; using SOS.Hosting; @@ -80,9 +82,9 @@ public HResult GetDebuggeeType(out DEBUG_CLASS debugClass, out DEBUG_CLASS_QUALI return VTable.GetDebuggeeType(Self, out debugClass, out qualifier); } - public HResult GetExecutingProcessorType(out IMAGE_FILE_MACHINE type) + public HResult GetProcessorType(out IMAGE_FILE_MACHINE type) { - return VTable.GetExecutingProcessorType(Self, out type); + return VTable.GetProcessorType(Self, out type); } public HResult AddCommand(string command, string help, IEnumerable aliases) @@ -478,20 +480,56 @@ public HResult GetLastException(out uint processId, out int threadId, out EXCEPT return hr; } + public void FlushCheck() + { + VTable.FlushCheck(Self); + } + + public IReadOnlyList ExecuteHostCommand(string commandLine, DEBUG_OUTPUT interestMask = DEBUG_OUTPUT.NORMAL) + { + CaptureConsoleService console = new(); + ExecuteHostCommand(commandLine, (DEBUG_OUTPUT mask, string text) => + { + if ((mask & interestMask) != 0) + { + console.Write(text); + } + }); + return console.OutputLines; + } + + public delegate void ExecuteHostCommandCallback(DEBUG_OUTPUT mask, string text); + + public void ExecuteHostCommand(string commandLine, ExecuteHostCommandCallback outputCallback) + { + IntPtr callbackPtr = Marshal.GetFunctionPointerForDelegate(outputCallback); + byte[] commandLineBytes = Encoding.ASCII.GetBytes(commandLine + "\0"); + fixed (byte* ptr = commandLineBytes) + { + HResult hr = VTable.ExecuteHostCommand(Self, ptr, callbackPtr); + if (!hr.IsOK) + { + throw new DiagnosticsException($"{commandLine} FAILED {hr}"); + } + } + } + [StructLayout(LayoutKind.Sequential)] private readonly unsafe struct IDebuggerServicesVTable { public readonly delegate* unmanaged[Stdcall] GetOperatingSystem; public readonly delegate* unmanaged[Stdcall] GetDebuggeeType; - public readonly delegate* unmanaged[Stdcall] GetExecutingProcessorType; + public readonly delegate* unmanaged[Stdcall] GetProcessorType; public readonly delegate* unmanaged[Stdcall] AddCommand; public readonly delegate* unmanaged[Stdcall] OutputString; public readonly delegate* unmanaged[Stdcall] ReadVirtual; public readonly delegate* unmanaged[Stdcall] WriteVirtual; public readonly delegate* unmanaged[Stdcall] GetNumberModules; + public readonly delegate* unmanaged[Stdcall] GetModuleByIndex; public readonly delegate* unmanaged[Stdcall] GetModuleNames; public readonly delegate* unmanaged[Stdcall] GetModuleInfo; public readonly delegate* unmanaged[Stdcall] GetModuleVersionInformation; + public readonly delegate* unmanaged[Stdcall] GetModuleByModuleName; public readonly delegate* unmanaged[Stdcall] GetNumberThreads; public readonly delegate* unmanaged[Stdcall] GetThreadIdsByIndex; public readonly delegate* unmanaged[Stdcall] GetThreadContextBySystemId; @@ -510,6 +548,8 @@ private readonly unsafe struct IDebuggerServicesVTable public readonly delegate* unmanaged[Stdcall] OutputDmlString; public readonly delegate* unmanaged[Stdcall] AddModuleSymbol; public readonly delegate* unmanaged[Stdcall] GetLastEventInformation; + public readonly delegate* unmanaged[Stdcall] FlushCheck; + public readonly delegate* unmanaged[Stdcall] ExecuteHostCommand; } } } diff --git a/src/SOS/SOS.Extensions/HostServices.cs b/src/SOS/SOS.Extensions/HostServices.cs index 65b57c1fc0..ebba6687c2 100644 --- a/src/SOS/SOS.Extensions/HostServices.cs +++ b/src/SOS/SOS.Extensions/HostServices.cs @@ -3,10 +3,12 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.InteropServices; +using System.Text; using Microsoft.Diagnostics.DebugServices; using Microsoft.Diagnostics.DebugServices.Implementation; using Microsoft.Diagnostics.ExtensionCommands; @@ -145,6 +147,10 @@ protected override void Destroy() _hostWrapper.ReleaseWithCheck(); } + public IReadOnlyList ExecuteCommand(string commandLine) => _commandService.ExecuteAndCapture(commandLine, _contextService.Services); + + public IReadOnlyList ExecuteHostCommand(string commandLine) => DebuggerServices.ExecuteHostCommand(commandLine, DEBUG_OUTPUT.NORMAL | DEBUG_OUTPUT.ERROR); + #region IHost public IServiceEvent OnShutdownEvent { get; } = new ServiceEvent(); diff --git a/src/SOS/SOS.Extensions/MemoryRegionServiceFromDebuggerServices.cs b/src/SOS/SOS.Extensions/MemoryRegionServiceFromDebuggerServices.cs index 403bcbc879..87fdce32aa 100644 --- a/src/SOS/SOS.Extensions/MemoryRegionServiceFromDebuggerServices.cs +++ b/src/SOS/SOS.Extensions/MemoryRegionServiceFromDebuggerServices.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; using System.Text; using Microsoft.Diagnostics.DebugServices; @@ -12,13 +13,12 @@ namespace SOS.Extensions { internal sealed class MemoryRegionServiceFromDebuggerServices : IMemoryRegionService { - private readonly IDebugClient5 _client; - private readonly IDebugControl5 _control; + private const string AddressCommand = "!address"; + private readonly DebuggerServices _debuggerServices; - public MemoryRegionServiceFromDebuggerServices(IDebugClient5 client) + public MemoryRegionServiceFromDebuggerServices(DebuggerServices debuggerServices) { - _client = client; - _control = (IDebugControl5)client; + _debuggerServices = debuggerServices; } public IEnumerable EnumerateRegions() @@ -26,13 +26,8 @@ public IEnumerable EnumerateRegions() bool foundHeader = false; bool skipped = false; - (int hr, string text) = RunCommandWithOutput("!address"); - if (hr < 0) - { - throw new InvalidOperationException($"!address failed with hresult={hr:x}"); - } - - foreach (string line in text.Split('\n')) + IReadOnlyList lines = _debuggerServices.ExecuteHostCommand(AddressCommand); + foreach (string line in lines) { if (line.Length == 0) { @@ -134,7 +129,6 @@ public IEnumerable EnumerateRegions() if (type == MemoryRegionType.MEM_IMAGE && index < parts.Length) { image = parts[index].Substring(1, parts[index].Length - 2); - index++; } if (description.Equals("", StringComparison.OrdinalIgnoreCase)) @@ -195,7 +189,7 @@ public IEnumerable EnumerateRegions() if (!foundHeader) { - throw new InvalidOperationException($"!address did not produce a standard header.\nThis may mean symbols could not be resolved for ntdll.\nPlease run !address and make sure the output looks correct."); + throw new InvalidOperationException($"{AddressCommand} did not produce a standard header.\nThis may mean symbols could not be resolved for ntdll.\nPlease run {AddressCommand} and make sure the output looks correct."); } } @@ -211,17 +205,6 @@ private static bool GetEnumValue(string[] parts, int index, out T type) return false; } - private (int hresult, string output) RunCommandWithOutput(string command) - { - using DbgEngOutputHolder dbgengOutput = new(_client); - StringBuilder sb = new(1024); - dbgengOutput.OutputReceived += (mask, text) => sb.Append(text); - - int hr = _control.ExecuteWide(DEBUG_OUTCTL.THIS_CLIENT, command, DEBUG_EXECUTE.DEFAULT); - - return (hr, sb.ToString()); - } - private sealed class AddressMemoryRange : IMemoryRegion { public ulong Start { get; internal set; } diff --git a/src/SOS/SOS.Extensions/TargetFromFromDebuggerServices.cs b/src/SOS/SOS.Extensions/TargetFromFromDebuggerServices.cs index fd4a8648c4..13fc5cd324 100644 --- a/src/SOS/SOS.Extensions/TargetFromFromDebuggerServices.cs +++ b/src/SOS/SOS.Extensions/TargetFromFromDebuggerServices.cs @@ -44,24 +44,26 @@ internal TargetFromDebuggerServices(DebuggerServices debuggerServices, IHost hos IsDump = true; } - hr = debuggerServices.GetExecutingProcessorType(out IMAGE_FILE_MACHINE type); + hr = debuggerServices.GetProcessorType(out IMAGE_FILE_MACHINE type); if (hr == HResult.S_OK) { + Debug.Assert(type is not IMAGE_FILE_MACHINE.ARM64X and not IMAGE_FILE_MACHINE.ARM64EC); Architecture = type switch { IMAGE_FILE_MACHINE.I386 => Architecture.X86, IMAGE_FILE_MACHINE.ARM => Architecture.Arm, IMAGE_FILE_MACHINE.THUMB => Architecture.Arm, - IMAGE_FILE_MACHINE.THUMB2 => Architecture.Arm, + IMAGE_FILE_MACHINE.ARMNT => Architecture.Arm, IMAGE_FILE_MACHINE.AMD64 => Architecture.X64, IMAGE_FILE_MACHINE.ARM64 => Architecture.Arm64, + IMAGE_FILE_MACHINE.LOONGARCH64 => (Architecture)6 /* Architecture.LoongArch64 */, IMAGE_FILE_MACHINE.RISCV64 => (Architecture)9 /* Architecture.RiscV64 */, _ => throw new PlatformNotSupportedException($"Machine type not supported: {type}"), }; } else { - throw new PlatformNotSupportedException($"GetExecutingProcessorType() FAILED {hr:X8}"); + throw new PlatformNotSupportedException($"GetProcessorType() FAILED {hr:X8}"); } hr = debuggerServices.GetCurrentProcessId(out uint processId); @@ -101,15 +103,15 @@ internal TargetFromDebuggerServices(DebuggerServices debuggerServices, IHost hos _serviceContainerFactory.AddServiceFactory((services) => CreateCrashInfoService(services, debuggerServices)); OnFlushEvent.Register(() => FlushService()); - if (debuggerServices.DebugClient is not null) + if (Host.HostType == HostType.DbgEng) { - _serviceContainerFactory.AddServiceFactory((services) => new MemoryRegionServiceFromDebuggerServices(debuggerServices.DebugClient)); + _serviceContainerFactory.AddServiceFactory((services) => new MemoryRegionServiceFromDebuggerServices(debuggerServices)); } Finished(); TargetWrapper targetWrapper = Services.GetService(); - targetWrapper?.ServiceWrapper.AddServiceWrapper(ManagedAnalysisWrapper.IID_ICLRManagedAnalysis, () => new ManagedAnalysisWrapper(this, Services, targetWrapper.ServiceWrapper)); + targetWrapper?.ServiceWrapper.AddServiceWrapper(ClrmaServiceWrapper.IID_ICLRMAService, () => new ClrmaServiceWrapper(this, Services, targetWrapper.ServiceWrapper)); } private unsafe ICrashInfoService CreateCrashInfoService(IServiceProvider services, DebuggerServices debuggerServices) diff --git a/src/SOS/SOS.Hosting/CorDebugDataTargetWrapper.cs b/src/SOS/SOS.Hosting/CorDebugDataTargetWrapper.cs index c46e8f1591..a58f59211f 100644 --- a/src/SOS/SOS.Hosting/CorDebugDataTargetWrapper.cs +++ b/src/SOS/SOS.Hosting/CorDebugDataTargetWrapper.cs @@ -107,6 +107,9 @@ private int GetPlatform( case Architecture.Arm64: platform = CorDebugPlatform.CORDB_PLATFORM_POSIX_ARM64; break; + case (Architecture)6 /* Architecture.LoongArch64 */: + platform = CorDebugPlatform.CORDB_PLATFORM_POSIX_LOONGARCH64; + break; case (Architecture)9 /* Architecture.RiscV64 */: platform = CorDebugPlatform.CORDB_PLATFORM_POSIX_RISCV64; break; diff --git a/src/SOS/SOS.Hosting/DataTargetWrapper.cs b/src/SOS/SOS.Hosting/DataTargetWrapper.cs index f61cbd4310..659835540f 100644 --- a/src/SOS/SOS.Hosting/DataTargetWrapper.cs +++ b/src/SOS/SOS.Hosting/DataTargetWrapper.cs @@ -110,8 +110,9 @@ private int GetMachineType( { Architecture.X64 => IMAGE_FILE_MACHINE.AMD64, Architecture.X86 => IMAGE_FILE_MACHINE.I386, - Architecture.Arm => IMAGE_FILE_MACHINE.THUMB2, + Architecture.Arm => IMAGE_FILE_MACHINE.ARMNT, Architecture.Arm64 => IMAGE_FILE_MACHINE.ARM64, + (Architecture)6 /* Architecture.LoongArch64 */ => IMAGE_FILE_MACHINE.LOONGARCH64, (Architecture)9 /* Architecture.RiscV64 */ => IMAGE_FILE_MACHINE.RISCV64, _ => IMAGE_FILE_MACHINE.UNKNOWN, }; diff --git a/src/SOS/SOS.Hosting/DbgEng/DebugControl.cs b/src/SOS/SOS.Hosting/DbgEng/DebugControl.cs index 50e0966688..097e8c1ac7 100644 --- a/src/SOS/SOS.Hosting/DbgEng/DebugControl.cs +++ b/src/SOS/SOS.Hosting/DbgEng/DebugControl.cs @@ -56,7 +56,7 @@ private static void AddDebugControl(VTableBuilder builder, SOSHost soshost) builder.AddMethod(new GetReturnOffsetDelegate((self, offset) => DebugClient.NotImplemented)); builder.AddMethod(new OutputStackTraceDelegate((self, outputControl, frames, frameSize, flags) => DebugClient.NotImplemented)); builder.AddMethod(new GetDebuggeeTypeDelegate(soshost.GetDebuggeeType)); - builder.AddMethod(new GetActualProcessorTypeDelegate((self, type) => DebugClient.NotImplemented)); + builder.AddMethod(new GetActualProcessorTypeDelegate(soshost.GetExecutingProcessorType)); builder.AddMethod(new GetExecutingProcessorTypeDelegate(soshost.GetExecutingProcessorType)); builder.AddMethod(new GetNumberPossibleExecutingProcessorTypesDelegate((self, number) => DebugClient.NotImplemented)); builder.AddMethod(new GetPossibleExecutingProcessorTypesDelegate((self, start, count, types) => DebugClient.NotImplemented)); diff --git a/src/SOS/SOS.Hosting/DbgEng/Interop/Enums/ImageFileMachine.cs b/src/SOS/SOS.Hosting/DbgEng/Interop/Enums/ImageFileMachine.cs index cb9ed62a24..a8524a388f 100644 --- a/src/SOS/SOS.Hosting/DbgEng/Interop/Enums/ImageFileMachine.cs +++ b/src/SOS/SOS.Hosting/DbgEng/Interop/Enums/ImageFileMachine.cs @@ -6,36 +6,39 @@ namespace SOS.Hosting.DbgEng.Interop public enum IMAGE_FILE_MACHINE : uint { UNKNOWN = 0, - I386 = 0x014c, // Intel 386. - R3000 = 0x0162, // MIPS little-endian, 0x160 big-endian - R4000 = 0x0166, // MIPS little-endian - R10000 = 0x0168, // MIPS little-endian + I386 = 0x014c, // Intel 386. + R3000 = 0x0162, // MIPS little-endian, 0x160 big-endian + R4000 = 0x0166, // MIPS little-endian + R10000 = 0x0168, // MIPS little-endian WCEMIPSV2 = 0x0169, // MIPS little-endian WCE v2 - ALPHA = 0x0184, // Alpha_AXP - SH3 = 0x01a2, // SH3 little-endian + ALPHA = 0x0184, // Alpha_AXP + SH3 = 0x01a2, // SH3 little-endian SH3DSP = 0x01a3, - SH3E = 0x01a4, // SH3E little-endian - SH4 = 0x01a6, // SH4 little-endian - SH5 = 0x01a8, // SH5 - ARM = 0x01c0, // ARM Little-Endian - THUMB = 0x01c2, - THUMB2 = 0x1c4, + SH3E = 0x01a4, // SH3E little-endian + SH4 = 0x01a6, // SH4 little-endian + SH5 = 0x01a8, // SH5 + ARM = 0x01c0, // ARM Little-Endian + THUMB = 0x01c2, // ARM Thumb/Thumb-2 Little-Endian + ARMNT = 0x01c4, // ARM Thumb-2 Little-Endian AM33 = 0x01d3, - POWERPC = 0x01F0, // IBM PowerPC Little-Endian + POWERPC = 0x01F0, // IBM PowerPC Little-Endian POWERPCFP = 0x01f1, - IA64 = 0x0200, // Intel 64 - MIPS16 = 0x0266, // MIPS - ALPHA64 = 0x0284, // ALPHA64 - MIPSFPU = 0x0366, // MIPS + IA64 = 0x0200, // Intel 64 + MIPS16 = 0x0266, // MIPS + ALPHA64 = 0x0284, // ALPHA64 + MIPSFPU = 0x0366, // MIPS MIPSFPU16 = 0x0466, // MIPS AXP64 = 0x0284, - TRICORE = 0x0520, // Infineon + TRICORE = 0x0520, // Infineon CEF = 0x0CEF, - EBC = 0x0EBC, // EFI Byte Code - AMD64 = 0x8664, // AMD64 (K8) - M32R = 0x9041, // M32R little-endian - ARM64 = 0xAA64, // ARM64 Little-endian + EBC = 0x0EBC, // EFI Byte Code + AMD64 = 0x8664, // AMD64 (K8) + M32R = 0x9041, // M32R little-endian + ARM64 = 0xAA64, // ARM64 Little-endian + ARM64EC = 0xA641, + ARM64X = 0xA64E, CEE = 0xC0EE, + LOONGARCH64 = 0x6264, RISCV64 = 0x5064 } } diff --git a/src/SOS/SOS.Hosting/SOSHost.cs b/src/SOS/SOS.Hosting/SOSHost.cs index 5d23b98c3f..5a8cfb48b4 100644 --- a/src/SOS/SOS.Hosting/SOSHost.cs +++ b/src/SOS/SOS.Hosting/SOSHost.cs @@ -165,27 +165,16 @@ internal unsafe int GetExecutingProcessorType( IntPtr self, IMAGE_FILE_MACHINE* type) { - switch (Target.Architecture) - { - case Architecture.X64: - *type = IMAGE_FILE_MACHINE.AMD64; - break; - case Architecture.X86: - *type = IMAGE_FILE_MACHINE.I386; - break; - case Architecture.Arm: - *type = IMAGE_FILE_MACHINE.THUMB2; - break; - case Architecture.Arm64: - *type = IMAGE_FILE_MACHINE.ARM64; - break; - case (Architecture)9 /* Architecture.RiscV64 */: - *type = IMAGE_FILE_MACHINE.RISCV64; - break; - default: - *type = IMAGE_FILE_MACHINE.UNKNOWN; - break; - } + *type = Target.Architecture switch + { + Architecture.X64 => IMAGE_FILE_MACHINE.AMD64, + Architecture.X86 => IMAGE_FILE_MACHINE.I386, + Architecture.Arm => IMAGE_FILE_MACHINE.ARMNT, + Architecture.Arm64 => IMAGE_FILE_MACHINE.ARM64, + (Architecture)6 /* Architecture.LoongArch64 */=> IMAGE_FILE_MACHINE.LOONGARCH64, + (Architecture)9 /* Architecture.RiscV64 */=> IMAGE_FILE_MACHINE.RISCV64, + _ => IMAGE_FILE_MACHINE.UNKNOWN, + }; return HResult.S_OK; } diff --git a/src/SOS/SOS.Package/SOS.Symbol.Package.csproj b/src/SOS/SOS.Package/SOS.Symbol.Package.csproj index 59adf253d9..d5c0851fc0 100644 --- a/src/SOS/SOS.Package/SOS.Symbol.Package.csproj +++ b/src/SOS/SOS.Package/SOS.Symbol.Package.csproj @@ -21,6 +21,9 @@ $(SOSPackagePathPrefix)/win-x64 + + + $(SOSPackagePathPrefix)/win-x86 diff --git a/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt b/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt index 7b9f3d7ee6..c45a887ecc 100644 --- a/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt +++ b/src/SOS/SOS.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt @@ -27,6 +27,9 @@ true false + true + false + $(RepoRootDir)/src/SOS/SOS.UnitTests/Debuggees $(RepoRootDir)/eng/AuxMsbuildFiles sdk.prebuilt @@ -43,33 +46,37 @@ - - - - - - - - diff --git a/src/SOS/SOS.UnitTests/Debuggees/DynamicMethod/DynamicMethod.csproj b/src/SOS/SOS.UnitTests/Debuggees/DynamicMethod/DynamicMethod.csproj new file mode 100644 index 0000000000..299cffbb99 --- /dev/null +++ b/src/SOS/SOS.UnitTests/Debuggees/DynamicMethod/DynamicMethod.csproj @@ -0,0 +1,9 @@ + + + + Exe + $(BuildProjectFramework) + $(BuildTargetFrameworks) + + + diff --git a/src/SOS/SOS.UnitTests/Debuggees/DynamicMethod/Program.cs b/src/SOS/SOS.UnitTests/Debuggees/DynamicMethod/Program.cs new file mode 100644 index 0000000000..16afe57006 --- /dev/null +++ b/src/SOS/SOS.UnitTests/Debuggees/DynamicMethod/Program.cs @@ -0,0 +1,67 @@ +using System; +using System.Reflection.Emit; +using System.Runtime.CompilerServices; + +namespace TestInfiniteDynamicMethods +{ + internal class Program + { + [MethodImpl(MethodImplOptions.NoInlining)] + static Func GetFibDynamicMethod() + { + DynamicMethod dynamicMethod = new DynamicMethod("Fibonacci", typeof(int), new Type[] { typeof(int) }); + ILGenerator ilgen = dynamicMethod.GetILGenerator(); + Label labelAfterCmp0 = ilgen.DefineLabel(); + ilgen.Emit(OpCodes.Ldarg_0); + ilgen.Emit(OpCodes.Ldc_I4_0); + ilgen.Emit(OpCodes.Bne_Un_S, labelAfterCmp0); + ilgen.Emit(OpCodes.Ldc_I4_0); + ilgen.Emit(OpCodes.Ret); + ilgen.MarkLabel(labelAfterCmp0); + + Label labelAfterCmp1 = ilgen.DefineLabel(); + ilgen.Emit(OpCodes.Ldarg_0); + ilgen.Emit(OpCodes.Ldc_I4_1); + ilgen.Emit(OpCodes.Bne_Un_S, labelAfterCmp1); + ilgen.Emit(OpCodes.Ldc_I4_1); + ilgen.Emit(OpCodes.Ret); + ilgen.MarkLabel(labelAfterCmp1); + + ilgen.Emit(OpCodes.Ldarg_0); + ilgen.Emit(OpCodes.Ldc_I4_1); + ilgen.Emit(OpCodes.Sub); + ilgen.Emit(OpCodes.Call, dynamicMethod); + + ilgen.Emit(OpCodes.Ldarg_0); + ilgen.Emit(OpCodes.Ldc_I4_2); + ilgen.Emit(OpCodes.Sub); + ilgen.Emit(OpCodes.Call, dynamicMethod); + + ilgen.Emit(OpCodes.Add); + ilgen.Emit(OpCodes.Ret); + + var result = dynamicMethod.CreateDelegate>(); + throw new Exception(); + } + + static void Main(string[] args) + { + Console.WriteLine("Hello, World!"); + + int count = 0; + while (true) + { + int result = GetFibDynamicMethod()(4); + + if (((++count) % 200) == 0) + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + + if (((++count) % 1000) == 0) + Console.WriteLine(count); + } + } + } +} diff --git a/src/SOS/SOS.UnitTests/SOS.cs b/src/SOS/SOS.UnitTests/SOS.cs index d7e8f6eb54..fb9d74886d 100644 --- a/src/SOS/SOS.UnitTests/SOS.cs +++ b/src/SOS/SOS.UnitTests/SOS.cs @@ -21,7 +21,7 @@ public static class SOSTestHelpers { public static IEnumerable GetConfigurations(string key, string value) { - return TestRunConfiguration.Instance.Configurations.Where((c) => key == null || c.AllSettings.GetValueOrDefault(key) == value).Select(c => new[] { c }); + return TestRunConfiguration.Instance.Configurations.Where((c) => key == null || c.AllSettings.GetValueOrDefault(key) == value).DefaultIfEmpty(TestConfiguration.Empty).Select(c => new[] { c }); } internal static void SkipIfArm(TestConfiguration config) @@ -254,6 +254,16 @@ await SOSTestHelpers.RunTest( Output); } + [SkippableTheory, MemberData(nameof(Configurations))] + public async Task DynamicMethod(TestConfiguration config) + { + if (config.PublishSingleFile || config.IsDesktop) + { + throw new SkipTestException("Single file and desktop framework not supported"); + } + await SOSTestHelpers.RunTest(config, debuggeeName: "DynamicMethod", scriptName: "DynamicMethod.script", Output); + } + [SkippableTheory, MemberData(nameof(Configurations))] public async Task Reflection(TestConfiguration config) { @@ -397,12 +407,18 @@ public async Task WebApp3(TestConfiguration config) UsePipeSync = true, DumpGenerator = SOSRunner.DumpGenerator.DotNetDump }, - Output); + Output); } [SkippableTheory, MemberData(nameof(SOSTestHelpers.GetConfigurations), "TestName", "SOS.DualRuntimes", MemberType = typeof(SOSTestHelpers))] public async Task DualRuntimes(TestConfiguration config) { + // This test on linux/macOS can be called with an empty config because vstest and dotnet test fail/complain about no test parameters. The + // linux/macOS config file doesn't contain a SOS.DualRuntimes TestName because this is Windows only. + if (config.IsEmpty) + { + throw new SkipTestException("Skipping DualRuntimes test"); + } if (config.PublishSingleFile) { throw new SkipTestException("Single file not supported"); diff --git a/src/SOS/SOS.UnitTests/SOSRunner.cs b/src/SOS/SOS.UnitTests/SOSRunner.cs index 9f3aee8dcb..5511fe2ed6 100644 --- a/src/SOS/SOS.UnitTests/SOSRunner.cs +++ b/src/SOS/SOS.UnitTests/SOSRunner.cs @@ -320,7 +320,6 @@ public static async Task CreateDump(TestInformation information) ProcessRunner processRunner = new ProcessRunner(exePath, ReplaceVariables(variables, arguments.ToString())). WithEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0"). WithEnvironmentVariable("DOTNET_ROOT", config.DotNetRoot). - WithEnvironmentVariable("DOTNET_LegacyExceptionHandling", "1"). WithRuntimeConfiguration("DbgEnableElfDumpOnMacOS", "1"). WithLog(new TestRunner.TestLogger(outputHelper.IndentedOutput)). WithTimeout(TimeSpan.FromMinutes(10)); @@ -680,7 +679,6 @@ public static async Task StartDebugger(TestInformation information, D ProcessRunner processRunner = new ProcessRunner(debuggerPath, ReplaceVariables(variables, arguments.ToString())). WithEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0"). WithEnvironmentVariable("DOTNET_ROOT", config.DotNetRoot). - WithEnvironmentVariable("DOTNET_LegacyExceptionHandling", "1"). WithLog(scriptLogger). WithTimeout(TimeSpan.FromMinutes(10)); diff --git a/src/SOS/SOS.UnitTests/Scripts/DynamicMethod.script b/src/SOS/SOS.UnitTests/Scripts/DynamicMethod.script new file mode 100644 index 0000000000..ea20901c36 --- /dev/null +++ b/src/SOS/SOS.UnitTests/Scripts/DynamicMethod.script @@ -0,0 +1,11 @@ + +CONTINUE + +LOADSOS + +SOSCOMMAND:ClrStack -i -a +VERIFY:\s+LOCALS:\s+ + +SOSCOMMAND:DumpIL .*System\.Reflection\.Emit\.DynamicMethod dynamicMethod @ 0x().*\s+ +VERIFY:\s+IL_0000: ldarg.0\s+ +VERIFY:\s+IL_0001: ldc.i4.0\s+ diff --git a/src/SOS/SOS.UnitTests/Scripts/GCTests.script b/src/SOS/SOS.UnitTests/Scripts/GCTests.script index a1b172dffb..acd1cdefc8 100644 --- a/src/SOS/SOS.UnitTests/Scripts/GCTests.script +++ b/src/SOS/SOS.UnitTests/Scripts/GCTests.script @@ -53,7 +53,7 @@ VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+ SOSCOMMAND:DumpObj VERIFY:\s*Name:\s+GCWhere\s+ VERIFY:\s+MethodTable:\s+\s+ -VERIFY:\s+EEClass:\s+\s+ +VERIFY:\s+(EEClass|Canonical MethodTable):\s+\s+ VERIFY:\s+Fields:\s+ VERIFY:\s+\s+\s+\s+System\.String.*_string\s+ VERIFY:\s+\s+\s+\s+System\.UInt64.*52704621242434 _static\s+ @@ -61,12 +61,12 @@ VERIFY:\s+\s+\s+\s+System\.UInt64.*52704621242434 _stati SOSCOMMAND:DumpObj -nofields VERIFY:\s*Name:\s+GCWhere\s+ VERIFY:\s+MethodTable:\s+\s+ -VERIFY:\s+EEClass:\s+\s+ +VERIFY:\s+(EEClass|Canonical MethodTable):\s+\s+ SOSCOMMAND:DumpObj -refs VERIFY:\s*Name:\s+GCWhere\s+ VERIFY:\s+MethodTable:\s+\s+ -VERIFY:\s+EEClass:\s+\s+ +VERIFY:\s+(EEClass|Canonical MethodTable):\s+\s+ VERIFY:\s+Fields:\s+ VERIFY:\s+\s+\s+\s+System\.String.*_string\s+ VERIFY:\s+\s+\s+\s+System\.UInt64.*52704621242434 _static\s+ @@ -133,7 +133,7 @@ VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+ SOSCOMMAND:DumpObj VERIFY:\s*Name:\s+GCWhere\s+ VERIFY:\s+MethodTable:\s+\s+ -VERIFY:\s+EEClass:\s+\s+ +VERIFY:\s+(EEClass|Canonical MethodTable):\s+\s+ VERIFY:\s+Fields:\s+ VERIFY:\s+\s+\s+\s+System\.String.*_string\s+ VERIFY:\s+\s+\s+\s+System\.UInt64.*52704621242434 _static\s+ @@ -141,12 +141,12 @@ VERIFY:\s+\s+\s+\s+System\.UInt64.*52704621242434 _stati SOSCOMMAND:DumpObj -nofields VERIFY:\s*Name:\s+GCWhere\s+ VERIFY:\s+MethodTable:\s+\s+ -VERIFY:\s+EEClass:\s+\s+ +VERIFY:\s+(EEClass|Canonical MethodTable):\s+\s+ SOSCOMMAND:DumpObj -refs VERIFY:\s*Name:\s+GCWhere\s+ VERIFY:\s+MethodTable:\s+\s+ -VERIFY:\s+EEClass:\s+\s+ +VERIFY:\s+(EEClass|Canonical MethodTable):\s+\s+ VERIFY:\s+Fields:\s+ VERIFY:\s+\s+\s+\s+System\.String.*_string\s+ VERIFY:\s+\s+\s+\s+System\.UInt64.*52704621242434 _static\s+ diff --git a/src/SOS/SOS.UnitTests/Scripts/OtherCommands.script b/src/SOS/SOS.UnitTests/Scripts/OtherCommands.script index 17ba7acf2a..e7655c6c8d 100644 --- a/src/SOS/SOS.UnitTests/Scripts/OtherCommands.script +++ b/src/SOS/SOS.UnitTests/Scripts/OtherCommands.script @@ -88,8 +88,6 @@ VERIFY:\s*Name:\s+.*(System\.Private\.CoreLib(\.ni)?\.dll|mscorlib.dll)\s+ ENDIF:SINGLE_FILE_APP SOSCOMMAND:DumpModule \s+Module\s+()\s+.* -VERIFY:\s*PEAssembly:\s+\s+ -VERIFY:\s*ModuleId:\s+\s+ VERIFY:\s*LoaderHeap:\s+\s+ VERIFY:\s*TypeDefToMethodTableMap:\s+\s+ diff --git a/src/SOS/Strike/CMakeLists.txt b/src/SOS/Strike/CMakeLists.txt index 19551ab0a8..f0c7ab5410 100644 --- a/src/SOS/Strike/CMakeLists.txt +++ b/src/SOS/Strike/CMakeLists.txt @@ -30,45 +30,36 @@ if(CLR_CMAKE_HOST_ARCH_AMD64) message(STATUS "CLR_CMAKE_HOST_ARCH_AMD64") add_definitions(-DSOS_TARGET_AMD64=1) add_definitions(-D_TARGET_WIN64_=1) - add_definitions(-DDBG_TARGET_64BIT) - add_definitions(-DDBG_TARGET_WIN64=1) if (CLR_CMAKE_HOST_WIN32) add_definitions(-DSOS_TARGET_ARM64=1) endif(CLR_CMAKE_HOST_WIN32) remove_definitions(-D_TARGET_ARM64_=1) add_definitions(-D_TARGET_AMD64_) - add_definitions(-DDBG_TARGET_AMD64) elseif(CLR_CMAKE_HOST_ARCH_I386) message(STATUS "CLR_CMAKE_HOST_ARCH_I386") add_definitions(-DSOS_TARGET_X86=1) add_definitions(-D_TARGET_X86_=1) add_definitions(-DTARGET_X86) - add_definitions(-DDBG_TARGET_32BIT) if (CLR_CMAKE_HOST_WIN32) add_definitions(-DSOS_TARGET_ARM=1) endif(CLR_CMAKE_HOST_WIN32) elseif(CLR_CMAKE_HOST_ARCH_ARM) message(STATUS "CLR_CMAKE_HOST_ARCH_ARM") add_definitions(-DSOS_TARGET_ARM=1) - add_definitions(-D_TARGET_WIN32_=1) add_definitions(-D_TARGET_ARM_=1) - add_definitions(-DDBG_TARGET_32BIT) elseif(CLR_CMAKE_HOST_ARCH_ARM64) message(STATUS "CLR_CMAKE_HOST_ARCH_ARM64") add_definitions(-DSOS_TARGET_ARM64=1) add_definitions(-D_TARGET_WIN64_=1) - add_definitions(-DDBG_TARGET_64BIT) - add_definitions(-DDBG_TARGET_WIN64=1) elseif(CLR_CMAKE_HOST_ARCH_MIPS64) add_definitions(-DSOS_TARGET_MIPS64=1) add_definitions(-D_TARGET_WIN64_=1) - add_definitions(-DDBG_TARGET_64BIT) - add_definitions(-DDBG_TARGET_WIN64=1) elseif(CLR_CMAKE_HOST_ARCH_RISCV64) add_definitions(-DSOS_TARGET_RISCV64=1) add_definitions(-D_TARGET_WIN64_=1) - add_definitions(-DDBG_TARGET_64BIT) - add_definitions(-DDBG_TARGET_WIN64=1) +elseif(CLR_CMAKE_HOST_ARCH_LOONGARCH64) + add_definitions(-DSOS_TARGET_LOONGARCH64=1) + add_definitions(-D_TARGET_WIN64_=1) endif() add_definitions(-DSTRIKE) @@ -82,7 +73,6 @@ if (CLR_CMAKE_HOST_WIN32) add_definitions(-DUSE_STL) set(SOS_SOURCES - clrma.cpp disasm.cpp dllsext.cpp eeheap.cpp @@ -97,12 +87,17 @@ if (CLR_CMAKE_HOST_WIN32) sigparser.cpp sildasm.cpp sos.cpp + sosextensions.cpp stressLogDump.cpp strike.cpp util.cpp vm.cpp WatchCmd.cpp Native.rc + clrma/clrma.cpp + clrma/managedanalysis.cpp + clrma/exception.cpp + clrma/thread.cpp platform/datatarget.cpp platform/hostimpl.cpp platform/targetimpl.cpp @@ -119,6 +114,7 @@ if (CLR_CMAKE_HOST_WIN32) extensions corguids dbgutil + coreclrminipal ${STATIC_MT_CRT_LIB} ${STATIC_MT_CPP_LIB} ${STATIC_MT_VCRT_LIB} @@ -142,8 +138,6 @@ if (CLR_CMAKE_HOST_WIN32) endif(NOT CLR_CMAKE_HOST_ARCH_ARM64 AND NOT CLR_CMAKE_HOST_ARCH_ARM) else(CLR_CMAKE_HOST_WIN32) - add_definitions(-DFEATURE_ENABLE_HARDWARE_EXCEPTIONS) - add_definitions(-DPAL_STDCPP_COMPAT=1) add_compile_options(-Wno-null-arithmetic) add_compile_options(-Wno-format) @@ -162,6 +156,7 @@ else(CLR_CMAKE_HOST_WIN32) stressLogDump.cpp strike.cpp sos.cpp + sosextensions.cpp util.cpp platform/datatarget.cpp platform/hostimpl.cpp @@ -188,6 +183,7 @@ else(CLR_CMAKE_HOST_WIN32) dbgutil palrt coreclrpal + coreclrminipal ) endif(CLR_CMAKE_HOST_WIN32) @@ -224,6 +220,10 @@ elseif(CLR_CMAKE_HOST_ARCH_RISCV64) set(SOS_SOURCES_ARCH disasmRISCV64.cpp ) +elseif(CLR_CMAKE_HOST_ARCH_LOONGARCH64) + set(SOS_SOURCES_ARCH + disasmLOONGARCH64.cpp + ) endif() list(APPEND SOS_SOURCES ${SOS_SOURCES_ARCH}) diff --git a/src/SOS/Strike/ExpressionNode.cpp b/src/SOS/Strike/ExpressionNode.cpp index d110c8a501..9635b0e113 100644 --- a/src/SOS/Strike/ExpressionNode.cpp +++ b/src/SOS/Strike/ExpressionNode.cpp @@ -3,9 +3,8 @@ #include "ExpressionNode.h" -#ifndef IfFailRet +#undef IfFailRet #define IfFailRet(EXPR) do { Status = (EXPR); if(FAILED(Status)) { return (Status); } } while (0) -#endif ICorDebugProcess* ExpressionNode::s_pCorDebugProcess = nullptr; @@ -480,8 +479,8 @@ BOOL ExpressionNode::ShouldExpandVariable(__in_z WCHAR* varToExpand) if(pAbsoluteExpression == NULL || varToExpand == NULL) return FALSE; // if there is a cast operation, move past it - WCHAR* pEndCast = _wcschr(varToExpand, L')'); - varToExpand = (pEndCast == NULL) ? varToExpand : pEndCast+1; + const WCHAR* pEndCast = _wcschr(varToExpand, L')'); + varToExpand = (pEndCast == NULL) ? varToExpand : (WCHAR*)(pEndCast+1); size_t varToExpandLen = _wcslen(varToExpand); size_t currentExpansionLen = _wcslen(pAbsoluteExpression); @@ -634,8 +633,8 @@ HRESULT ExpressionNode::ExpandFields(ICorDebugValue* pInnerValue, __in_z WCHAR* if(pBaseTypeNode == NULL) return Status; if(fieldExpanded) return Status; - WCHAR* pEndCast = _wcschr(varToExpand, L')'); - WCHAR* pNonCast = (pEndCast == NULL) ? varToExpand : pEndCast+1; + const WCHAR* pEndCast = _wcschr(varToExpand, L')'); + const WCHAR* pNonCast = (pEndCast == NULL) ? varToExpand : pEndCast+1; if(_wcscmp(pNonCast, pAbsoluteExpression) != 0) { pBaseTypeNode->Expand(varToExpand); @@ -1579,12 +1578,12 @@ HRESULT ExpressionNode::ParseNextIdentifier(__in_z WCHAR** expression, __inout_e WCHAR* expressionStart = *expression; DWORD currentCharsParsed = *charactersParsed; - DWORD identifierLen = (DWORD) _wcscspn(expressionStart, L".["); + DWORD identifierLen = (DWORD) wcscspn(expressionStart, L".["); // if the first character was a . or [ skip over it. Note that we don't // do this always in case the first WCHAR was part of a surrogate pair if(identifierLen == 0) { - identifierLen = (DWORD) _wcscspn(expressionStart+1, L".[") + 1; + identifierLen = (DWORD) wcscspn(expressionStart+1, L".[") + 1; } *expression += identifierLen; @@ -2062,7 +2061,7 @@ HRESULT ExpressionNode::FindTypeByName(ICorDebugModule* pModule, __in_z const WC WCHAR rootName[mdNameLen]; const WCHAR* pRootName = NULL; int typeNameLen = (int) _wcslen(pTypeName); - int genericParamListStart = (int) _wcscspn(pTypeName, L"<"); + int genericParamListStart = (int) wcscspn(pTypeName, L"<"); if(genericParamListStart != typeNameLen) { if(pTypeName[typeNameLen-1] != L'>' || genericParamListStart > mdNameLen) diff --git a/src/SOS/Strike/Strike.vcxproj b/src/SOS/Strike/Strike.vcxproj index 609d90ec02..1946a72c8f 100644 --- a/src/SOS/Strike/Strike.vcxproj +++ b/src/SOS/Strike/Strike.vcxproj @@ -84,7 +84,7 @@ - $(RepoRoot)artifacts\obj;$(RepoRoot)src\shared;$(RepoRoot)src\shared\inc;$(RepoRoot)src\shared\pal\prebuilt\inc;$(RepoRoot)src\shared\pal\inc;$(RepoRoot)src\shared\pal\inc\rt;$(SolutionDir)src\shared\gcdump;$(SolutionDir)src\SOS\Strike\platform;$(SolutionDir)src\SOS\inc;$(SolutionDir)src\SOS\extensions;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories) + $(RepoRoot)artifacts\obj;$(RepoRoot)src\shared;$(RepoRoot)src\shared\inc;$(RepoRoot)src\shared\pal\prebuilt\inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;$(SolutionDir)src\SOS\Strike\;$(SolutionDir)src\SOS\inc;$(SolutionDir)src\SOS\extensions;$(SolutionDir)src\shared\gcdump;$(SolutionDir)src\SOS\Strike\platform;%(AdditionalIncludeDirectories) %(AdditionalOptions) /d2Zi+ /Zm200 /ZH:SHA_256 /source-charset:utf-8 /homeparams Debug/ true @@ -234,7 +234,7 @@ - ..\..\SOS\Strike;..\..\pal\prebuilt\inc;..\..\inc;..\..\SOS\gcdump;inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories) + ..\..\SOS\Strike;..\..\shared;..\..\shared\minipal;..\..\shared\pal\prebuilt\inc;..\..\shared\inc;..\..\shared\gcdump;..\inc;C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\DIA SDK\include;%(AdditionalIncludeDirectories) %(AdditionalOptions) /d2Zi+ /Zm200 /ZH:SHA_256 /source-charset:utf-8 Release/ true @@ -385,9 +385,15 @@ - + + + + + + + @@ -402,6 +408,7 @@ + @@ -415,6 +422,9 @@ + + + @@ -428,6 +438,7 @@ + diff --git a/src/SOS/Strike/Strike.vcxproj.filters b/src/SOS/Strike/Strike.vcxproj.filters index 53a91f82dd..312329ab0a 100644 --- a/src/SOS/Strike/Strike.vcxproj.filters +++ b/src/SOS/Strike/Strike.vcxproj.filters @@ -33,7 +33,22 @@ platform - + + clrma + + + clrma + + + clrma + + + clrma + + + + + @@ -74,6 +89,16 @@ platform + + clrma + + + clrma + + + clrma + + @@ -89,6 +114,9 @@ {8340fe5a-df30-45ca-8a4e-7811ac6ebbd2} + + {e8809ec7-01fb-4c2b-b1fe-6be4f9c1a91a} + diff --git a/src/SOS/Strike/WatchCmd.cpp b/src/SOS/Strike/WatchCmd.cpp index 93eeece88f..d058ae37c6 100644 --- a/src/SOS/Strike/WatchCmd.cpp +++ b/src/SOS/Strike/WatchCmd.cpp @@ -3,9 +3,8 @@ #include "WatchCmd.h" -#ifndef IfFailRet +#undef IfFailRet #define IfFailRet(EXPR) do { Status = (EXPR); if(FAILED(Status)) { return (Status); } } while (0) -#endif _PersistList::~_PersistList() { diff --git a/src/SOS/Strike/clrma.cpp b/src/SOS/Strike/clrma.cpp deleted file mode 100644 index 1077d77064..0000000000 --- a/src/SOS/Strike/clrma.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include -#include -#include // IDL -#include "exts.h" - -HRESULT CLRMACreateInstance(ICLRManagedAnalysis** ppCLRMA); -HRESULT CLRMAReleaseInstance(); - -ICLRManagedAnalysis* g_managedAnalysis = nullptr; - -// -// Exports -// - -HRESULT CLRMACreateInstance(ICLRManagedAnalysis** ppCLRMA) -{ - HRESULT hr = E_UNEXPECTED; - - if (ppCLRMA == nullptr) - { - return E_INVALIDARG; - } - *ppCLRMA = nullptr; - - if (g_managedAnalysis == nullptr) - { - Extensions* extensions = Extensions::GetInstance(); - if (extensions == nullptr || extensions->GetDebuggerServices() == nullptr) - { - return E_FAIL; - } - ITarget* target = extensions->GetTarget(); - if (target == nullptr) - { - return E_FAIL; - } - hr = target->GetService(__uuidof(ICLRManagedAnalysis), (void**)&g_managedAnalysis); - if (FAILED(hr)) - { - return hr; - } - } - g_managedAnalysis->AddRef(); - *ppCLRMA = g_managedAnalysis; - return S_OK; -} - -HRESULT CLRMAReleaseInstance() -{ - if (g_managedAnalysis != nullptr) - { - g_managedAnalysis->Release(); - g_managedAnalysis = nullptr; - } - return S_OK; -} diff --git a/src/SOS/Strike/clrma/clrma.cpp b/src/SOS/Strike/clrma/clrma.cpp new file mode 100644 index 0000000000..c62aae06a1 --- /dev/null +++ b/src/SOS/Strike/clrma/clrma.cpp @@ -0,0 +1,143 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "exts.h" +#include "managedanalysis.h" + +HRESULT CLRMACreateInstance(ICLRManagedAnalysis** ppCLRMA); +HRESULT CLRMAReleaseInstance(); + +ICLRManagedAnalysis* g_managedAnalysis = nullptr; + +int g_clrmaGlobalFlags = ClrmaGlobalFlags::LoggingEnabled | ClrmaGlobalFlags::DacClrmaEnabled | ClrmaGlobalFlags::ManagedClrmaEnabled; + +// +// Exports +// + +HRESULT +CLRMACreateInstance(ICLRManagedAnalysis** ppCLRMA) +{ + HRESULT hr = E_UNEXPECTED; + + if (ppCLRMA == nullptr) + { + return E_INVALIDARG; + } + + *ppCLRMA = nullptr; + + if (g_managedAnalysis == nullptr) + { + g_managedAnalysis = new (std::nothrow) ClrmaManagedAnalysis(); + if (g_managedAnalysis == nullptr) + { + return E_OUTOFMEMORY; + } + OnUnloadTask::Register(([]() { CLRMAReleaseInstance(); })); + } + + g_managedAnalysis->AddRef(); + *ppCLRMA = g_managedAnalysis; + return S_OK; +} + +HRESULT +CLRMAReleaseInstance() +{ + TraceInformation("CLRMAReleaseInstance\n"); + if (g_managedAnalysis != nullptr) + { + g_managedAnalysis->Release(); + g_managedAnalysis = nullptr; + } + return S_OK; +} + +DECLARE_API(clrmaconfig) +{ + INIT_API_EXT(); + + BOOL bEnable = FALSE; + BOOL bDisable = FALSE; + BOOL bDacClrma = FALSE; + BOOL bManagedClrma = FALSE; + BOOL bLogging = FALSE; + + CMDOption option[] = + { // name, vptr, type, hasValue + {"-enable", &bEnable, COBOOL, FALSE}, + {"-disable", &bDisable, COBOOL, FALSE}, + {"-dac", &bDacClrma, COBOOL, FALSE}, + {"-managed", &bManagedClrma, COBOOL, FALSE}, + {"-logging", &bLogging, COBOOL, FALSE}, + }; + + if (!GetCMDOption(args, option, ARRAY_SIZE(option), NULL, 0, NULL)) + { + return E_INVALIDARG; + } + + if (bEnable) + { + if (bDacClrma) + { + g_clrmaGlobalFlags |= ClrmaGlobalFlags::DacClrmaEnabled; + } + if (bManagedClrma) + { + g_clrmaGlobalFlags |= ClrmaGlobalFlags::ManagedClrmaEnabled; + } + if (bLogging) + { + g_clrmaGlobalFlags |= ClrmaGlobalFlags::LoggingEnabled; + } + } + else if (bDisable) + { + if (bDacClrma) + { + g_clrmaGlobalFlags &= ~ClrmaGlobalFlags::DacClrmaEnabled; + } + if (bManagedClrma) + { + g_clrmaGlobalFlags &= ~ClrmaGlobalFlags::ManagedClrmaEnabled; + } + if (bLogging) + { + g_clrmaGlobalFlags &= ~ClrmaGlobalFlags::LoggingEnabled; + } + } + + ExtOut("CLRMA logging: %s\n", (g_clrmaGlobalFlags & ClrmaGlobalFlags::LoggingEnabled) ? "enabled (disable with '-disable -logging')" : "disabled (enable with '-enable -logging')"); + ExtOut("CLRMA direct DAC support: %s\n", (g_clrmaGlobalFlags & ClrmaGlobalFlags::DacClrmaEnabled) ? "enabled (disable with '-disable -dac')" : "disabled (enable with '-enable -dac')"); + ExtOut("CLRMA managed support: %s\n", (g_clrmaGlobalFlags & ClrmaGlobalFlags::ManagedClrmaEnabled) ? "enabled (disable with '-disable -managed')" : "disabled (enable with '-enable -managed')"); + + return Status; +} + +extern void InternalOutputVaList(ULONG mask, PCSTR format, va_list args); + +void +TraceInformation(PCSTR format, ...) +{ + if (g_clrmaGlobalFlags & ClrmaGlobalFlags::LoggingEnabled) + { + va_list args; + va_start(args, format); + InternalOutputVaList(DEBUG_OUTPUT_NORMAL, format, args); + va_end(args); + } +} + +void +TraceError(PCSTR format, ...) +{ + if (g_clrmaGlobalFlags & ClrmaGlobalFlags::LoggingEnabled) + { + va_list args; + va_start(args, format); + InternalOutputVaList(DEBUG_OUTPUT_ERROR, format, args); + va_end(args); + } +} diff --git a/src/SOS/Strike/clrma/exception.cpp b/src/SOS/Strike/clrma/exception.cpp new file mode 100644 index 0000000000..17dc054ccc --- /dev/null +++ b/src/SOS/Strike/clrma/exception.cpp @@ -0,0 +1,553 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "managedanalysis.h" + +extern BOOL IsAsyncException(const DacpExceptionObjectData& excData); + +_Use_decl_annotations_ +ClrmaException::ClrmaException(ClrmaManagedAnalysis* managedAnalysis, ULONG64 address) : + m_lRefs(1), + m_managedAnalysis(managedAnalysis), + m_address(address), + m_typeName(nullptr), + m_message(nullptr), + m_exceptionDataInitialized(false), + m_stackFramesInitialized(false), + m_innerExceptionsInitialized(false) +{ + _ASSERTE(address != 0); + managedAnalysis->AddRef(); +} + +ClrmaException::~ClrmaException() +{ + TraceInformation("~ClrmaException\n"); + if (m_typeName != nullptr) + { + delete [] m_typeName; + m_typeName = nullptr; + } + if (m_message != nullptr) + { + delete [] m_message; + m_message = nullptr; + } + if (m_managedAnalysis != nullptr) + { + m_managedAnalysis->Release(); + m_managedAnalysis = nullptr; + } +} + +/// +/// This called by each clrma exception methods to initialize and cache the exception data. +/// +HRESULT +ClrmaException::Initialize() +{ + if (m_managedAnalysis == nullptr) + { + return E_UNEXPECTED; + } + if (!m_exceptionDataInitialized) + { + TraceInformation("ClrmaException::Initialize %016llx\n", m_address); + + HRESULT hr; + DacpObjectData objData; + if (FAILED(hr = objData.Request(m_managedAnalysis->SosDacInterface(), m_address))) + { + TraceError("ClrmaException::Initialize GetObjectData FAILED %08x\n", hr); + return hr; + } + + if (m_managedAnalysis->IsExceptionObj(objData.MethodTable) != 0) + { + if (FAILED(hr = m_exceptionData.Request(m_managedAnalysis->SosDacInterface(), m_address))) + { + TraceError("ClrmaException::Initialize GetObjectExceptionData FAILED %08x\n", hr); + return hr; + } + UINT cbTypeName = 0; + if (SUCCEEDED(hr = m_managedAnalysis->SosDacInterface()->GetMethodTableName(objData.MethodTable, 0, nullptr, &cbTypeName))) + { + ArrayHolder typeName = new (std::nothrow)WCHAR[cbTypeName]; + if (typeName != nullptr) + { + if (SUCCEEDED(hr = m_managedAnalysis->SosDacInterface()->GetMethodTableName(objData.MethodTable, cbTypeName, typeName, nullptr))) + { + m_typeName = typeName.Detach(); + } + else + { + TraceError("ClrmaException::Initialize GetMethodTableName(%016x) 2 FAILED %08x\n", objData.MethodTable, hr); + } + } + } + else + { + TraceError("ClrmaException::Initialize GetMethodTableName(%016x) 1 FAILED %08x\n", objData.MethodTable, hr); + } + if (m_exceptionData.Message == 0) + { + // To match the built-in SOS provider that scrapes !pe output. + const WCHAR* none = L""; + m_message = new (std::nothrow) WCHAR[wcslen(none) + 1]; + wcscpy(m_message, none); + } + else + { + m_message = m_managedAnalysis->GetStringObject(m_exceptionData.Message); + } + } + m_exceptionDataInitialized = true; + } + return S_OK; +} + +// IUnknown +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::QueryInterface( + REFIID InterfaceId, + PVOID* Interface + ) +{ + if (Interface == nullptr) + { + return E_INVALIDARG; + } + + *Interface = nullptr; + + if (IsEqualIID(InterfaceId, IID_IUnknown)) + { + *Interface = (IUnknown*)this; + AddRef(); + return S_OK; + } + else if (IsEqualIID(InterfaceId, __uuidof(ICLRMAClrException))) + { + *Interface = (ICLRMAClrException*)this; + AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +STDMETHODIMP_(ULONG) +ClrmaException::AddRef() +{ + return (ULONG)InterlockedIncrement(&m_lRefs); +} + +STDMETHODIMP_(ULONG) +ClrmaException::Release() +{ + LONG lRefs = InterlockedDecrement(&m_lRefs); + if (lRefs == 0) + { + delete this; + } + return lRefs; +} + +// +// ICLRMAClrException +// + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::get_DebuggerCommand( + BSTR* pValue + ) +{ + if (pValue == nullptr) + { + return E_INVALIDARG; + } + *pValue = nullptr; + return E_NOTIMPL; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::get_Address( + ULONG64* pValue + ) +{ + if (pValue == nullptr) + { + return E_INVALIDARG; + } + *pValue = m_address; + return S_OK; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::get_HResult( + HRESULT* pValue + ) +{ + if (pValue == nullptr) + { + return E_INVALIDARG; + } + + *pValue = 0; + + HRESULT hr; + if (FAILED(hr = Initialize())) + { + return hr; + } + + *pValue = m_exceptionData.HResult; + return S_OK; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::get_Type( + BSTR* pValue + ) +{ + if (pValue == nullptr) + { + return E_INVALIDARG; + } + + *pValue = nullptr; + + HRESULT hr; + if (FAILED(hr = Initialize())) + { + return hr; + } + + const WCHAR* typeName = m_typeName; + if (typeName == nullptr) + { + // To match the built-in SOS provider that scrapes !pe output + typeName = L""; + } + + *pValue = SysAllocString(typeName); + + return ((*pValue) != nullptr) ? S_OK : S_FALSE; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::get_Message( + BSTR* pValue + ) +{ + if (pValue == nullptr) + { + return E_INVALIDARG; + } + + *pValue = nullptr; + + HRESULT hr; + if (FAILED(hr = Initialize())) + { + return hr; + } + + if (m_message != nullptr) + { + *pValue = SysAllocString(m_message); + } + + return ((*pValue) != nullptr) ? S_OK : S_FALSE; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::get_FrameCount( + UINT* pCount + ) +{ + TraceInformation("ClrmaException::get_FrameCount\n"); + + if (pCount == nullptr) + { + return E_INVALIDARG; + } + + *pCount = 0; + + HRESULT hr; + if (FAILED(hr = Initialize())) + { + return hr; + } + + if (!m_stackFramesInitialized) + { + GetStackFrames(); + m_stackFramesInitialized = true; + } + + *pCount = (USHORT)m_stackFrames.size(); + + return ((*pCount) != 0) ? S_OK : S_FALSE; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::Frame( + UINT nFrame, + ULONG64* pAddrIP, + ULONG64* pAddrSP, + BSTR* bstrModule, + BSTR* bstrFunction, + ULONG64* pDisplacement + ) +{ + TraceInformation("ClrmaException::Frame %d\n", nFrame); + + if (!pAddrIP || !pAddrSP || !bstrModule || !bstrFunction || !pDisplacement) + { + return E_INVALIDARG; + } + + *pAddrIP = 0; + *pAddrSP = 0; + *bstrModule = nullptr; + *bstrFunction = nullptr; + *pDisplacement = 0; + + UINT nCount = 0; + HRESULT hr; + if (FAILED(hr = get_FrameCount(&nCount))) + { + return hr; + } + + if (nFrame >= nCount) + { + return E_BOUNDS; + } + + BSTR moduleName = SysAllocString(m_stackFrames[nFrame].Module.c_str()); + if (moduleName == nullptr) + { + return E_OUTOFMEMORY; + } + + BSTR functionName = SysAllocString(m_stackFrames[nFrame].Function.c_str()); + if (functionName == nullptr) + { + SysFreeString(moduleName); + return E_OUTOFMEMORY; + } + + *pAddrIP = m_stackFrames[nFrame].IP; + *pAddrSP = m_stackFrames[nFrame].SP; + *bstrModule = moduleName; + *bstrFunction = functionName; + *pDisplacement = m_stackFrames[nFrame].Displacement; + + return S_OK; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::get_InnerExceptionCount( + USHORT* pCount + ) +{ + TraceInformation("ClrmaException::get_InnerExceptionCount\n"); + + if (pCount == nullptr) + { + return E_INVALIDARG; + } + + *pCount = 0; + + HRESULT hr; + if (FAILED(hr = Initialize())) + { + return hr; + } + + if (!m_innerExceptionsInitialized) + { + m_innerExceptions.clear(); + + if (m_exceptionData.InnerException != 0) + { + m_innerExceptions.push_back(m_exceptionData.InnerException); + } + + m_innerExceptionsInitialized = true; + } + + *pCount = (USHORT)m_innerExceptions.size(); + + return ((*pCount) != 0) ? S_OK : S_FALSE; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaException::InnerException( + USHORT nIndex, + ICLRMAClrException** ppClrException) +{ + TraceInformation("ClrmaException::InnerException %d\n", nIndex); + + if (ppClrException == nullptr) + { + return E_INVALIDARG; + } + + *ppClrException = nullptr; + + HRESULT hr; + USHORT nCount = 0; + if (FAILED(hr = get_InnerExceptionCount(&nCount))) + { + return hr; + } + + if (nIndex >= nCount) + { + return E_BOUNDS; + } + + ReleaseHolder exception = new (std::nothrow) ClrmaException(m_managedAnalysis, m_innerExceptions[nIndex]); + if (exception == nullptr) + { + return E_OUTOFMEMORY; + } + + if (FAILED(hr = exception->QueryInterface(__uuidof(ICLRMAClrException), (void**)ppClrException))) + { + return hr; + } + + return S_OK; +} + +HRESULT +ClrmaException::GetStackFrames() +{ + HRESULT hr; + + m_stackFrames.clear(); + + if (m_exceptionData.StackTrace == 0) + { + return S_OK; + } + + DacpObjectData arrayObjData; + if (FAILED(hr = arrayObjData.Request(m_managedAnalysis->SosDacInterface(), m_exceptionData.StackTrace))) + { + TraceError("ClrmaException::GetStackFrames GetObjectData(%016llx) FAILED %08x\n", m_exceptionData.StackTrace, hr); + return hr; + } + + if (arrayObjData.ObjectType != OBJ_ARRAY || arrayObjData.dwNumComponents == 0) + { + TraceError("ClrmaException::GetStackFrames StackTrace not array or empty\n"); + return E_FAIL; + } + CLRDATA_ADDRESS arrayDataPtr = arrayObjData.ArrayDataPtr; + + // If the stack trace is object[] (.NET 9 or greater), the StackTraceElement array is referenced by the first entry + if (arrayObjData.ElementTypeHandle == m_managedAnalysis->ObjectMethodTable()) + { + if (FAILED(hr = m_managedAnalysis->ReadPointer(arrayDataPtr, &arrayDataPtr))) + { + TraceError("ClrmaException::GetStackFrames ReadPointer(%016llx) FAILED %08x\n", arrayDataPtr, hr); + return hr; + } + } + + bool bAsync = IsAsyncException(m_exceptionData); + + if (m_managedAnalysis->PointerSize() == 8) + { + StackTrace64 stackTrace; + if (FAILED(hr = m_managedAnalysis->ReadMemory(arrayDataPtr, &stackTrace, sizeof(StackTrace64)))) + { + TraceError("ClrmaException::GetStackFrames ReadMemory(%016llx) StackTrace64 FAILED %08x\n", arrayDataPtr, hr); + return hr; + } + if (stackTrace.m_size > 0) + { + CLRDATA_ADDRESS elementPtr = arrayDataPtr + offsetof(StackTrace64, m_elements); + for (ULONG i = 0; i < MAX_STACK_FRAMES && i < stackTrace.m_size; i++) + { + StackTraceElement64 stackTraceElement; + if (SUCCEEDED(hr = m_managedAnalysis->ReadMemory(elementPtr, &stackTraceElement, sizeof(StackTraceElement64)))) + { + StackFrame frame; + frame.Frame = i; + frame.SP = stackTraceElement.sp; + frame.IP = stackTraceElement.ip; + if ((m_managedAnalysis->ProcessorType() == IMAGE_FILE_MACHINE_AMD64) && bAsync) + { + frame.IP++; + } + if (SUCCEEDED(hr = m_managedAnalysis->GetMethodDescInfo(stackTraceElement.pFunc, frame, /* stripFunctionParameters */ true))) + { + m_stackFrames.push_back(frame); + } + } + else + { + TraceError("ClrmaException::GetStackFrames ReadMemory(%016llx) StackTraceElement64 FAILED %08x\n", elementPtr, hr); + } + elementPtr += sizeof(StackTraceElement64); + } + } + } + else + { + StackTrace32 stackTrace; + if (FAILED(hr = m_managedAnalysis->ReadMemory(arrayDataPtr, &stackTrace, sizeof(StackTrace32)))) + { + TraceError("ClrmaException::GetStackFrames ReadMemory(%016llx) StackTrace32 FAILED %08x\n", arrayDataPtr, hr); + return hr; + } + if (stackTrace.m_size > 0) + { + CLRDATA_ADDRESS elementPtr = arrayDataPtr + offsetof(StackTrace32, m_elements); + for (ULONG i = 0; i < MAX_STACK_FRAMES && i < stackTrace.m_size; i++) + { + StackTraceElement32 stackTraceElement; + if (SUCCEEDED(hr = m_managedAnalysis->ReadMemory(elementPtr, &stackTraceElement, sizeof(StackTraceElement32)))) + { + StackFrame frame; + frame.Frame = i; + frame.SP = stackTraceElement.sp; + frame.IP = stackTraceElement.ip; + if ((m_managedAnalysis->ProcessorType() == IMAGE_FILE_MACHINE_I386) && (!bAsync || i != 0)) + { + frame.IP++; + } + if (SUCCEEDED(hr = m_managedAnalysis->GetMethodDescInfo(stackTraceElement.pFunc, frame, /* stripFunctionParameters */ true))) + { + m_stackFrames.push_back(frame); + } + } + else + { + TraceError("ClrmaException::GetStackFrames ReadMemory(%016llx) StackTraceElement32 FAILED %08x\n", elementPtr, hr); + } + elementPtr += sizeof(StackTraceElement32); + } + } + } + + return S_OK; +} diff --git a/src/SOS/Strike/clrma/exception.h b/src/SOS/Strike/clrma/exception.h new file mode 100644 index 0000000000..04e2f7e3eb --- /dev/null +++ b/src/SOS/Strike/clrma/exception.h @@ -0,0 +1,92 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#pragma once + +#include "managedanalysis.h" + +class ClrmaException : public ICLRMAClrException +{ +public: + ClrmaException(_In_ ClrmaManagedAnalysis* managedAnalysis, _In_ ULONG64 address); + virtual ~ClrmaException(); + +public: + // IUnknown + STDMETHOD(QueryInterface)(_In_ REFIID InterfaceId, _Out_ PVOID* Interface); + STDMETHOD_(ULONG, AddRef)(); + STDMETHOD_(ULONG, Release)(); + + // ICLRMAClrException + STDMETHOD(get_DebuggerCommand)(_Out_ BSTR* pValue); + STDMETHOD(get_Address)(_Out_ ULONG64* pValue); + STDMETHOD(get_HResult)(_Out_ HRESULT* pValue); + STDMETHOD(get_Type)(_Out_ BSTR* pValue); + STDMETHOD(get_Message)(_Out_ BSTR* pValue); + + STDMETHOD(get_FrameCount)(_Out_ UINT* pCount); + STDMETHOD(Frame)(_In_ UINT nFrame, _Out_ ULONG64* pAddrIP, _Out_ ULONG64* pAddrSP, _Out_ BSTR* bstrModule, _Out_ BSTR* bstrFunction, _Out_ ULONG64* pDisplacement); + + STDMETHOD(get_InnerExceptionCount)(_Out_ USHORT* pCount); + STDMETHOD(InnerException)(_In_ USHORT nIndex, _COM_Outptr_result_maybenull_ ICLRMAClrException** ppClrException); + +private: + HRESULT Initialize(); + HRESULT GetStackFrames(); + + LONG m_lRefs; + ClrmaManagedAnalysis* m_managedAnalysis; + ULONG64 m_address; + + // ClrmaException::Initialize() + DacpExceptionObjectData m_exceptionData; + WCHAR* m_typeName; + WCHAR* m_message; + bool m_exceptionDataInitialized; + + // Initialized in ClrmaException::get_FrameCount + std::vector m_stackFrames; + bool m_stackFramesInitialized; + + // Initialized in ClrmaException::get_InnerExceptionCount + std::vector m_innerExceptions; + bool m_innerExceptionsInitialized; +}; + +// This struct needs to match the definition in the runtime and the target bitness. +// See: https://github.com/dotnet/runtime/blob/main/src/coreclr/vm/clrex.h + +struct StackTraceElement32 +{ + ULONG32 ip; + ULONG32 sp; + ULONG32 pFunc; // MethodDesc + INT flags; // This is StackTraceElementFlags but it needs to always be "int" sized for backward compatibility. +}; + +struct StackTraceElement64 +{ + ULONG64 ip; + ULONG64 sp; + ULONG64 pFunc; // MethodDesc + INT flags; // This is StackTraceElementFlags but it needs to always be "int" sized for backward compatibility. +}; + +// This is the layout of the _stackTrace pointer in an exception object. It is a managed array of bytes or if .NET 9.0 or greater +// an array of objects where the first entry is the address of stack trace element array. The layout is target bitness dependent. + +#pragma warning(disable:4200) + +struct StackTrace32 +{ + ULONG32 m_size; // ArrayHeader + ULONG32 m_thread; // + StackTraceElement32 m_elements[0]; +}; + +struct StackTrace64 +{ + ULONG64 m_size; // ArrayHeader + ULONG64 m_thread; // + StackTraceElement64 m_elements[0]; +}; diff --git a/src/SOS/Strike/clrma/managedanalysis.cpp b/src/SOS/Strike/clrma/managedanalysis.cpp new file mode 100644 index 0000000000..6adb3fa73a --- /dev/null +++ b/src/SOS/Strike/clrma/managedanalysis.cpp @@ -0,0 +1,700 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "managedanalysis.h" + +extern bool IsWindowsTarget(); +extern "C" IXCLRDataProcess * GetClrDataFromDbgEng(); + +_Use_decl_annotations_ +ClrmaManagedAnalysis::ClrmaManagedAnalysis() : + m_lRefs(1), + m_pointerSize(0), + m_fileSeparator(0), + m_processorType(0), + m_debugClient(nullptr), + m_debugData(nullptr), + m_debugSystem(nullptr), + m_debugControl(nullptr), + m_debugSymbols(nullptr), + m_clrmaService(nullptr), + m_clrData(nullptr), + m_sosDac(nullptr) +{ +} + +ClrmaManagedAnalysis::~ClrmaManagedAnalysis() +{ + TraceInformation("~ClrmaManagedAnalysis\n"); + ReleaseDebugClient(); +} + +HRESULT +ClrmaManagedAnalysis::QueryDebugClient(IUnknown* pUnknown) +{ + HRESULT hr; + ReleaseHolder debugClient; + if (FAILED(hr = pUnknown->QueryInterface(__uuidof(IDebugClient), (void**)&debugClient))) + { + return hr; + } + ReleaseHolder debugData; + if (FAILED(hr = debugClient->QueryInterface(__uuidof(IDebugDataSpaces), (void**)&debugData))) + { + return hr; + } + ReleaseHolder debugSystem; + if (FAILED(hr = debugClient->QueryInterface(__uuidof(IDebugSystemObjects), (void**)&debugSystem))) + { + return hr; + } + ReleaseHolder debugControl; + if (FAILED(hr = debugClient->QueryInterface(__uuidof(IDebugControl), (void**)&debugControl))) + { + return hr; + } + ReleaseHolder debugSymbols; + if (FAILED(hr = debugClient->QueryInterface(__uuidof(IDebugSymbols3), (void**)&debugSymbols))) + { + return hr; + } + m_debugClient = debugClient.Detach(); + m_debugData = debugData.Detach(); + m_debugSystem = debugSystem.Detach(); + m_debugControl = debugControl.Detach(); + m_debugSymbols = debugSymbols.Detach(); + + if (FAILED(hr = m_debugControl->GetExecutingProcessorType(&m_processorType))) + { + return hr; + } + switch (m_processorType) + { + case IMAGE_FILE_MACHINE_AMD64: + case IMAGE_FILE_MACHINE_ARM64: + case IMAGE_FILE_MACHINE_ARM64X: + case IMAGE_FILE_MACHINE_ARM64EC: + case IMAGE_FILE_MACHINE_LOONGARCH64: + case IMAGE_FILE_MACHINE_RISCV64: + m_pointerSize = 8; + break; + + case IMAGE_FILE_MACHINE_I386: + case IMAGE_FILE_MACHINE_ARM: + case IMAGE_FILE_MACHINE_THUMB: + case IMAGE_FILE_MACHINE_ARMNT: + m_pointerSize = 4; + break; + + default: + return E_INVALIDARG; + } + if (IsWindowsTarget()) + { + m_fileSeparator = L'\\'; + } + else + { + m_fileSeparator = L'/'; + } + return S_OK; +} + +void +ClrmaManagedAnalysis::ReleaseDebugClient() +{ + if (m_clrData != nullptr) + { + m_clrData->Release(); + m_clrData = nullptr; + } + if (m_sosDac != nullptr) + { + m_sosDac->Release(); + m_sosDac = nullptr; + } + if (m_clrmaService != nullptr) + { + m_clrmaService->Release(); + m_clrmaService = nullptr; + } + if (m_debugSymbols != nullptr) + { + m_debugSymbols->Release(); + m_debugSymbols= nullptr; + } + if (m_debugControl != nullptr) + { + m_debugControl->Release(); + m_debugControl = nullptr; + } + if (m_debugSystem != nullptr) + { + m_debugSystem->Release(); + m_debugSystem = nullptr; + } + if (m_debugData != nullptr) + { + m_debugData->Release(); + m_debugData = nullptr; + } + if (m_debugClient != nullptr) + { + m_debugClient->Release(); + m_debugClient = nullptr; + } +} + +// +// IUnknown +// + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaManagedAnalysis::QueryInterface( + REFIID InterfaceId, + PVOID* Interface + ) +{ + if (Interface == nullptr) + { + return E_INVALIDARG; + } + + *Interface = nullptr; + + if (IsEqualIID(InterfaceId, IID_IUnknown)) + { + *Interface = (IUnknown*)this; + AddRef(); + return S_OK; + } + else if (IsEqualIID(InterfaceId, __uuidof(ICLRManagedAnalysis))) + { + *Interface = (ICLRManagedAnalysis*)this; + AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +STDMETHODIMP_(ULONG) +ClrmaManagedAnalysis::AddRef() +{ + return (ULONG)InterlockedIncrement(&m_lRefs); +} + +STDMETHODIMP_(ULONG) +ClrmaManagedAnalysis::Release() +{ + LONG lRefs = InterlockedDecrement(&m_lRefs); + if (lRefs == 0) + { + delete this; + } + return lRefs; +} + +// +// ICLRManagedAnalysis +// + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaManagedAnalysis::AssociateClient( + IUnknown* pUnknown + ) +{ + TraceInformation("ClrmaManagedAnalysis::AssociateClient\n"); + + if (pUnknown == nullptr) + { + return E_INVALIDARG; + } + + // Release previous client and DAC interfaces + ReleaseDebugClient(); + + // Setup the debugger client interfaces + HRESULT hr; + if (FAILED(hr = QueryDebugClient(pUnknown))) + { + TraceError("AssociateClient QueryDebugClient FAILED %08x\n", hr); + return hr; + } + + Extensions* extensions = Extensions::GetInstance(); + if (extensions != nullptr && extensions->GetDebuggerServices() != nullptr) + { + extensions->FlushCheck(); + + ITarget* target = extensions->GetTarget(); + if (target != nullptr) + { + // + // First try getting the managed CLRMA service instance + // + if (g_clrmaGlobalFlags & ClrmaGlobalFlags::ManagedClrmaEnabled) + { + TraceInformation("AssociateClient trying managed CLRMA\n"); + ReleaseHolder clrmaService; + if (SUCCEEDED(hr = target->GetService(__uuidof(ICLRMAService), (void**)&clrmaService))) + { + if (SUCCEEDED(hr = clrmaService->AssociateClient(m_debugClient))) + { + m_clrmaService = clrmaService.Detach(); + return S_OK; + } + } + } + // + // If there isn't a managed CLRMA service, use the DAC CLRMA implementation + // + if (g_clrmaGlobalFlags & ClrmaGlobalFlags::DacClrmaEnabled) + { + TraceInformation("AssociateClient trying DAC CLRMA\n"); + IRuntime* runtime = nullptr; + if (FAILED(hr = target->GetRuntime(&runtime))) + { + TraceError("AssociateClient GetRuntime FAILED %08x\n", hr); + return hr; + } + ReleaseHolder clrData; + if (FAILED(hr = runtime->GetClrDataProcess((IXCLRDataProcess**)&clrData))) + { + clrData = GetClrDataFromDbgEng(); + if (clrData == nullptr) + { + TraceError("AssociateClient GetClrDataProcess FAILED %08x\n", hr); + return hr; + } + } + ReleaseHolder sosDac; + if (FAILED(hr = clrData->QueryInterface(__uuidof(ISOSDacInterface), (void**)&sosDac))) + { + TraceError("AssociateClient QueryInterface ISOSDacInterface FAILED %08x\n", hr); + return hr; + } + if (FAILED(hr = sosDac->GetUsefulGlobals(&m_usefulGlobals))) + { + TraceError("AssociateClient GetUsefulGlobals FAILED %08x\n", hr); + return hr; + } + clrData->AddRef(); + m_clrData = clrData.Detach(); + m_sosDac = sosDac.Detach(); + return S_OK; + } + } + } + + return E_NOINTERFACE; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaManagedAnalysis::get_ProviderName( + BSTR* bstrProvider + ) +{ + TraceInformation("ClrmaManagedAnalysis::get_ProviderName\n"); + + if (bstrProvider == nullptr) + { + return E_INVALIDARG; + } + + *bstrProvider = SysAllocString(L"SOSCLRMA"); + + if ((*bstrProvider) == nullptr) + { + return E_OUTOFMEMORY; + } + + return S_OK; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaManagedAnalysis::GetThread( + ULONG osThreadId, + ICLRMAClrThread** ppClrThread +) +{ + TraceInformation("ClrmaManagedAnalysis::GetThread %04x\n", osThreadId); + + if (ppClrThread == nullptr) + { + return E_INVALIDARG; + } + + *ppClrThread = nullptr; + + if (m_debugClient == nullptr) + { + return E_UNEXPECTED; + } + + // Current thread? + HRESULT hr; + if (osThreadId == 0) + { + ULONG tid; + if (FAILED(hr = m_debugSystem->GetCurrentThreadSystemId(&tid))) + { + TraceError("GetThread GetCurrentThreadSystemId FAILED %08x\n", hr); + return hr; + } + osThreadId = tid; + } + // Last event thread? + else if (osThreadId == (ULONG)-1) + { + ULONG lastEventType = 0; + ULONG lastEventProcessId = 0; + ULONG lastEventThreadIdIndex = DEBUG_ANY_ID; + if (FAILED(hr = m_debugControl->GetLastEventInformation(&lastEventType, &lastEventProcessId, &lastEventThreadIdIndex, NULL, 0, NULL, NULL, 0, NULL))) + { + TraceError("GetThread GetLastEventInformation FAILED %08x\n", hr); + return hr; + } + if (lastEventThreadIdIndex == DEBUG_ANY_ID) + { + TraceError("GetThread lastEventThreadIdIndex == DEBUG_ANY_ID\n"); + return E_INVALIDARG; + } + ULONG ids = 0; + ULONG sysIds = 0; + if (FAILED(hr = m_debugSystem->GetThreadIdsByIndex(lastEventThreadIdIndex, 1, &ids, &sysIds))) + { + TraceError("GetThread GetThreadIdsByIndex FAILED %08x\n", hr); + return hr; + } + osThreadId = sysIds; + } + + if (m_clrmaService != nullptr) + { + if (FAILED(hr = m_clrmaService->GetThread(osThreadId, ppClrThread))) + { + TraceError("GetThread ICLRMAService::GetThread FAILED %08x\n", hr); + return hr; + } + } + else + { + ReleaseHolder thread = new (std::nothrow) ClrmaThread(this, osThreadId); + if (thread == nullptr) + { + return E_OUTOFMEMORY; + } + if (FAILED(hr = thread->Initialize())) + { + return hr; + } + if (FAILED(hr = thread->QueryInterface(__uuidof(ICLRMAClrThread), (void**)ppClrThread))) + { + TraceError("GetThread QueryInterface ICLRMAClrThread 1 FAILED %08x\n", hr); + return hr; + } + } + + return S_OK; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaManagedAnalysis::GetException( + ULONG64 address, + ICLRMAClrException** ppClrException + ) +{ + TraceInformation("ClrmaManagedAnalysis::GetException %016llx\n", address); + + if (ppClrException == nullptr) + { + return E_INVALIDARG; + } + + *ppClrException = nullptr; + + if (m_debugClient == nullptr) + { + return E_UNEXPECTED; + } + + HRESULT hr; + if (m_clrmaService != nullptr) + { + if (FAILED(hr = m_clrmaService->GetException(address, ppClrException))) + { + TraceError("GetException ICLRMAService::GetException FAILED %08x\n", hr); + return hr; + } + } + else + { + if (address == 0) + { + ReleaseHolder thread; + if (FAILED(hr = GetThread(0, (ICLRMAClrThread**)&thread))) + { + TraceError("GetException GetThread FAILED %08x\n", hr); + return hr; + } + if (FAILED(hr = thread->get_CurrentException(ppClrException))) + { + TraceError("GetException get_CurrentException FAILED %08x\n", hr); + return hr; + } + } + else + { + ReleaseHolder exception = new (std::nothrow) ClrmaException(this, address); + if (exception == nullptr) + { + TraceError("GetException new ClrmaException FAILED\n"); + return E_OUTOFMEMORY; + } + if (FAILED(hr = exception->QueryInterface(__uuidof(ICLRMAClrException), (void**)ppClrException))) + { + TraceError("GetException QueryInterface ICLRMAClrException 1 FAILED %08x\n", hr); + return hr; + } + } + } + + return S_OK; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaManagedAnalysis::get_ObjectInspection( + ICLRMAObjectInspection** ppObjectInspection) +{ + TraceInformation("ClrmaManagedAnalysis::get_ObjectInspection\n"); + + if (ppObjectInspection == nullptr) + { + return E_INVALIDARG; + } + + *ppObjectInspection = nullptr; + + if (m_debugClient == nullptr) + { + return E_UNEXPECTED; + } + + if (m_clrmaService != nullptr) + { + return m_clrmaService->GetObjectInspection(ppObjectInspection); + } + + return E_NOTIMPL; +} + +HRESULT +ClrmaManagedAnalysis::GetMethodDescInfo(CLRDATA_ADDRESS methodDesc, StackFrame& frame, bool stripFunctionParameters) +{ + HRESULT hr; + DacpMethodDescData methodDescData; + if (SUCCEEDED(hr = methodDescData.Request(SosDacInterface(), methodDesc))) + { + // Don't compute the method displacement if IP is 0 + if (frame.IP > 0) + { + frame.Displacement = (frame.IP - methodDescData.NativeCodeAddr); + } + + DacpModuleData moduleData; + if (SUCCEEDED(hr = moduleData.Request(SosDacInterface(), methodDescData.ModulePtr))) + { + CLRDATA_ADDRESS baseAddress = 0; + ULONG index = DEBUG_ANY_ID; + if (FAILED(hr = SosDacInterface()->GetPEFileBase(moduleData.PEAssembly, &baseAddress)) || baseAddress == 0) + { + TraceInformation("GetMethodDescInfo(%016llx) GetPEFileBase %016llx FAILED %08x\n", methodDesc, moduleData.PEAssembly, hr); + if (FAILED(hr = m_debugSymbols->GetModuleByOffset(frame.IP, 0, &index, &baseAddress))) + { + TraceError("GetMethodDescInfo GetModuleByOffset FAILED %08x\n", hr); + baseAddress = 0; + index = DEBUG_ANY_ID; + } + } + + // Attempt to get the module name from the debugger + ArrayHolder wszModuleName = new WCHAR[MAX_LONGPATH + 1]; + if (baseAddress != 0 || index != DEBUG_ANY_ID) + { + if (SUCCEEDED(hr = m_debugSymbols->GetModuleNameStringWide(DEBUG_MODNAME_MODULE, index, baseAddress, wszModuleName, MAX_LONGPATH, nullptr))) + { + frame.Module = wszModuleName; + } + else + { + TraceError("GetMethodDescInfo(%016llx) GetModuleNameStringWide(%d, %016llx) FAILED %08x\n", methodDesc, index, baseAddress, hr); + } + } + + // Fallback if we can't get it from the debugger + if (frame.Module.empty()) + { + wszModuleName[0] = L'\0'; + if (FAILED(hr = SosDacInterface()->GetPEFileName(moduleData.PEAssembly, MAX_LONGPATH, wszModuleName, nullptr))) + { + TraceInformation("GetMethodDescInfo(%016llx) GetPEFileName(%016llx) FAILED %08x\n", methodDesc, moduleData.PEAssembly, hr); + ReleaseHolder pModule; + if (SUCCEEDED(hr = SosDacInterface()->GetModule(moduleData.Address, (IXCLRDataModule**)&pModule))) + { + ULONG32 nameLen = 0; + if (FAILED(hr = pModule->GetFileName(MAX_LONGPATH, &nameLen, wszModuleName))) + { + TraceError("GetMethodDescInfo IXCLRDataModule::GetFileName FAILED %08x\n", hr); + } + } + else + { + TraceError("GetMethodDescInfo GetModule FAILED %08x\n", hr); + } + } + if (wszModuleName[0] != L'\0') + { + frame.Module = wszModuleName; + _ASSERTE(m_fileSeparator != 0); + size_t nameStart = frame.Module.find_last_of(m_fileSeparator); + if (nameStart != -1) + { + frame.Module = frame.Module.substr(nameStart + 1); + } + } + } + } + else + { + TraceError("GetMethodDescInfo(%016llx) ISOSDacInterface::GetModuleData FAILED %08x\n", methodDesc, hr); + } + + ArrayHolder wszNameBuffer = new WCHAR[MAX_LONGPATH + 1]; + if (SUCCEEDED(hr = SosDacInterface()->GetMethodDescName(methodDesc, MAX_LONGPATH, wszNameBuffer, NULL))) + { + frame.Function = wszNameBuffer; + + // Under certain circumstances DacpMethodDescData::GetMethodDescName() returns a module qualified method name + size_t nameStart = frame.Function.find_first_of(L'!'); + if (nameStart != -1) + { + // Fallback to using the module name from the function name + if (frame.Module.empty()) + { + frame.Module = frame.Function.substr(0, nameStart); + } + // Now strip the module name from the function name. Need to do this after the module name fallback + frame.Function = frame.Function.substr(nameStart + 1); + } + + // Strip off the function parameters + if (stripFunctionParameters) + { + size_t parameterStart = frame.Function.find_first_of(L'('); + if (parameterStart != -1) + { + frame.Function = frame.Function.substr(0, parameterStart); + } + } + } + else + { + TraceError("GetMethodDescInfo(%016llx) ISOSDacInterface::GetMethodDescName FAILED %08x\n", methodDesc, hr); + } + } + else + { + TraceError("GetMethodDescInfo(%016llx) ISOSDacInterface::GetMethodDescData FAILED %08x\n", methodDesc, hr); + } + if (frame.Module.empty()) + { + frame.Module = L"UNKNOWN"; + } + if (frame.Function.empty()) + { + frame.Function = L"UNKNOWN"; + } + return S_OK; +} + +CLRDATA_ADDRESS +ClrmaManagedAnalysis::IsExceptionObj(CLRDATA_ADDRESS mtObj) +{ + CLRDATA_ADDRESS walkMT = mtObj; + DacpMethodTableData dmtd; + HRESULT hr; + + // We want to follow back until we get the mt for System.Exception + while (walkMT != NULL) + { + if (FAILED(hr = dmtd.Request(SosDacInterface(), walkMT))) + { + TraceError("IsExceptionObj ISOSDacInterface::GetMethodDescData FAILED %08x\n", hr); + break; + } + if (walkMT == m_usefulGlobals.ExceptionMethodTable) + { + return walkMT; + } + walkMT = dmtd.ParentMethodTable; + } + + return 0; +} + +WCHAR* +ClrmaManagedAnalysis::GetStringObject(CLRDATA_ADDRESS stringObject) +{ + if (stringObject == 0) + { + return nullptr; + } + HRESULT hr; + DacpObjectData objData; + if (FAILED(hr = objData.Request(SosDacInterface(), stringObject))) + { + TraceError("GetStringObject ISOSDacInterface::GetObjectData FAILED %08x\n", hr); + return nullptr; + } + if (objData.Size > 0x200000) + { + TraceError("GetStringObject object size (%08llx) > 0x200000\n", objData.Size); + return nullptr; + } + // Ignore the HRESULT because this function fails with E_INVALIDARG but still returns cbNeeded. + UINT32 cbNeeded = 0; + SosDacInterface()->GetObjectStringData(stringObject, 0, nullptr, &cbNeeded); + if (cbNeeded <= 0 || cbNeeded > 0x200000) + { + TraceError("GetStringObject needed (%08x) > 0x200000\n", cbNeeded); + return nullptr; + } + ArrayHolder stringBuffer = new (std::nothrow) WCHAR[cbNeeded]; + if (stringBuffer == nullptr) + { + TraceError("GetStringObject out of memory\n"); + return nullptr; + } + if (FAILED(hr = SosDacInterface()->GetObjectStringData(stringObject, cbNeeded, stringBuffer, nullptr))) + { + TraceError("GetStringObject ISOSDacInterface::GetObjectStringData FAILED %08x\n", hr); + return nullptr; + } + return stringBuffer.Detach(); +} + +HRESULT +ClrmaManagedAnalysis::ReadPointer(CLRDATA_ADDRESS address, CLRDATA_ADDRESS* pointer) +{ + _ASSERTE(pointer != nullptr); + _ASSERTE(m_pointerSize == 4 || m_pointerSize == 8); + *pointer = 0; + return m_debugData->ReadVirtual(address, pointer, m_pointerSize, nullptr); +} diff --git a/src/SOS/Strike/clrma/managedanalysis.h b/src/SOS/Strike/clrma/managedanalysis.h new file mode 100644 index 0000000000..02a80a3304 --- /dev/null +++ b/src/SOS/Strike/clrma/managedanalysis.h @@ -0,0 +1,130 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#pragma once + +#include +#include +#include +#include // IDL +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +enum ClrmaGlobalFlags +{ + LoggingEnabled = 0x01, // CLRMA logging enabled + DacClrmaEnabled = 0x02, // Direct DAC CLRMA code enabled + ManagedClrmaEnabled = 0x04, // Native AOT managed support enabled +}; + +#define MAX_STACK_FRAMES 1000 // Max number of stack frames returned from thread stackwalk + +typedef struct StackFrame +{ + ULONG Frame = 0; + ULONG64 SP = 0; + ULONG64 IP = 0; + ULONG64 Displacement = 0; + std::wstring Module; + std::wstring Function; +} StackFrame; + +extern int g_clrmaGlobalFlags; + +extern void TraceInformation(PCSTR format, ...); +extern void TraceError(PCSTR format, ...); + +class ClrmaManagedAnalysis : public ICLRManagedAnalysis +{ +public: + ClrmaManagedAnalysis(); + virtual ~ClrmaManagedAnalysis(); + +public: + // IUnknown + STDMETHOD(QueryInterface)(_In_ REFIID InterfaceId, _Out_ PVOID* Interface); + STDMETHOD_(ULONG, AddRef)(); + STDMETHOD_(ULONG, Release)(); + + // ICLRManagedAnalysis + STDMETHOD(AssociateClient)(_In_ IUnknown* pUnknown); + + STDMETHOD(get_ProviderName)(_Out_ BSTR* bstrProvider); + + STDMETHOD(GetThread)(_In_ ULONG osThreadId, _COM_Outptr_ ICLRMAClrThread** ppClrThread); + + STDMETHOD(GetException)(_In_ ULONG64 address, _COM_Outptr_ ICLRMAClrException** ppClrException); + + STDMETHOD(get_ObjectInspection)(_COM_Outptr_ ICLRMAObjectInspection** ppObjectInspection); + + // Helper functions + inline IXCLRDataProcess* ClrData() { return m_clrData; } + inline ISOSDacInterface* SosDacInterface() { return m_sosDac; } + inline int PointerSize() { return m_pointerSize; } + inline ULONG ProcessorType() { return m_processorType; } + inline CLRDATA_ADDRESS ObjectMethodTable() { return m_usefulGlobals.ObjectMethodTable; } + + /// + /// Fills in the frame.Module and frame.Function from the MethodDesc. + /// + HRESULT GetMethodDescInfo(CLRDATA_ADDRESS methodDesc, StackFrame& frame, bool stripFunctionParameters); + + /// + /// Returns base Exception MT address if exception derived MT + /// + CLRDATA_ADDRESS IsExceptionObj(CLRDATA_ADDRESS mtObj); + + /// + /// Return the string object contents + /// + WCHAR* GetStringObject(CLRDATA_ADDRESS stringObject); + + /// + /// Reads a target size pointer. + /// + HRESULT ReadPointer(CLRDATA_ADDRESS address, CLRDATA_ADDRESS* pointer); + + /// + /// Read memory + /// + inline HRESULT ReadMemory(CLRDATA_ADDRESS address, PVOID buffer, ULONG cb) { return m_debugData->ReadVirtual(address, buffer, cb, nullptr); } + +private: + HRESULT QueryDebugClient(IUnknown* pUnknown); + void ReleaseDebugClient(); + + LONG m_lRefs; + int m_pointerSize; + WCHAR m_fileSeparator; + ULONG m_processorType; + IDebugClient* m_debugClient; + IDebugDataSpaces* m_debugData; + IDebugSystemObjects* m_debugSystem; + IDebugControl* m_debugControl; + IDebugSymbols3* m_debugSymbols; + + // CLRMA service from managed code + ICLRMAService* m_clrmaService; + + // DAC interface instances + IXCLRDataProcess* m_clrData; + ISOSDacInterface* m_sosDac; + + DacpUsefulGlobalsData m_usefulGlobals; +}; + +#include "thread.h" +#include "exception.h" + diff --git a/src/SOS/Strike/clrma/thread.cpp b/src/SOS/Strike/clrma/thread.cpp new file mode 100644 index 0000000000..bd8220f8ac --- /dev/null +++ b/src/SOS/Strike/clrma/thread.cpp @@ -0,0 +1,525 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "managedanalysis.h" +#include + +_Use_decl_annotations_ +ClrmaThread::ClrmaThread(ClrmaManagedAnalysis* managedAnalysis, ULONG osThreadId) : + m_lRefs(1), + m_managedAnalysis(managedAnalysis), + m_osThreadId(osThreadId), + m_lastThrownObject(0), + m_firstNestedException(0), + m_stackFramesInitialized(false), + m_nestedExceptionsInitialized(false) +{ + _ASSERTE(osThreadId != 0 && osThreadId != (ULONG)-1); + managedAnalysis->AddRef(); +} + +ClrmaThread::~ClrmaThread() +{ + TraceInformation("~ClrmaThread\n"); + if (m_managedAnalysis != nullptr) + { + m_managedAnalysis->Release(); + m_managedAnalysis = nullptr; + } +} + +/// +/// This function returns success if this thread is managed and caches some managed exception info away. +/// +HRESULT +ClrmaThread::Initialize() +{ + TraceInformation("ClrmaThread::Initialize %04x\n", m_osThreadId); + HRESULT hr; + DacpThreadStoreData threadStore; + if (FAILED(hr = threadStore.Request(m_managedAnalysis->SosDacInterface()))) + { + TraceError("ClrmaThread::Initialize GetThreadStoreData FAILED %08x\n", hr); + return hr; + } + DacpThreadData thread; + CLRDATA_ADDRESS curThread = threadStore.firstThread; + while (curThread != 0) + { + if ((hr = thread.Request(m_managedAnalysis->SosDacInterface(), curThread)) != S_OK) + { + TraceError("ClrmaThread::Initialize GetThreadData FAILED %08x\n", hr); + return hr; + } + if (thread.osThreadId == m_osThreadId) + { + if (thread.lastThrownObjectHandle != 0) + { + if (FAILED(hr = m_managedAnalysis->ReadPointer(thread.lastThrownObjectHandle, &m_lastThrownObject))) + { + TraceError("ClrmaThread::Initialize ReadPointer FAILED %08x\n", hr); + } + } + m_firstNestedException = thread.firstNestedException; + return S_OK; + } + curThread = thread.nextThread; + } + TraceError("ClrmaThread::Initialize FAILED managed thread not found\n"); + return E_FAIL; +} + +// +// IUnknown +// + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaThread::QueryInterface( + REFIID InterfaceId, + PVOID* Interface + ) +{ + if (Interface == nullptr) + { + return E_INVALIDARG; + } + + *Interface = nullptr; + + if (IsEqualIID(InterfaceId, IID_IUnknown)) + { + *Interface = (IUnknown*)this; + AddRef(); + return S_OK; + } + else if (IsEqualIID(InterfaceId, __uuidof(ICLRMAClrThread))) + { + *Interface = (ICLRMAClrThread*)this; + AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +STDMETHODIMP_(ULONG) +ClrmaThread::AddRef() +{ + return (ULONG)InterlockedIncrement(&m_lRefs); +} + +STDMETHODIMP_(ULONG) +ClrmaThread::Release() +{ + LONG lRefs = InterlockedDecrement(&m_lRefs); + if (lRefs == 0) + { + delete this; + } + return lRefs; +} + +// +// ICLRMAClrThread +// + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaThread::get_DebuggerCommand( + BSTR* pValue + ) +{ + if (pValue == nullptr) + { + return E_INVALIDARG; + } + *pValue = nullptr; + return E_NOTIMPL; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaThread::get_OSThreadId( + ULONG* pOSThreadId + ) +{ + if (pOSThreadId == nullptr) + { + return E_INVALIDARG; + } + *pOSThreadId = m_osThreadId; + return S_OK; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaThread::get_FrameCount( + UINT* pCount + ) +{ + TraceInformation("ClrmaThread::get_FrameCount\n"); + + if (pCount == nullptr) + { + return E_INVALIDARG; + } + + *pCount = 0; + + if (m_managedAnalysis == nullptr) + { + return E_UNEXPECTED; + } + + if (!m_stackFramesInitialized) + { + m_stackFrames.clear(); + + ReleaseHolder pTask; + HRESULT hr; + if (SUCCEEDED(hr = m_managedAnalysis->ClrData()->GetTaskByOSThreadID( + m_osThreadId, + (IXCLRDataTask**)&pTask))) + { + ReleaseHolder pStackWalk; + if (SUCCEEDED(hr = pTask->CreateStackWalk( + CLRDATA_SIMPFRAME_UNRECOGNIZED | + CLRDATA_SIMPFRAME_MANAGED_METHOD | + CLRDATA_SIMPFRAME_RUNTIME_MANAGED_CODE | + CLRDATA_SIMPFRAME_RUNTIME_UNMANAGED_CODE, + (IXCLRDataStackWalk**)&pStackWalk))) + { + // For each managed stack frame + int index = 0; + int count = 0; + do + { + StackFrame frame; + frame.Frame = index; + if (FAILED(hr = GetFrameLocation(pStackWalk, &frame.IP, &frame.SP))) + { + TraceError("Unwind: GetFrameLocation() FAILED %08x\n", hr); + break; + } + // Only include normal frames, skipping any special frames + DacpFrameData frameData; + if (SUCCEEDED(hr = frameData.Request(pStackWalk)) && frameData.frameAddr != 0) + { + TraceInformation("Unwind: skipping special frame SP %016llx IP %016llx\n", frame.SP, frame.IP); + continue; + } + CLRDATA_ADDRESS methodDesc = 0; + if (FAILED(hr = m_managedAnalysis->SosDacInterface()->GetMethodDescPtrFromIP(frame.IP, &methodDesc))) + { + TraceInformation("Unwind: skipping frame GetMethodDescPtrFromIP(%016llx) FAILED %08x\n", frame.IP, hr); + continue; + } + // Get normal module and method names like MethodNameFromIP() does for !clrstack + if (FAILED(hr = m_managedAnalysis->GetMethodDescInfo(methodDesc, frame, /* stripFunctionParameters */ false))) + { + TraceInformation("Unwind: skipping frame GetMethodDescInfo(%016llx) FAILED %08x\n", methodDesc, hr); + continue; + } + m_stackFrames.push_back(frame); + index++; + + } while (count++ < MAX_STACK_FRAMES && pStackWalk->Next() == S_OK); + } + else + { + TraceError("Unwind: CreateStackWalk FAILED %08x\n", hr); + } + } + else + { + TraceError("Unwind: GetTaskByOSThreadID FAILED %08x\n", hr); + } + + m_stackFramesInitialized = true; + } + + *pCount = (USHORT)m_stackFrames.size(); + + return ((*pCount) != 0) ? S_OK : S_FALSE; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaThread::Frame( + UINT nFrame, + ULONG64* pAddrIP, + ULONG64* pAddrSP, + BSTR* bstrModule, + BSTR* bstrFunction, + ULONG64* pDisplacement + ) +{ + TraceInformation("ClrmaThread::Frame %d\n", nFrame); + + if (!pAddrIP || !pAddrSP || !bstrModule || !bstrFunction || !pDisplacement) + { + return E_INVALIDARG; + } + + *pAddrIP = 0; + *pAddrSP = 0; + *bstrModule = nullptr; + *bstrFunction = nullptr; + *pDisplacement = 0; + + UINT nCount = 0; + HRESULT hr; + if (FAILED(hr= get_FrameCount(&nCount))) + { + return hr; + } + + if (nFrame >= nCount) + { + return E_BOUNDS; + } + + BSTR moduleName = SysAllocString(m_stackFrames[nFrame].Module.c_str()); + if (moduleName == nullptr) + { + return E_OUTOFMEMORY; + } + + BSTR functionName = SysAllocString(m_stackFrames[nFrame].Function.c_str()); + if (functionName == nullptr) + { + SysFreeString(moduleName); + return E_OUTOFMEMORY; + } + + *pAddrIP = m_stackFrames[nFrame].IP; + *pAddrSP = m_stackFrames[nFrame].SP; + *bstrModule = moduleName; + *bstrFunction = functionName; + *pDisplacement = m_stackFrames[nFrame].Displacement; + + return S_OK; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaThread::get_CurrentException( + ICLRMAClrException** ppClrException + ) +{ + TraceInformation("ClrmaThread::get_CurrentException\n"); + + if (ppClrException == nullptr) + { + return E_INVALIDARG; + } + + *ppClrException = nullptr; + + if (m_managedAnalysis == nullptr) + { + return E_UNEXPECTED; + } + + if (m_lastThrownObject != 0) + { + ReleaseHolder exception = new (std::nothrow) ClrmaException(m_managedAnalysis, m_lastThrownObject); + if (exception == nullptr) + { + return E_OUTOFMEMORY; + } + HRESULT hr; + if (FAILED(hr = exception->QueryInterface(__uuidof(ICLRMAClrException), (void**)ppClrException))) + { + return hr; + } + } + + return ((*ppClrException) != nullptr) ? S_OK : S_FALSE; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaThread::get_NestedExceptionCount( + USHORT* pCount + ) +{ + TraceInformation("ClrmaThread::get_NestedExceptionCount\n"); + + if (pCount == nullptr) + { + return E_INVALIDARG; + } + + *pCount = 0; + + if (m_managedAnalysis == nullptr) + { + return E_UNEXPECTED; + } + + if (!m_nestedExceptionsInitialized) + { + m_nestedExceptions.clear(); + + HRESULT hr; + CLRDATA_ADDRESS currentNested = m_firstNestedException; + while (currentNested != 0) + { + CLRDATA_ADDRESS obj = 0, next = 0; + if (FAILED(hr = m_managedAnalysis->SosDacInterface()->GetNestedExceptionData(currentNested, &obj, &next))) + { + TraceError("get_NestedExceptionCount GetNestedExceptionData FAILED %08x\n", hr); + return hr; + } + m_nestedExceptions.push_back(obj); + currentNested = next; + } + + m_nestedExceptionsInitialized = true; + } + + *pCount = (USHORT)m_nestedExceptions.size(); + + return ((*pCount) != 0) ? S_OK : S_FALSE; +} + +_Use_decl_annotations_ +STDMETHODIMP +ClrmaThread::NestedException( + USHORT nIndex, + ICLRMAClrException** ppClrException + ) +{ + TraceInformation("ClrmaThread::NestedException %d\n", nIndex); + + if (ppClrException == nullptr) + { + return E_INVALIDARG; + } + + *ppClrException = nullptr; + + HRESULT hr; + USHORT nCount = 0; + if (hr = get_NestedExceptionCount(&nCount)) + { + return hr; + } + + if (nIndex >= nCount) + { + return E_BOUNDS; + } + + ReleaseHolder exception = new (std::nothrow) ClrmaException(m_managedAnalysis, m_nestedExceptions[nIndex]); + if (exception == nullptr) + { + return E_OUTOFMEMORY; + } + + if (FAILED(hr = exception->QueryInterface(__uuidof(ICLRMAClrException), (void**)ppClrException))) + { + return hr; + } + + return ((*ppClrException) != nullptr) ? S_OK : S_FALSE; +} + +HRESULT +ClrmaThread::GetFrameLocation( + IXCLRDataStackWalk* pStackWalk, + CLRDATA_ADDRESS* ip, + CLRDATA_ADDRESS* sp) +{ + ULONG32 contextSize = 0; + ULONG32 contextFlags = CONTEXT_ARM64_CONTROL; + ULONG processorType = m_managedAnalysis->ProcessorType(); + switch (processorType) + { + case IMAGE_FILE_MACHINE_AMD64: + contextSize = sizeof(AMD64_CONTEXT); + contextFlags = 0x00100001; + break; + + case IMAGE_FILE_MACHINE_ARM64: + contextSize = sizeof(ARM64_CONTEXT); + contextFlags = 0x00400001; + break; + + case IMAGE_FILE_MACHINE_I386: + contextSize = sizeof(X86_CONTEXT); + contextFlags = 0x00010001; + break; + + case IMAGE_FILE_MACHINE_ARM: + case IMAGE_FILE_MACHINE_THUMB: + case IMAGE_FILE_MACHINE_ARMNT: + contextSize = sizeof(ARM_CONTEXT); + contextFlags = 0x00200001; + break; + + case IMAGE_FILE_MACHINE_RISCV64: + contextSize = sizeof(RISCV64_CONTEXT); + contextFlags = 0x01000001; + break; + + case IMAGE_FILE_MACHINE_LOONGARCH64: + contextSize = sizeof(LOONGARCH64_CONTEXT); + contextFlags = 0x00800001; + break; + + default: + TraceError("GetFrameLocation: Invalid processor type %04x\n", processorType); + return E_FAIL; + } + CROSS_PLATFORM_CONTEXT context; + HRESULT hr = pStackWalk->GetContext(contextFlags, contextSize, nullptr, (BYTE *)&context); + if (FAILED(hr)) + { + TraceError("GetFrameLocation GetContext failed: %08x\n", hr); + return hr; + } + if (hr == S_FALSE) + { + // GetContext returns S_FALSE if the frame iterator is invalid. That's basically an error for us. + TraceError("GetFrameLocation GetContext returned S_FALSE\n"); + return E_FAIL; + } + switch (processorType) + { + case IMAGE_FILE_MACHINE_AMD64: + *ip = context.Amd64Context.Rip; + *sp = context.Amd64Context.Rsp; + break; + + case IMAGE_FILE_MACHINE_ARM64: + *ip = context.Arm64Context.Pc; + *sp = context.Arm64Context.Sp; + break; + + case IMAGE_FILE_MACHINE_I386: + *ip = context.X86Context.Eip; + *sp = context.X86Context.Esp; + break; + + case IMAGE_FILE_MACHINE_ARM: + case IMAGE_FILE_MACHINE_THUMB: + case IMAGE_FILE_MACHINE_ARMNT: + *ip = context.ArmContext.Pc & ~THUMB_CODE; + *sp = context.ArmContext.Sp; + break; + + case IMAGE_FILE_MACHINE_RISCV64: + *ip = context.RiscV64Context.Pc; + *sp = context.RiscV64Context.Sp; + break; + + case IMAGE_FILE_MACHINE_LOONGARCH64: + *ip = context.LoongArch64Context.Pc; + *sp = context.LoongArch64Context.Sp; + break; + } + return S_OK; +} diff --git a/src/SOS/Strike/clrma/thread.h b/src/SOS/Strike/clrma/thread.h new file mode 100644 index 0000000000..96d2f251c3 --- /dev/null +++ b/src/SOS/Strike/clrma/thread.h @@ -0,0 +1,52 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#pragma once + +#include "managedanalysis.h" + +class ClrmaThread : public ICLRMAClrThread +{ +public: + ClrmaThread(_In_ ClrmaManagedAnalysis* managedAnalysis, _In_ ULONG osThreadId); + virtual ~ClrmaThread(); + +public: + // IUnknown + STDMETHOD(QueryInterface)(_In_ REFIID InterfaceId, _Out_ PVOID* Interface); + STDMETHOD_(ULONG, AddRef)(); + STDMETHOD_(ULONG, Release)(); + + // ICLRMAClrThread + STDMETHOD(get_DebuggerCommand)(_Out_ BSTR* pValue); + STDMETHOD(get_OSThreadId)(_Out_ ULONG* pValue); + + STDMETHOD(get_FrameCount)(_Out_ UINT* pCount); + STDMETHOD(Frame)(_In_ UINT nFrame, _Out_ ULONG64* pAddrIP, _Out_ ULONG64* pAddrSP, _Out_ BSTR* bstrModule, _Out_ BSTR* bstrFunction, _Out_ ULONG64* pDisplacement); + + STDMETHOD(get_CurrentException)(_COM_Outptr_result_maybenull_ ICLRMAClrException** ppClrException); + + STDMETHOD(get_NestedExceptionCount)(_Out_ USHORT* pCount); + STDMETHOD(NestedException)(_In_ USHORT nIndex, _COM_Outptr_ ICLRMAClrException** ppClrException); + + HRESULT Initialize(); + +private: + LONG m_lRefs; + ClrmaManagedAnalysis* m_managedAnalysis; + ULONG m_osThreadId; + + // ClrmaThread::Initialize() + CLRDATA_ADDRESS m_lastThrownObject; + CLRDATA_ADDRESS m_firstNestedException; + + // Initialized in ClrmaThread::get_FrameCount + std::vector m_stackFrames; + bool m_stackFramesInitialized; + + // Initialized in ClrmaThread::get_NestedExceptionCount + std::vector m_nestedExceptions; + bool m_nestedExceptionsInitialized; + + HRESULT GetFrameLocation(IXCLRDataStackWalk* pStackWalk, CLRDATA_ADDRESS* ip, CLRDATA_ADDRESS* sp); +}; diff --git a/src/SOS/Strike/crosscontext.h b/src/SOS/Strike/crosscontext.h new file mode 100644 index 0000000000..47937e3761 --- /dev/null +++ b/src/SOS/Strike/crosscontext.h @@ -0,0 +1,399 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#pragma once + +/// X86 Context +#define X86_SIZE_OF_80387_REGISTERS 80 +#define X86_MAXIMUM_SUPPORTED_EXTENSION 512 + +typedef struct { + DWORD ControlWord; + DWORD StatusWord; + DWORD TagWord; + DWORD ErrorOffset; + DWORD ErrorSelector; + DWORD DataOffset; + DWORD DataSelector; + BYTE RegisterArea[X86_SIZE_OF_80387_REGISTERS]; + DWORD Cr0NpxState; +} X86_FLOATING_SAVE_AREA; + +typedef struct { + + DWORD ContextFlags; + DWORD Dr0; + DWORD Dr1; + DWORD Dr2; + DWORD Dr3; + DWORD Dr6; + DWORD Dr7; + + X86_FLOATING_SAVE_AREA FloatSave; + + DWORD SegGs; + DWORD SegFs; + DWORD SegEs; + DWORD SegDs; + + DWORD Edi; + DWORD Esi; + DWORD Ebx; + DWORD Edx; + DWORD Ecx; + DWORD Eax; + + DWORD Ebp; + DWORD Eip; + DWORD SegCs; + DWORD EFlags; + DWORD Esp; + DWORD SegSs; + + BYTE ExtendedRegisters[X86_MAXIMUM_SUPPORTED_EXTENSION]; + +} X86_CONTEXT; + +typedef struct { + ULONGLONG Low; + LONGLONG High; +} M128A_XPLAT; + + +/// AMD64 Context +typedef struct { + WORD ControlWord; + WORD StatusWord; + BYTE TagWord; + BYTE Reserved1; + WORD ErrorOpcode; + DWORD ErrorOffset; + WORD ErrorSelector; + WORD Reserved2; + DWORD DataOffset; + WORD DataSelector; + WORD Reserved3; + DWORD MxCsr; + DWORD MxCsr_Mask; + M128A_XPLAT FloatRegisters[8]; + +#if defined(_WIN64) + M128A_XPLAT XmmRegisters[16]; + BYTE Reserved4[96]; +#else + M128A_XPLAT XmmRegisters[8]; + BYTE Reserved4[220]; + + DWORD Cr0NpxState; +#endif + +} AMD64_XMM_SAVE_AREA32; + +typedef struct { + + DWORD64 P1Home; + DWORD64 P2Home; + DWORD64 P3Home; + DWORD64 P4Home; + DWORD64 P5Home; + DWORD64 P6Home; + + DWORD ContextFlags; + DWORD MxCsr; + + WORD SegCs; + WORD SegDs; + WORD SegEs; + WORD SegFs; + WORD SegGs; + WORD SegSs; + DWORD EFlags; + + DWORD64 Dr0; + DWORD64 Dr1; + DWORD64 Dr2; + DWORD64 Dr3; + DWORD64 Dr6; + DWORD64 Dr7; + + DWORD64 Rax; + DWORD64 Rcx; + DWORD64 Rdx; + DWORD64 Rbx; + DWORD64 Rsp; + DWORD64 Rbp; + DWORD64 Rsi; + DWORD64 Rdi; + DWORD64 R8; + DWORD64 R9; + DWORD64 R10; + DWORD64 R11; + DWORD64 R12; + DWORD64 R13; + DWORD64 R14; + DWORD64 R15; + + DWORD64 Rip; + + union { + AMD64_XMM_SAVE_AREA32 FltSave; + struct { + M128A_XPLAT Header[2]; + M128A_XPLAT Legacy[8]; + M128A_XPLAT Xmm0; + M128A_XPLAT Xmm1; + M128A_XPLAT Xmm2; + M128A_XPLAT Xmm3; + M128A_XPLAT Xmm4; + M128A_XPLAT Xmm5; + M128A_XPLAT Xmm6; + M128A_XPLAT Xmm7; + M128A_XPLAT Xmm8; + M128A_XPLAT Xmm9; + M128A_XPLAT Xmm10; + M128A_XPLAT Xmm11; + M128A_XPLAT Xmm12; + M128A_XPLAT Xmm13; + M128A_XPLAT Xmm14; + M128A_XPLAT Xmm15; + } DUMMYSTRUCTNAME; + } DUMMYUNIONNAME; + + M128A_XPLAT VectorRegister[26]; + DWORD64 VectorControl; + + DWORD64 DebugControl; + DWORD64 LastBranchToRip; + DWORD64 LastBranchFromRip; + DWORD64 LastExceptionToRip; + DWORD64 LastExceptionFromRip; + +} AMD64_CONTEXT; + +typedef struct{ + __int64 LowPart; + __int64 HighPart; +} FLOAT128_XPLAT; + + +/// ARM Context +#define ARM_MAX_BREAKPOINTS_CONST 8 +#define ARM_MAX_WATCHPOINTS_CONST 1 +typedef DECLSPEC_ALIGN(8) struct { + + DWORD ContextFlags; + + DWORD R0; + DWORD R1; + DWORD R2; + DWORD R3; + DWORD R4; + DWORD R5; + DWORD R6; + DWORD R7; + DWORD R8; + DWORD R9; + DWORD R10; + DWORD R11; + DWORD R12; + + DWORD Sp; + DWORD Lr; + DWORD Pc; + DWORD Cpsr; + + DWORD Fpscr; + DWORD Padding; + union { + M128A_XPLAT Q[16]; + ULONGLONG D[32]; + DWORD S[32]; + } DUMMYUNIONNAME; + + DWORD Bvr[ARM_MAX_BREAKPOINTS_CONST]; + DWORD Bcr[ARM_MAX_BREAKPOINTS_CONST]; + DWORD Wvr[ARM_MAX_WATCHPOINTS_CONST]; + DWORD Wcr[ARM_MAX_WATCHPOINTS_CONST]; + + DWORD Padding2[2]; + +} ARM_CONTEXT; + +// On ARM this mask is or'ed with the address of code to get an instruction pointer +#ifndef THUMB_CODE +#define THUMB_CODE 1 +#endif + +///ARM64 Context +#define ARM64_MAX_BREAKPOINTS 8 +#define ARM64_MAX_WATCHPOINTS 2 +typedef struct { + + DWORD ContextFlags; + DWORD Cpsr; // NZVF + DAIF + CurrentEL + SPSel + union { + struct { + DWORD64 X0; + DWORD64 X1; + DWORD64 X2; + DWORD64 X3; + DWORD64 X4; + DWORD64 X5; + DWORD64 X6; + DWORD64 X7; + DWORD64 X8; + DWORD64 X9; + DWORD64 X10; + DWORD64 X11; + DWORD64 X12; + DWORD64 X13; + DWORD64 X14; + DWORD64 X15; + DWORD64 X16; + DWORD64 X17; + DWORD64 X18; + DWORD64 X19; + DWORD64 X20; + DWORD64 X21; + DWORD64 X22; + DWORD64 X23; + DWORD64 X24; + DWORD64 X25; + DWORD64 X26; + DWORD64 X27; + DWORD64 X28; + }; + + DWORD64 X[29]; + }; + + DWORD64 Fp; + DWORD64 Lr; + DWORD64 Sp; + DWORD64 Pc; + + + M128A_XPLAT V[32]; + DWORD Fpcr; + DWORD Fpsr; + + DWORD Bcr[ARM64_MAX_BREAKPOINTS]; + DWORD64 Bvr[ARM64_MAX_BREAKPOINTS]; + DWORD Wcr[ARM64_MAX_WATCHPOINTS]; + DWORD64 Wvr[ARM64_MAX_WATCHPOINTS]; + +} ARM64_CONTEXT; + +///RISCV64 Context +#define RISCV64_MAX_BREAKPOINTS 8 +#define RISCV64_MAX_WATCHPOINTS 2 +typedef struct { + + DWORD ContextFlags; + + DWORD64 R0; + DWORD64 Ra; + DWORD64 Sp; + DWORD64 Gp; + DWORD64 Tp; + DWORD64 T0; + DWORD64 T1; + DWORD64 T2; + DWORD64 Fp; + DWORD64 S1; + DWORD64 A0; + DWORD64 A1; + DWORD64 A2; + DWORD64 A3; + DWORD64 A4; + DWORD64 A5; + DWORD64 A6; + DWORD64 A7; + DWORD64 S2; + DWORD64 S3; + DWORD64 S4; + DWORD64 S5; + DWORD64 S6; + DWORD64 S7; + DWORD64 S8; + DWORD64 S9; + DWORD64 S10; + DWORD64 S11; + DWORD64 T3; + DWORD64 T4; + DWORD64 T5; + DWORD64 T6; + DWORD64 Pc; + + ULONGLONG F[32]; + DWORD Fcsr; + + DWORD Padding[3]; + +} RISCV64_CONTEXT; + +///LOONGARCH64 Context +#define LOONGARCH64_MAX_BREAKPOINTS 8 +#define LOONGARCH64_MAX_WATCHPOINTS 2 +typedef struct { + + DWORD ContextFlags; + + DWORD64 R0; + DWORD64 Ra; + DWORD64 Tp; + DWORD64 Sp; + DWORD64 A0; + DWORD64 A1; + DWORD64 A2; + DWORD64 A3; + DWORD64 A4; + DWORD64 A5; + DWORD64 A6; + DWORD64 A7; + DWORD64 T0; + DWORD64 T1; + DWORD64 T2; + DWORD64 T3; + DWORD64 T4; + DWORD64 T5; + DWORD64 T6; + DWORD64 T7; + DWORD64 T8; + DWORD64 X0; + DWORD64 Fp; + DWORD64 S0; + DWORD64 S1; + DWORD64 S2; + DWORD64 S3; + DWORD64 S4; + DWORD64 S5; + DWORD64 S6; + DWORD64 S7; + DWORD64 S8; + DWORD64 Pc; + + // + // Floating Point Registers: FPR64/LSX/LASX. + // + ULONGLONG F[4*32]; + DWORD64 Fcc; + DWORD Fcsr; + +} LOONGARCH64_CONTEXT; + +typedef struct _CROSS_PLATFORM_CONTEXT { + + _CROSS_PLATFORM_CONTEXT() {} + + union { + X86_CONTEXT X86Context; + AMD64_CONTEXT Amd64Context; + ARM_CONTEXT ArmContext; + ARM64_CONTEXT Arm64Context; + RISCV64_CONTEXT RiscV64Context; + LOONGARCH64_CONTEXT LoongArch64Context; + }; + +} CROSS_PLATFORM_CONTEXT, *PCROSS_PLATFORM_CONTEXT; + diff --git a/src/SOS/Strike/dacprivate2x.h b/src/SOS/Strike/dacprivate2x.h new file mode 100644 index 0000000000..5db02a3fac --- /dev/null +++ b/src/SOS/Strike/dacprivate2x.h @@ -0,0 +1,20 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#pragma once + +// 2.x version +struct MSLAYOUT DacpTieredVersionData_2x +{ + enum TieredState + { + NON_TIERED, + TIERED_0, + TIERED_1, + TIERED_UNKNOWN + }; + + CLRDATA_ADDRESS NativeCodeAddr; + TieredState TieredInfo; + CLRDATA_ADDRESS NativeCodeVersionNodePtr; +}; diff --git a/src/SOS/Strike/dbgengservices.cpp b/src/SOS/Strike/dbgengservices.cpp index 58187515b9..8d6bbaa64e 100644 --- a/src/SOS/Strike/dbgengservices.cpp +++ b/src/SOS/Strike/dbgengservices.cpp @@ -5,7 +5,6 @@ #include #include #include "hostservices.h" -#include "dbgengservices.h" #include "exts.h" extern IMachine* GetTargetMachine(ULONG processorType); @@ -190,10 +189,24 @@ DbgEngServices::GetDebuggeeType( } HRESULT -DbgEngServices::GetExecutingProcessorType( +DbgEngServices::GetProcessorType( PULONG type) { - return m_control->GetExecutingProcessorType(type); + ULONG executingType; + HRESULT hr = m_control->GetExecutingProcessorType(&executingType); + if (FAILED(hr)) + { + return hr; + } + _ASSERTE(executingType != IMAGE_FILE_MACHINE_ARM64X); + *type = executingType; +#if defined(SOS_TARGET_AMD64) || defined(SOS_TARGET_ARM64) + if (executingType == IMAGE_FILE_MACHINE_ARM64EC) + { + *type = IMAGE_FILE_MACHINE_AMD64; + } +#endif // defined(SOS_TARGET_AMD64) || defined(SOS_TARGET_ARM64) + return S_OK; } HRESULT @@ -242,6 +255,14 @@ DbgEngServices::GetNumberModules( return m_symbols->GetNumberModules(loaded, unloaded); } +HRESULT +DbgEngServices::GetModuleByIndex( + ULONG index, + PULONG64 base) +{ + return m_symbols->GetModuleByIndex(index, base); +} + HRESULT DbgEngServices::GetModuleNames( ULONG index, @@ -268,15 +289,19 @@ DbgEngServices::GetModuleInfo( PULONG timestamp, PULONG checksum) { - HRESULT hr = m_symbols->GetModuleByIndex(index, moduleBase); + ULONG64 base; + HRESULT hr = m_symbols->GetModuleByIndex(index, &base); if (FAILED(hr)) { return hr; } DEBUG_MODULE_PARAMETERS params; - hr = m_symbols->GetModuleParameters(1, moduleBase, 0, ¶ms); + hr = m_symbols->GetModuleParameters(1, &base, 0, ¶ms); if (FAILED(hr)) { return hr; } + if (moduleBase) { + *moduleBase = base; + } if (moduleSize) { *moduleSize = params.Size; } @@ -301,6 +326,16 @@ DbgEngServices::GetModuleVersionInformation( return m_symbols->GetModuleVersionInformation(index, base, item, buffer, bufferSize, versionInfoSize); } +HRESULT +DbgEngServices::GetModuleByModuleName( + PCSTR name, + ULONG startIndex, + PULONG index, + PULONG64 base) +{ + return m_symbols->GetModuleByModuleName(name, startIndex, index, base); +} + HRESULT DbgEngServices::GetNumberThreads( PULONG number) @@ -536,6 +571,26 @@ DbgEngServices::GetLastEventInformation( descriptionUsed); } +void +DbgEngServices::FlushCheck() +{ + // Flush the target when the debugger target breaks + if (m_flushNeeded) + { + m_flushNeeded = false; + Extensions::GetInstance()->FlushTarget(); + } +} + +HRESULT +DbgEngServices::ExecuteHostCommand( + PCSTR commandLine, + PEXECUTE_COMMAND_OUTPUT_CALLBACK callback) +{ + OutputCaptureHolder holder(m_client, callback); + return m_control->Execute(DEBUG_OUTCTL_THIS_CLIENT, commandLine, DEBUG_EXECUTE_NO_REPEAT); +} + //---------------------------------------------------------------------------- // IRemoteMemoryService //---------------------------------------------------------------------------- @@ -708,17 +763,6 @@ HRESULT DbgEngServices::UnloadModule( // Helper Functions //---------------------------------------------------------------------------- -void -DbgEngServices::FlushCheck(Extensions* extensions) -{ - // Flush the target when the debugger target breaks - if (m_flushNeeded) - { - m_flushNeeded = false; - extensions->FlushTarget(); - } -} - IMachine* DbgEngServices::GetMachine() { diff --git a/src/SOS/Strike/dbgengservices.h b/src/SOS/Strike/dbgengservices.h index f7ba96cac2..c7cbb4092e 100644 --- a/src/SOS/Strike/dbgengservices.h +++ b/src/SOS/Strike/dbgengservices.h @@ -41,8 +41,6 @@ class DbgEngServices : public IDebuggerServices, public IRemoteMemoryService, pu // Helper functions //---------------------------------------------------------------------------- - void FlushCheck(Extensions* extensions); - IMachine* GetMachine(); HRESULT SetCurrentThreadIdFromSystemId( @@ -74,7 +72,7 @@ class DbgEngServices : public IDebuggerServices, public IRemoteMemoryService, pu PULONG debugClass, PULONG qualifier); - HRESULT STDMETHODCALLTYPE GetExecutingProcessorType( + HRESULT STDMETHODCALLTYPE GetProcessorType( PULONG type); HRESULT STDMETHODCALLTYPE AddCommand( @@ -103,6 +101,10 @@ class DbgEngServices : public IDebuggerServices, public IRemoteMemoryService, pu PULONG loaded, PULONG unloaded); + HRESULT STDMETHODCALLTYPE GetModuleByIndex( + ULONG index, + PULONG64 base); + HRESULT STDMETHODCALLTYPE GetModuleNames( ULONG index, ULONG64 base, @@ -131,6 +133,12 @@ class DbgEngServices : public IDebuggerServices, public IRemoteMemoryService, pu ULONG bufferSize, PULONG versionInfoSize); + HRESULT STDMETHODCALLTYPE GetModuleByModuleName( + PCSTR name, + ULONG startIndex, + PULONG index, + PULONG64 base); + HRESULT STDMETHODCALLTYPE GetNumberThreads( PULONG number); @@ -218,6 +226,12 @@ class DbgEngServices : public IDebuggerServices, public IRemoteMemoryService, pu ULONG descriptionSize, PULONG descriptionUsed); + void STDMETHODCALLTYPE FlushCheck(); + + HRESULT STDMETHODCALLTYPE ExecuteHostCommand( + PCSTR commandLine, + PEXECUTE_COMMAND_OUTPUT_CALLBACK callback); + //---------------------------------------------------------------------------- // IRemoteMemoryService //---------------------------------------------------------------------------- @@ -305,6 +319,72 @@ class DbgEngServices : public IDebuggerServices, public IRemoteMemoryService, pu ULONG64 BaseOffset); }; +class OutputCaptureHolder : IDebugOutputCallbacks +{ +private: + ULONG m_ref; + IDebugClient* m_client; + IDebugOutputCallbacks* m_previous; + PEXECUTE_COMMAND_OUTPUT_CALLBACK m_callback; + +public: + //---------------------------------------------------------------------------- + // IUnknown + //---------------------------------------------------------------------------- + + HRESULT STDMETHODCALLTYPE + QueryInterface(REFIID InterfaceId, PVOID* Interface) + { + if (InterfaceId == __uuidof(IUnknown) || + InterfaceId == __uuidof(IDebugOutputCallbacks)) + { + *Interface = static_cast(this); + AddRef(); + return S_OK; + } + *Interface = nullptr; + return E_NOINTERFACE; + } + + ULONG STDMETHODCALLTYPE + AddRef() + { + LONG ref = InterlockedIncrement(&m_ref); + return ref; + } + + ULONG STDMETHODCALLTYPE + Release() + { + LONG ref = InterlockedDecrement(&m_ref); + return ref; + } + + HRESULT STDMETHODCALLTYPE + Output(ULONG mask, PCSTR text) + { + m_callback(mask, text); + return S_OK; + } + +public: + OutputCaptureHolder(IDebugClient* client, PEXECUTE_COMMAND_OUTPUT_CALLBACK callback) : + m_ref(0), + m_client(client), + m_previous(nullptr), + m_callback(callback) + { + _ASSERTE(SUCCEEDED(client->GetOutputCallbacks(&m_previous))); + _ASSERTE(SUCCEEDED(client->SetOutputCallbacks(this))); + } + + ~OutputCaptureHolder() + { + _ASSERTE(SUCCEEDED(m_client->SetOutputCallbacks(m_previous))); + _ASSERTE(m_ref == 0); + } +}; + #ifdef __cplusplus }; #endif diff --git a/src/SOS/Strike/disasm.cpp b/src/SOS/Strike/disasm.cpp index b116c72b98..784ddfafea 100644 --- a/src/SOS/Strike/disasm.cpp +++ b/src/SOS/Strike/disasm.cpp @@ -19,10 +19,13 @@ namespace X86GCDump { #include "gcdump.h" +#undef CONTRACTL +#undef CONTRACTL_END +#undef NOTHROW +#undef GC_NOTRIGGER #undef assert #define assert(a) #define CONTRACTL -#define DAC_ARG(x) #define CONTRACTL_END #undef NOTHROW #define NOTHROW @@ -33,8 +36,6 @@ namespace X86GCDump #undef CONTRACTL_END #undef NOTHROW #undef GC_NOTRIGGER -#undef _ASSERTE -#define _ASSERTE(a) do {} while (0) #include "gcdump.cpp" #include "i386/gcdumpx86.cpp" @@ -126,7 +127,7 @@ GenOpenMapping( return NULL; } - hMappedFile = CreateFileMapping ( + hMappedFile = CreateFileMappingA ( hFile, NULL, PAGE_READONLY, @@ -990,8 +991,8 @@ void DumpStackWorker (DumpStackFlag &DSFlag) { if (IsInterrupt()) return; - DWORD_PTR retAddr; - DWORD_PTR whereCalled; + TADDR retAddr; + TADDR whereCalled; move_xp(retAddr, ptr); g_targetMachine->IsReturnAddress(retAddr, &whereCalled); if (whereCalled) @@ -1008,9 +1009,9 @@ void DumpStackWorker (DumpStackFlag &DSFlag) if (bOutput) ExtOut ("\n"); - DWORD_PTR cxrAddr; + TADDR cxrAddr; CROSS_PLATFORM_CONTEXT cxr; - DWORD_PTR exrAddr; + TADDR exrAddr; EXCEPTION_RECORD exr; if (g_targetMachine->GetExceptionContext(ptr,retAddr,&cxrAddr,&cxr,&exrAddr,&exr)) @@ -1140,6 +1141,18 @@ LPCSTR RISCV64Machine::s_SPName = "sp"; #endif // SOS_TARGET_RISCV64 +#ifdef SOS_TARGET_LOONGARCH64 +/// +/// LOONGARCH64Machine implementation +/// +LPCSTR LOONGARCH64Machine::s_DumpStackHeading = "ChildFP RetAddr Caller, Callee\n"; +LPCSTR LOONGARCH64Machine::s_GCRegs[30] = {"r0", "ra", "tp", "a0", "a1", "a2", "a3", "a4", "a5", + "a6", "a7", "t0", "t1", "t2", "t3", "t4", "t5", "t6", + "t7", "t8", "x0", "s0", "s1", "s2", "s3", "s4", "s5", + "s6", "s7", "s8"}; +LPCSTR LOONGARCH64Machine::s_SPName = "sp"; +#endif // SOS_TARGET_LOONGARCH64 + // // GCEncodingInfo class member implementations // diff --git a/src/SOS/Strike/disasm.h b/src/SOS/Strike/disasm.h index 714e0fddab..82ad583780 100644 --- a/src/SOS/Strike/disasm.h +++ b/src/SOS/Strike/disasm.h @@ -402,7 +402,6 @@ class ARM64Machine : public IMachine #endif // SOS_TARGET_ARM64 - #ifdef SOS_TARGET_RISCV64 /// RISCV64 Machine specific code @@ -471,6 +470,74 @@ class RISCV64Machine : public IMachine #endif // SOS_TARGET_RISCV64 +#ifdef SOS_TARGET_LOONGARCH64 + +/// LOONGARCH64 Machine specific code +class LOONGARCH64Machine : public IMachine +{ +public: + typedef LOONGARCH64_CONTEXT TGT_CTXT; + + static IMachine* GetInstance() + { static LOONGARCH64Machine s_LOONGARCH64MachineInstance; return &s_LOONGARCH64MachineInstance; } + + ULONG GetPlatform() const { return IMAGE_FILE_MACHINE_LOONGARCH64; } + ULONG GetContextSize() const { return sizeof(LOONGARCH64_CONTEXT); } + ULONG GetFullContextFlags() const { return 0x00800007L; } + void SetContextFlags(BYTE* context, ULONG32 contextFlags) { ((LOONGARCH64_CONTEXT*)context)->ContextFlags = contextFlags; }; + + virtual void Unassembly( + TADDR IPBegin, + TADDR IPEnd, + TADDR IPAskedFor, + TADDR GCStressCodeCopy, + GCEncodingInfo *pGCEncodingInfo, + SOSEHInfo *pEHInfo, + BOOL bSuppressLines, + BOOL bDisplayOffsets, + std::function displayIL) const; + virtual void IsReturnAddress( + TADDR retAddr, + TADDR* whereCalled) const; + virtual BOOL GetExceptionContext ( + TADDR stack, + TADDR PC, + TADDR *cxrAddr, + CROSS_PLATFORM_CONTEXT * cxr, + TADDR *exrAddr, + PEXCEPTION_RECORD exr) const; + + // retrieve stack pointer, frame pointer, and instruction pointer from the target context + virtual TADDR GetSP(const CROSS_PLATFORM_CONTEXT & ctx) const { return ctx.LoongArch64Context.Sp; } + virtual TADDR GetBP(const CROSS_PLATFORM_CONTEXT & ctx) const { return ctx.LoongArch64Context.Fp; } + virtual TADDR GetIP(const CROSS_PLATFORM_CONTEXT & ctx) const { return ctx.LoongArch64Context.Pc; } + + virtual void FillSimpleContext(StackTrace_SimpleContext * dest, LPVOID srcCtx) const; + virtual void FillTargetContext(LPVOID destCtx, LPVOID srcCtx, int idx = 0) const; + + virtual LPCSTR GetDumpStackHeading() const { return s_DumpStackHeading; } + virtual LPCSTR GetSPName() const { return s_SPName; } + virtual void GetGCRegisters(LPCSTR** regNames, unsigned int* cntRegs) const + { _ASSERTE(cntRegs != NULL); *regNames = s_GCRegs; *cntRegs = ARRAY_SIZE(s_GCRegs);} + + virtual void DumpGCInfo(GCInfoToken gcInfoToken, unsigned methodSize, printfFtn gcPrintf, bool encBytes, bool bPrintHeader) const; + + int StackWalkIPAdjustOffset() const { return 4; } + +private: + LOONGARCH64Machine() {} + ~LOONGARCH64Machine() {} + LOONGARCH64Machine(const LOONGARCH64Machine& machine); // undefined + LOONGARCH64Machine & operator=(const LOONGARCH64Machine&); // undefined + + static LPCSTR s_DumpStackHeading; + static LPCSTR s_GCRegs[30]; + static LPCSTR s_SPName; + +}; // class LOONGARCH64Machine + +#endif // SOS_TARGET_LOONGARCH64 + #ifdef _MSC_VER #pragma warning(pop) #endif // _MSC_VER @@ -563,4 +630,21 @@ inline void RISCV64Machine::FillTargetContext(LPVOID destCtx, LPVOID srcCtx, int *dest = *(TGT_CTXT*)srcCtx; } #endif // SOS_TARGET_RISCV64 + +#ifdef SOS_TARGET_LOONGARCH64 +inline void LOONGARCH64Machine::FillSimpleContext(StackTrace_SimpleContext * dest, LPVOID srcCtx) const +{ + TGT_CTXT& src = *(TGT_CTXT*) srcCtx; + dest->StackOffset = src.Sp; + dest->FrameOffset = src.Fp; + dest->InstructionOffset = src.Pc; +} + +inline void LOONGARCH64Machine::FillTargetContext(LPVOID destCtx, LPVOID srcCtx, int idx /*= 0*/) const +{ + TGT_CTXT* dest = (TGT_CTXT*)destCtx + idx; + *dest = *(TGT_CTXT*)srcCtx; +} +#endif // SOS_TARGET_LOONGARCH64 + #endif // __disasm_h__ diff --git a/src/SOS/Strike/disasmARM.cpp b/src/SOS/Strike/disasmARM.cpp index 07204a4ff5..607ce937e9 100644 --- a/src/SOS/Strike/disasmARM.cpp +++ b/src/SOS/Strike/disasmARM.cpp @@ -28,9 +28,6 @@ namespace ARMGCDump { #undef TARGET_X86 -#undef LIMITED_METHOD_CONTRACT -#define LIMITED_METHOD_DAC_CONTRACT ((void)0) -#define SUPPORTS_DAC ((void)0) #define LF_GCROOTS #define LL_INFO1000 #define LOG(x) @@ -255,9 +252,9 @@ static TADDR MDForCall (TADDR callee) { // call managed code? JITTypes jitType; - TADDR methodDesc; TADDR PC = callee; - TADDR gcinfoAddr; + DWORD_PTR methodDesc; + DWORD_PTR gcinfoAddr; PC = GetRealCallTarget(callee); if (!PC) diff --git a/src/SOS/Strike/disasmARM64.cpp b/src/SOS/Strike/disasmARM64.cpp index 31f5ccb870..f22f900203 100644 --- a/src/SOS/Strike/disasmARM64.cpp +++ b/src/SOS/Strike/disasmARM64.cpp @@ -24,9 +24,6 @@ namespace ARM64GCDump { #undef TARGET_X86 -#undef LIMITED_METHOD_CONTRACT -#define LIMITED_METHOD_DAC_CONTRACT ((void)0) -#define SUPPORTS_DAC ((void)0) #define LF_GCROOTS #define LL_INFO1000 #define LOG(x) @@ -146,7 +143,7 @@ void ARM64Machine::Unassembly ( BOOL bDisplayOffsets, std::function displayIL) const { - TADDR PC = PCBegin; + ULONG_PTR PC = PCBegin; char line[1024]; ULONG lineNum; ULONG curLine = -1; diff --git a/src/SOS/Strike/disasmLOONGARCH64.cpp b/src/SOS/Strike/disasmLOONGARCH64.cpp new file mode 100644 index 0000000000..d9f509500e --- /dev/null +++ b/src/SOS/Strike/disasmLOONGARCH64.cpp @@ -0,0 +1,154 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#undef _TARGET_AMD64_ +#ifndef _TARGET_LOONGARCH64_ +#define _TARGET_LOONGARCH64_ +#endif + +#undef TARGET_AMD64 +#ifndef TARGET_LOONGARCH64 +#define TARGET_LOONGARCH64 +#endif + +#include "strike.h" +#include "util.h" +#include + +#include "disasm.h" + +#include "corhdr.h" +#include "cor.h" +#include "dacprivate.h" + +namespace LOONGARCH64GCDump +{ +#undef TARGET_X86 +#undef LIMITED_METHOD_CONTRACT +#define LIMITED_METHOD_DAC_CONTRACT ((void)0) +#define SUPPORTS_DAC ((void)0) +#define LF_GCROOTS +#define LL_INFO1000 +#define LOG(x) +#define LOG_PIPTR(pObjRef, gcFlags, hCallBack) +#define DAC_ARG(x) +#include "gcdumpnonx86.cpp" +} + +#if !defined(_TARGET_WIN64_) +#error This file only supports SOS targeting LOONGARCH64 from a 64-bit debugger +#endif + +#if !defined(SOS_TARGET_LOONGARCH64) +#error This file should be used to support SOS targeting LOONGARCH64 debuggees +#endif + + +void LOONGARCH64Machine::IsReturnAddress(TADDR retAddr, TADDR* whereCalled) const +{ + *whereCalled = 0; + _ASSERTE("LOONGARCH64:NYI"); +} + +// Determine if a value is MT/MD/Obj +static void HandleValue(TADDR value) +{ + // A MethodTable? + if (IsMethodTable(value)) + { + NameForMT_s (value, g_mdName,mdNameLen); + ExtOut (" (MT: %S)", g_mdName); + return; + } + + // A Managed Object? + TADDR dwMTAddr; + move_xp (dwMTAddr, value); + if (IsStringObject(value)) + { + ExtOut (" (\""); + StringObjectContent (value, TRUE); + ExtOut ("\")"); + return; + } + else if (IsMethodTable(dwMTAddr)) + { + NameForMT_s (dwMTAddr, g_mdName,mdNameLen); + ExtOut (" (Object: %S)", g_mdName); + return; + } + + // A MethodDesc? + if (IsMethodDesc(value)) + { + NameForMD_s (value, g_mdName,mdNameLen); + ExtOut (" (MD: %S)", g_mdName); + return; + } + + // A JitHelper? + const char* name = HelperFuncName(value); + if (name) { + ExtOut (" (JitHelp: %s)", name); + return; + } + + // A call to managed code? + // LOONGARCH64TODO: not (yet) implemented. perhaps we don't need it at all. + + // Random symbol. + char Symbol[1024]; + if (SUCCEEDED(g_ExtSymbols->GetNameByOffset(TO_CDADDR(value), Symbol, 1024, + NULL, NULL))) + { + if (Symbol[0] != '\0') + { + ExtOut (" (%s)", Symbol); + return; + } + } +} + +/**********************************************************************\ +* Routine Description: * +* * +* Unassembly a managed code. Translating managed object, * +* call. * +* * +\**********************************************************************/ +void LOONGARCH64Machine::Unassembly ( + TADDR PCBegin, + TADDR PCEnd, + TADDR PCAskedFor, + TADDR GCStressCodeCopy, + GCEncodingInfo *pGCEncodingInfo, + SOSEHInfo *pEHInfo, + BOOL bSuppressLines, + BOOL bDisplayOffsets, + std::function displayIL) const +{ + _ASSERTE("LOONGARCH64:NYI"); +} + +BOOL LOONGARCH64Machine::GetExceptionContext (TADDR stack, TADDR PC, TADDR *cxrAddr, CROSS_PLATFORM_CONTEXT * cxr, + TADDR * exrAddr, PEXCEPTION_RECORD exr) const +{ + _ASSERTE("LOONGARCH64:NYI"); + return FALSE; +} + +/// +/// Dump LOONGARCH GCInfo table +/// +void LOONGARCH64Machine::DumpGCInfo(GCInfoToken gcInfoToken, unsigned methodSize, printfFtn gcPrintf, bool encBytes, bool bPrintHeader) const +{ + if (bPrintHeader) + { + ExtOut("Pointer table:\n"); + } + + LOONGARCH64GCDump::GCDump gcDump(gcInfoToken.Version, encBytes, 5, true); + gcDump.gcPrintf = gcPrintf; + + gcDump.DumpGCTable(dac_cast(gcInfoToken.Info), methodSize, 0); +} diff --git a/src/SOS/Strike/disasmX86.cpp b/src/SOS/Strike/disasmX86.cpp index 1c34f4815a..21db6e526a 100644 --- a/src/SOS/Strike/disasmX86.cpp +++ b/src/SOS/Strike/disasmX86.cpp @@ -337,9 +337,9 @@ TADDR MDForCall (TADDR callee) { // call managed code? JITTypes jitType; - TADDR methodDesc; - TADDR IP = callee; - TADDR gcinfoAddr; + DWORD_PTR methodDesc; + DWORD_PTR IP = callee; + DWORD_PTR gcinfoAddr; if (!GetCalleeSite (callee, IP)) return 0; @@ -390,7 +390,7 @@ void HandleCall(TADDR callee, Register *reg) #ifdef _TARGET_AMD64_ // A jump thunk? - CONTEXT ctx = {0}; + CONTEXT ctx; ctx.ContextFlags = (DT_CONTEXT_AMD64 | DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER); for (unsigned ireg = 0; ireg < 16; ireg++) @@ -620,7 +620,14 @@ void // #ifdef _WIN64 - ExtOut("%08x`%08x ", (ULONG)(InstrAddr >> 32), (ULONG)InstrAddr); + if (GetHost()->GetHostType() == IHost::HostType::DbgEng) + { + ExtOut("%08x`%08x ", (ULONG)(InstrAddr >> 32), (ULONG)InstrAddr); + } + else + { + ExtOut("%016llx ", InstrAddr); + } #else ExtOut("%08x ", (ULONG)InstrAddr); #endif @@ -754,7 +761,7 @@ void // Find the real callee site. Handle JMP instruction. // Return TRUE if we get the address, FALSE if not. -BOOL GetCalleeSite (TADDR IP, TADDR &IPCallee) +BOOL GetCalleeSite (DWORD_PTR IP, DWORD_PTR &IPCallee) { while (TRUE) { unsigned char inst[2]; @@ -806,7 +813,7 @@ BOOL GetCalleeSite (TADDR IP, TADDR &IPCallee) // GetFinalTarget is based on HandleCall, but avoids printing anything to the output. // This is currently only called on x64 -eTargetType GetFinalTarget(TADDR callee, TADDR* finalMDorIP) +eTargetType GetFinalTarget(DWORD_PTR callee, DWORD_PTR* finalMDorIP) { // call managed code? TADDR methodDesc = MDForCall (callee); @@ -823,7 +830,7 @@ eTargetType GetFinalTarget(TADDR callee, TADDR* finalMDorIP) #ifdef _TARGET_AMD64_ // A jump thunk? - CONTEXT ctx = {0}; + CONTEXT ctx; ctx.ContextFlags = (DT_CONTEXT_AMD64 | DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER); ctx.Rip = callee; @@ -1048,7 +1055,7 @@ void // on WOW64 the range valid for code is almost the whole 4GB address space if (g_ExtData->ReadVirtual(TO_CDADDR(*whereCalled), &addr, sizeof(addr), NULL) == S_OK) { - TADDR callee; + DWORD_PTR callee; if (GetCalleeSite(*whereCalled, callee)) { *whereCalled = callee; } @@ -1074,8 +1081,8 @@ void // on WOW64 the range valid for code is almost the whole 4GB address space if (g_ExtData->ReadVirtual(TO_CDADDR(*whereCalled), &addr, sizeof(addr), NULL) == S_OK) { - TADDR callee; - if (GetCalleeSite(*whereCalled,callee)) { + DWORD_PTR callee; + if (GetCalleeSite(*whereCalled, callee)) { *whereCalled = callee; } return; @@ -1172,14 +1179,13 @@ void PrintReg (Register *reg) struct CallInfo { - DWORD_PTR stackPos; - DWORD_PTR retAddr; - DWORD_PTR whereCalled; + TADDR stackPos; + TADDR retAddr; + TADDR whereCalled; }; // Search for a Return address on stack. -BOOL GetNextRetAddr (DWORD_PTR stackBegin, DWORD_PTR stackEnd, - CallInfo &callInfo) +BOOL GetNextRetAddr (DWORD_PTR stackBegin, DWORD_PTR stackEnd, CallInfo &callInfo) { for (callInfo.stackPos = stackBegin; callInfo.stackPos <= stackEnd; @@ -1209,8 +1215,7 @@ struct FrameInfo }; // if a EBP frame, return TRUE if EBP has been setup -void GetFrameBaseHelper (DWORD_PTR IPBegin, DWORD_PTR IPEnd, - INT_PTR &StackChange) +void GetFrameBaseHelper (DWORD_PTR IPBegin, DWORD_PTR IPEnd, INT_PTR &StackChange) { char line[256]; char *ptr; @@ -1626,8 +1631,8 @@ void RestoreFrameUnmanaged (Register *reg, DWORD_PTR CurIP) { NextTerm (ptr); // check the value on stack is a return address. - DWORD_PTR retAddr; - DWORD_PTR whereCalled; + TADDR retAddr; + TADDR whereCalled; move_xp (retAddr, reg[ESP].value); int ESPAdjustCount = 0; while (1) diff --git a/src/SOS/Strike/exts.cpp b/src/SOS/Strike/exts.cpp index eba9fa9bbc..1bb392ba47 100644 --- a/src/SOS/Strike/exts.cpp +++ b/src/SOS/Strike/exts.cpp @@ -1,13 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// ==++== -// - -// -// ==--== #include "exts.h" #include "disasm.h" + #ifndef FEATURE_PAL #define VER_PRODUCTVERSION_W (0x0100) @@ -100,6 +96,30 @@ ExtQuery(ILLDBServices* services) return Status; } +HRESULT +ExtInit(PDEBUG_CLIENT client) +{ + HRESULT hr; + if ((hr = ExtQuery(client)) == S_OK) + { + // Reset some global variables on entry + ControlC = FALSE; + g_bDacBroken = TRUE; + g_clrData = NULL; + g_sos = NULL; + + // Flush here only on Windows under dbgeng. The lldb sos plugin handles it for Linux/MacOS. +#ifndef FEATURE_PAL + Extensions* extensions = Extensions::GetInstance(); + if (extensions != nullptr) + { + extensions->FlushCheck(); + } +#endif // !FEATURE_PAL + } + return hr; +} + IMachine* GetTargetMachine(ULONG processorType) { @@ -132,15 +152,70 @@ GetTargetMachine(ULONG processorType) targetMachine = ARM64Machine::GetInstance(); } #endif // SOS_TARGET_ARM64 + _ASSERTE(processorType != IMAGE_FILE_MACHINE_ARM64X); +#if defined(SOS_TARGET_AMD64) || defined(SOS_TARGET_ARM64) + if (processorType == IMAGE_FILE_MACHINE_ARM64EC) + { +#ifdef SOS_TARGET_AMD64 + targetMachine = AMD64Machine::GetInstance(); +#endif // SOS_TARGET_AMD64 + } +#endif // defined(SOS_TARGET_AMD64) || defined(SOS_TARGET_ARM64) #ifdef SOS_TARGET_RISCV64 if (processorType == IMAGE_FILE_MACHINE_RISCV64) { targetMachine = RISCV64Machine::GetInstance(); } #endif // SOS_TARGET_RISCV64 +#ifdef SOS_TARGET_LOONGARCH64 + if (processorType == IMAGE_FILE_MACHINE_LOONGARCH64) + { + targetMachine = LOONGARCH64Machine::GetInstance(); + } +#endif // SOS_TARGET_LOONGARCH64 return targetMachine; } +const char* +GetProcessorName(ULONG type) +{ + const char* architecture = "unknown"; + switch (type) + { + case IMAGE_FILE_MACHINE_AMD64: + architecture = "x64"; + break; + case IMAGE_FILE_MACHINE_I386: + architecture = "x86"; + break; + case IMAGE_FILE_MACHINE_ARM: + architecture = "arm"; + break; + case IMAGE_FILE_MACHINE_THUMB: + architecture = "thumb"; + break; + case IMAGE_FILE_MACHINE_ARMNT: + architecture = "armnt"; + break; + case IMAGE_FILE_MACHINE_ARM64: + architecture = "arm64"; + break; + case IMAGE_FILE_MACHINE_ARM64EC: + architecture = "arm64ec"; + break; + case IMAGE_FILE_MACHINE_ARM64X: + architecture = "arm64x"; + break; + case IMAGE_FILE_MACHINE_RISCV64: + architecture = "riscv64"; + break; + case IMAGE_FILE_MACHINE_LOONGARCH64: + architecture = "loongarch64"; + break; + } + return architecture; +} + HRESULT ArchQuery(void) { @@ -150,29 +225,19 @@ ArchQuery(void) g_targetMachine = GetTargetMachine(processorType); if (g_targetMachine == NULL) { - const char* architecture = ""; - switch (processorType) + const char* architecture = GetProcessorName(processorType); + const char* message = ""; +#if defined(SOS_TARGET_AMD64) || defined(SOS_TARGET_ARM64) + if (processorType == IMAGE_FILE_MACHINE_ARM64EC) { - case IMAGE_FILE_MACHINE_AMD64: - architecture = "x64"; - break; - case IMAGE_FILE_MACHINE_I386: - architecture = "x86"; - break; - case IMAGE_FILE_MACHINE_ARM: - case IMAGE_FILE_MACHINE_THUMB: - case IMAGE_FILE_MACHINE_ARMNT: - architecture = "arm32"; - break; - case IMAGE_FILE_MACHINE_ARM64: - architecture = "arm64"; - break; - case IMAGE_FILE_MACHINE_RISCV64: - architecture = "riscv64"; - break; + message = "Arm64ec targets require a x64 compatible SOS and debugger."; } - ExtErr("SOS does not support the current target architecture '%s' (0x%04x). A 32 bit target may require a 32 bit debugger or vice versa. In general, try to use the same bitness for the debugger and target process.\n", - architecture, processorType); + else +#endif + { + message = "A 32 bit target may require a 32 bit debugger or vice versa. In general, try to use the same bitness for the debugger and target process."; + } + ExtErr("SOS does not support the current target architecture '%s' (0x%04x). %s\n", architecture, processorType, message); return E_FAIL; } return S_OK; @@ -275,6 +340,33 @@ DACMessage(HRESULT Status) ExtOut("For more information see https://go.microsoft.com/fwlink/?linkid=2135652\n"); } +IXCLRDataProcess* +GetClrDataFromDbgEng() +{ +#ifdef FEATURE_PAL + return nullptr; +#else + IXCLRDataProcess* clrData = nullptr; + + // Fail if ExtensionApis wasn't initialized because we are hosted under dotnet-dump + if (Ioctl != nullptr) + { + // Try getting the DAC interface from dbgeng if the above fails on Windows + WDBGEXTS_CLR_DATA_INTERFACE Query; + + Query.Iid = &__uuidof(IXCLRDataProcess); + if (Ioctl(IG_GET_CLR_DATA_INTERFACE, &Query, sizeof(Query))) + { + // No AddRef needed. IG_GET_CLR_DATA_INTERFACE either creates or QI's the IXCLRDataProcess instance. + clrData = (IXCLRDataProcess*)Query.Iface; + clrData->Flush(); + } + } + + return clrData; +#endif +} + #ifndef FEATURE_PAL BOOL IsMiniDumpFileNODAC(); @@ -440,57 +532,3 @@ DebugClient::Release() } #endif // FEATURE_PAL - -/// -/// Returns the host instance -/// -/// * dotnet-dump - m_pHost has already been set by SOSInitializeByHost by SOS.Hosting -/// * lldb - m_pHost has already been set by SOSInitializeByHost by libsosplugin which gets it via the InitializeHostServices callback -/// * dbgeng - SOS.Extensions provides the instance via the InitializeHostServices callback -/// -IHost* SOSExtensions::GetHost() -{ - if (m_pHost == nullptr) - { -#ifndef FEATURE_PAL - // Initialize the hosting runtime which will call InitializeHostServices and set m_pHost to the host instance - InitializeHosting(); -#endif - // Otherwise, use the local host instance (hostimpl.*) that creates a local target instance (targetimpl.*) - if (m_pHost == nullptr) - { - m_pHost = Host::GetInstance(); - } - } - return m_pHost; -} - -/// -/// Returns the runtime or fails if no target or current runtime -/// -/// runtime instance -/// error code -HRESULT GetRuntime(IRuntime** ppRuntime) -{ - SOSExtensions* extensions = (SOSExtensions*)Extensions::GetInstance(); - ITarget* target = extensions->GetTarget(); - if (target == nullptr) - { - return E_FAIL; - } -#ifndef FEATURE_PAL - extensions->FlushCheck(); -#endif - return target->GetRuntime(ppRuntime); -} - -void FlushCheck() -{ -#ifndef FEATURE_PAL - SOSExtensions* extensions = (SOSExtensions*)Extensions::GetInstance(); - if (extensions != nullptr) - { - extensions->FlushCheck(); - } -#endif // !FEATURE_PAL -} diff --git a/src/SOS/Strike/exts.h b/src/SOS/Strike/exts.h index 4b1212b34c..5ee3a0c70d 100644 --- a/src/SOS/Strike/exts.h +++ b/src/SOS/Strike/exts.h @@ -14,13 +14,8 @@ #include #include -#if defined(_MSC_VER) -#pragma warning(disable:4245) // signed/unsigned mismatch -#pragma warning(disable:4100) // unreferenced formal parameter -#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union -#pragma warning(disable:4127) // conditional expression is constant -#pragma warning(disable:4430) // missing type specifier: C++ doesn't support default-int -#endif +#undef CreateProcess + #include "strike.h" #include #include @@ -35,6 +30,10 @@ #undef StackTrace #endif +#ifndef FEATURE_PAL +#include "dbgengservices.h" +#endif + #include "platformspecific.h" // We need to define the target address type. This has to be used in the @@ -56,10 +55,6 @@ // printing CDA values. #define CDA_TO_UL64(cda) ((ULONG64)(TO_TADDR(cda))) -#ifndef IMAGE_FILE_MACHINE_RISCV64 -#define IMAGE_FILE_MACHINE_RISCV64 0x5064 // RISCV64 -#endif // !IMAGE_FILE_MACHINE_RISCV64 - typedef struct _TADDR_RANGE { TADDR start; @@ -73,12 +68,9 @@ typedef struct _TADDR_SEGINFO TADDR end; } TADDR_SEGINFO; +#include "sosextensions.h" #include "util.h" -#ifndef FEATURE_PAL -#include "dbgengservices.h" -#endif - #ifdef __cplusplus extern "C" { #endif @@ -122,86 +114,6 @@ class OnUnloadTask static OnUnloadTask *s_pUnloadTaskList; }; -//----------------------------------------------------------------------------------------- -// Extension helper class -//----------------------------------------------------------------------------------------- -class SOSExtensions : public Extensions -{ - SOSExtensions(IDebuggerServices* debuggerServices, IHost* host) : - Extensions(debuggerServices) - { - m_pHost = host; - OnUnloadTask::Register(SOSExtensions::Uninitialize); - } - -#ifndef FEATURE_PAL - ~SOSExtensions() - { - if (m_pDebuggerServices != nullptr) - { - ((DbgEngServices*)m_pDebuggerServices)->Uninitialize(); - m_pDebuggerServices->Release(); - m_pDebuggerServices = nullptr; - } - } -#endif - -public: - -#ifndef FEATURE_PAL - static HRESULT Initialize(IDebugClient* client) - { - if (s_extensions == nullptr) - { - DbgEngServices* debuggerServices = new DbgEngServices(client); - HRESULT hr = debuggerServices->Initialize(); - if (FAILED(hr)) { - return hr; - } - s_extensions = new SOSExtensions(debuggerServices, nullptr); - } - return S_OK; - } -#endif - - static HRESULT Initialize(IHost* host, IDebuggerServices* debuggerServices) - { - if (s_extensions == nullptr) - { - s_extensions = new SOSExtensions(debuggerServices, host); - } - return S_OK; - } - - static void Uninitialize() - { - if (s_extensions != nullptr) - { - delete s_extensions; - s_extensions = nullptr; - } - } - -#ifndef FEATURE_PAL - void FlushCheck() - { - if (m_pDebuggerServices != nullptr) - { - ((DbgEngServices*)m_pDebuggerServices)->FlushCheck(this); - } - } -#endif - - IHost* GetHost(); -}; - -extern HRESULT GetRuntime(IRuntime** ppRuntime); -extern void FlushCheck(); - -#ifndef MINIDUMP - -#define EXIT_API ExtRelease - // Safe release and NULL. #define EXT_RELEASE(Unk) \ ((Unk) != NULL ? ((Unk)->Release(), (Unk) = NULL) : NULL) @@ -236,6 +148,12 @@ extern BOOL InitializePAL(); HRESULT ExtQuery(PDEBUG_CLIENT client); +HRESULT +ExtInit(PDEBUG_CLIENT client); + +const char* +GetProcessorName(ULONG type); + HRESULT ArchQuery(void); @@ -251,6 +169,9 @@ EENotLoadedMessage(HRESULT Status); void DACMessage(HRESULT Status); +IXCLRDataProcess* +GetClrDataFromDbgEng(); + extern BOOL ControlC; inline BOOL IsInterrupt() @@ -282,12 +203,7 @@ class __ExtensionCleanUp #define INIT_API_EXT() \ HRESULT Status; \ __ExtensionCleanUp __extensionCleanUp; \ - if ((Status = ExtQuery(client)) != S_OK) return Status; \ - ControlC = FALSE; \ - g_bDacBroken = TRUE; \ - g_clrData = NULL; \ - g_sos = NULL; \ - FlushCheck(); + if ((Status = ExtInit(client)) != S_OK) return Status; // Also initializes the target machine #define INIT_API_NOEE() \ @@ -498,6 +414,7 @@ inline BOOL IsDbgTargetAmd64() { return g_targetMachine->GetPlatform() == IMAGE inline BOOL IsDbgTargetArm() { return g_targetMachine->GetPlatform() == IMAGE_FILE_MACHINE_ARMNT; } inline BOOL IsDbgTargetArm64() { return g_targetMachine->GetPlatform() == IMAGE_FILE_MACHINE_ARM64; } inline BOOL IsDbgTargetRiscV64(){ return g_targetMachine->GetPlatform() == IMAGE_FILE_MACHINE_RISCV64; } +inline BOOL IsDbgTargetLoongArch64(){ return g_targetMachine->GetPlatform() == IMAGE_FILE_MACHINE_LOONGARCH64; } inline BOOL IsDbgTargetWin64() { return IsDbgTargetAmd64(); } /* Returns the instruction pointer for the given CONTEXT. We need this and its family of @@ -597,8 +514,6 @@ extern ReadVirtualCache *rvCache; #define CPPMOD #endif -#endif - #ifdef __cplusplus } #endif diff --git a/src/SOS/Strike/gchist.cpp b/src/SOS/Strike/gchist.cpp index 82a43a9531..71be0d8ab9 100644 --- a/src/SOS/Strike/gchist.cpp +++ b/src/SOS/Strike/gchist.cpp @@ -53,15 +53,6 @@ #include "util.h" -#ifndef _ASSERTE -#ifdef _DEBUG -#define _ASSERTE(expr) \ - do { if (!(expr) ) { ExtOut(#expr); DebugBreak(); } } while (0) -#else // _DEBUG -#define _ASSERTE(expr) -#endif // _DEBUG else -#endif // !_ASSERTE - #ifdef _MSC_VER #pragma warning(disable:4244) // conversion from 'unsigned int' to 'unsigned short', possible loss of data #pragma warning(disable:4189) // local variable is initialized but not referenced diff --git a/src/SOS/Strike/gcroot.cpp b/src/SOS/Strike/gcroot.cpp index 8a426ca7c3..70988f2bca 100644 --- a/src/SOS/Strike/gcroot.cpp +++ b/src/SOS/Strike/gcroot.cpp @@ -27,27 +27,9 @@ #include "sos.h" #include "disasm.h" - -#ifdef _ASSERTE -#undef _ASSERTE -#endif - -#define _ASSERTE(a) {;} - #include "gcdesc.h" - #include "safemath.h" - -#undef _ASSERTE - -#ifdef _DEBUG -#define _ASSERTE(expr) \ - do { if (!(expr) ) { ExtErr("_ASSERTE fired:\n\t%s\n", #expr); if (IsDebuggerPresent()) DebugBreak(); } } while (0) -#else -#define _ASSERTE(x) -#endif - inline size_t ALIGN_DOWN( size_t val, size_t alignment ) { // alignment must be a power of 2 for this implementation to work (need modulo otherwise) diff --git a/src/shared/inc/hillclimbing.h b/src/SOS/Strike/hillclimbing.h similarity index 100% rename from src/shared/inc/hillclimbing.h rename to src/SOS/Strike/hillclimbing.h diff --git a/src/SOS/Strike/managedcommands.cpp b/src/SOS/Strike/managedcommands.cpp index 79de0556f8..ceea890796 100644 --- a/src/SOS/Strike/managedcommands.cpp +++ b/src/SOS/Strike/managedcommands.cpp @@ -193,6 +193,12 @@ DECLARE_API(DumpRequests) return ExecuteManagedOnlyCommand("dumprequests", args); } +DECLARE_API(dumplocks) +{ + INIT_API_EXT(); + return ExecuteManagedOnlyCommand("dumplocks", args); +} + typedef HRESULT (*PFN_COMMAND)(PDEBUG_CLIENT client, PCSTR args); // diff --git a/src/SOS/Strike/metadata.cpp b/src/SOS/Strike/metadata.cpp index 4b6e6dffd5..95d12f9aa0 100644 --- a/src/SOS/Strike/metadata.cpp +++ b/src/SOS/Strike/metadata.cpp @@ -467,22 +467,15 @@ inline bool isCallConv(unsigned sigByte, CorCallingConvention conv) return ((sigByte & IMAGE_CEE_CS_CALLCONV_MASK) == (unsigned) conv); } -#ifndef IfFailGoto +#undef IfFailGoto #define IfFailGoto(EXPR, LABEL) \ do { hr = (EXPR); if(FAILED(hr)) { goto LABEL; } } while (0) -#endif -#ifndef IfFailGo +#undef IfFailGo #define IfFailGo(EXPR) IfFailGoto(EXPR, ErrExit) -#endif -#ifndef IfFailRet +#undef IfFailRet #define IfFailRet(EXPR) do { hr = (EXPR); if(FAILED(hr)) { return (hr); } } while (0) -#endif - -#ifndef _ASSERTE -#define _ASSERTE(expr) -#endif HRESULT MDInfo::GetFullNameForMD(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, LONG *plSigBlobRemaining) { diff --git a/src/SOS/Strike/platform/cordebugdatatarget.h b/src/SOS/Strike/platform/cordebugdatatarget.h index a911769191..78dc96681a 100644 --- a/src/SOS/Strike/platform/cordebugdatatarget.h +++ b/src/SOS/Strike/platform/cordebugdatatarget.h @@ -98,6 +98,8 @@ class CorDebugDataTarget : public ICorDebugMutableDataTarget, public ICorDebugMe *pPlatform = CORDB_PLATFORM_POSIX_ARM64; else if (platformKind == IMAGE_FILE_MACHINE_RISCV64) *pPlatform = CORDB_PLATFORM_POSIX_RISCV64; + else if (platformKind == IMAGE_FILE_MACHINE_LOONGARCH64) + *pPlatform = CORDB_PLATFORM_POSIX_LOONGARCH64; else return E_FAIL; } diff --git a/src/SOS/Strike/platform/datatarget.cpp b/src/SOS/Strike/platform/datatarget.cpp index eb22b9397b..63a059b536 100644 --- a/src/SOS/Strike/platform/datatarget.cpp +++ b/src/SOS/Strike/platform/datatarget.cpp @@ -99,7 +99,7 @@ HRESULT STDMETHODCALLTYPE DataTarget::GetPointerSize( /* [out] */ ULONG32 *size) { -#if defined(SOS_TARGET_AMD64) || defined(SOS_TARGET_ARM64) || defined(SOS_TARGET_MIPS64) || defined(SOS_TARGET_RISCV64) +#if defined(SOS_TARGET_AMD64) || defined(SOS_TARGET_ARM64) || defined(SOS_TARGET_MIPS64) || defined(SOS_TARGET_RISCV64) || defined(SOS_TARGET_LOONGARCH64) *size = 8; #elif defined(SOS_TARGET_ARM) || defined(SOS_TARGET_X86) *size = 4; diff --git a/src/SOS/Strike/platform/runtimeimpl.cpp b/src/SOS/Strike/platform/runtimeimpl.cpp index ee87d3e980..81e1514e12 100644 --- a/src/SOS/Strike/platform/runtimeimpl.cpp +++ b/src/SOS/Strike/platform/runtimeimpl.cpp @@ -25,6 +25,8 @@ #include #endif // !FEATURE_PAL +#define CORDBG_E_NO_IMAGE_AVAILABLE EMAKEHR(0x1c64) + typedef HRESULT (STDAPICALLTYPE *OpenVirtualProcessImpl2FnPtr)(ULONG64 clrInstanceId, IUnknown * pDataTarget, LPCWSTR pDacModulePath, diff --git a/src/SOS/Strike/platformspecific.h b/src/SOS/Strike/platformspecific.h index 6a66df890d..88ac1a7368 100644 --- a/src/SOS/Strike/platformspecific.h +++ b/src/SOS/Strike/platformspecific.h @@ -14,6 +14,7 @@ // The main debugger code already has target platform definitions for CONTEXT. #include +#include #ifndef FEATURE_PAL @@ -42,14 +43,6 @@ struct DT_UNICODE_STRING #define DT_GDI_HANDLE_BUFFER_SIZE32 34 #define DT_GDI_HANDLE_BUFFER_SIZE64 60 -#ifndef IMAGE_FILE_MACHINE_ARMNT -#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian -#endif - -#ifndef IMAGE_FILE_MACHINE_ARM64 -#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // ARM64 Little-Endian -#endif - #ifdef _TARGET_WIN64_ typedef ULONG DT_GDI_HANDLE_BUFFER[DT_GDI_HANDLE_BUFFER_SIZE64]; #else diff --git a/src/SOS/Strike/sigparser.cpp b/src/SOS/Strike/sigparser.cpp index f73769dbe1..b16abd2f37 100644 --- a/src/SOS/Strike/sigparser.cpp +++ b/src/SOS/Strike/sigparser.cpp @@ -13,9 +13,8 @@ #include "strike.h" #include "util.h" -#ifndef IfFailRet +#undef IfFailRet #define IfFailRet(EXPR) do { HRESULT Status = (EXPR); if(FAILED(Status)) { return (Status); } } while (0) -#endif HRESULT SigParser::SkipExactlyOne() { @@ -122,8 +121,18 @@ HRESULT SigParser::SkipExactlyOne() // HRESULT SigParser::SkipMethodHeaderSignature( - uint32_t * pcArgs) + uint32_t * pcArgs, bool skipReturnType /*= true*/) { + CONTRACTL + { + INSTANCE_CHECK; + NOTHROW; + GC_NOTRIGGER; + FORBID_FAULT; + SUPPORTS_DAC; + } + CONTRACTL_END + HRESULT hr = S_OK; // Skip calling convention @@ -143,8 +152,11 @@ SigParser::SkipMethodHeaderSignature( // Get arg count; IfFailRet(GetData(pcArgs)); - // Skip return type; - IfFailRet(SkipExactlyOne()); + if (skipReturnType) + { + // Skip return type; + IfFailRet(SkipExactlyOne()); + } return hr; } // SigParser::SkipMethodHeaderSignature diff --git a/src/SOS/Strike/sildasm.cpp b/src/SOS/Strike/sildasm.cpp index 6c45def10e..d6edd86fb1 100644 --- a/src/SOS/Strike/sildasm.cpp +++ b/src/SOS/Strike/sildasm.cpp @@ -31,7 +31,6 @@ #include "sos_md.h" #define _BLD_CLR 1 -#define SOS_INCLUDE 1 #include "corhlpr.h" #include "corhlpr.cpp" diff --git a/src/SOS/Strike/sos.def b/src/SOS/Strike/sos.def index b22c8b14c8..f0ac6da839 100644 --- a/src/SOS/Strike/sos.def +++ b/src/SOS/Strike/sos.def @@ -12,6 +12,7 @@ EXPORTS ClrStack clrstack=ClrStack CLRStack=ClrStack + clrmaconfig crashinfo DumpALC dumpalc=DumpALC @@ -50,6 +51,8 @@ EXPORTS dumpheap=DumpHeap DumpIL dumpil=DumpIL + dumplocks + DumpLocks=dumplocks DumpLog dumplog=DumpLog Dumplog=DumpLog @@ -138,6 +141,7 @@ EXPORTS pe=PrintException printexception=PrintException Printexception=PrintException + processor SaveModule savemodule=SaveModule SetHostRuntime diff --git a/src/SOS/Strike/sosdocs.txt b/src/SOS/Strike/sosdocs.txt index 0d424296be..889b88925e 100644 --- a/src/SOS/Strike/sosdocs.txt +++ b/src/SOS/Strike/sosdocs.txt @@ -2614,31 +2614,33 @@ COMMAND: sethostruntime. -c, -netcore - switch to hosting on the .NET Core runtime -f, -netfx - switch to hosting on the desktop .NET Framework runtime if loaded. -none - disable hosting managed code (for testing). +-major - set the .NET Core's runtime version (used with the argument). -clear - clear the .NET Core host runtime path. -This command controls the runtime that is used to host the maanged code that -runs as part of SOS in the debugger (cdb/windbg). The default is the desktop -.NET Framework. The "-netcore" option allows the installed .NET Core runtime -be used. The "-netfx" option allows switches back to the .NET Framework runtime. +This command controls the runtime that is used to host the manged code that +runs as part of SOS in the debugger (cdb/windbg). The default is the .NET Core +runtime. The "-netfx" option allows the .NET Framework runtime to be used to +host the managed SOS code. The "-netcore" option switches the installed .NET +Core runtime. If a is given, the command assumes it is a path to a .NET -Core runtime which needs to be at least version 2.1.0 or greater. If there are +Core runtime which needs to be at least version 6.0 or greater. If there are spaces in directory, it needs to be single-quoted ('). Normally, SOS attempts to find an installed .NET Core runtime to run its managed code automatically but this command is available if it fails. The default is to use the same runtime (coreclr.dll) being debugged. Use this command if the default runtime being debugged isn't working enough to run -the SOS code or if the version is less than 2.1.0. +the SOS code or if the version is less than 6.0. If you received the following error message when running a SOS command, use -this command to set the path to 2.0.0 or greater .NET Core runtime. +this command to set the path to 6.0 or greater .NET Core runtime. 0:000> !clrstack Error: Fail to initialize CoreCLR 80004005 ClrStack failed - 0:000> sethostruntime "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.1.6" + 0:000> sethostruntime -major 6 "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.30" You can use the "dotnet --info" in a command shell to find the path of an installed .NET Core runtime. diff --git a/src/SOS/Strike/sosdocsunix.txt b/src/SOS/Strike/sosdocsunix.txt index d8cb6c2116..2d62683ac8 100644 --- a/src/SOS/Strike/sosdocsunix.txt +++ b/src/SOS/Strike/sosdocsunix.txt @@ -2249,26 +2249,27 @@ SetHostRuntime [-c][-netcore] [-none] [-clear] -c, -netcore - switch to hosting on the .NET Core runtime -none - disable hosting managed code (for testing). -clear - clear the .NET Core host runtime path. +-major - set the .NET Core's runtime version (used with the argument). This command sets the path to the .NET Core runtime to use to host the managed code that runs as part of SOS in the debugger (lldb). The runtime needs -to be at least version 2.1.0 or greater. If there are spaces in directory, it +to be at least version 6.0 or greater. If there are spaces in directory, it needs to be single-quoted ('). Normally, SOS attempts to find an installed .NET Core runtime to run its managed code automatically but this command is available if it fails. The default is to use the same runtime (libcoreclr) being debugged. Use this command if the default runtime being debugged isn't working enough to run -the SOS code or if the version is less than 2.1.0. +the SOS code or if the version is less than 6.0. If you received the following error message when running a SOS command, use -this command to set the path to 2.1.0 or greater .NET Core runtime. +this command to set the path to 6.0 or greater .NET Core runtime. (lldb) clrstack Error: Fail to initialize CoreCLR 80004005 ClrStack failed - (lldb) sethostruntime /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.6 + (lldb) sethostruntime -major 6 /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.30 You can use the "dotnet --info" in a command shell to find the path of an installed .NET Core runtime. diff --git a/src/SOS/Strike/sosextensions.cpp b/src/SOS/Strike/sosextensions.cpp new file mode 100644 index 0000000000..bbb1725a55 --- /dev/null +++ b/src/SOS/Strike/sosextensions.cpp @@ -0,0 +1,109 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "exts.h" +#ifndef FEATURE_PAL +#include "dbgengservices.h" +#endif + +SOSExtensions::SOSExtensions(IDebuggerServices* debuggerServices, IHost* host) : + Extensions(debuggerServices) +{ + m_pHost = host; + OnUnloadTask::Register(SOSExtensions::Uninitialize); +} + +#ifndef FEATURE_PAL + +SOSExtensions::~SOSExtensions() +{ + if (m_pDebuggerServices != nullptr) + { + ((DbgEngServices*)m_pDebuggerServices)->Uninitialize(); + m_pDebuggerServices->Release(); + m_pDebuggerServices = nullptr; + } +} + +HRESULT +SOSExtensions::Initialize(IDebugClient* client) +{ + if (s_extensions == nullptr) + { + DbgEngServices* debuggerServices = new DbgEngServices(client); + HRESULT hr = debuggerServices->Initialize(); + if (FAILED(hr)) { + return hr; + } + s_extensions = new SOSExtensions(debuggerServices, nullptr); + } + return S_OK; +} + +#endif + +HRESULT +SOSExtensions::Initialize(IHost* host, IDebuggerServices* debuggerServices) +{ + if (s_extensions == nullptr) + { + s_extensions = new SOSExtensions(debuggerServices, host); + } + return S_OK; +} + +void +SOSExtensions::Uninitialize() +{ + if (s_extensions != nullptr) + { + delete s_extensions; + s_extensions = nullptr; + } +} + +/// +/// Returns the host instance +/// +/// * dotnet-dump - m_pHost has already been set by SOSInitializeByHost by SOS.Hosting +/// * lldb - m_pHost has already been set by SOSInitializeByHost by libsosplugin which gets it via the InitializeHostServices callback +/// * dbgeng - SOS.Extensions provides the instance via the InitializeHostServices callback +/// +IHost* +SOSExtensions::GetHost() +{ + if (m_pHost == nullptr) + { +#ifndef FEATURE_PAL + // Initialize the hosting runtime which will call InitializeHostServices and set m_pHost to the host instance + InitializeHosting(); +#endif + // Otherwise, use the local host instance (hostimpl.*) that creates a local target instance (targetimpl.*) + if (m_pHost == nullptr) + { + m_pHost = Host::GetInstance(); + } + } + return m_pHost; +} + +/// +/// Returns the runtime or fails if no target or current runtime +/// +/// runtime instance +/// error code +HRESULT +GetRuntime(IRuntime** ppRuntime) +{ + Extensions* extensions = Extensions::GetInstance(); + ITarget* target = extensions->GetTarget(); + if (target == nullptr) + { + return E_FAIL; + } + // Flush here only on Windows under dbgeng. The lldb sos plugin handles it for Linux/MacOS. +#ifndef FEATURE_PAL + extensions->FlushCheck(); +#endif + return target->GetRuntime(ppRuntime); +} diff --git a/src/SOS/Strike/sosextensions.h b/src/SOS/Strike/sosextensions.h new file mode 100644 index 0000000000..892c7e30da --- /dev/null +++ b/src/SOS/Strike/sosextensions.h @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#pragma once + +#include + +//----------------------------------------------------------------------------------------- +// Extension helper class +//----------------------------------------------------------------------------------------- +class SOSExtensions : public Extensions +{ + SOSExtensions(IDebuggerServices* debuggerServices, IHost* host); +#ifndef FEATURE_PAL + ~SOSExtensions(); +#endif + +public: +#ifndef FEATURE_PAL + static HRESULT Initialize(IDebugClient* client); +#endif + static HRESULT Initialize(IHost* host, IDebuggerServices* debuggerServices); + static void Uninitialize(); + IHost* GetHost(); +}; + +extern HRESULT GetRuntime(IRuntime** ppRuntime); diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index b6f42fef6a..bf8ac0e4bd 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -85,9 +85,18 @@ #include #include #include - +#include +#include +#include +#include +#include +#include +#include #include #include +#ifdef HOST_UNIX +#include +#endif #include "strike.h" #include "sos.h" @@ -124,6 +133,7 @@ #include "ExpressionNode.h" #include "WatchCmd.h" #include "tls.h" +#include "clrma/managedanalysis.h" typedef struct _VM_COUNTERS { SIZE_T PeakVirtualSize; @@ -147,14 +157,6 @@ const PROCESSINFOCLASS ProcessVmCounters = static_cast(3); // Max number of methods that !dumpmodule -prof will print const UINT kcMaxMethodDescsForProfiler = 100; -#include -#include -#include -#include -#include -#include -#include - BOOL ControlC = FALSE; WCHAR g_mdName[mdNameLen]; @@ -190,9 +192,8 @@ extern const char* g_sosPrefix; #include "ntinfo.h" #endif // FEATURE_PAL -#ifndef IfFailRet +#undef IfFailRet #define IfFailRet(EXPR) do { Status = (EXPR); if(FAILED(Status)) { return (Status); } } while (0) -#endif #ifdef FEATURE_PAL @@ -574,8 +575,8 @@ DECLARE_API (EEStack) ULONG64 IP; g_ExtRegisters->GetInstructionOffset (&IP); JITTypes jitType; - TADDR methodDesc; - TADDR gcinfoAddr; + DWORD_PTR methodDesc; + DWORD_PTR gcinfoAddr; IP2MethodDesc (TO_TADDR(IP), methodDesc, jitType, gcinfoAddr); if (methodDesc) { @@ -650,7 +651,11 @@ BOOL GatherDynamicInfo(TADDR DynamicMethodObj, DacpObjectData *codeArray, iOffset = GetObjFieldOffset(TO_CDADDR(DynamicMethodObj), objData.MethodTable, W("m_resolver")); if (iOffset <= 0) - return bRet; + { + iOffset = GetObjFieldOffset(TO_CDADDR(DynamicMethodObj), objData.MethodTable, W("_resolver")); + if (iOffset <= 0) + return bRet; + } TADDR resolverPtr; if (FAILED(MOVE(resolverPtr, DynamicMethodObj + iOffset))) @@ -803,7 +808,7 @@ DECLARE_API(DumpIL) // We have a DynamicMethod managed object, let us visit the town and paint. DacpObjectData codeArray; DacpObjectData tokenArray; - DWORD_PTR tokenArrayAddr; + TADDR tokenArrayAddr; if (!GatherDynamicInfo (dwDynamicMethodObj, &codeArray, &tokenArray, &tokenArrayAddr)) { DMLOut("Error gathering dynamic info from object at %s.\n", DMLObject(dwDynamicMethodObj)); @@ -1047,7 +1052,8 @@ DECLARE_API(DumpClass) EnableDMLHolder dmlHolder(dml); CLRDATA_ADDRESS methodTable; - if ((Status=g_sos->GetMethodTableForEEClass(TO_CDADDR(dwStartAddr), &methodTable)) != S_OK) + BOOL preferMT = FALSE; + if (!SUCCEEDED(Status = PreferCanonMTOverEEClass(TO_CDADDR(dwStartAddr), &preferMT, &methodTable))) { ExtOut("Invalid EEClass address\n"); return Status; @@ -1080,11 +1086,28 @@ DECLARE_API(DumpClass) ParentEEClass = mtdataparent.Class; } - DMLOut("Parent Class: %s\n", DMLClass(ParentEEClass)); + if (!preferMT) + { + DMLOut("Parent Class: %s\n", DMLClass(ParentEEClass)); + } + else + { + DMLOut("Parent MethodTable: %s\n", DMLMethodTable(mtdata.ParentMethodTable)); + } DMLOut("Module: %s\n", DMLModule(mtdata.Module)); DMLOut("Method Table: %s\n", DMLMethodTable(methodTable)); - ExtOut("Vtable Slots: %x\n", mtdata.wNumVirtuals); - ExtOut("Total Method Slots: %x\n", mtdata.wNumVtableSlots); + if (preferMT) + { + DMLOut("Canonical MethodTable: %s\n", DMLClass(mtdata.Class)); + } + if (mtdata.wNumVirtuals != 0) + { + ExtOut("Vtable Slots: %x\n", mtdata.wNumVirtuals); + } + if (mtdata.wNumVtableSlots != 0) + { + ExtOut("Total Method Slots: %x\n", mtdata.wNumVtableSlots); + } ExtOut("Class Attributes: %x ", mtdata.dwAttrClass); if (IsTdInterface(mtdata.dwAttrClass)) @@ -1188,7 +1211,15 @@ DECLARE_API(DumpMT) DacpMethodTableCollectibleData vMethTableCollectible; vMethTableCollectible.Request(g_sos, TO_CDADDR(dwStartAddr)); - table.WriteRow("EEClass:", EEClassPtr(vMethTable.Class)); + BOOL preferCanonMT = FALSE; + if (SUCCEEDED(PreferCanonMTOverEEClass(vMethTable.Class, &preferCanonMT)) && preferCanonMT) + { + table.WriteRow("Canonical MethodTable:", EEClassPtr(vMethTable.Class)); + } + else + { + table.WriteRow("EEClass:", EEClassPtr(vMethTable.Class)); + } table.WriteRow("Module:", ModulePtr(vMethTable.Module)); @@ -1231,79 +1262,101 @@ DECLARE_API(DumpMT) table.WriteRow("ComponentSize:", PrefixHex(vMethTable.ComponentSize)); table.WriteRow("DynamicStatics:", vMethTable.bIsDynamic ? "true" : "false"); table.WriteRow("ContainsPointers:", vMethTable.bContainsPointers ? "true" : "false"); - table.WriteRow("Slots in VTable:", Decimal(vMethTable.wNumMethods)); + table.WriteRow("Number of Methods:", Decimal(vMethTable.wNumMethods)); table.SetColWidth(0, 29); table.WriteRow("Number of IFaces in IFaceMap:", Decimal(vMethTable.wNumInterfaces)); if (bDumpMDTable) { - table.ReInit(4, POINTERSIZE_HEX, AlignRight); + table.ReInit(5, POINTERSIZE_HEX, AlignRight); table.SetColAlignment(3, AlignLeft); table.SetColWidth(2, 6); Print("--------------------------------------\n"); Print("MethodDesc Table\n"); - table.WriteRow("Entry", "MethodDesc", "JIT", "Name"); + table.WriteRow("Entry", "MethodDesc", "JIT", "Slot", "Name"); - for (DWORD n = 0; n < vMethTable.wNumMethods; n++) + ISOSMethodEnum *pMethodEnumerator; + if (SUCCEEDED(g_sos15->GetMethodTableSlotEnumerator(dwStartAddr, &pMethodEnumerator))) { - JITTypes jitType; - DWORD_PTR methodDesc=0; - DWORD_PTR gcinfoAddr; - - CLRDATA_ADDRESS entry; - if (g_sos->GetMethodTableSlot(dwStartAddr, n, &entry) != S_OK) + SOSMethodData entry; + unsigned int fetched; + while (SUCCEEDED(pMethodEnumerator->Next(1, &entry, &fetched)) && fetched != 0) { - PrintLn(""); - continue; - } + JITTypes jitType = TYPE_UNKNOWN; + DWORD_PTR methodDesc = (DWORD_PTR)entry.MethodDesc; + DWORD_PTR methodDescFromIP2MD = 0; + DWORD_PTR gcinfoAddr = 0; + + if (entry.Entrypoint != 0) + { + IP2MethodDesc((DWORD_PTR)entry.Entrypoint, methodDescFromIP2MD, jitType, gcinfoAddr); + if ((methodDescFromIP2MD != methodDesc) && methodDesc != 0) + { + ExtOut("MethodDesc from IP2MD does not match MethodDesc from enumerator\n"); + } + } - IP2MethodDesc((DWORD_PTR)entry, methodDesc, jitType, gcinfoAddr); - table.WriteColumn(0, entry); - table.WriteColumn(1, MethodDescPtr(methodDesc)); + table.WriteColumn(0, entry.Entrypoint); + table.WriteColumn(1, MethodDescPtr(methodDesc)); - if (jitType == TYPE_UNKNOWN && methodDesc != (TADDR)0) - { - // We can get a more accurate jitType from NativeCodeAddr of the methoddesc, - // because the methodtable entry hasn't always been patched. - DacpMethodDescData tmpMethodDescData; - if (tmpMethodDescData.Request(g_sos, TO_CDADDR(methodDesc)) == S_OK) + if (jitType == TYPE_UNKNOWN && methodDesc != (TADDR)0) { - DacpCodeHeaderData codeHeaderData; - if (codeHeaderData.Request(g_sos,tmpMethodDescData.NativeCodeAddr) == S_OK) + // We can get a more accurate jitType from NativeCodeAddr of the methoddesc, + // because the methodtable entry hasn't always been patched. + DacpMethodDescData tmpMethodDescData; + if (tmpMethodDescData.Request(g_sos, TO_CDADDR(methodDesc)) == S_OK) { - jitType = (JITTypes) codeHeaderData.JITType; + DacpCodeHeaderData codeHeaderData; + if (codeHeaderData.Request(g_sos,tmpMethodDescData.NativeCodeAddr) == S_OK) + { + jitType = (JITTypes) codeHeaderData.JITType; + } } } - } - const char *pszJitType = "NONE"; - if (jitType == TYPE_JIT) - pszJitType = "JIT"; - else if (jitType == TYPE_PJIT) - pszJitType = "PreJIT"; - else - { - DacpMethodDescData MethodDescData; - if (MethodDescData.Request(g_sos, TO_CDADDR(methodDesc)) == S_OK) + const char *pszJitType = "NONE"; + if (jitType == TYPE_JIT) + pszJitType = "JIT"; + else if (jitType == TYPE_PJIT) + pszJitType = "PreJIT"; + else { - // Is it an fcall? - ULONG64 baseAddress = g_pRuntime->GetModuleAddress(); - ULONG64 size = g_pRuntime->GetModuleSize(); - if ((TO_TADDR(MethodDescData.NativeCodeAddr) >= TO_TADDR(baseAddress)) && - ((TO_TADDR(MethodDescData.NativeCodeAddr) < TO_TADDR(baseAddress + size)))) + DacpMethodDescData MethodDescData; + if (MethodDescData.Request(g_sos, TO_CDADDR(methodDesc)) == S_OK) { - pszJitType = "FCALL"; + // Is it an fcall? + ULONG64 baseAddress = g_pRuntime->GetModuleAddress(); + ULONG64 size = g_pRuntime->GetModuleSize(); + if ((TO_TADDR(MethodDescData.NativeCodeAddr) >= TO_TADDR(baseAddress)) && + ((TO_TADDR(MethodDescData.NativeCodeAddr) < TO_TADDR(baseAddress + size)))) + { + pszJitType = "FCALL"; + } } } - } - table.WriteColumn(2, pszJitType); + table.WriteColumn(2, pszJitType); + table.WriteColumn(3, entry.Slot); - NameForMD_s(methodDesc,g_mdName,mdNameLen); - table.WriteColumn(3, g_mdName); + if (methodDesc != 0) + NameForMD_s(methodDesc,g_mdName,mdNameLen); + else + { + DacpModuleData moduleData; + if(moduleData.Request(g_sos, entry.DefiningModule)==S_OK) + { + NameForToken_s(&moduleData, entry.Token, g_mdName, mdNameLen, true); + } + else + { + _snwprintf_s(g_mdName, mdNameLen, _TRUNCATE, W("Unknown Module!%08x"), entry.Token); + } + } + table.WriteColumn(4, g_mdName); + } } } return Status; @@ -1324,7 +1377,15 @@ HRESULT PrintVC(TADDR taMT, TADDR taObject, BOOL bPrintFields = TRUE) ExtOut("Name: %S\n", g_mdName); DMLOut("MethodTable: %s\n", DMLMethodTable(taMT)); - DMLOut("EEClass: %s\n", DMLClass(mtabledata.Class)); + BOOL preferCanonMT = FALSE; + if (SUCCEEDED(PreferCanonMTOverEEClass(TO_CDADDR(taMT), &preferCanonMT)) && preferCanonMT) + { + DMLOut("Canonical MethodTable: %s\n", DMLClass(mtabledata.Class)); + } + else + { + DMLOut("EEClass: %s\n", DMLClass(mtabledata.Class)); + } ExtOut("Size: %d(0x%x) bytes\n", size, size); FileNameForModule(TO_TADDR(mtabledata.Module), g_mdName); @@ -1417,7 +1478,15 @@ HRESULT PrintObj(TADDR taObj, BOOL bPrintFields = TRUE) DacpMethodTableData mtabledata; if ((Status=mtabledata.Request(g_sos,objData.MethodTable)) == S_OK) { - DMLOut("EEClass: %s\n", DMLClass(mtabledata.Class)); + BOOL preferCanonMT = FALSE; + if (SUCCEEDED(PreferCanonMTOverEEClass(mtabledata.Class, &preferCanonMT)) && preferCanonMT) + { + DMLOut("Canonical MethodTable: %s\n", DMLClass(mtabledata.Class)); + } + else + { + DMLOut("EEClass: %s\n", DMLClass(mtabledata.Class)); + } } else { @@ -1915,14 +1984,14 @@ HRESULT PrintArray(DacpObjectData& objData, DumpArrayFlags& flags, BOOL isPermSe } DWORD *lowerBounds = (DWORD *)alloca(dwRankAllocSize); - if (!SafeReadMemory(objData.ArrayLowerBoundsPtr, lowerBounds, dwRankAllocSize, NULL)) + if (!SafeReadMemory(TO_TADDR(objData.ArrayLowerBoundsPtr), lowerBounds, dwRankAllocSize, NULL)) { ExtOut("Failed to read lower bounds info from the array\n"); return S_OK; } DWORD *bounds = (DWORD *)alloca(dwRankAllocSize); - if (!SafeReadMemory (objData.ArrayBoundsPtr, bounds, dwRankAllocSize, NULL)) + if (!SafeReadMemory(TO_TADDR(objData.ArrayBoundsPtr), bounds, dwRankAllocSize, NULL)) { ExtOut("Failed to read bounds info from the array\n"); return S_OK; @@ -2773,7 +2842,15 @@ HRESULT FormatException(CLRDATA_ADDRESS taObj, BOOL bLineNumbers = FALSE) MOVE (stackTraceSize, dataPtr); DWORD cbStackSize = static_cast(stackTraceSize * sizeof(StackTraceElement)); - dataPtr += sizeof(size_t) + sizeof(size_t); // skip the array header, then goes the data + + if (IsRuntimeVersionAtLeast(9)) + { + dataPtr += sizeof(uint32_t) + sizeof(uint32_t) + sizeof(DWORD_PTR); // skip the 9.0 array header + } + else + { + dataPtr += sizeof(size_t) + sizeof(DWORD_PTR); // skip the array header, then goes the data + } if (stackTraceSize == 0) { @@ -3966,10 +4043,7 @@ DECLARE_API(DumpModule) DMLOut("Assembly: %s\n", DMLAssembly(module.Assembly)); ExtOut("BaseAddress: %p\n", SOS_PTR(module.ilBase)); - ExtOut("PEAssembly: %p\n", SOS_PTR(module.PEAssembly)); - ExtOut("ModuleId: %p\n", SOS_PTR(module.dwModuleID)); - ExtOut("ModuleIndex: %p\n", SOS_PTR(module.dwModuleIndex)); - ExtOut("LoaderHeap: %p\n", SOS_PTR(module.pLookupTableHeap)); + ExtOut("LoaderHeap: %p\n", SOS_PTR(module.LoaderAllocator)); ExtOut("TypeDefToMethodTableMap: %p\n", SOS_PTR(module.TypeDefToMethodTableMap)); ExtOut("TypeRefToMethodTableMap: %p\n", SOS_PTR(module.TypeRefToMethodTableMap)); ExtOut("MethodDefToDescMap: %p\n", SOS_PTR(module.MethodDefToDescMap)); @@ -4382,12 +4456,12 @@ HRESULT PrintThreadsFromThreadStore(BOOL bMiniDump, BOOL bPrintLiveThreadsOnly) #ifndef FEATURE_PAL DWORD_PTR OleTlsDataAddr; if (IsWindowsTarget() && !bSwitchedOutFiber - && SafeReadMemory(Thread.teb + offsetof(TEB, ReservedForOle), + && SafeReadMemory(TO_TADDR(Thread.teb + offsetof(TEB, ReservedForOle)), &OleTlsDataAddr, sizeof(OleTlsDataAddr), NULL) && OleTlsDataAddr != 0) { DWORD AptState; - if (SafeReadMemory(OleTlsDataAddr+offsetof(SOleTlsData,dwFlags), + if (SafeReadMemory(TO_TADDR(OleTlsDataAddr+offsetof(SOleTlsData,dwFlags)), &AptState, sizeof(AptState), NULL)) { @@ -4952,7 +5026,7 @@ void IssueDebuggerBPCommand ( CLRDATA_ADDRESS addr ) sprintf_s(buffer, ARRAY_SIZE(buffer), "breakpoint set --address 0x%p", SOS_PTR(addr)); #endif ExtOut("Setting breakpoint: %s [%S]\n", buffer, wszNameBuffer); - g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, buffer, 0); + g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, buffer, 0); if (curLimit < MaxBPsCached) { @@ -5713,7 +5787,7 @@ class CNotification : public IXCLRDataExceptionNotification5 #else sprintf_s(buffer, ARRAY_SIZE(buffer), "breakpoint set --one-shot --address 0x%p", SOS_PTR(startAddr+catcherNativeOffset)); #endif - g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, buffer, 0); + g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, buffer, 0); } g_stopOnNextCatch = FALSE; } @@ -5763,7 +5837,7 @@ BOOL CheckCLRNotificationEvent(DEBUG_LAST_EVENT_INFO_EXCEPTION* pdle) return FALSE; } - // The new DAC based interface doesn't exists so ask the debugger for the last exception information. + // The new DAC based interface doesn't exists so ask the debugger for the last exception information. #ifdef HOST_WINDOWS ULONG Type, ProcessId, ThreadId; @@ -5812,7 +5886,7 @@ HRESULT HandleCLRNotificationEvent() ExtOut("Expecting first chance CLRN exception\n"); return E_FAIL; #else - g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, "process continue", 0); + g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, "process continue", 0); return S_OK; #endif } @@ -5833,9 +5907,9 @@ HRESULT HandleCLRNotificationEvent() case DEBUG_STATUS_GO_HANDLED: case DEBUG_STATUS_GO_NOT_HANDLED: #ifndef FEATURE_PAL - g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, "g", 0); + g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, "g", 0); #else - g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, "process continue", 0); + g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, "process continue", 0); #endif break; default: @@ -5869,7 +5943,7 @@ HRESULT HandleRuntimeLoadedNotification(IDebugClient* client) { INIT_API_EFN(); EnableModuleLoadUnloadCallbacks(); - return g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, "sxe -c \"!SOSHandleCLRN\" clrn", 0); + return g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, "sxe -c \"!SOSHandleCLRN\" clrn", 0); } #else // FEATURE_PAL @@ -6224,7 +6298,7 @@ DECLARE_API(bpmd) SOS_PTR(MethodDescData.AddressOfNativeCodeSlot), SOS_PTR(MethodDescData.AddressOfNativeCodeSlot)); - Status = g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, buffer, 0); + Status = g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, buffer, 0); if (FAILED(Status)) { ExtOut("Unable to set breakpoint with IDebugControl::Execute: %x\n",Status); @@ -6256,7 +6330,7 @@ DECLARE_API(bpmd) { ExtOut("Adding pending breakpoints...\n"); #ifndef FEATURE_PAL - Status = g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, "sxe -c \"!SOSHandleCLRN\" clrn", 0); + Status = g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, "sxe -c \"!SOSHandleCLRN\" clrn", 0); #else Status = g_ExtServices->SetExceptionCallback(HandleExceptionNotification); #endif // FEATURE_PAL @@ -6643,8 +6717,8 @@ DECLARE_API(GCInfo) if (!IsMethodDesc(taStartAddr)) { JITTypes jitType; - TADDR methodDesc; - TADDR gcinfoAddr; + DWORD_PTR methodDesc; + DWORD_PTR gcinfoAddr; IP2MethodDesc(taStartAddr, methodDesc, jitType, gcinfoAddr); tmpAddr = methodDesc; } @@ -8163,8 +8237,8 @@ DECLARE_API (ProcInfo) if (FAILED(g_ExtData->ReadVirtual(UL64_TO_CDA(addr), &buffer, readBytes, NULL))) break; addr += readBytes; - WCHAR *pt = buffer; - WCHAR *end = pt; + const WCHAR *pt = buffer; + const WCHAR *end = pt; while (pt < &buffer[DT_OS_PAGE_SIZE/2]) { end = _wcschr (pt, L'\0'); if (end == NULL) { @@ -8414,7 +8488,7 @@ DECLARE_API(Token2EE) FileNameForModule(dwAddr, FileName); // We'd like a short form for this output - LPWSTR pszFilename = _wcsrchr (FileName, GetTargetDirectorySeparatorW()); + LPCWSTR pszFilename = _wcsrchr (FileName, GetTargetDirectorySeparatorW()); if (pszFilename == NULL) { pszFilename = FileName; @@ -8542,7 +8616,7 @@ DECLARE_API(Name2EE) FileNameForModule (dwAddr, FileName); // We'd like a short form for this output - LPWSTR pszFilename = _wcsrchr (FileName, GetTargetDirectorySeparatorW()); + LPCWSTR pszFilename = _wcsrchr (FileName, GetTargetDirectorySeparatorW()); if (pszFilename == NULL) { pszFilename = FileName; @@ -8624,7 +8698,7 @@ DECLARE_API(FindRoots) idp2->SetGcNotification(gea); // ... and register the notification handler #ifndef FEATURE_PAL - g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, "sxe -c \"!SOSHandleCLRN\" clrn", 0); + g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, "sxe -c \"!SOSHandleCLRN\" clrn", 0); #else g_ExtServices->SetExceptionCallback(HandleExceptionNotification); #endif // FEATURE_PAL @@ -8817,6 +8891,8 @@ class GCHandlesImpl mType = HNDTYPE_DEPENDENT; else if (_stricmp(type, "WeakWinRT") == 0) mType = HNDTYPE_WEAK_WINRT; + else if (_stricmp(type, "WeakInteriorPointer") == 0) + mType = HNDTYPE_WEAK_INTERIOR_POINTER; else sos::Throw("Unknown handle type '%s'.", type.GetPtr()); } @@ -8985,6 +9061,10 @@ class GCHandlesImpl type = "WeakWinRT"; if (pStats) pStats->weakWinRTHandleCount++; break; + case HNDTYPE_WEAK_INTERIOR_POINTER: + type = "WeakInteriorPointer"; + if (pStats) pStats->weakInteriorPointerHandleCount++; + break; default: DebugBreak(); type = "Unknown"; @@ -9004,6 +9084,8 @@ class GCHandlesImpl mOut.WriteRow(data[i].Handle, type, ObjectPtr(objAddr), Decimal(size), ObjectPtr(data[i].Secondary), mtName); else if (data[i].Type == HNDTYPE_WEAK_WINRT) mOut.WriteRow(data[i].Handle, type, ObjectPtr(objAddr), Decimal(size), Pointer(data[i].Secondary), mtName); + else if (data[i].Type == HNDTYPE_WEAK_INTERIOR_POINTER) + mOut.WriteRow(data[i].Handle, type, ObjectPtr(objAddr), Decimal(size), Pointer(data[i].Secondary), mtName); else mOut.WriteRow(data[i].Handle, type, ObjectPtr(objAddr), Decimal(size), "", mtName); } @@ -9028,6 +9110,7 @@ class GCHandlesImpl PrintHandleRow("Weak Long Handles:", pStats->weakLongHandleCount); PrintHandleRow("Weak Short Handles:", pStats->weakShortHandleCount); PrintHandleRow("Weak WinRT Handles:", pStats->weakWinRTHandleCount); + PrintHandleRow("Weak Interior Pointer Handles:", pStats->weakInteriorPointerHandleCount); PrintHandleRow("Variable Handles:", pStats->variableCount); PrintHandleRow("SizedRef Handles:", pStats->sizedRefCount); PrintHandleRow("Dependent Handles:", pStats->dependentCount); @@ -9143,7 +9226,7 @@ DECLARE_API(TraceToCode) } else { - Status = g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, "thr; .echo wait" ,0); + Status = g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, "thr; .echo wait" ,0); if (FAILED(Status)) { ExtOut("Error tracing instruction\n"); @@ -9197,7 +9280,7 @@ DECLARE_API(GetCodeTypeFlags) sprintf_s(buffer, ARRAY_SIZE(buffer), "r$t%d=0", preg); - Status = g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, buffer ,0); + Status = g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, buffer ,0); if (FAILED(Status)) { ExtOut("Error initialized register $t%d to zero\n", preg); @@ -9248,7 +9331,7 @@ DECLARE_API(GetCodeTypeFlags) sprintf_s(buffer, ARRAY_SIZE(buffer), "r$t%d=%x", preg, codeType); - Status = g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, buffer, 0); + Status = g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, buffer, 0); if (FAILED(Status)) { ExtOut("Error setting register $t%d\n", preg); @@ -9317,7 +9400,7 @@ DECLARE_API(StopOnException) sprintf_s(buffer, ARRAY_SIZE(buffer), "r$t%d=0", preg); - Status = g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, buffer, 0); + Status = g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, buffer, 0); if (FAILED(Status)) { ExtOut("Error initialized register $t%d to zero\n", preg); @@ -9337,7 +9420,7 @@ DECLARE_API(StopOnException) EXCEPTION_COMPLUS ); - Status = g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, buffer, 0); + Status = g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, buffer, 0); if (FAILED(Status)) { ExtOut("Error setting breakpoint: %s\n", buffer); @@ -9360,7 +9443,7 @@ DECLARE_API(StopOnException) } TADDR taLTOH; - if (!SafeReadMemory(Thread.lastThrownObjectHandle, + if (!SafeReadMemory(TO_TADDR(Thread.lastThrownObjectHandle), &taLTOH, sizeof(taLTOH), NULL)) { @@ -9383,7 +9466,7 @@ DECLARE_API(StopOnException) sprintf_s(buffer, ARRAY_SIZE(buffer), "r$t%d=1", preg); - Status = g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, buffer, 0); + Status = g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, buffer, 0); if (FAILED(Status)) { ExtOut("Failed to execute the following command: %s\n", buffer); @@ -10523,7 +10606,7 @@ class ClrStackImplWithICorDebug InternalFrameManager internalFrameManager; IfFailRet(internalFrameManager.Init(pThread3)); - #if defined(_AMD64_) || defined(_ARM64_) || defined(_RISCV64_) + #if defined(_AMD64_) || defined(_ARM64_) || defined(_RISCV64_) || defined(_LOONGARCH64_) ExtOut("%-16s %-16s %s\n", "Child SP", "IP", "Call Site"); #elif defined(_X86_) || defined(_ARM_) ExtOut("%-8s %-8s %s\n", "Child SP", "IP", "Call Site"); @@ -11011,6 +11094,24 @@ class ClrStackImpl ExtOut(outputFormat3, "t5", context.RiscV64Context.T5, "t6", context.RiscV64Context.T6, "pc", context.RiscV64Context.Pc); } #endif +#if defined(SOS_TARGET_LOONGARCH64) + if (IsDbgTargetLoongArch64()) + { + foundPlatform = true; + String outputFormat3 = " %3s=%016llx %3s=%016llx %3s=%016llx\n"; + ExtOut(outputFormat3, "r0", context.LoongArch64Context.R0, "ra", context.LoongArch64Context.Ra, "tp", context.LoongArch64Context.Tp); + ExtOut(outputFormat3, "sp", context.LoongArch64Context.Sp, "a0", context.LoongArch64Context.A0, "a1", context.LoongArch64Context.A1); + ExtOut(outputFormat3, "a2", context.LoongArch64Context.A2, "a3", context.LoongArch64Context.A3, "a4", context.LoongArch64Context.A4); + ExtOut(outputFormat3, "a5", context.LoongArch64Context.A5, "a6", context.LoongArch64Context.A6, "a7", context.LoongArch64Context.A7); + ExtOut(outputFormat3, "t0", context.LoongArch64Context.T0, "t1", context.LoongArch64Context.T1, "t2", context.LoongArch64Context.T2); + ExtOut(outputFormat3, "t3", context.LoongArch64Context.T3, "t4", context.LoongArch64Context.T4, "t5", context.LoongArch64Context.T5); + ExtOut(outputFormat3, "t6", context.LoongArch64Context.T6, "t7", context.LoongArch64Context.T7, "t8", context.LoongArch64Context.T8); + ExtOut(outputFormat3, "x0", context.LoongArch64Context.X0, "fp", context.LoongArch64Context.Fp, "s0", context.LoongArch64Context.S0); + ExtOut(outputFormat3, "s1", context.LoongArch64Context.S1, "s2", context.LoongArch64Context.S2, "s3", context.LoongArch64Context.S3); + ExtOut(outputFormat3, "s4", context.LoongArch64Context.S4, "s5", context.LoongArch64Context.S5, "s6", context.LoongArch64Context.S6); + ExtOut(outputFormat3, "s7", context.LoongArch64Context.S7, "s8", context.LoongArch64Context.S8, "pc", context.LoongArch64Context.Pc); + } +#endif if (!foundPlatform) { @@ -11986,7 +12087,7 @@ static HRESULT DumpMDInfoBuffer(DWORD_PTR dwStartAddr, DWORD Flags, ULONG64 Esp, } if (wszNameBuffer[0] != W('\0')) { - WCHAR *pJustName = _wcsrchr(wszNameBuffer, GetTargetDirectorySeparatorW()); + const WCHAR *pJustName = _wcsrchr(wszNameBuffer, GetTargetDirectorySeparatorW()); if (pJustName == NULL) pJustName = wszNameBuffer - 1; @@ -11999,7 +12100,7 @@ static HRESULT DumpMDInfoBuffer(DWORD_PTR dwStartAddr, DWORD Flags, ULONG64 Esp, // returns a module qualified method name HRESULT hr = g_sos->GetMethodDescName(dwStartAddr, MAX_LONGPATH, wszNameBuffer, NULL); - WCHAR* pwszMethNameBegin = (hr != S_OK ? NULL : _wcschr(wszNameBuffer, L'!')); + const WCHAR* pwszMethNameBegin = (hr != S_OK ? NULL : _wcschr(wszNameBuffer, L'!')); if (!bModuleNameWorked && hr == S_OK && pwszMethNameBegin != NULL) { // if we weren't able to get the module name, but GetMethodDescName returned @@ -12441,14 +12542,14 @@ BOOL FormatFromRemoteString(DWORD_PTR strObjPointer, __out_ecount(cchString) PWS UINT Length = 0; while(1) { - if (_wcsncmp(pwszPointer, PSZSEP, ARRAY_SIZE(PSZSEP)-1) != 0) + if (wcsncmp(pwszPointer, PSZSEP, ARRAY_SIZE(PSZSEP)-1) != 0) { delete [] pwszBuf; return bRet; } - pwszPointer += _wcslen(PSZSEP); - LPWSTR nextPos = _wcsstr(pwszPointer, PSZSEP); + pwszPointer += wcslen(PSZSEP); + LPWSTR nextPos = (LPWSTR)wcsstr(pwszPointer, PSZSEP); if (nextPos == NULL) { // Done! Note that we are leaving the function before we add the last @@ -12465,7 +12566,7 @@ BOOL FormatFromRemoteString(DWORD_PTR strObjPointer, __out_ecount(cchString) PWS // Note that we don't add a newline because we have this embedded in wszLineBuffer swprintf_s(wszLineBuffer, ARRAY_SIZE(wszLineBuffer), W(" %p %p %s"), SOS_PTR(-1), SOS_PTR(-1), pwszPointer); - Length += (UINT)_wcslen(wszLineBuffer); + Length += (UINT)wcslen(wszLineBuffer); if (wszBuffer) { @@ -12655,7 +12756,6 @@ HRESULT ImplementEFNGetManagedExcepStack( DECLARE_API(VerifyStackTrace) { INIT_API(); - ONLY_SUPPORTED_ON_WINDOWS_TARGET(); BOOL bVerifyManagedExcepStack = FALSE; CMDOption option[] = @@ -12925,7 +13025,7 @@ DECLARE_API(SuppressJitOptimization) else { g_fAllowJitOptimization = FALSE; - g_ExtControl->Execute(DEBUG_EXECUTE_NOT_LOGGED, "sxe -c \"!SOSHandleCLRN\" clrn", 0); + g_ExtControl->Execute(DEBUG_OUTCTL_NOT_LOGGED, "sxe -c \"!SOSHandleCLRN\" clrn", 0); ExtOut("JIT optimization will be suppressed\n"); } } @@ -13441,6 +13541,7 @@ DECLARE_API(SetHostRuntime) BOOL bNetCore = FALSE; BOOL bNone = FALSE; BOOL bClear = FALSE; + DWORD_PTR majorRuntimeVersion = 0; CMDOption option[] = { // name, vptr, type, hasValue {"-netfx", &bNetFx, COBOOL, FALSE}, @@ -13449,6 +13550,7 @@ DECLARE_API(SetHostRuntime) {"-c", &bNetCore, COBOOL, FALSE}, {"-none", &bNone, COBOOL, FALSE}, {"-clear", &bClear, COBOOL, FALSE}, + {"-major", &majorRuntimeVersion, COSIZE_T, TRUE}, }; StringHolder hostRuntimeDirectory; CMDValue arg[] = @@ -13460,56 +13562,55 @@ DECLARE_API(SetHostRuntime) { return E_INVALIDARG; } - if (narg > 0 || bNetCore || bNetFx || bNone) + HostRuntimeFlavor flavor = HostRuntimeFlavor::NetCore; + int major = 0, minor = 0; + if (narg > 0 || majorRuntimeVersion > 0 || bClear || bNetCore || bNetFx || bNone) { if (IsHostingInitialized()) { ExtErr("Runtime hosting already initialized\n"); goto exit; } - } - if (bClear) - { - SetHostRuntimeDirectory(nullptr); - } - else if (bNone) - { - SetHostRuntimeFlavor(HostRuntimeFlavor::None); - } - else if (bNetCore) - { - SetHostRuntimeFlavor(HostRuntimeFlavor::NetCore); - } - else if (bNetFx) - { - SetHostRuntimeFlavor(HostRuntimeFlavor::NetFx); - } - if (narg > 0) - { - if (!SetHostRuntimeDirectory(hostRuntimeDirectory.data)) + if (bClear) + { + SetHostRuntime(HostRuntimeFlavor::NetCore, 0, 0, nullptr); + } + if (bNone) + { + flavor = HostRuntimeFlavor::None; + } + else if (bNetCore) + { + flavor = HostRuntimeFlavor::NetCore; + } + else if (bNetFx) + { + flavor = HostRuntimeFlavor::NetFx; + } + major = (int)majorRuntimeVersion; + if (!SetHostRuntime(flavor, major, minor, hostRuntimeDirectory.data)) { ExtErr("Invalid host runtime path %s\n", hostRuntimeDirectory.data); return E_FAIL; } } exit: - const char* flavor = ""; - switch (GetHostRuntimeFlavor()) + LPCSTR directory = nullptr; + GetHostRuntime(flavor, major, minor, directory); + switch (flavor) { case HostRuntimeFlavor::None: - flavor = "no"; + ExtOut("Using no runtime to host the managed SOS code\n"); break; case HostRuntimeFlavor::NetCore: - flavor = ".NET Core"; + ExtOut("Using .NET Core runtime (version %d.%d) to host the managed SOS code\n", major, minor); break; case HostRuntimeFlavor::NetFx: - flavor = "desktop .NET Framework"; + ExtOut("Using desktop .NET Framework runtime to host the managed SOS code\n"); break; default: break; } - ExtOut("Using %s runtime to host the managed SOS code\n", flavor); - const char* directory = GetHostRuntimeDirectory(); if (directory != nullptr) { ExtOut("Host runtime path: %s\n", directory); @@ -13517,6 +13618,27 @@ DECLARE_API(SetHostRuntime) return S_OK; } +DECLARE_API(processor) +{ + INIT_API_EXT(); + ULONG executingType; + if (SUCCEEDED(g_ExtControl->GetExecutingProcessorType(&executingType))) + { + ExtOut("Executing processor type: %04x '%s'\n", executingType, GetProcessorName(executingType)); + } + ULONG actualType; + if (SUCCEEDED(g_ExtControl->GetActualProcessorType(&actualType))) + { + ExtOut("Actual processor type: %04x '%s'\n", actualType, GetProcessorName(actualType)); + } + ULONG effectiveType; + if (SUCCEEDED(g_ExtControl->GetEffectiveProcessorType(&effectiveType))) + { + ExtOut("Effective processor type: %04x '%s'\n", effectiveType, GetProcessorName(effectiveType)); + } + return S_OK; +} + #endif // FEATURE_PAL // @@ -13558,7 +13680,7 @@ DECLARE_API(SetClrPath) // DECLARE_API(runtimes) { - INIT_API_NOEE_PROBE_MANAGED("runtimes"); + INIT_API_NODAC_PROBE_MANAGED("runtimes"); BOOL bNetFx = FALSE; BOOL bNetCore = FALSE; @@ -13598,6 +13720,19 @@ DECLARE_API(runtimes) return Status; } +const std::string +GetDirectory(const std::string& fileName) +{ + size_t last = fileName.rfind(DIRECTORY_SEPARATOR_STR_A); + if (last != std::string::npos) { + last++; + } + else { + last = 0; + } + return fileName.substr(0, last); +} + void PrintHelp (__in_z LPCSTR pszCmdName) { static LPSTR pText = NULL; @@ -13605,24 +13740,23 @@ void PrintHelp (__in_z LPCSTR pszCmdName) if (pText == NULL) { #ifndef FEATURE_PAL HGLOBAL hResource = NULL; - HRSRC hResInfo = FindResource (g_hInstance, TEXT ("DOCUMENTATION"), TEXT ("TEXT")); - if (hResInfo) hResource = LoadResource (g_hInstance, hResInfo); - if (hResource) pText = (LPSTR) LockResource (hResource); + HRSRC hResInfo = FindResourceW(g_hInstance, TEXT ("DOCUMENTATION"), TEXT ("TEXT")); + if (hResInfo) hResource = LoadResource(g_hInstance, hResInfo); + if (hResource) pText = (LPSTR)LockResource(hResource); if (pText == NULL) { ExtErr("Error loading documentation resource\n"); return; } #else - ArrayHolder szSOSModulePath = new char[MAX_LONGPATH + 1]; - UINT cch = MAX_LONGPATH; - if (!PAL_GetPALDirectoryA(szSOSModulePath, &cch)) { + Dl_info info; + if (dladdr((PVOID)&PrintHelp, &info) == 0) + { ExtErr("Error: Failed to get SOS module directory\n"); return; } - char lpFilename[MAX_LONGPATH + 12]; // + 12 to make enough room for strcat function. - strcpy_s(lpFilename, ARRAY_SIZE(lpFilename), szSOSModulePath); + strcpy_s(lpFilename, ARRAY_SIZE(lpFilename), GetDirectory(info.dli_fname).c_str()); strcat_s(lpFilename, ARRAY_SIZE(lpFilename), "sosdocsunix.txt"); HANDLE hSosDocFile = CreateFileA(lpFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); diff --git a/src/SOS/Strike/strike.h b/src/SOS/Strike/strike.h index 3ec9073e13..6106ff17aa 100644 --- a/src/SOS/Strike/strike.h +++ b/src/SOS/Strike/strike.h @@ -9,37 +9,7 @@ #ifndef __strike_h__ #define __strike_h__ -#include - -#if defined(_MSC_VER) -#pragma warning(disable:4245) // signed/unsigned mismatch -#pragma warning(disable:4100) // unreferenced formal parameter -#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union -#pragma warning(disable:4127) // conditional expression is constant -#pragma warning(disable:6255) // Prefast: alloca indicates failure by raising a stack overflow exception -#endif - -#ifdef PAL_STDCPP_COMPAT -#define _iswprint PAL_iswprint -#define _wcslen PAL_wcslen -#define _wcsncmp PAL_wcsncmp -#define _wcsrchr PAL_wcsrchr -#define _wcscmp PAL_wcscmp -#define _wcschr PAL_wcschr -#define _wcscspn PAL_wcscspn -#define _wcscat PAL_wcscat -#define _wcsstr PAL_wcsstr -#else // PAL_STDCPP_COMPAT -#define _iswprint iswprint -#define _wcslen wcslen -#define _wcsncmp wcsncmp -#define _wcsrchr wcsrchr -#define _wcscmp wcscmp -#define _wcschr wcschr -#define _wcscspn wcscspn -#define _wcscat wcscat -#define _wcsstr wcsstr -#endif // !PAL_STDCPP_COMPAT +#include "warningcontrol.h" #define ___in _SAL1_Source_(__in, (), _In_) #define ___out _SAL1_Source_(__out, (), _Out_) @@ -50,10 +20,22 @@ #include #include #include - #include +#include +#include + +#define _wcsrchr u16_strrchr +#define _wcscmp u16_strcmp +#define _wcsncmp u16_strncmp +#define _wcschr u16_strchr +#define _wcscat u16_strcat +#define _wcsstr u16_strstr + +inline size_t __cdecl _wcslen(const WCHAR* str) +{ + return u16_strlen(str); +} -//#define NOEXTAPI #define KDEXT_64BIT #include #undef DECLARE_API @@ -71,10 +53,6 @@ #include "host.h" #include "hostservices.h" -#ifndef PAL_STDCPP_COMPAT -#include -#endif - #ifdef FEATURE_PAL #ifndef alloca #define alloca __builtin_alloca diff --git a/src/SOS/Strike/symbols.cpp b/src/SOS/Strike/symbols.cpp index 4663282e5b..b6f3d6fe1d 100644 --- a/src/SOS/Strike/symbols.cpp +++ b/src/SOS/Strike/symbols.cpp @@ -13,7 +13,6 @@ #include "safemath.h" #include -#include #include #ifdef FEATURE_PAL @@ -29,9 +28,8 @@ #include #endif -#ifndef IfFailRet +#undef IfFailRet #define IfFailRet(EXPR) do { Status = (EXPR); if(FAILED(Status)) { return (Status); } } while (0) -#endif #ifndef FEATURE_PAL HMODULE g_hmoduleSymBinder = nullptr; diff --git a/src/SOS/Strike/util.cpp b/src/SOS/Strike/util.cpp index 63001e1999..2f24ae08d8 100644 --- a/src/SOS/Strike/util.cpp +++ b/src/SOS/Strike/util.cpp @@ -10,32 +10,33 @@ #include "disasm.h" #include -#include "corhdr.h" -#include "cor.h" -#include "dacprivate.h" -#include "sospriv.h" -#include "corerror.h" -#include "safemath.h" +#include +#include +#include +#include "dacprivate2x.h" +#include +#include +#include #include #include #include #include -#include -#include "gcinfo.h" +#include #ifndef STRESS_LOG #define STRESS_LOG #endif // STRESS_LOG #define STRESS_LOG_READONLY -#include "stresslog.h" +#include #ifdef FEATURE_PAL #include #include +#include #endif // !FEATURE_PAL -#include "coreclrhost.h" +#include #include #include @@ -59,10 +60,10 @@ const char * const CorElementTypeNamespace[ELEMENT_TYPE_MAX]= IXCLRDataProcess *g_clrData = NULL; ISOSDacInterface *g_sos = NULL; +ISOSDacInterface15 *g_sos15 = NULL; -#ifndef IfFailRet +#undef IfFailRet #define IfFailRet(EXPR) do { Status = (EXPR); if(FAILED(Status)) { return (Status); } } while (0) -#endif // Max number of reverted rejit versions that !dumpmd and !ip2md will print const UINT kcMaxRevertedRejitData = 10; @@ -997,7 +998,7 @@ void ComposeName_s(CorElementType Type, __out_ecount(capacity_buffer) LPSTR buff LPWSTR FormatTypeName (__out_ecount (maxChars) LPWSTR pszName, UINT maxChars) { UINT iStart = 0; - UINT iLen = (int) _wcslen(pszName); + UINT iLen = (int) u16_strlen(pszName); if (iLen > maxChars) { iStart = iLen - maxChars; @@ -1294,7 +1295,7 @@ int GetObjFieldOffset(CLRDATA_ADDRESS cdaObj, CLRDATA_ADDRESS cdaMT, __in_z LPCW { DWORD offset = vFieldDesc.dwOffset + sizeof(BaseObject); NameForToken_s (TokenFromRid(vFieldDesc.mb, mdtFieldDef), pImport, g_mdName, mdNameLen, false); - if (_wcscmp (wszFieldName, g_mdName) == 0) + if (u16_strcmp (wszFieldName, g_mdName) == 0) { if (pDacpFieldDescData != NULL) { @@ -1937,7 +1938,7 @@ BOOL IsObjectArray (DacpObjectData *pData) BOOL IsObjectArray (DWORD_PTR obj) { - DWORD_PTR mtAddr = (TADDR)0; + TADDR mtAddr = (TADDR)0; if (SUCCEEDED(GetMTOfObject(obj, &mtAddr))) return TO_TADDR(g_special_usefulGlobals.ArrayMethodTable) == mtAddr; @@ -1946,7 +1947,7 @@ BOOL IsObjectArray (DWORD_PTR obj) BOOL IsStringObject (size_t obj) { - DWORD_PTR mtAddr = (TADDR)0; + TADDR mtAddr = (TADDR)0; if (SUCCEEDED(GetMTOfObject(obj, &mtAddr))) return TO_TADDR(g_special_usefulGlobals.StringMethodTable) == mtAddr; @@ -1966,7 +1967,7 @@ BOOL IsDerivedFrom(CLRDATA_ADDRESS mtObj, __in_z LPCWSTR baseString) } NameForMT_s(TO_TADDR(walkMT), g_mdName, mdNameLen); - if (_wcscmp(baseString, g_mdName) == 0) + if (u16_strcmp(baseString, g_mdName) == 0) { return TRUE; } @@ -2476,8 +2477,8 @@ void GetInfoFromName(DWORD_PTR ModulePtr, const char* name, mdTypeDef* retMdType mdToken tkEnclose = mdTokenNil; WCHAR *pName; WCHAR *pHead = wszName; - while ( ((pName = _wcschr (pHead,L'+')) != NULL) || - ((pName = _wcschr (pHead,L'/')) != NULL)) { + while ( ((pName = (WCHAR*)u16_strchr (pHead,L'+')) != NULL) || + ((pName = (WCHAR*)u16_strchr (pHead,L'/')) != NULL)) { pName[0] = L'\0'; if (FAILED(pImport->FindTypeDefByName(pHead,tkEnclose,&tkEnclose))) return; @@ -2498,7 +2499,7 @@ void GetInfoFromName(DWORD_PTR ModulePtr, const char* name, mdTypeDef* retMdType // See if it is a method WCHAR *pwzMethod; - if ((pwzMethod = _wcsrchr(pName, L'.')) == NULL) + if ((pwzMethod = (WCHAR*)u16_strrchr(pName, L'.')) == NULL) return; if (pwzMethod[-1] == L'.') @@ -2627,7 +2628,7 @@ HRESULT GetMethodDefinitionsFromName(TADDR ModulePtr, IXCLRDataModule* mod, cons * Find the EE data given a name. * * * \**********************************************************************/ -HRESULT GetMethodDescsFromName(TADDR ModulePtr, IXCLRDataModule* mod, const char *name, DWORD_PTR **pOut,int *numMethods) +HRESULT GetMethodDescsFromName(DWORD_PTR ModulePtr, IXCLRDataModule* mod, const char *name, DWORD_PTR **pOut,int *numMethods) { if (name == NULL || pOut == NULL || numMethods == NULL) return E_FAIL; @@ -2655,7 +2656,7 @@ HRESULT GetMethodDescsFromName(TADDR ModulePtr, IXCLRDataModule* mod, const char if (methodCount > 0) { - *pOut = new TADDR[methodCount]; + *pOut = new DWORD_PTR[methodCount]; if (*pOut==NULL) { ReportOOM(); @@ -3358,18 +3359,8 @@ bool IsRuntimeVersionAtLeast(VS_FIXEDFILEINFO& fileInfo, DWORD major) { return true; } - // fall through - - default: - if (HIWORD(fileInfo.dwFileVersionMS) >= major) - { - return true; - } - // fall through - - break; } - return false; + return HIWORD(fileInfo.dwFileVersionMS) >= major; } // Returns true if there is a change in the data structures that SOS depends on like @@ -3554,7 +3545,7 @@ void StringObjectContent(size_t obj, BOOL fLiteral, const int length) ULONG j,k=0; for (j = 0; j < wcharsRead; j ++) { - if (_iswprint (buffer[j])) { + if (iswprint (buffer[j])) { out[k] = buffer[j]; k ++; } @@ -3639,8 +3630,8 @@ __int64 str64hex(const char *ptr) break; } - if (nCount>15) { - return _UI64_MAX; // would be an overflow + if (nCount > 15) { + return UINT64_MAX; // would be an overflow } value = value << 4; @@ -3930,6 +3921,154 @@ void ResetGlobals(void) Output::ResetIndent(); } +class SOSDacInterface15Simulator : public ISOSDacInterface15 +{ + class SOSMethodEnum : public ISOSMethodEnum + { + CLRDATA_ADDRESS pMT; + unsigned int index; + unsigned int slotCount; + ULONG refCount; + public: + SOSMethodEnum(CLRDATA_ADDRESS mt) : pMT(mt), refCount(1) + { + } + + virtual ~SOSMethodEnum() {} + + virtual HRESULT STDMETHODCALLTYPE Reset() + { + index = 0; + DacpMethodTableData vMethTable; + HRESULT hr = vMethTable.Request(g_sos, pMT); + if (FAILED(hr)) + return hr; + + slotCount = vMethTable.wNumMethods; + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE GetCount(unsigned int *pc) + { + *pc = slotCount; + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE Skip(unsigned int skipCount) + { + index += skipCount; + return S_OK; + } + + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ unsigned int count, + /* [length_is][size_is][out] */ SOSMethodData methods[ ], + /* [out] */ unsigned int *pFetched) + { + if (!pFetched) + return E_POINTER; + + if (!methods) + return E_POINTER; + + unsigned int i = 0; + while (i < count && index < slotCount) + { + SOSMethodData methodData = { 0 }; + + JITTypes jitType; + DWORD_PTR methodDesc=0; + DWORD_PTR gcinfoAddr; + + CLRDATA_ADDRESS entry; + methodData.Slot = index; + HRESULT hr = g_sos->GetMethodTableSlot(pMT, index++, &entry); + if (hr != S_OK) + { + PrintLn(""); + continue; + } + + IP2MethodDesc((DWORD_PTR)entry, methodDesc, jitType, gcinfoAddr); + + methodData.MethodDesc = methodDesc; + methodData.Entrypoint = entry; + + methods[i++] = methodData; + } + + *pFetched = i; + return i < count ? S_FALSE : S_OK; + } + + STDMETHOD_(ULONG, AddRef)() { return ++refCount; } + STDMETHOD_(ULONG, Release)() + { + --refCount; + if (refCount == 0) + { + delete this; + return 0; + } + return refCount; + } + + STDMETHOD(QueryInterface)( + THIS_ + ___in REFIID InterfaceId, + ___out PVOID* Interface + ) + { + if (InterfaceId == IID_IUnknown || + InterfaceId == IID_ISOSMethodEnum) + { + *Interface = (ISOSMethodEnum*)this; + AddRef(); + return S_OK; + } + *Interface = NULL; + return E_NOINTERFACE; + } + }; + +public: + STDMETHOD_(ULONG, AddRef)() { return 1; }; + STDMETHOD_(ULONG, Release)() { return 1; }; + STDMETHOD(QueryInterface)( + THIS_ + ___in REFIID InterfaceId, + ___out PVOID* Interface + ) + { + if (InterfaceId == IID_IUnknown || + InterfaceId == IID_ISOSDacInterface15) + { + *Interface = (ISOSDacInterface15*)this; + return S_OK; + } + *Interface = NULL; + return E_NOINTERFACE; + } + + virtual HRESULT STDMETHODCALLTYPE GetMethodTableSlotEnumerator( + CLRDATA_ADDRESS mt, + ISOSMethodEnum **enumerator) + { + SOSMethodEnum *simulator = new(std::nothrow) SOSMethodEnum(mt); + *enumerator = simulator; + if (simulator == NULL) + { + return E_OUTOFMEMORY; + } + HRESULT hr = simulator->Reset(); + if (FAILED(hr)) + { + simulator->Release(); + } + return hr; + } +} SOSDacInterface15Simulator_Instance; + //--------------------------------------------------------------------------------------- // // Loads private DAC interface, and points g_clrData to it. @@ -3943,23 +4082,11 @@ HRESULT LoadClrDebugDll(void) HRESULT hr = g_pRuntime->GetClrDataProcess(&g_clrData); if (FAILED(hr)) { -#ifdef FEATURE_PAL - return hr; -#else - // Fail if ExtensionApis wasn't initialized because we are hosted under dotnet-dump - if (Ioctl == nullptr) { - return hr; - } - // Try getting the DAC interface from dbgeng if the above fails on Windows - WDBGEXTS_CLR_DATA_INTERFACE Query; - - Query.Iid = &__uuidof(IXCLRDataProcess); - if (!Ioctl(IG_GET_CLR_DATA_INTERFACE, &Query, sizeof(Query))) { + g_clrData = GetClrDataFromDbgEng(); + if (g_clrData == nullptr) + { return hr; } - g_clrData = (IXCLRDataProcess*)Query.Iface; - g_clrData->Flush(); -#endif } else { @@ -3972,6 +4099,13 @@ HRESULT LoadClrDebugDll(void) g_sos = NULL; return hr; } + + // Always have an instance of the MethodTable enumerator + hr = g_clrData->QueryInterface(__uuidof(ISOSDacInterface15), (void**)&g_sos15); + if (FAILED(hr)) + { + g_sos15 = &SOSDacInterface15Simulator_Instance; + } return S_OK; } @@ -4694,7 +4828,7 @@ CachedString Output::BuildManagedVarValue(__in_z LPCWSTR expansionName, ULONG fr numFrameDigits = 1; } - size_t totalStringLength = strlen(DMLFormats[type]) + _wcslen(expansionName) + numFrameDigits + _wcslen(simpleName) + 1; + size_t totalStringLength = strlen(DMLFormats[type]) + u16_strlen(expansionName) + numFrameDigits + u16_strlen(simpleName) + 1; if (totalStringLength > ret.GetStrLen()) { ret.Allocate(static_cast(totalStringLength)); @@ -5150,7 +5284,7 @@ ULONG __stdcall PEOffsetMemoryReader::Release() // IDiaReadExeAtOffsetCallback implementation HRESULT __stdcall PEOffsetMemoryReader::ReadExecutableAt(DWORDLONG fileOffset, DWORD cbData, DWORD* pcbData, BYTE data[]) { - return SafeReadMemory(m_moduleBaseAddress + fileOffset, data, cbData, pcbData) ? S_OK : E_FAIL; + return SafeReadMemory(m_moduleBaseAddress + TO_TADDR(fileOffset), data, cbData, pcbData) ? S_OK : E_FAIL; } PERvaMemoryReader::PERvaMemoryReader(TADDR moduleBaseAddress) : @@ -5218,7 +5352,7 @@ static void AddAssemblyName(WString& methodOutput, CLRDATA_ADDRESS mdesc) { if (wszFileName[0] != W('\0')) { - WCHAR *pJustName = _wcsrchr(wszFileName, GetTargetDirectorySeparatorW()); + const WCHAR *pJustName = u16_strrchr(wszFileName, GetTargetDirectorySeparatorW()); if (pJustName == NULL) pJustName = wszFileName - 1; methodOutput += (pJustName + 1); @@ -5721,3 +5855,30 @@ HRESULT GetMetadataMemory(CLRDATA_ADDRESS address, ULONG32 bufferSize, BYTE* buf } #endif // FEATURE_PAL + +/**********************************************************************\ +* Routine Description: * +* * +* Since .NET 9+ the runtime does not expose EEClass, but instead * +* returns a pointer to the canonical MethodTable in * +* DacpMethodTableData:Class. * +* Detect that situation by calling GetMethodTableForEEClass and * +* comparing the result to the EEClass itself. * +* * +\**********************************************************************/ + +HRESULT PreferCanonMTOverEEClass(CLRDATA_ADDRESS eeClassPtr, BOOL *preferCanonMT, CLRDATA_ADDRESS *outCanonMT) +{ + HRESULT Status; + CLRDATA_ADDRESS canonMT = 0; + if (!SUCCEEDED(Status = g_sos->GetMethodTableForEEClass(eeClassPtr, &canonMT))) + { + return Status; + } + *preferCanonMT = (eeClassPtr == canonMT); + if (outCanonMT) + { + *outCanonMT = canonMT; + } + return S_OK; +} diff --git a/src/SOS/Strike/util.h b/src/SOS/Strike/util.h index f3f68aa2b7..8648e311eb 100644 --- a/src/SOS/Strike/util.h +++ b/src/SOS/Strike/util.h @@ -4,8 +4,6 @@ #ifndef __util_h__ #define __util_h__ -#define LIMITED_METHOD_CONTRACT ((void)0) - #define CONVERT_FROM_SIGN_EXTENDED(offset) ((ULONG_PTR)(offset)) // So we can use the PAL_TRY_NAKED family of macros without dependencies on utilcode. @@ -30,19 +28,22 @@ inline void RestoreSOToleranceState() {} #include "data.h" #endif //STRIKE -#include "cordebug.h" -#include "static_assert.h" +#include +#include #include -#include "extensions.h" -#include "releaseholder.h" +#include +#include #include "hostimpl.h" #include "targetimpl.h" #include "runtimeimpl.h" #include "symbols.h" +#include "crosscontext.h" typedef LPCSTR LPCUTF8; typedef LPSTR LPUTF8; +#include "contract.h" +#undef NOTHROW #ifdef FEATURE_PAL #define NOTHROW #else @@ -71,19 +72,16 @@ DECLARE_HANDLE(OBJECTHANDLE); #define TARGET_POINTER_SIZE POINTERSIZE_BYTES #endif // TARGET_POINTER_SIZE -#ifndef _ASSERTE +#undef _ASSERTE #ifdef _DEBUG #define _ASSERTE(expr) \ do { if (!(expr) ) { ExtErr("_ASSERTE fired:\n\t%s\n", #expr); if (IsDebuggerPresent()) DebugBreak(); } } while (0) #else -#define _ASSERTE(x) +#define _ASSERTE(expr) ((void)0) #endif -#endif // ASSERTE -#ifdef _DEBUG -#define ASSERT_CHECK(expr, msg, reason) \ - do { if (!(expr) ) { ExtOut(reason); ExtOut(msg); ExtOut(#expr); DebugBreak(); } } while (0) -#endif +#undef _ASSERT +#define _ASSERT _ASSERTE // The native symbol reader dll name #if defined(_AMD64_) @@ -96,10 +94,6 @@ DECLARE_HANDLE(OBJECTHANDLE); #define NATIVE_SYMBOL_READER_DLL "Microsoft.DiaSymReader.Native.arm64.dll" #endif -// PREFIX macros - Begin -#define PREFIX_ASSUME(_condition) -// PREFIX macros - End - class MethodTable; #define MD_NOT_YET_LOADED ((DWORD_PTR)-1) @@ -121,6 +115,8 @@ class MethodTable; #define HNDTYPE_ASYNCPINNED (7) #define HNDTYPE_SIZEDREF (8) #define HNDTYPE_WEAK_WINRT (9) +#define HNDTYPE_WEAK_INTERIOR_POINTER (10) + class BaseObject { @@ -149,6 +145,7 @@ enum EEFLAVOR {UNKNOWNEE, MSCOREE, MSCORWKS, MSCOREND}; #include "sospriv.h" extern IXCLRDataProcess *g_clrData; extern ISOSDacInterface *g_sos; +extern ISOSDacInterface15 *g_sos15; #include "dacprivate.h" @@ -609,7 +606,6 @@ class BaseString typedef BaseString String; typedef BaseString WString; - template void Flatten(__out_ecount(len) T *data, unsigned int len) { @@ -1545,12 +1541,6 @@ BOOL IsMiniDumpFile(); void ReportOOM(); BOOL SafeReadMemory (TADDR offset, PVOID lpBuffer, ULONG cb, PULONG lpcbBytesRead); -#if !defined(_TARGET_WIN64_) && !defined(_ARM64_) && !defined(_MIPS64_) && !defined(_RISCV64_) -// on 64-bit platforms TADDR and CLRDATA_ADDRESS are identical -inline BOOL SafeReadMemory (CLRDATA_ADDRESS offset, PVOID lpBuffer, ULONG cb, PULONG lpcbBytesRead) -{ return SafeReadMemory(TO_TADDR(offset), lpBuffer, cb, lpcbBytesRead); } -#endif - BOOL NameForMD_s (DWORD_PTR pMD, __out_ecount (capacity_mdName) WCHAR *mdName, size_t capacity_mdName); BOOL NameForMT_s (DWORD_PTR MTAddr, __out_ecount (capacity_mdName) WCHAR *mdName, size_t capacity_mdName); @@ -1720,11 +1710,12 @@ struct GCHandleStatistics DWORD sizedRefCount; DWORD dependentCount; DWORD weakWinRTHandleCount; + DWORD weakInteriorPointerHandleCount; DWORD unknownHandleCount; GCHandleStatistics() : strongHandleCount(0), pinnedHandleCount(0), asyncPinnedHandleCount(0), refCntHandleCount(0), weakLongHandleCount(0), weakShortHandleCount(0), variableCount(0), sizedRefCount(0), - dependentCount(0), weakWinRTHandleCount(0), unknownHandleCount(0) + dependentCount(0), weakWinRTHandleCount(0), weakInteriorPointerHandleCount(0), unknownHandleCount(0) {} ~GCHandleStatistics() { @@ -2135,356 +2126,13 @@ class PERvaMemoryReader : IDiaReadExeAtRVACallback #endif // !FEATURE_PAL -/// X86 Context -#define X86_SIZE_OF_80387_REGISTERS 80 -#define X86_MAXIMUM_SUPPORTED_EXTENSION 512 - -typedef struct { - DWORD ControlWord; - DWORD StatusWord; - DWORD TagWord; - DWORD ErrorOffset; - DWORD ErrorSelector; - DWORD DataOffset; - DWORD DataSelector; - BYTE RegisterArea[X86_SIZE_OF_80387_REGISTERS]; - DWORD Cr0NpxState; -} X86_FLOATING_SAVE_AREA; - -typedef struct { - - DWORD ContextFlags; - DWORD Dr0; - DWORD Dr1; - DWORD Dr2; - DWORD Dr3; - DWORD Dr6; - DWORD Dr7; - - X86_FLOATING_SAVE_AREA FloatSave; - - DWORD SegGs; - DWORD SegFs; - DWORD SegEs; - DWORD SegDs; - - DWORD Edi; - DWORD Esi; - DWORD Ebx; - DWORD Edx; - DWORD Ecx; - DWORD Eax; - - DWORD Ebp; - DWORD Eip; - DWORD SegCs; - DWORD EFlags; - DWORD Esp; - DWORD SegSs; - - BYTE ExtendedRegisters[X86_MAXIMUM_SUPPORTED_EXTENSION]; - -} X86_CONTEXT; - -typedef struct { - ULONGLONG Low; - LONGLONG High; -} M128A_XPLAT; - - -/// AMD64 Context -typedef struct { - WORD ControlWord; - WORD StatusWord; - BYTE TagWord; - BYTE Reserved1; - WORD ErrorOpcode; - DWORD ErrorOffset; - WORD ErrorSelector; - WORD Reserved2; - DWORD DataOffset; - WORD DataSelector; - WORD Reserved3; - DWORD MxCsr; - DWORD MxCsr_Mask; - M128A_XPLAT FloatRegisters[8]; - -#if defined(_WIN64) - M128A_XPLAT XmmRegisters[16]; - BYTE Reserved4[96]; -#else - M128A_XPLAT XmmRegisters[8]; - BYTE Reserved4[220]; - - DWORD Cr0NpxState; -#endif - -} AMD64_XMM_SAVE_AREA32; - -typedef struct { - - DWORD64 P1Home; - DWORD64 P2Home; - DWORD64 P3Home; - DWORD64 P4Home; - DWORD64 P5Home; - DWORD64 P6Home; - - DWORD ContextFlags; - DWORD MxCsr; - - WORD SegCs; - WORD SegDs; - WORD SegEs; - WORD SegFs; - WORD SegGs; - WORD SegSs; - DWORD EFlags; - - DWORD64 Dr0; - DWORD64 Dr1; - DWORD64 Dr2; - DWORD64 Dr3; - DWORD64 Dr6; - DWORD64 Dr7; - - DWORD64 Rax; - DWORD64 Rcx; - DWORD64 Rdx; - DWORD64 Rbx; - DWORD64 Rsp; - DWORD64 Rbp; - DWORD64 Rsi; - DWORD64 Rdi; - DWORD64 R8; - DWORD64 R9; - DWORD64 R10; - DWORD64 R11; - DWORD64 R12; - DWORD64 R13; - DWORD64 R14; - DWORD64 R15; - - DWORD64 Rip; - - union { - AMD64_XMM_SAVE_AREA32 FltSave; - struct { - M128A_XPLAT Header[2]; - M128A_XPLAT Legacy[8]; - M128A_XPLAT Xmm0; - M128A_XPLAT Xmm1; - M128A_XPLAT Xmm2; - M128A_XPLAT Xmm3; - M128A_XPLAT Xmm4; - M128A_XPLAT Xmm5; - M128A_XPLAT Xmm6; - M128A_XPLAT Xmm7; - M128A_XPLAT Xmm8; - M128A_XPLAT Xmm9; - M128A_XPLAT Xmm10; - M128A_XPLAT Xmm11; - M128A_XPLAT Xmm12; - M128A_XPLAT Xmm13; - M128A_XPLAT Xmm14; - M128A_XPLAT Xmm15; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - - M128A_XPLAT VectorRegister[26]; - DWORD64 VectorControl; - - DWORD64 DebugControl; - DWORD64 LastBranchToRip; - DWORD64 LastBranchFromRip; - DWORD64 LastExceptionToRip; - DWORD64 LastExceptionFromRip; - -} AMD64_CONTEXT; - -typedef struct{ - __int64 LowPart; - __int64 HighPart; -} FLOAT128_XPLAT; - - -/// ARM Context -#define ARM_MAX_BREAKPOINTS_CONST 8 -#define ARM_MAX_WATCHPOINTS_CONST 1 -typedef DECLSPEC_ALIGN(8) struct { - - DWORD ContextFlags; - - DWORD R0; - DWORD R1; - DWORD R2; - DWORD R3; - DWORD R4; - DWORD R5; - DWORD R6; - DWORD R7; - DWORD R8; - DWORD R9; - DWORD R10; - DWORD R11; - DWORD R12; - - DWORD Sp; - DWORD Lr; - DWORD Pc; - DWORD Cpsr; - - DWORD Fpscr; - DWORD Padding; - union { - M128A_XPLAT Q[16]; - ULONGLONG D[32]; - DWORD S[32]; - } DUMMYUNIONNAME; - - DWORD Bvr[ARM_MAX_BREAKPOINTS_CONST]; - DWORD Bcr[ARM_MAX_BREAKPOINTS_CONST]; - DWORD Wvr[ARM_MAX_WATCHPOINTS_CONST]; - DWORD Wcr[ARM_MAX_WATCHPOINTS_CONST]; - - DWORD Padding2[2]; - -} ARM_CONTEXT; - -// On ARM this mask is or'ed with the address of code to get an instruction pointer -#ifndef THUMB_CODE -#define THUMB_CODE 1 -#endif - -///ARM64 Context -#define ARM64_MAX_BREAKPOINTS 8 -#define ARM64_MAX_WATCHPOINTS 2 -typedef struct { - - DWORD ContextFlags; - DWORD Cpsr; // NZVF + DAIF + CurrentEL + SPSel - union { - struct { - DWORD64 X0; - DWORD64 X1; - DWORD64 X2; - DWORD64 X3; - DWORD64 X4; - DWORD64 X5; - DWORD64 X6; - DWORD64 X7; - DWORD64 X8; - DWORD64 X9; - DWORD64 X10; - DWORD64 X11; - DWORD64 X12; - DWORD64 X13; - DWORD64 X14; - DWORD64 X15; - DWORD64 X16; - DWORD64 X17; - DWORD64 X18; - DWORD64 X19; - DWORD64 X20; - DWORD64 X21; - DWORD64 X22; - DWORD64 X23; - DWORD64 X24; - DWORD64 X25; - DWORD64 X26; - DWORD64 X27; - DWORD64 X28; - }; - - DWORD64 X[29]; - }; - - DWORD64 Fp; - DWORD64 Lr; - DWORD64 Sp; - DWORD64 Pc; - - - M128A_XPLAT V[32]; - DWORD Fpcr; - DWORD Fpsr; - - DWORD Bcr[ARM64_MAX_BREAKPOINTS]; - DWORD64 Bvr[ARM64_MAX_BREAKPOINTS]; - DWORD Wcr[ARM64_MAX_WATCHPOINTS]; - DWORD64 Wvr[ARM64_MAX_WATCHPOINTS]; - -} ARM64_CONTEXT; - -///RISCV64 Context -#define RISCV64_MAX_BREAKPOINTS 8 -#define RISCV64_MAX_WATCHPOINTS 2 -typedef struct { - - DWORD ContextFlags; - - DWORD64 R0; - DWORD64 Ra; - DWORD64 Sp; - DWORD64 Gp; - DWORD64 Tp; - DWORD64 T0; - DWORD64 T1; - DWORD64 T2; - DWORD64 Fp; - DWORD64 S1; - DWORD64 A0; - DWORD64 A1; - DWORD64 A2; - DWORD64 A3; - DWORD64 A4; - DWORD64 A5; - DWORD64 A6; - DWORD64 A7; - DWORD64 S2; - DWORD64 S3; - DWORD64 S4; - DWORD64 S5; - DWORD64 S6; - DWORD64 S7; - DWORD64 S8; - DWORD64 S9; - DWORD64 S10; - DWORD64 S11; - DWORD64 T3; - DWORD64 T4; - DWORD64 T5; - DWORD64 T6; - DWORD64 Pc; - - ULONGLONG F[32]; - DWORD Fcsr; - - DWORD Padding[3]; - -} RISCV64_CONTEXT; - -typedef struct _CROSS_PLATFORM_CONTEXT { - - _CROSS_PLATFORM_CONTEXT() {} - - union { - X86_CONTEXT X86Context; - AMD64_CONTEXT Amd64Context; - ARM_CONTEXT ArmContext; - ARM64_CONTEXT Arm64Context; - RISCV64_CONTEXT RiscV64Context; - }; - -} CROSS_PLATFORM_CONTEXT, *PCROSS_PLATFORM_CONTEXT; - - - WString BuildRegisterOutput(const SOSStackRefData &ref, bool printObj = true); WString MethodNameFromIP(CLRDATA_ADDRESS methodDesc, BOOL bSuppressLines = FALSE, BOOL bAssemblyName = FALSE, BOOL bDisplacement = FALSE, BOOL bAdjustIPForLineNumber = FALSE); HRESULT GetGCRefs(ULONG osID, SOSStackRefData **ppRefs, unsigned int *pRefCnt, SOSStackRefError **ppErrors, unsigned int *pErrCount); WString GetFrameFromAddress(TADDR frameAddr, IXCLRDataStackWalk *pStackwalk = NULL, BOOL bAssemblyName = FALSE); +HRESULT PreferCanonMTOverEEClass(CLRDATA_ADDRESS eeClassPtr, BOOL *preferCanonMT, CLRDATA_ADDRESS *outCanonMT = NULL); + /* This cache is used to read data from the target process if the reads are known * to be sequential. */ @@ -2646,6 +2294,44 @@ class InternalFrameManager private: HRESULT PrintCurrentInternalFrame(); }; + +#undef LIMITED_METHOD_DAC_CONTRACT +#define LIMITED_METHOD_DAC_CONTRACT ((void)0) +#undef LIMITED_METHOD_CONTRACT +#define LIMITED_METHOD_CONTRACT ((void)0) +#undef WRAPPER_NO_CONTRACT +#define WRAPPER_NO_CONTRACT ((void)0) +#undef SUPPORTS_DAC +#define SUPPORTS_DAC ((void)0) + +////////////////////////////////////////////////////////////////////////////// +// enum CorElementTypeZapSig defines some additional internal ELEMENT_TYPE's +// values that are only used by ZapSig signatures. +////////////////////////////////////////////////////////////////////////////// +typedef enum CorElementTypeZapSig +{ + // ZapSig encoding for ELEMENT_TYPE_VAR and ELEMENT_TYPE_MVAR. It is always followed + // by the RID of a GenericParam token, encoded as a compressed integer. + ELEMENT_TYPE_VAR_ZAPSIG = 0x3b, + + // UNUSED = 0x3c, + + // ZapSig encoding for native value types in IL stubs. IL stub signatures may contain + // ELEMENT_TYPE_INTERNAL followed by ParamTypeDesc with ELEMENT_TYPE_VALUETYPE element + // type. It acts like a modifier to the underlying structure making it look like its + // unmanaged view (size determined by unmanaged layout, blittable, no GC pointers). + // + // ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG is used when encoding such types to NGEN images. + // The signature looks like this: ET_NATIVE_VALUETYPE_ZAPSIG ET_VALUETYPE . + // See code:ZapSig.GetSignatureForTypeHandle and code:SigPointer.GetTypeHandleThrowing + // where the encoding/decoding takes place. + ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG = 0x3d, + + ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for System.__Canon + ELEMENT_TYPE_MODULE_ZAPSIG = 0x3f, // zapsig encoding for external module id# + +} CorElementTypeZapSig; + #include "sigparser.h" #endif // __util_h__ diff --git a/src/shared/inc/warningcontrol.h b/src/SOS/Strike/warningcontrol.h similarity index 83% rename from src/shared/inc/warningcontrol.h rename to src/SOS/Strike/warningcontrol.h index a1b68de9d4..abf0b7c94a 100644 --- a/src/shared/inc/warningcontrol.h +++ b/src/SOS/Strike/warningcontrol.h @@ -3,33 +3,36 @@ // // warningcontrol.h // -// Header file to globally control the warning settings for the entire Viper build. -// You do not need to explicitly include this file; rather, it gets included -// on the command line with a /FI (force include) directive. This is controlled -// in sources.vip. -// // KEEP THIS LIST SORTED! // +#pragma once + #if defined(_MSC_VER) + #pragma warning(error :4007) // 'main' : must be __cdecl #pragma warning(error :4013) // 'function' undefined - assuming extern returning int #pragma warning(3 :4092) // sizeof returns 'unsigned long' +#pragma warning(disable: 4100) // unreferenced formal parameter #pragma warning(error :4102) // "'%$S' : unreferenced label" #pragma warning(3 :4121) // structure is sensitive to alignment #pragma warning(3 :4125) // decimal digit in octal sequence +#pragma warning(disable :4127) // conditional expression is constant #pragma warning(3 :4130) // logical operation on address of string constant #pragma warning(3 :4132) // const object should be initialized #pragma warning(4 :4177) // pragma data_seg s/b at global scope +#pragma warning(disable :4201) // nonstandard extension used : nameless struct/union #pragma warning(3 :4212) // function declaration used ellipsis +#pragma warning(disable :4245) // signed/unsigned mismatch #pragma warning(disable :4291) // delete not defined for new, c++ exception may cause leak #pragma warning(disable :4311) // pointer truncation from '%$S' to '%$S' #pragma warning(disable :4312) // '' : conversion from '%$S' to '%$S' of greater size +#pragma warning(disable :4430) // missing type specifier: C++ doesn't support default-int #pragma warning(disable :4477) // format string '%$S' requires an argument of type '%$S', but variadic argument %d has type '%$S' #pragma warning(3 :4530) // C++ exception handler used, but unwind semantics are not enabled. Specify -GX #pragma warning(error :4551) // Function call missing argument list - #pragma warning(error :4806) // unsafe operation involving type 'bool' +#pragma warning(disable :6255) // Prefast: alloca indicates failure by raising a stack overflow exception #if defined(_DEBUG) && (!defined(_MSC_FULL_VER) || (_MSC_FULL_VER <= 181040116)) // The CLR header file check.h, macro CHECK_MSG_EX, can create unreachable code if the LEAVE_DEBUG_ONLY_CODE diff --git a/src/SOS/Strike/xplat/dbgeng.h b/src/SOS/Strike/xplat/dbgeng.h index 64a64fc916..146ecf1bdb 100644 --- a/src/SOS/Strike/xplat/dbgeng.h +++ b/src/SOS/Strike/xplat/dbgeng.h @@ -111,7 +111,14 @@ class DebugClient GetExecutingProcessorType( PULONG type) { - return m_lldbservices->GetExecutingProcessorType(type); + return m_lldbservices->GetProcessorType(type); + } + + HRESULT + GetActualProcessorType( + PULONG type) + { + return m_lldbservices->GetProcessorType(type); } HRESULT diff --git a/src/SOS/extensions/CMakeLists.txt b/src/SOS/extensions/CMakeLists.txt index bb4f7bf47f..5c09dad71a 100644 --- a/src/SOS/extensions/CMakeLists.txt +++ b/src/SOS/extensions/CMakeLists.txt @@ -2,8 +2,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) include(configure.cmake) -add_definitions(-DPAL_STDCPP_COMPAT) - include_directories(${ROOT_DIR}/src/SOS/inc) set(SOURCES diff --git a/src/SOS/extensions/extensions.cpp b/src/SOS/extensions/extensions.cpp index 2015805765..a87aaadcaf 100644 --- a/src/SOS/extensions/extensions.cpp +++ b/src/SOS/extensions/extensions.cpp @@ -124,6 +124,17 @@ IHostServices* Extensions::GetHostServices() return m_pHostServices; } +/// +/// Check if a target flush is needed +/// +void Extensions::FlushCheck() +{ + if (m_pDebuggerServices != nullptr) + { + m_pDebuggerServices->FlushCheck(); + } +} + /// /// Returns the symbol service instance /// @@ -234,6 +245,24 @@ bool GetAbsolutePath(const char* path, std::string& absolutePath) return false; } +/// +// Returns just the file name portion of a file path +/// +/// full path to get file name +/// just the file name +const std::string +GetFileName(const std::string& filePath) +{ + size_t last = filePath.rfind(DIRECTORY_SEPARATOR_STR_A); + if (last != std::string::npos) { + last++; + } + else { + last = 0; + } + return filePath.substr(last); +} + /// /// Internal output helper function /// @@ -250,7 +279,7 @@ void InternalOutputVaList( size_t length = vsnprintf(str, sizeof(str), format, args); if (length < sizeof(str)) { - Extensions::GetInstance()->GetDebuggerServices()->OutputString(mask, str); + GetDebuggerServices()->OutputString(mask, str); } else { @@ -259,7 +288,7 @@ void InternalOutputVaList( if (str_ptr != nullptr) { vsnprintf(str_ptr, length + 1, format, argsCopy); - Extensions::GetInstance()->GetDebuggerServices()->OutputString(mask, str_ptr); + GetDebuggerServices()->OutputString(mask, str_ptr); ::free(str_ptr); } } @@ -268,10 +297,11 @@ void InternalOutputVaList( /// /// Internal trace output for extensions library /// -void TraceError(PCSTR format, ...) +void TraceHostingError(PCSTR format, ...) { va_list args; va_start(args, format); + GetDebuggerServices()->OutputString(DEBUG_OUTPUT_ERROR, "SOS_HOSTING: "); InternalOutputVaList(DEBUG_OUTPUT_ERROR, format, args); va_end(args); } diff --git a/src/SOS/extensions/extensions.h b/src/SOS/extensions/extensions.h index 38eaff9d21..fa040e42bd 100644 --- a/src/SOS/extensions/extensions.h +++ b/src/SOS/extensions/extensions.h @@ -10,6 +10,10 @@ #include "debuggerservices.h" #include "symbolservice.h" +#ifndef HOST_WINDOWS +#define _strdup strdup +#endif + interface IRuntime; enum HostRuntimeFlavor @@ -21,11 +25,10 @@ enum HostRuntimeFlavor extern BOOL IsHostingInitialized(); extern HRESULT InitializeHosting(); -extern LPCSTR GetHostRuntimeDirectory(); -extern bool SetHostRuntimeDirectory(LPCSTR hostRuntimeDirectory); -extern HostRuntimeFlavor GetHostRuntimeFlavor(); -extern bool SetHostRuntimeFlavor(HostRuntimeFlavor flavor); +extern bool SetHostRuntime(HostRuntimeFlavor flavor, int major, int minor, LPCSTR hostRuntimeDirectory); +extern void GetHostRuntime(HostRuntimeFlavor& flavor, int& major, int& minor, LPCSTR& hostRuntimeDirectory); extern bool GetAbsolutePath(const char* path, std::string& absolutePath); +extern const std::string GetFileName(const std::string& filePath); #ifdef __cplusplus extern "C" { @@ -85,6 +88,11 @@ class Extensions /// ISymbolService* GetSymbolService(); + /// + /// Check if a target flush is needed + /// + void FlushCheck(); + /// /// Create a new target with the extension services for /// diff --git a/src/SOS/extensions/hostcoreclr.cpp b/src/SOS/extensions/hostcoreclr.cpp index 002ec7dc83..ddb26a11e2 100644 --- a/src/SOS/extensions/hostcoreclr.cpp +++ b/src/SOS/extensions/hostcoreclr.cpp @@ -24,12 +24,11 @@ #include "coreclrhost.h" #include "extensions.h" -#include #include +#include -#ifndef IfFailRet +#undef IfFailRet #define IfFailRet(EXPR) do { Status = (EXPR); if(FAILED(Status)) { return (Status); } } while (0) -#endif #ifdef FEATURE_PAL #define TPALIST_SEPARATOR_STR_A ":" @@ -44,6 +43,12 @@ #define DT_LNK 10 #endif +struct RuntimeVersion +{ + uint32_t Major; + uint32_t Minor; +}; + #if !defined(FEATURE_PAL) && !defined(HOST_ARM64) && !defined(HOST_ARM) extern HRESULT InitializeDesktopClrHost(); #endif @@ -52,26 +57,21 @@ extern HRESULT InitializeDesktopClrHost(); extern HMODULE g_hInstance; #endif -extern void TraceError(PCSTR format, ...); +extern void TraceHostingError(PCSTR format, ...); -static HostRuntimeFlavor g_hostRuntimeFlavor = HostRuntimeFlavor::NetCore; bool g_hostingInitialized = false; +static HostRuntimeFlavor g_hostRuntimeFlavor = HostRuntimeFlavor::NetCore; +static RuntimeVersion g_hostRuntimeVersion = { }; static LPCSTR g_hostRuntimeDirectory = nullptr; static ExtensionsInitializeDelegate g_extensionsInitializeFunc = nullptr; -struct RuntimeVersion -{ - uint32_t Major; - uint32_t Minor; -}; - namespace RuntimeHostingConstants { // This list is in probing order. constexpr RuntimeVersion SupportedHostRuntimeVersions[] = { + {8, 0}, {7, 0}, {6, 0}, - {8, 0}, {9, 0}, }; @@ -88,6 +88,8 @@ namespace RuntimeHostingConstants "DOTNET_ROOT_ARM64"; #elif defined(HOST_RISCV64) "DOTNET_ROOT_RISCV64"; +#elif defined(HOST_LOONGARCH64) + "DOTNET_ROOT_LOONGARCH64"; #else "Error"; #error Hosting layer doesn't support target arch @@ -110,6 +112,8 @@ namespace RuntimeHostingConstants "/etc/dotnet/install_location_arm64"; #elif defined(HOST_RISCV64) "/etc/dotnet/install_location_riscv64"; +#elif defined(HOST_LOONGARCH64) + "/etc/dotnet/install_location_loongarch64"; #else "ERROR"; #error Hosting layer doesn't support target arch @@ -333,6 +337,12 @@ static std::string GetTpaListForRuntimeVersion( // ... // } + if (hostRuntimeVersion.Major > 0 && hostRuntimeVersion.Major < 8) + { + AddFileToTpaList(directory, "System.Collections.Immutable.dll", tpaList); + AddFileToTpaList(directory, "System.Reflection.Metadata.dll", tpaList); + } + // Trust the runtime assemblies that are newer than the ones needed and provided by SOS's managed // components. AddFilesFromDirectoryToTpaList(hostRuntimeDirectory.c_str(), tpaList); @@ -379,7 +389,6 @@ static bool FindDotNetVersion(const RuntimeVersion& runtimeVersion, std::string& return true; } - return false; } @@ -397,7 +406,7 @@ static HRESULT ProbeInstallationMarkerFile(const char* const markerName, std::st if (getline(&line, &lineLen, locationFile) == -1) { - TraceError("SOS_HOSTING: Unable to read .NET installation marker at %s\n", markerName); + TraceHostingError("Unable to read .NET installation marker at %s\n", markerName); free(line); return E_FAIL; } @@ -467,7 +476,7 @@ static HRESULT GetHostRuntime(std::string& coreClrPath, std::string& hostRuntime if (g_hostRuntimeDirectory == nullptr) { #if defined(HOST_FREEBSD) - TraceError("SOS_HOSTING: FreeBSD not supported\n"); + TraceHostingError("FreeBSD not supported\n"); return E_FAIL; #else @@ -490,7 +499,7 @@ static HRESULT GetHostRuntime(std::string& coreClrPath, std::string& hostRuntime ArrayHolder programFiles = new CHAR[MAX_LONGPATH]; if (GetEnvironmentVariableA("PROGRAMFILES", programFiles, MAX_LONGPATH) == 0) { - TraceError("SOS_HOSTING: PROGRAMFILES environment variable not found\n"); + TraceHostingError("PROGRAMFILES environment variable not found\n"); return E_FAIL; } std::string windowsInstallPath(programFiles); @@ -504,7 +513,7 @@ static HRESULT GetHostRuntime(std::string& coreClrPath, std::string& hostRuntime if (Status != S_OK) { - TraceError("SOS_HOSTING: Failed to find runtime directory\n"); + TraceHostingError("Failed to find runtime directory\n"); return E_FAIL; } @@ -521,14 +530,17 @@ static HRESULT GetHostRuntime(std::string& coreClrPath, std::string& hostRuntime if (hostRuntimeVersion.Major == 0) { - TraceError("SOS_HOSTING: Failed to find a supported runtime within %s\n", hostRuntimeDirectory.c_str()); + TraceHostingError("Failed to find a supported runtime within %s\n", hostRuntimeDirectory.c_str()); return E_FAIL; } // Save away the runtime version we are going to use to host the SOS managed code g_hostRuntimeDirectory = _strdup(hostRuntimeDirectory.c_str()); + g_hostRuntimeVersion = hostRuntimeVersion; } hostRuntimeDirectory.assign(g_hostRuntimeDirectory); + hostRuntimeVersion = g_hostRuntimeVersion; + coreClrPath.assign(g_hostRuntimeDirectory); coreClrPath.append(DIRECTORY_SEPARATOR_STR_A); coreClrPath.append(MAKEDLLNAME_A("coreclr")); @@ -548,7 +560,7 @@ static HRESULT InitializeNetCoreHost() Dl_info info; if (dladdr((PVOID)&InitializeNetCoreHost, &info) == 0) { - TraceError("SOS_HOSTING: Failed to get SOS module directory with dladdr()\n"); + TraceHostingError("Failed to get SOS module directory with dladdr()\n"); return E_FAIL; } sosModulePath = info.dli_fname; @@ -556,7 +568,7 @@ static HRESULT InitializeNetCoreHost() ArrayHolder szSOSModulePath = new char[MAX_LONGPATH + 1]; if (GetModuleFileNameA(g_hInstance, szSOSModulePath, MAX_LONGPATH) == 0) { - TraceError("SOS_HOSTING: Failed to get SOS module directory\n"); + TraceHostingError("Failed to get SOS module directory\n"); return HRESULT_FROM_WIN32(GetLastError()); } sosModulePath = szSOSModulePath; @@ -580,7 +592,7 @@ static HRESULT InitializeNetCoreHost() void* coreclrLib = dlopen(coreClrPath.c_str(), RTLD_NOW | RTLD_LOCAL); if (coreclrLib == nullptr) { - TraceError("SOS_HOSTING: Failed to load runtime module %s\n", coreClrPath.c_str()); + TraceHostingError("Failed to load runtime module %s\n", coreClrPath.c_str()); return E_FAIL; } initializeCoreCLR = (coreclr_initialize_ptr)dlsym(coreclrLib, "coreclr_initialize"); @@ -589,7 +601,7 @@ static HRESULT InitializeNetCoreHost() HMODULE coreclrLib = LoadLibraryA(coreClrPath.c_str()); if (coreclrLib == nullptr) { - TraceError("SOS_HOSTING: Failed to load runtime module %s\n", coreClrPath.c_str()); + TraceHostingError("Failed to load runtime module %s\n", coreClrPath.c_str()); return E_FAIL; } initializeCoreCLR = (coreclr_initialize_ptr)GetProcAddress(coreclrLib, "coreclr_initialize"); @@ -598,7 +610,7 @@ static HRESULT InitializeNetCoreHost() if (initializeCoreCLR == nullptr || createDelegate == nullptr) { - TraceError("SOS_HOSTING: coreclr_initialize or coreclr_create_delegate not found in %s\n", coreClrPath.c_str()); + TraceHostingError("coreclr_initialize or coreclr_create_delegate not found in %s\n", coreClrPath.c_str()); return E_FAIL; } @@ -607,7 +619,7 @@ static HRESULT InitializeNetCoreHost() size_t lastSlash = sosModuleDirectory.rfind(DIRECTORY_SEPARATOR_CHAR_A); if (lastSlash == std::string::npos) { - TraceError("SOS_HOSTING: Failed to parse SOS module name\n"); + TraceHostingError("Failed to parse SOS module name\n"); return E_FAIL; } sosModuleDirectory.erase(lastSlash); @@ -642,7 +654,7 @@ static HRESULT InitializeNetCoreHost() char* exePath = minipal_getexepath(); if (!exePath) { - TraceError("SOS_HOSTING: Could not get full path to current executable\n"); + TraceHostingError("Could not get full path to current executable\n"); return E_FAIL; } @@ -652,14 +664,14 @@ static HRESULT InitializeNetCoreHost() free(exePath); if (FAILED(hr)) { - TraceError("SOS_HOSTING: Fail to initialize hosting runtime '%s' %08x\n", coreClrPath.c_str(), hr); + TraceHostingError("Fail to initialize hosting runtime '%s' %08x\n", coreClrPath.c_str(), hr); return hr; } hr = createDelegate(hostHandle, domainId, ExtensionsDllName, ExtensionsClassName, ExtensionsInitializeFunctionName, (void**)&g_extensionsInitializeFunc); if (FAILED(hr)) { - TraceError("SOS_HOSTING: Fail to create hosting delegate %08x\n", hr); + TraceHostingError("Fail to create hosting delegate %08x\n", hr); return hr; } } @@ -673,33 +685,16 @@ static HRESULT InitializeNetCoreHost() } if (FAILED(hr)) { - TraceError("SOS_HOSTING: Extension host initialization FAILED %08x\n", hr); + TraceHostingError("Extension host initialization FAILED %08x\n", hr); return hr; } return hr; } /**********************************************************************\ - * Gets the host runtime flavor + * Sets the host runtime info \**********************************************************************/ -HostRuntimeFlavor GetHostRuntimeFlavor() -{ - return g_hostRuntimeFlavor; -} - -/**********************************************************************\ - * Sets the host runtime flavor -\**********************************************************************/ -bool SetHostRuntimeFlavor(HostRuntimeFlavor flavor) -{ - g_hostRuntimeFlavor = flavor; - return true; -} - -/**********************************************************************\ - * Sets the host runtime directory path -\**********************************************************************/ -bool SetHostRuntimeDirectory(LPCSTR hostRuntimeDirectory) +bool SetHostRuntime(HostRuntimeFlavor flavor, int major, int minor, LPCSTR hostRuntimeDirectory) { if (hostRuntimeDirectory != nullptr) { @@ -709,22 +704,40 @@ bool SetHostRuntimeDirectory(LPCSTR hostRuntimeDirectory) return false; } hostRuntimeDirectory = _strdup(fullPath.c_str()); + + // Try to get the runtime version from the host runtime directory + if (major == 0) + { + uint32_t majorVersion = 0; + uint32_t minorVersion = 0; + uint32_t revision = 0; + if (sscanf(GetFileName(fullPath).c_str(), "%d.%d.%d", &majorVersion, &minorVersion, &revision) == 3) + { + major = majorVersion; + minor = minorVersion; + } + } } if (g_hostRuntimeDirectory != nullptr) { free((void*)g_hostRuntimeDirectory); } + g_hostRuntimeFlavor = flavor; + g_hostRuntimeVersion.Major = major; + g_hostRuntimeVersion.Minor = minor; g_hostRuntimeDirectory = hostRuntimeDirectory; - g_hostRuntimeFlavor = HostRuntimeFlavor::NetCore; return true; } /**********************************************************************\ - * Gets the current host runtime directory path or null if not set + * Gets the current host runtime information \**********************************************************************/ -LPCSTR GetHostRuntimeDirectory() +void GetHostRuntime(HostRuntimeFlavor& flavor, int& major, int& minor, LPCSTR& hostRuntimeDirectory) { - return g_hostRuntimeDirectory; + flavor = g_hostRuntimeFlavor; + major = g_hostRuntimeVersion.Major; + minor = g_hostRuntimeVersion.Minor; + hostRuntimeDirectory = g_hostRuntimeDirectory; } /**********************************************************************\ diff --git a/src/SOS/extensions/hostdesktop.cpp b/src/SOS/extensions/hostdesktop.cpp index 4028115586..5d17d0e6bd 100644 --- a/src/SOS/extensions/hostdesktop.cpp +++ b/src/SOS/extensions/hostdesktop.cpp @@ -19,7 +19,7 @@ EXTERN_GUID(CLSID_CLRRuntimeHost, 0x90F1A06E, 0x7712, 0x4762, 0x86, 0xB5, 0x7A, 0x5E, 0xBA, 0x6B, 0xDB, 0x02); extern HMODULE g_hInstance; -extern void TraceError(PCSTR format, ...); +extern void TraceHostingError(PCSTR format, ...); ICLRRuntimeHost* g_clrHost = nullptr; @@ -35,13 +35,13 @@ HRESULT InitializeDesktopClrHost() ArrayHolder wszSOSModulePath = new WCHAR[MAX_LONGPATH + 1]; if (GetModuleFileNameW(g_hInstance, wszSOSModulePath, MAX_LONGPATH) == 0) { - TraceError("SOS_HOSTING: Failed to get SOS module directory\n"); + TraceHostingError("Failed to get SOS module directory\n"); return HRESULT_FROM_WIN32(GetLastError()); } ArrayHolder wszManagedModulePath = new WCHAR[MAX_LONGPATH + 1]; if (wcscpy_s(wszManagedModulePath.GetPtr(), MAX_LONGPATH, wszSOSModulePath.GetPtr()) != 0) { - TraceError("SOS_HOSTING: Failed to copy module name\n"); + TraceHostingError("Failed to copy module name\n"); return E_FAIL; } WCHAR* lastSlash = wcsrchr(wszManagedModulePath.GetPtr(), DIRECTORY_SEPARATOR_CHAR_W); @@ -51,7 +51,7 @@ HRESULT InitializeDesktopClrHost() } if (wcscat_s(wszManagedModulePath.GetPtr(), MAX_LONGPATH, ExtensionsDllNameW) != 0) { - TraceError("SOS_HOSTING: Failed to append SOS module name\n"); + TraceHostingError("Failed to append SOS module name\n"); return E_FAIL; } if (g_clrHost == nullptr) @@ -59,7 +59,7 @@ HRESULT InitializeDesktopClrHost() hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); if (FAILED(hr) && hr != RPC_E_CHANGED_MODE) { - TraceError("SOS_HOSTING: CoInitializeEx failed. %08x\n", hr); + TraceHostingError("CoInitializeEx failed. %08x\n", hr); return hr; } // Loads the CLR and then initializes the managed debugger extensions. @@ -67,26 +67,26 @@ HRESULT InitializeDesktopClrHost() hr = CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, (PVOID*)&metaHost); if (FAILED(hr) || metaHost == nullptr) { - TraceError("SOS_HOSTING: CLRCreateInstance failed %08x\n", hr); + TraceHostingError("CLRCreateInstance failed %08x\n", hr); return hr; } ReleaseHolder runtimeInfo; hr = metaHost->GetRuntime(CLR_VERSION, IID_ICLRRuntimeInfo, (PVOID*)&runtimeInfo); if (FAILED(hr) || runtimeInfo == nullptr) { - TraceError("SOS_HOSTING: ICLRMetaHost::GetRuntime failed %08x\n", hr); + TraceHostingError("ICLRMetaHost::GetRuntime failed %08x\n", hr); return hr; } hr = runtimeInfo->GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (PVOID*)&g_clrHost); if (FAILED(hr) || g_clrHost == nullptr) { - TraceError("SOS_HOSTING: ICLRRuntimeInfo::GetInterface failed %08x\n", hr); + TraceHostingError("ICLRRuntimeInfo::GetInterface failed %08x\n", hr); return hr; } hr = g_clrHost->Start(); if (FAILED(hr)) { - TraceError("SOS_HOSTING: ICLRRuntimeHost::Start failed %08x\n", hr); + TraceHostingError("ICLRRuntimeHost::Start failed %08x\n", hr); g_clrHost->Release(); g_clrHost = nullptr; return hr; @@ -96,14 +96,14 @@ HRESULT InitializeDesktopClrHost() hr = g_clrHost->ExecuteInDefaultAppDomain(wszManagedModulePath.GetPtr(), ExtensionsClassNameW, ExtensionsInitializeFunctionNameW, wszSOSModulePath.GetPtr(), (DWORD *)&ret); if (FAILED(hr)) { - TraceError("SOS_HOSTING: ICLRRuntimeHost::ExecuteInDefaultAppDomain failed %08x\n", hr); + TraceHostingError("ICLRRuntimeHost::ExecuteInDefaultAppDomain failed %08x\n", hr); g_clrHost->Release(); g_clrHost = nullptr; return hr; } if (ret != 0) { - TraceError("SOS_HOSTING: Extension initialization failed %08x\n", ret); + TraceHostingError("Extension initialization failed %08x\n", ret); g_clrHost->Release(); g_clrHost = nullptr; return ret; diff --git a/src/SOS/inc/clrmaservice.h b/src/SOS/inc/clrmaservice.h new file mode 100644 index 0000000000..4887d035f0 --- /dev/null +++ b/src/SOS/inc/clrmaservice.h @@ -0,0 +1,38 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#pragma once + +#include +#include +#include // IDL + +#ifdef __cplusplus +extern "C" { +#endif + +/// +/// ICLRMAService +/// +MIDL_INTERFACE("1FCF4C14-60C1-44E6-84ED-20506EF3DC60") +ICLRMAService : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE AssociateClient( + IUnknown *pUnknown) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetThread( + ULONG osThreadId, + ICLRMAClrThread **ppClrThread) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetException( + ULONG64 address, + ICLRMAClrException **ppClrException) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetObjectInspection( + ICLRMAObjectInspection **ppObjectInspection) = 0; +}; + +#ifdef __cplusplus +}; +#endif diff --git a/src/SOS/inc/debuggerservices.h b/src/SOS/inc/debuggerservices.h index 1ec815f4a0..204a164525 100644 --- a/src/SOS/inc/debuggerservices.h +++ b/src/SOS/inc/debuggerservices.h @@ -10,6 +10,8 @@ extern "C" { #endif +typedef bool (*PEXECUTE_COMMAND_OUTPUT_CALLBACK)(ULONG mask, const char *text); + /// /// IDebuggerServices /// @@ -35,7 +37,7 @@ IDebuggerServices : public IUnknown PULONG debugClass, PULONG qualifier) = 0; - virtual HRESULT STDMETHODCALLTYPE GetExecutingProcessorType( + virtual HRESULT STDMETHODCALLTYPE GetProcessorType( PULONG type) = 0; virtual HRESULT STDMETHODCALLTYPE AddCommand( @@ -64,6 +66,10 @@ IDebuggerServices : public IUnknown PULONG loaded, PULONG unloaded) = 0; + virtual HRESULT STDMETHODCALLTYPE GetModuleByIndex( + ULONG index, + PULONG64 base) = 0; + virtual HRESULT STDMETHODCALLTYPE GetModuleNames( ULONG index, ULONG64 base, @@ -92,6 +98,12 @@ IDebuggerServices : public IUnknown ULONG bufferSize, PULONG versionInfoSize) = 0; + virtual HRESULT STDMETHODCALLTYPE GetModuleByModuleName( + PCSTR name, + ULONG startIndex, + PULONG index, + PULONG64 base) = 0; + virtual HRESULT STDMETHODCALLTYPE GetNumberThreads( PULONG number) = 0; @@ -177,6 +189,12 @@ IDebuggerServices : public IUnknown PSTR description, ULONG descriptionSize, PULONG descriptionUsed) = 0; + + virtual void STDMETHODCALLTYPE FlushCheck() = 0; + + virtual HRESULT STDMETHODCALLTYPE ExecuteHostCommand( + PCSTR commandLine, + PEXECUTE_COMMAND_OUTPUT_CALLBACK callback) = 0; }; #ifdef __cplusplus diff --git a/src/SOS/inc/lldbservices.h b/src/SOS/inc/lldbservices.h index fb07983b6a..bef3f2ace6 100644 --- a/src/SOS/inc/lldbservices.h +++ b/src/SOS/inc/lldbservices.h @@ -38,8 +38,36 @@ extern "C" { // Symbol messages, such as for !sym noisy. #define DEBUG_OUTPUT_SYMBOLS 0x00000200 +// Output control flags. +// Output generated by methods called by this +// client will be sent only to this clients +// output callbacks. +#define DEBUG_OUTCTL_THIS_CLIENT 0x00000000 +// Output will be sent to all clients. +#define DEBUG_OUTCTL_ALL_CLIENTS 0x00000001 +// Output will be sent to all clients except +// the client generating the output. +#define DEBUG_OUTCTL_ALL_OTHER_CLIENTS 0x00000002 +// Output will be discarded immediately and will not +// be logged or sent to callbacks. +#define DEBUG_OUTCTL_IGNORE 0x00000003 +// Output will be logged but not sent to callbacks. +#define DEBUG_OUTCTL_LOG_ONLY 0x00000004 +// All send control bits. +#define DEBUG_OUTCTL_SEND_MASK 0x00000007 +// Do not place output from this client in +// the global log file. +#define DEBUG_OUTCTL_NOT_LOGGED 0x00000008 +// Send output to clients regardless of whether the +// mask allows it or not. +#define DEBUG_OUTCTL_OVERRIDE_MASK 0x00000010 +// Text is markup instead of plain text. #define DEBUG_OUTCTL_DML 0x00000020 + +// Special values which mean leave the output settings +// unchanged. #define DEBUG_OUTCTL_AMBIENT_DML 0xfffffffe +#define DEBUG_OUTCTL_AMBIENT_TEXT 0xffffffff // Execute and ExecuteCommandFile flags. // These flags only apply to the command @@ -229,6 +257,7 @@ typedef struct _DEBUG_STACK_FRAME_EX interface ILLDBServices; typedef HRESULT (*PFN_EXCEPTION_CALLBACK)(ILLDBServices *services); typedef HRESULT (*PFN_RUNTIME_LOADED_CALLBACK)(ILLDBServices *services); +typedef void (*PFN_MODULE_LOAD_CALLBACK)(void* param, const char* moduleFilePath, ULONG64 moduleAddress, int moduleSize); //---------------------------------------------------------------------------- // ILLDBServices @@ -292,7 +321,7 @@ ILLDBServices : public IUnknown // Returns the type of processor used in the // current processor context. - virtual HRESULT STDMETHODCALLTYPE GetExecutingProcessorType( + virtual HRESULT STDMETHODCALLTYPE GetProcessorType( PULONG type) = 0; // Executes the given command string. diff --git a/src/SOS/lldbplugin/CMakeLists.txt b/src/SOS/lldbplugin/CMakeLists.txt index 49936d30b4..76dc0ecc7b 100644 --- a/src/SOS/lldbplugin/CMakeLists.txt +++ b/src/SOS/lldbplugin/CMakeLists.txt @@ -13,8 +13,6 @@ if (CORECLR_SET_RPATH) endif(CLR_CMAKE_HOST_OSX) endif (CORECLR_SET_RPATH) -add_definitions(-DPAL_STDCPP_COMPAT) - set(ENABLE_LLDBPLUGIN ${CLR_CMAKE_HOST_UNIX} CACHE BOOL "Enable building the SOS plugin for LLDB.") set(REQUIRE_LLDBPLUGIN ${CLR_CMAKE_HOST_LINUX} CACHE BOOL "Require building the SOS plugin for LLDB.") @@ -22,43 +20,6 @@ if(SKIP_LLDBPLUGIN) set(REQUIRE_LLDBPLUGIN false) endif() -if(CLR_CMAKE_HOST_ARCH_AMD64) - add_definitions(-D_TARGET_AMD64_=1) - add_definitions(-DDBG_TARGET_64BIT=1) - add_definitions(-DDBG_TARGET_AMD64=1) - add_definitions(-DDBG_TARGET_WIN64=1) - add_definitions(-DBIT64) -elseif(CLR_CMAKE_HOST_ARCH_I386) - add_definitions(-D_TARGET_X86_=1) - add_definitions(-DDBG_TARGET_32BIT=1) - add_definitions(-DDBG_TARGET_X86=1) -elseif(CLR_CMAKE_HOST_ARCH_ARM) - add_definitions(-D_TARGET_ARM_=1) - add_definitions(-DDBG_TARGET_32BIT=1) - add_definitions(-DDBG_TARGET_ARM=1) -elseif(CLR_CMAKE_HOST_ARCH_ARM64) - add_definitions(-D_TARGET_ARM64_=1) - add_definitions(-DDBG_TARGET_64BIT=1) - add_definitions(-DDBG_TARGET_ARM64=1) - add_definitions(-DDBG_TARGET_WIN64=1) - add_definitions(-DBIT64) - SET(REQUIRE_LLDBPLUGIN false) -elseif(CLR_CMAKE_HOST_ARCH_MIPS64) - add_definitions(-D_TARGET_MIPS64_=1) - add_definitions(-DDBG_TARGET_64BIT=1) - add_definitions(-DDBG_TARGET_MIPS64=1) - add_definitions(-DDBG_TARGET_WIN64=1) - add_definitions(-DBIT64) - SET(REQUIRE_LLDBPLUGIN false) -elseif(CLR_CMAKE_HOST_ARCH_RISCV64) - add_definitions(-D_TARGET_RISCV64_=1) - add_definitions(-DDBG_TARGET_64BIT=1) - add_definitions(-DDBG_TARGET_RISCV64=1) - add_definitions(-DDBG_TARGET_WIN64=1) - add_definitions(-DBIT64) - SET(REQUIRE_LLDBPLUGIN false) -endif() - if(NOT $ENV{LLVM_HOME} STREQUAL "") set(LLDB_INCLUDE_DIR "$ENV{LLVM_HOME}/include") set(LLDB_LIB_DIR "$ENV{LLVM_HOME}/lib") diff --git a/src/SOS/lldbplugin/lldbplugin.vcxproj b/src/SOS/lldbplugin/lldbplugin.vcxproj index 40c35b58fa..255d144c85 100644 --- a/src/SOS/lldbplugin/lldbplugin.vcxproj +++ b/src/SOS/lldbplugin/lldbplugin.vcxproj @@ -172,7 +172,7 @@ $(SolutionDir)src\SOS\inc;$(SolutionDir)src\SOS\extensions;$(SolutionDir)src\shared\inc;$(SolutionDir)src\shared\pal\inc;$(SolutionDir)src\shared\pal\inc\rt;$(SolutionDir)src\shared\pal\inc\rt\cpp;%(AdditionalIncludeDirectories) - _AMD64_;_WIN64;AMD64;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;DBG_TARGET_AMD64_UNIX;BIT64=1;PAL_STDCPP_COMPAT;_SECURE_SCL=0;LINUX64;PLATFORM_UNIX=1;FEATURE_PAL;FEATURE_PAL_ANSI;UNIX_AMD64_ABI;%(PreprocessorDefinitions) + _AMD64_;_WIN64;AMD64;_TARGET_64BIT_=1;_TARGET_AMD64_=1;DBG_TARGET_64BIT=1;DBG_TARGET_AMD64=1;DBG_TARGET_WIN64=1;DBG_TARGET_AMD64_UNIX;BIT64=1;_SECURE_SCL=0;LINUX64;PLATFORM_UNIX=1;FEATURE_PAL;FEATURE_PAL_ANSI;UNIX_AMD64_ABI;%(PreprocessorDefinitions) true @@ -181,4 +181,4 @@ - \ No newline at end of file + diff --git a/src/SOS/lldbplugin/services.cpp b/src/SOS/lldbplugin/services.cpp index 54c430d20d..9f8285b40e 100644 --- a/src/SOS/lldbplugin/services.cpp +++ b/src/SOS/lldbplugin/services.cpp @@ -223,13 +223,17 @@ LLDBServices::VirtualUnwind( DT_CONTEXT *dtcontext = (DT_CONTEXT*)context; lldb::SBFrame frameFound; -#ifdef DBG_TARGET_AMD64 +#ifdef TARGET_AMD64 DWORD64 spToFind = dtcontext->Rsp; -#elif DBG_TARGET_X86 +#elif TARGET_X86 DWORD spToFind = dtcontext->Esp; -#elif DBG_TARGET_ARM +#elif TARGET_ARM DWORD spToFind = dtcontext->Sp; -#elif DBG_TARGET_ARM64 +#elif TARGET_ARM64 + DWORD64 spToFind = dtcontext->Sp; +#elif TARGET_RISCV64 + DWORD64 spToFind = dtcontext->Sp; +#elif TARGET_LOONGARCH64 DWORD64 spToFind = dtcontext->Sp; #else #error "spToFind undefined for this platform" @@ -443,17 +447,21 @@ LLDBServices::GetPageSize( } HRESULT -LLDBServices::GetExecutingProcessorType( +LLDBServices::GetProcessorType( PULONG type) { -#ifdef DBG_TARGET_AMD64 +#ifdef TARGET_AMD64 *type = IMAGE_FILE_MACHINE_AMD64; -#elif DBG_TARGET_ARM +#elif TARGET_ARM *type = IMAGE_FILE_MACHINE_ARMNT; -#elif DBG_TARGET_ARM64 +#elif TARGET_ARM64 *type = IMAGE_FILE_MACHINE_ARM64; -#elif DBG_TARGET_X86 +#elif TARGET_X86 *type = IMAGE_FILE_MACHINE_I386; +#elif TARGET_RISCV64 + *type = IMAGE_FILE_MACHINE_RISCV64; +#elif TARGET_LOONGARCH64 + *type = IMAGE_FILE_MACHINE_LOONGARCH64; #else #error "Unsupported target" #endif @@ -1621,7 +1629,7 @@ LLDBServices::GetContextFromFrame( /* const */ lldb::SBFrame& frame, DT_CONTEXT *dtcontext) { -#ifdef DBG_TARGET_AMD64 +#ifdef TARGET_AMD64 dtcontext->Rip = frame.GetPC(); dtcontext->Rsp = frame.GetSP(); dtcontext->Rbp = frame.GetFP(); @@ -1648,7 +1656,7 @@ LLDBServices::GetContextFromFrame( dtcontext->SegEs = GetRegister(frame, "es"); dtcontext->SegFs = GetRegister(frame, "fs"); dtcontext->SegGs = GetRegister(frame, "gs"); -#elif DBG_TARGET_ARM +#elif TARGET_ARM dtcontext->Pc = frame.GetPC(); dtcontext->Sp = frame.GetSP(); dtcontext->Lr = GetRegister(frame, "lr"); @@ -1667,7 +1675,7 @@ LLDBServices::GetContextFromFrame( dtcontext->R10 = GetRegister(frame, "r10"); dtcontext->R11 = GetRegister(frame, "r11"); dtcontext->R12 = GetRegister(frame, "r12"); -#elif DBG_TARGET_ARM64 +#elif TARGET_ARM64 dtcontext->Pc = frame.GetPC(); dtcontext->Sp = frame.GetSP(); dtcontext->Lr = GetRegister(frame, "x30"); @@ -1703,7 +1711,7 @@ LLDBServices::GetContextFromFrame( dtcontext->X26 = GetRegister(frame, "x26"); dtcontext->X27 = GetRegister(frame, "x27"); dtcontext->X28 = GetRegister(frame, "x28"); -#elif DBG_TARGET_X86 +#elif TARGET_X86 dtcontext->Eip = frame.GetPC(); dtcontext->Esp = frame.GetSP(); dtcontext->Ebp = frame.GetFP(); @@ -1722,6 +1730,41 @@ LLDBServices::GetContextFromFrame( dtcontext->SegEs = GetRegister(frame, "es"); dtcontext->SegFs = GetRegister(frame, "fs"); dtcontext->SegGs = GetRegister(frame, "gs"); +#elif TARGET_LOONGARCH64 + dtcontext->Pc = frame.GetPC(); + dtcontext->Sp = frame.GetSP(); + dtcontext->Ra = GetRegister(frame, "ra"); + dtcontext->Fp = GetRegister(frame, "fp"); + + dtcontext->R0 = GetRegister(frame, "r0"); + dtcontext->Tp = GetRegister(frame, "tp"); + dtcontext->A0 = GetRegister(frame, "a0"); + dtcontext->A1 = GetRegister(frame, "a1"); + dtcontext->A2 = GetRegister(frame, "a2"); + dtcontext->A3 = GetRegister(frame, "a3"); + dtcontext->A4 = GetRegister(frame, "a4"); + dtcontext->A5 = GetRegister(frame, "a5"); + dtcontext->A6 = GetRegister(frame, "a6"); + dtcontext->A7 = GetRegister(frame, "a7"); + dtcontext->T0 = GetRegister(frame, "t0"); + dtcontext->T1 = GetRegister(frame, "t1"); + dtcontext->T2 = GetRegister(frame, "t2"); + dtcontext->T3 = GetRegister(frame, "t3"); + dtcontext->T4 = GetRegister(frame, "t4"); + dtcontext->T5 = GetRegister(frame, "t5"); + dtcontext->T6 = GetRegister(frame, "t6"); + dtcontext->T7 = GetRegister(frame, "t7"); + dtcontext->T8 = GetRegister(frame, "t8"); + dtcontext->X0 = GetRegister(frame, "x0"); + dtcontext->S0 = GetRegister(frame, "s0"); + dtcontext->S1 = GetRegister(frame, "s1"); + dtcontext->S2 = GetRegister(frame, "s2"); + dtcontext->S3 = GetRegister(frame, "s3"); + dtcontext->S4 = GetRegister(frame, "s4"); + dtcontext->S5 = GetRegister(frame, "s5"); + dtcontext->S6 = GetRegister(frame, "s6"); + dtcontext->S7 = GetRegister(frame, "s7"); + dtcontext->S8 = GetRegister(frame, "s8"); #endif } @@ -2532,6 +2575,42 @@ LLDBServices::OutputDmlString( OutputString(mask, str); } +void +LLDBServices::FlushCheck() +{ + // The infrastructure expects a target to only be created if there is a valid process. + lldb::SBProcess process = GetCurrentProcess(); + if (process.IsValid()) + { + InitializeThreadInfo(process); + + // Has the process changed since the last commmand? + Extensions::GetInstance()->UpdateTarget(GetProcessId(process)); + + // Has the target "moved" (been continued) since the last command? Flush the target. + uint32_t stopId = process.GetStopID(); + if (stopId != m_currentStopId) + { + m_currentStopId = stopId; + Extensions::GetInstance()->FlushTarget(); + } + } + else + { + Extensions::GetInstance()->DestroyTarget(); + m_threadInfoInitialized = false; + m_processId = 0; + } +} + +HRESULT +LLDBServices::ExecuteHostCommand( + PCSTR commandLine, + PEXECUTE_COMMAND_OUTPUT_CALLBACK callback) +{ + return Execute(DEBUG_OUTCTL_THIS_CLIENT, commandLine, DEBUG_EXECUTE_NO_REPEAT); +} + //---------------------------------------------------------------------------- // Helper functions //---------------------------------------------------------------------------- @@ -2910,34 +2989,6 @@ LLDBServices::ReadVirtualCache(ULONG64 address, PVOID buffer, ULONG bufferSize, return true; } -void -LLDBServices::FlushCheck() -{ - // The infrastructure expects a target to only be created if there is a valid process. - lldb::SBProcess process = GetCurrentProcess(); - if (process.IsValid()) - { - InitializeThreadInfo(process); - - // Has the process changed since the last commmand? - Extensions::GetInstance()->UpdateTarget(GetProcessId(process)); - - // Has the target "moved" (been continued) since the last command? Flush the target. - uint32_t stopId = process.GetStopID(); - if (stopId != m_currentStopId) - { - m_currentStopId = stopId; - Extensions::GetInstance()->FlushTarget(); - } - } - else - { - Extensions::GetInstance()->DestroyTarget(); - m_threadInfoInitialized = false; - m_processId = 0; - } -} - lldb::SBCommand LLDBServices::AddCommand( const char* name, diff --git a/src/SOS/lldbplugin/services.h b/src/SOS/lldbplugin/services.h index 085a74b1ad..734f56bf2f 100644 --- a/src/SOS/lldbplugin/services.h +++ b/src/SOS/lldbplugin/services.h @@ -136,7 +136,7 @@ class LLDBServices : public ILLDBServices, public ILLDBServices2, public IDebugg HRESULT STDMETHODCALLTYPE GetPageSize( PULONG size); - HRESULT STDMETHODCALLTYPE GetExecutingProcessorType( + HRESULT STDMETHODCALLTYPE GetProcessorType( PULONG type); HRESULT STDMETHODCALLTYPE Execute( @@ -415,14 +415,18 @@ class LLDBServices : public ILLDBServices, public ILLDBServices2, public IDebugg ULONG mask, PCSTR str); + void STDMETHODCALLTYPE FlushCheck(); + + HRESULT STDMETHODCALLTYPE ExecuteHostCommand( + PCSTR commandLine, + PEXECUTE_COMMAND_OUTPUT_CALLBACK callback); + //---------------------------------------------------------------------------- // LLDBServices (internal) //---------------------------------------------------------------------------- PCSTR GetPluginModuleDirectory(); - void FlushCheck(); - lldb::SBCommand AddCommand(const char *name, lldb::SBCommandPluginInterface *impl, const char *help); void AddManagedCommand(const char* name, const char* help); diff --git a/src/SOS/lldbplugin/sethostruntimecommand.cpp b/src/SOS/lldbplugin/sethostruntimecommand.cpp index 309c462050..a6e3166d95 100644 --- a/src/SOS/lldbplugin/sethostruntimecommand.cpp +++ b/src/SOS/lldbplugin/sethostruntimecommand.cpp @@ -20,6 +20,10 @@ class sethostruntimeCommand : public lldb::SBCommandPluginInterface char** arguments, lldb::SBCommandReturnObject &result) { + HostRuntimeFlavor flavor = HostRuntimeFlavor::NetCore; + LPCSTR hostRuntimeDirectory = nullptr; + int major = 0, minor = 0; + result.SetStatus(lldb::eReturnStatusSuccessFinishResult); if (arguments != nullptr && arguments[0] != nullptr) @@ -32,39 +36,58 @@ class sethostruntimeCommand : public lldb::SBCommandPluginInterface } else { - if (strcmp(arguments[0], "-none") == 0) + if (*arguments != nullptr && strcmp(*arguments, "-clear") == 0) + { + SetHostRuntime(HostRuntimeFlavor::NetCore, 0, 0, nullptr); + arguments++; + } + if (*arguments != nullptr && strcmp(*arguments, "-none") == 0) + { + flavor = HostRuntimeFlavor::None; + arguments++; + } + else if (*arguments != nullptr && strcmp(*arguments, "-netcore") == 0) + { + flavor = HostRuntimeFlavor::NetCore; + arguments++; + } + if (*arguments != nullptr && strcmp(*arguments, "-major") == 0) { - SetHostRuntimeFlavor(HostRuntimeFlavor::None); + arguments++; + if (*arguments != nullptr) + { + major = atoi(*arguments); + arguments++; + } } - else if (strcmp(arguments[0], "-netcore") == 0) + if (*arguments != nullptr) { - SetHostRuntimeFlavor(HostRuntimeFlavor::NetCore); + hostRuntimeDirectory = *arguments; + arguments++; } - else if (!SetHostRuntimeDirectory(arguments[0])) + if (!SetHostRuntime(flavor, major, minor, hostRuntimeDirectory)) { - result.Printf("Invalid host runtime path: %s\n", arguments[0]); + result.Printf("Invalid host runtime path: %s\n", hostRuntimeDirectory); result.SetStatus(lldb::eReturnStatusFailed); return result.Succeeded(); } } } - const char* flavor = ""; - switch (GetHostRuntimeFlavor()) + GetHostRuntime(flavor, major, minor, hostRuntimeDirectory); + switch (flavor) { case HostRuntimeFlavor::None: - flavor = "no"; + result.Printf("Using no runtime to host the managed SOS code\n"); break; case HostRuntimeFlavor::NetCore: - flavor = ".NET Core"; + result.Printf("Using .NET Core runtime (version %d.%d) to host the managed SOS code\n", major, minor); break; default: break; } - result.Printf("Using %s runtime to host the managed SOS code\n", flavor); - const char* directory = GetHostRuntimeDirectory(); - if (directory != nullptr) + if (hostRuntimeDirectory != nullptr) { - result.Printf("Host runtime path: %s\n", directory); + result.Printf("Host runtime path: %s\n", hostRuntimeDirectory); } return result.Succeeded(); } diff --git a/src/Tools/dotnet-counters/CounterMonitor.cs b/src/Tools/dotnet-counters/CounterMonitor.cs index 5f1ff39d68..b57bfec95d 100644 --- a/src/Tools/dotnet-counters/CounterMonitor.cs +++ b/src/Tools/dotnet-counters/CounterMonitor.cs @@ -23,8 +23,9 @@ namespace Microsoft.Diagnostics.Tools.Counters internal class CounterMonitor : ICountersLogger { private const int BufferDelaySecs = 1; + private const string EventCountersProviderPrefix = "EventCounters\\"; private int _processId; - private CounterSet _counterList; + private List _counterList; private IConsole _console; private ICounterRenderer _renderer; private string _output; @@ -66,6 +67,13 @@ private void MeterInstrumentEventObserved(string meterName, DateTime timestamp) private void HandleDiagnosticCounter(ICounterPayload payload) { + // if EventCounters were explicitly requested on the command-line then show them always + if (_counterList.Where(group => group.ProviderName == payload.CounterMetadata.ProviderName && group.Type == CounterGroupType.EventCounter).Any()) + { + CounterPayloadReceived((CounterPayload)payload); + return; + } + // init providerEventState if this is the first time we've seen an event from this provider if (!_providerEventStates.TryGetValue(payload.CounterMetadata.ProviderName, out ProviderEventState providerState)) { @@ -206,7 +214,7 @@ public async Task Monitor( _settings.MaxTimeSeries = maxTimeSeries; _settings.CounterIntervalSeconds = refreshInterval; _settings.ResumeRuntime = resumeRuntime; - _settings.CounterGroups = GetEventPipeProviders(); + _settings.CounterGroups = _counterList.ToArray(); _settings.UseCounterRateAndValuePayloads = true; bool useSharedSession = false; @@ -290,7 +298,7 @@ public async Task Collect( _settings.MaxTimeSeries = maxTimeSeries; _settings.CounterIntervalSeconds = refreshInterval; _settings.ResumeRuntime = resumeRuntime; - _settings.CounterGroups = GetEventPipeProviders(); + _settings.CounterGroups = _counterList.ToArray(); _output = output; _diagnosticsClient = holder.Client; if (_output.Length == 0) @@ -354,9 +362,9 @@ private static void ValidateNonNegative(int value, string argName) } } - internal CounterSet ConfigureCounters(string commaSeparatedProviderListText, List providerList) + internal List ConfigureCounters(string commaSeparatedProviderListText, List providerList) { - CounterSet counters = new(); + List counters = new(); try { if (commaSeparatedProviderListText != null) @@ -388,24 +396,24 @@ internal CounterSet ConfigureCounters(string commaSeparatedProviderListText, Lis } } - if (counters.IsEmpty) + if (counters.Count == 0) { _console.Out.WriteLine($"--counters is unspecified. Monitoring System.Runtime counters by default."); - counters.AddAllProviderCounters("System.Runtime"); + ParseCounterProvider("System.Runtime", counters); } return counters; } // parses a comma separated list of providers - internal static CounterSet ParseProviderList(string providerListText) + internal static List ParseProviderList(string providerListText) { - CounterSet set = new(); + List set = new(); ParseProviderList(providerListText, set); return set; } // parses a comma separated list of providers - internal static void ParseProviderList(string providerListText, CounterSet counters) + internal static void ParseProviderList(string providerListText, List counters) { bool inParen = false; int startIdx = -1; @@ -457,7 +465,7 @@ internal static void ParseProviderList(string providerListText, CounterSet count // System.Runtime // System.Runtime[exception-count] // System.Runtime[exception-count,cpu-usage] - private static void ParseCounterProvider(string providerText, CounterSet counters) + private static void ParseCounterProvider(string providerText, List counters) { string[] tokens = providerText.Split('['); if (tokens.Length == 0) @@ -468,12 +476,24 @@ private static void ParseCounterProvider(string providerText, CounterSet counter { throw new FormatException("Expected at most one '[' in counter_provider"); } + string providerName = tokens[0]; - if (tokens.Length == 1) + CounterGroupType groupType = CounterGroupType.All; + // EventCounters\ is a special prefix for a provider that marks it as an EventCounter provider. + if (providerName.StartsWith(EventCountersProviderPrefix)) { - counters.AddAllProviderCounters(providerName); // Only a provider name was specified + providerName = providerName.Substring(EventCountersProviderPrefix.Length); + groupType = CounterGroupType.EventCounter; } - else + + // An empty set of counters means all counters are enabled. + string[] enabledCounters = Array.Empty(); + EventPipeCounterGroup preExistingGroup = counters.FirstOrDefault(group => group.ProviderName == providerName); + if (preExistingGroup != null && preExistingGroup.Type != groupType) + { + throw new FormatException("Using the same provider name with and without the EventCounters\\ prefix in the counter list is not supported."); + } + if (tokens.Length == 2) { string counterNames = tokens[1]; if (!counterNames.EndsWith(']')) @@ -487,17 +507,34 @@ private static void ParseCounterProvider(string providerText, CounterSet counter throw new FormatException("Unexpected characters after closing ']' in counter_provider"); } } - string[] enabledCounters = counterNames.Substring(0, counterNames.Length - 1).Split(',', StringSplitOptions.RemoveEmptyEntries); - counters.AddProviderCounters(providerName, enabledCounters); + enabledCounters = counterNames.Substring(0, counterNames.Length - 1).Split(',', StringSplitOptions.RemoveEmptyEntries); } - } - private EventPipeCounterGroup[] GetEventPipeProviders() => - _counterList.Providers.Select(provider => new EventPipeCounterGroup + // haven't seen this provider yet so add it + if (preExistingGroup == null) { - ProviderName = provider, - CounterNames = _counterList.GetCounters(provider).ToArray() - }).ToArray(); + counters.Add(new EventPipeCounterGroup + { + ProviderName = providerName, + CounterNames = enabledCounters, + Type = groupType + }); + } + // we've already seen the provider so merge the configurations + else + { + // If the previous config had some specific counters and the new one also has specific counters then merge them. + // Otherwise one of the two requested all counters so the union is also all counters. + if (preExistingGroup.CounterNames.Length == 0 || enabledCounters.Length == 0) + { + preExistingGroup.CounterNames = Array.Empty(); + } + else + { + preExistingGroup.CounterNames = preExistingGroup.CounterNames.Union(enabledCounters).ToArray(); + } + } + } private async Task Start(MetricsPipeline pipeline, CancellationToken token) { diff --git a/src/Tools/dotnet-counters/CounterSet.cs b/src/Tools/dotnet-counters/CounterSet.cs deleted file mode 100644 index 26483af51f..0000000000 --- a/src/Tools/dotnet-counters/CounterSet.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Diagnostics.Tools.Counters -{ - public class CounterSet - { - // a mapping from provider to a list of counters that should be enabled - // an empty List means all counters are enabled - private readonly Dictionary> _providerCounters; - - public CounterSet() - { - _providerCounters = new Dictionary>(); - } - - public bool IsEmpty => _providerCounters.Count == 0; - - public IEnumerable Providers => _providerCounters.Keys; - - public bool IncludesAllCounters(string providerName) - { - return _providerCounters.TryGetValue(providerName, out List enabledCounters) && enabledCounters.Count == 0; - } - - public IEnumerable GetCounters(string providerName) - { - if (!_providerCounters.TryGetValue(providerName, out List enabledCounters)) - { - return Array.Empty(); - } - return enabledCounters; - } - - // Called when we want to enable all counters under a provider name. - public void AddAllProviderCounters(string providerName) - { - _providerCounters[providerName] = new List(); - } - - public void AddProviderCounters(string providerName, string[] counters) - { - if (!_providerCounters.TryGetValue(providerName, out List enabledCounters)) - { - enabledCounters = new List(counters.Distinct()); - _providerCounters.Add(providerName, enabledCounters); - } - else if (enabledCounters.Count != 0) // empty list means all counters are enabled already - { - foreach (string counter in counters) - { - if (!enabledCounters.Contains(counter)) - { - enabledCounters.Add(counter); - } - } - } - } - - public bool Contains(string providerName, string counterName) - { - return _providerCounters.TryGetValue(providerName, out List counters) && - (counters.Count == 0 || counters.Contains(counterName)); - } - } -} diff --git a/src/Tools/dotnet-counters/Exporters/ConsoleWriter.cs b/src/Tools/dotnet-counters/Exporters/ConsoleWriter.cs index 94df5e4dc4..0acab08869 100644 --- a/src/Tools/dotnet-counters/Exporters/ConsoleWriter.cs +++ b/src/Tools/dotnet-counters/Exporters/ConsoleWriter.cs @@ -21,12 +21,10 @@ private class ObservedProvider public ObservedProvider(string name) { Name = name; - KnownData.TryGetProvider(name, out KnownProvider); } public string Name { get; } // Name of the category. public Dictionary Counters { get; } = new Dictionary(); // Counters in this category. - public readonly CounterProvider KnownProvider; } /// Information about an observed counter. @@ -146,7 +144,7 @@ public void AssignRowsAndInitializeDisplay() if (RenderRow(ref row) && // Blank line. RenderTableRow(ref row, "Name", "Current Value", "Last Delta")) // Table header { - foreach (ObservedProvider provider in _providers.Values.OrderBy(p => p.KnownProvider == null).ThenBy(p => p.Name)) // Known providers first. + foreach (ObservedProvider provider in _providers.Values.OrderBy(p => p.Name)) { if (!RenderTableRow(ref row, $"[{provider.Name}]")) { diff --git a/src/Tools/dotnet-counters/KnownData.cs b/src/Tools/dotnet-counters/KnownData.cs deleted file mode 100644 index 4658d6ff6a..0000000000 --- a/src/Tools/dotnet-counters/KnownData.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Microsoft.Diagnostics.Tools.Counters -{ - internal static class KnownData - { - private const string maxVersion = "8.0"; - - internal static readonly string[] s_AllVersions = new[] { net30, net31, net50, net60, net70, net80 }; - private static readonly string[] s_StartingNet5 = new[] { net50, net60, net70, net80 }; - private static readonly string[] s_StartingNet6 = new[] { net60, net70, net80 }; - private static readonly string[] s_StartingNet7 = new[] { net70, net80 }; - - private static readonly IReadOnlyDictionary _knownProviders = - CreateKnownProviders(maxVersion).ToDictionary(p => p.Name, StringComparer.OrdinalIgnoreCase); - - private const string net80 = "8.0"; - private const string net70 = "7.0"; - private const string net60 = "6.0"; - private const string net50 = "5.0"; - private const string net31 = "3.1"; - private const string net30 = "3.0"; - - private static IEnumerable CreateKnownProviders(string runtimeVersion) - { - yield return new CounterProvider( - "System.Runtime", // Name - "A default set of performance counters provided by the .NET runtime.", // Description - "0xffffffff", // Keywords - "5", // Level - new[] { // Counters - new CounterProfile{ Name="cpu-usage", Description="The percent of process' CPU usage relative to all of the system CPU resources [0-100]", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="working-set", Description="Amount of working set used by the process (MB)", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="gc-heap-size", Description="Total heap size reported by the GC (MB)", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="gen-0-gc-count", Description="Number of Gen 0 GCs between update intervals", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="gen-1-gc-count", Description="Number of Gen 1 GCs between update intervals", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="gen-2-gc-count", Description="Number of Gen 2 GCs between update intervals", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="time-in-gc", Description="% time in GC since the last GC", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="gen-0-size", Description="Gen 0 Heap Size", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="gen-1-size", Description="Gen 1 Heap Size", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="gen-2-size", Description="Gen 2 Heap Size", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="loh-size", Description="LOH Size", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="poh-size", Description="POH (Pinned Object Heap) Size", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="alloc-rate", Description="Number of bytes allocated in the managed heap between update intervals", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="gc-fragmentation", Description="GC Heap Fragmentation", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="assembly-count", Description="Number of Assemblies Loaded", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="exception-count", Description="Number of Exceptions / sec", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="threadpool-thread-count", Description="Number of ThreadPool Threads", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="monitor-lock-contention-count", Description="Number of times there were contention when trying to take the monitor lock between update intervals", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="threadpool-queue-length", Description="ThreadPool Work Items Queue Length", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="threadpool-completed-items-count", Description="ThreadPool Completed Work Items Count", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="active-timer-count", Description="Number of timers that are currently active", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="il-bytes-jitted", Description="Total IL bytes jitted", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="methods-jitted-count", Description="Number of methods jitted", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="gc-committed", Description="Size of committed memory by the GC (MB)", SupportedVersions=s_StartingNet6 } - }, - runtimeVersion // RuntimeVersion - ); - yield return new CounterProvider( - "Microsoft.AspNetCore.Hosting", // Name - "A set of performance counters provided by ASP.NET Core.", // Description - "0x0", // Keywords - "4", // Level - new[] { // Counters - new CounterProfile{ Name="requests-per-second", Description="Number of requests between update intervals", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="total-requests", Description="Total number of requests", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="current-requests", Description="Current number of requests", SupportedVersions=s_AllVersions }, - new CounterProfile{ Name="failed-requests", Description="Failed number of requests", SupportedVersions=s_AllVersions }, - }, - runtimeVersion - ); - yield return new CounterProvider( - "Microsoft-AspNetCore-Server-Kestrel", // Name - "A set of performance counters provided by Kestrel.", // Description - "0x0", // Keywords - "4", // Level - new[] { - new CounterProfile{ Name="connections-per-second", Description="Number of connections between update intervals", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="total-connections", Description="Total Connections", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="tls-handshakes-per-second", Description="Number of TLS Handshakes made between update intervals", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="total-tls-handshakes", Description="Total number of TLS handshakes made", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="current-tls-handshakes", Description="Number of currently active TLS handshakes", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="failed-tls-handshakes", Description="Total number of failed TLS handshakes", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="current-connections", Description="Number of current connections", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="connection-queue-length", Description="Length of Kestrel Connection Queue", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="request-queue-length", Description="Length total HTTP request queue", SupportedVersions=s_StartingNet5 }, - }, - runtimeVersion - ); - yield return new CounterProvider( - "System.Net.Http", - "A set of performance counters for System.Net.Http", - "0x0", // Keywords - "1", // Level - new[] { - new CounterProfile{ Name="requests-started", Description="Total Requests Started", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="requests-started-rate", Description="Number of Requests Started between update intervals", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="requests-aborted", Description="Total Requests Aborted", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="requests-aborted-rate", Description="Number of Requests Aborted between update intervals", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="current-requests", Description="Current Requests", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="http11-connections-current-total", Description="Current number of HTTP 1.1 connections", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="http20-connections-current-total", Description="Current number of HTTP 2.0 connections", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="http30-connections-current-total", Description="Current number of HTTP 3.0 connections", SupportedVersions=s_StartingNet7 }, - new CounterProfile{ Name="http11-requests-queue-duration", Description="Average duration of the time HTTP 1.1 requests spent in the request queue", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="http20-requests-queue-duration", Description="Average duration of the time HTTP 2.0 requests spent in the request queue", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="http30-requests-queue-duration", Description="Average duration of the time HTTP 3.0 requests spent in the request queue", SupportedVersions=s_StartingNet7 }, - }, - runtimeVersion - ); - yield return new CounterProvider( - "System.Net.NameResolution", - "A set of performance counters for DNS lookups", - "0x0", - "1", - new[] { - new CounterProfile{ Name="dns-lookups-requested", Description="The number of DNS lookups requested since the process started", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="dns-lookups-duration", Description="Average DNS Lookup Duration", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="current-dns-lookups", Description="The current number of DNS lookups that have started but not yet completed", SupportedVersions=s_StartingNet6 }, - }, - runtimeVersion - ); - yield return new CounterProvider( - "System.Net.Security", - "A set of performance counters for TLS", - "0x0", - "1", - new[] { - new CounterProfile{ Name="tls-handshake-rate", Description="The number of TLS handshakes completed per update interval", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="total-tls-handshakes", Description="The total number of TLS handshakes completed since the process started", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="current-tls-handshakes", Description="The current number of TLS handshakes that have started but not yet completed", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="failed-tls-handshakes", Description="The total number of TLS handshakes failed since the process started", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="all-tls-sessions-open", Description="The number of active all TLS sessions", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="tls10-sessions-open", Description="The number of active TLS 1.0 sessions", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="tls11-sessions-open", Description="The number of active TLS 1.1 sessions", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="tls12-sessions-open", Description="The number of active TLS 1.2 sessions", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="tls13-sessions-open", Description="The number of active TLS 1.3 sessions", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="all-tls-handshake-duration", Description="The average duration of all TLS handshakes", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="tls10-handshake-duration", Description="The average duration of TLS 1.0 handshakes", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="tls11-handshake-duration", Description="The average duration of TLS 1.1 handshakes", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="tls12-handshake-duration", Description="The average duration of TLS 1.2 handshakes", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="tls13-handshake-duration", Description="The average duration of TLS 1.3 handshakes", SupportedVersions=s_StartingNet5 }, - }, - runtimeVersion - ); - yield return new CounterProvider( - "System.Net.Sockets", - "A set of performance counters for System.Net.Sockets", - "0x0", - "1", - new[] { - new CounterProfile{ Name="outgoing-connections-established", Description="The total number of outgoing connections established since the process started", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="incoming-connections-established", Description="The total number of incoming connections established since the process started", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="current-outgoing-connect-attempts", Description="The current number of outgoing connect attempts that have started but not yet completed", SupportedVersions=s_StartingNet7 }, - new CounterProfile{ Name="bytes-received", Description="The total number of bytes received since the process started", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="bytes-sent", Description="The total number of bytes sent since the process started", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="datagrams-received", Description="The total number of datagrams received since the process started", SupportedVersions=s_StartingNet5 }, - new CounterProfile{ Name="datagrams-sent", Description="The total number of datagrams sent since the process started", SupportedVersions=s_StartingNet5 }, - }, - runtimeVersion - ); - } - - public static IReadOnlyList GetAllProviders(string version) - { - return CreateKnownProviders(version).Where(p => p.Counters.Count > 0).ToDictionary(p => p.Name, StringComparer.OrdinalIgnoreCase).Values.ToList(); - } - - public static bool TryGetProvider(string providerName, out CounterProvider provider) => _knownProviders.TryGetValue(providerName, out provider); - } -} diff --git a/src/Tools/dotnet-counters/Program.cs b/src/Tools/dotnet-counters/Program.cs index 4870e3faf8..b9079cefbb 100644 --- a/src/Tools/dotnet-counters/Program.cs +++ b/src/Tools/dotnet-counters/Program.cs @@ -138,7 +138,12 @@ private static Option ExportFileNameOption() => private static Option CounterOption() => new( alias: "--counters", - description: "A comma-separated list of counter providers. Counter providers can be specified as or [comma_separated_counter_names]. If the provider_name is used without qualifying counter_names then all counters will be shown. For example \"System.Runtime[cpu-usage,working-set],Microsoft.AspNetCore.Hosting\" includes the cpu-usage and working-set counters from the System.Runtime provider and all the counters from the Microsoft.AspNetCore.Hosting provider. To discover provider and counter names, use the list command.") + description: "A comma-separated list of counter providers. Counter providers can be specified as or [comma_separated_counter_names]. If the provider_name" + + " is used without qualifying counter_names then all counters will be shown. For example \"System.Runtime[dotnet.assembly.count,dotnet.gc.pause.time],Microsoft.AspNetCore.Hosting\"" + + " includes the dotnet.assembly.count and dotnet.gc.pause.time counters from the System.Runtime provider and all the counters from the Microsoft.AspNetCore.Hosting provider. Provider" + + " names can either refer to the name of a Meter for the System.Diagnostics.Metrics API or the name of an EventSource for the EventCounters API. If the monitored application has both" + + " a Meter and an EventSource with the same name, the Meter is automatically preferred. Use the prefix \'EventCounters\\\' in front of a provider name to only show the EventCounters." + + " To discover well-known provider and counter names, please visit https://learn.microsoft.com/dotnet/core/diagnostics/built-in-metrics.") { Argument = new Argument(name: "counters") }; @@ -216,30 +221,10 @@ private static Option ShowDeltasOption() => " This is useful to monitor the rate of change for a metric.") { }; - private static readonly string[] s_SupportedRuntimeVersions = KnownData.s_AllVersions; - public static int List(IConsole console, string runtimeVersion) { - if (!s_SupportedRuntimeVersions.Contains(runtimeVersion)) - { - Console.WriteLine($"{runtimeVersion} is not a supported version string or a supported runtime version."); - Console.WriteLine("Supported version strings: 3.0, 3.1, 5.0, 6.0, 7.0, 8.0"); - return 0; - } - IReadOnlyList profiles = KnownData.GetAllProviders(runtimeVersion); - int maxNameLength = profiles.Max(p => p.Name.Length); - Console.WriteLine($"Showing well-known counters for .NET (Core) version {runtimeVersion} only. Specific processes may support additional counters."); - foreach (CounterProvider profile in profiles) - { - IReadOnlyList counters = profile.GetAllCounters(); - int maxCounterNameLength = counters.Max(c => c.Name.Length); - Console.WriteLine($"{profile.Name.PadRight(maxNameLength)}"); - foreach (CounterProfile counter in profile.Counters.Values) - { - Console.WriteLine($" {counter.Name.PadRight(maxCounterNameLength)} \t\t {counter.Description}"); - } - Console.WriteLine(""); - } + Console.WriteLine("Counter information has been moved to the online .NET documentation."); + Console.WriteLine("Please visit https://learn.microsoft.com/dotnet/core/diagnostics/built-in-metrics."); return 1; } diff --git a/src/Tools/dotnet-symbol/Program.cs b/src/Tools/dotnet-symbol/Program.cs index d7f7e0a21b..8aa07ddeb7 100644 --- a/src/Tools/dotnet-symbol/Program.cs +++ b/src/Tools/dotnet-symbol/Program.cs @@ -5,9 +5,12 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Net.Http.Headers; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; using Microsoft.Diagnostic.Tools.Symbol.Properties; using Microsoft.FileFormats; using Microsoft.FileFormats.ELF; @@ -25,11 +28,13 @@ private struct ServerInfo { public Uri Uri; public string PersonalAccessToken; + public bool InternalSymwebServer; } private readonly List InputFilePaths = new(); private readonly List CacheDirectories = new(); private readonly List SymbolServers = new(); + private TokenCredential TokenCredential = new DefaultAzureCredential(includeInteractiveCredentials: true); private string OutputDirectory; private TimeSpan? Timeout; private bool Overwrite; @@ -63,6 +68,11 @@ public static void Main(string[] args) program.SymbolServers.Add(new ServerInfo { Uri = uri, PersonalAccessToken = null }); break; + case "--internal-server": + Uri.TryCreate("https://symweb.azurefd.net/", UriKind.Absolute, out uri); + program.SymbolServers.Add(new ServerInfo { Uri = uri, PersonalAccessToken = null, InternalSymwebServer = true }); + break; + case "--authenticated-server-path": if (++i < args.Length) { @@ -256,7 +266,14 @@ private Microsoft.SymbolStore.SymbolStores.SymbolStore BuildSymbolStore() foreach (ServerInfo server in ((IEnumerable)SymbolServers).Reverse()) { - store = new HttpSymbolStore(Tracer, store, server.Uri, server.PersonalAccessToken); + if (server.InternalSymwebServer) + { + store = new HttpSymbolStore(Tracer, store, server.Uri, SymwebAuthenticationFunc); + } + else + { + store = new HttpSymbolStore(Tracer, store, server.Uri, server.PersonalAccessToken); + } if (Timeout.HasValue && store is HttpSymbolStore http) { http.Timeout = Timeout.Value; @@ -277,6 +294,19 @@ private Microsoft.SymbolStore.SymbolStores.SymbolStore BuildSymbolStore() return store; } + private async ValueTask SymwebAuthenticationFunc(CancellationToken token) + { + try + { + AccessToken accessToken = await TokenCredential.GetTokenAsync(new TokenRequestContext(["api://af9e1c69-e5e9-4331-8cc5-cdf93d57bafa/.default"]), token).ConfigureAwait(false); + return new AuthenticationHeaderValue("Bearer", accessToken.Token); + } + catch (Exception ex) when (ex is CredentialUnavailableException or AuthenticationFailedException) + { + return null; + } + } + private sealed class SymbolStoreKeyWrapper { public readonly SymbolStoreKey Key; diff --git a/src/Tools/dotnet-symbol/dotnet-symbol.csproj b/src/Tools/dotnet-symbol/dotnet-symbol.csproj index 86275cc922..bf363f1a99 100644 --- a/src/Tools/dotnet-symbol/dotnet-symbol.csproj +++ b/src/Tools/dotnet-symbol/dotnet-symbol.csproj @@ -14,6 +14,10 @@ All + + + + diff --git a/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs b/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs index 97007d3d1e..f1f40b384b 100644 --- a/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs +++ b/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs @@ -45,7 +45,7 @@ private static void ConsoleWriteLine(string str) /// Sets the size of the in-memory circular buffer in megabytes. /// A list of EventPipe providers to be enabled. This is in the form 'Provider[,Provider]', where Provider is in the form: 'KnownProviderName[:Flags[:Level][:KeyValueArgs]]', and KeyValueArgs is in the form: '[key1=value1][;key2=value2]' /// A named pre-defined set of provider configurations that allows common tracing scenarios to be specified succinctly. - /// The desired format of the created trace file. + /// If not using the default NetTrace format, an additional file will be emitted with the specified format under the same output name and with the corresponding format extension. /// The duration of trace to be taken. /// A list of CLR events to be emitted. /// The verbosity level of CLR events diff --git a/src/Tools/dotnet-trace/CommandLine/Options/CommonOptions.cs b/src/Tools/dotnet-trace/CommandLine/Options/CommonOptions.cs index 0500292d6d..a5e9fd7ad2 100644 --- a/src/Tools/dotnet-trace/CommandLine/Options/CommonOptions.cs +++ b/src/Tools/dotnet-trace/CommandLine/Options/CommonOptions.cs @@ -28,7 +28,7 @@ public static Option NameOption() => public static Option FormatOption() => new( alias: "--format", - description: $"Sets the output format for the trace file. Default is {DefaultTraceFileFormat()}.") + description: $"If not using the default NetTrace format, an additional file will be emitted with the specified format under the same output name and with the corresponding format extension. The default format is {DefaultTraceFileFormat()}.") { Argument = new Argument(name: "trace-file-format", getDefaultValue: DefaultTraceFileFormat) }; diff --git a/src/Tools/dotnet-trace/CommandLine/PrintReportHelper.cs b/src/Tools/dotnet-trace/CommandLine/PrintReportHelper.cs index d74f25043c..ec60dd8f9f 100644 --- a/src/Tools/dotnet-trace/CommandLine/PrintReportHelper.cs +++ b/src/Tools/dotnet-trace/CommandLine/PrintReportHelper.cs @@ -96,6 +96,12 @@ internal static void TopNWriteToStdOut(List nodesToReport, boo } int n = nodesToReport.Count; + if (n == 0) + { + Console.Error.WriteLine("[WARNING] No method calls found"); + return; + } + int maxDigit = (int)Math.Log10(n) + 1; string extra = new(' ', maxDigit - 1); diff --git a/src/Tools/dotnet-trace/TraceFileFormatConverter.cs b/src/Tools/dotnet-trace/TraceFileFormatConverter.cs index f383a7453d..b954cf0524 100644 --- a/src/Tools/dotnet-trace/TraceFileFormatConverter.cs +++ b/src/Tools/dotnet-trace/TraceFileFormatConverter.cs @@ -36,14 +36,13 @@ internal static string GetConvertedFilename(string fileToConvert, string outputf internal static void ConvertToFormat(IConsole console, TraceFileFormat format, string fileToConvert, string outputFilename) { - console.Out.WriteLine($"Writing:\t{outputFilename}"); - switch (format) { case TraceFileFormat.NetTrace: break; case TraceFileFormat.Speedscope: case TraceFileFormat.Chromium: + console.Out.WriteLine($"Processing trace data file '{fileToConvert}' to create a new {format} file '{outputFilename}'."); try { Convert(console, format, fileToConvert, outputFilename); diff --git a/src/dbgshim/CMakeLists.txt b/src/dbgshim/CMakeLists.txt index 62e404fcc5..af05336236 100644 --- a/src/dbgshim/CMakeLists.txt +++ b/src/dbgshim/CMakeLists.txt @@ -1,6 +1,9 @@ +include(${CLR_SHARED_DIR}/shared.cmake) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + add_definitions(-DFEATURE_NO_HOST) add_definitions(-DSELF_NO_HOST) -add_definitions(-D_BLD_CLR) set(DBGSHIM_SOURCES dbgshim.cpp @@ -15,6 +18,8 @@ endif(CLR_CMAKE_HOST_WIN32) if(CLR_CMAKE_HOST_WIN32) list(APPEND DBGSHIM_SOURCES + securityutil.cpp + securitywrapper.cpp dbgshim.rc ) preprocess_file(${CMAKE_CURRENT_SOURCE_DIR}/dbgshim.ntdef ${CMAKE_CURRENT_BINARY_DIR}/dbgshim.def) @@ -47,6 +52,7 @@ endif(CLR_CMAKE_HOST_UNIX) set(DBGSHIM_LIBRARIES dbgutil corguids + coreclrminipal utilcodestaticnohost ) diff --git a/src/dbgshim/dbgshim.cpp b/src/dbgshim/dbgshim.cpp index 40c129c02b..69952a0533 100644 --- a/src/dbgshim/dbgshim.cpp +++ b/src/dbgshim/dbgshim.cpp @@ -318,13 +318,13 @@ class RuntimeStartupHelper { if (lpApplicationGroupId != NULL) { - int size = wcslen(lpApplicationGroupId) + 1; + int size = u16_strlen(lpApplicationGroupId) + 1; m_applicationGroupId = new (nothrow) WCHAR[size]; if (m_applicationGroupId == NULL) { return E_OUTOFMEMORY; } - wcscpy_s(m_applicationGroupId, size, lpApplicationGroupId); + u16_strcpy_s(m_applicationGroupId, size, lpApplicationGroupId); } DWORD pe = PAL_RegisterForRuntimeStartup(m_processId, m_applicationGroupId, RuntimeStartupHandler, this, &m_unregisterToken); @@ -379,7 +379,7 @@ class RuntimeStartupHelper else { // Fallback to loading DBI side-by-side the runtime module - char *pszLast = strrchr(pszModulePath, DIRECTORY_SEPARATOR_CHAR_A); + const char *pszLast = strrchr(pszModulePath, DIRECTORY_SEPARATOR_CHAR_A); if (pszLast == NULL) { _ASSERT(!"InvokeStartupCallback: can find separator in coreclr path\n"); @@ -1059,9 +1059,9 @@ IsCoreClr( //strip off everything up to and including the last slash in the path to get name const WCHAR* pModuleName = pModulePath; - while(wcschr(pModuleName, DIRECTORY_SEPARATOR_CHAR_W) != NULL) + while(u16_strchr(pModuleName, DIRECTORY_SEPARATOR_CHAR_W) != NULL) { - pModuleName = wcschr(pModuleName, DIRECTORY_SEPARATOR_CHAR_W); + pModuleName = u16_strchr(pModuleName, DIRECTORY_SEPARATOR_CHAR_W); pModuleName++; // pass the slash } @@ -1388,7 +1388,7 @@ EnumProcessModulesInternal( // above EnumProcessModules calls. If this actually happens, then give // up on trying to get the whole module list and risk missing the coreclr // module. - cbNeeded = min(cbNeeded, cbNeeded2); + cbNeeded = std::min(cbNeeded, cbNeeded2); } *pCountModules = cbNeeded / sizeof(HMODULE); @@ -1545,7 +1545,7 @@ EnumerateCLRs( LPWSTR* pStringArray = (LPWSTR*) &pOutBuffer[cbEventArrayData]; pStringArray[0] = (WCHAR*) &pOutBuffer[cbEventArrayData + cbStringArrayData]; - wcscpy_s(pStringArray[0], MAX_LONGPATH, clrRuntimeInfo.ClrInfo.RuntimeModulePath); + u16_strcpy_s(pStringArray[0], MAX_LONGPATH, clrRuntimeInfo.ClrInfo.RuntimeModulePath); *pdwArrayLengthOut = 1; *ppHandleArrayOut = pEventArray; @@ -1688,7 +1688,7 @@ const WCHAR *c_versionStrFormat = W("%08x;%08x;%p"); // // Notes: // The null-terminated version string including null, is -// copied to pVersion on output. Thus *pdwLength == wcslen(pBuffer)+1. +// copied to pVersion on output. Thus *pdwLength == u16_strlen(pBuffer)+1. // The version string is an opaque string that can only be passed back to other // DbgShim APIs. //----------------------------------------------------------------------------- @@ -1785,7 +1785,7 @@ ParseVersionString( if ((piDebuggerVersion == NULL) || (pdwPidDebuggee == NULL) || (phmodTargetCLR == NULL) || - (wcslen(szDebuggeeVersion) < c_iMinVersionStringLen) || + (u16_strlen(szDebuggeeVersion) < c_iMinVersionStringLen) || (W(';') != szDebuggeeVersion[c_idxFirstSemi]) || (W(';') != szDebuggeeVersion[c_idxSecondSemi])) { @@ -1855,7 +1855,7 @@ GetDbiFilenameNextToRuntime( // Step 2: 'Coreclr.dll' --> 'mscordbi.dll' // WCHAR * pCoreClrPath = modulePath; - WCHAR * pLast = wcsrchr(pCoreClrPath, DIRECTORY_SEPARATOR_CHAR_W); + const WCHAR * pLast = u16_strrchr(pCoreClrPath, DIRECTORY_SEPARATOR_CHAR_W); if (pLast == NULL) { ThrowHR(E_FAIL); @@ -1872,7 +1872,7 @@ GetDbiFilenameNextToRuntime( AppendDbiDllName(szFullDbiPath); - szFullCoreClrPath.Set(pCoreClrPath, (COUNT_T)wcslen(pCoreClrPath)); + szFullCoreClrPath.Set(pCoreClrPath, (COUNT_T)u16_strlen(pCoreClrPath)); } diff --git a/src/dbgshim/debugshim.cpp b/src/dbgshim/debugshim.cpp index bc480ee803..6525aa97e4 100644 --- a/src/dbgshim/debugshim.cpp +++ b/src/dbgshim/debugshim.cpp @@ -11,16 +11,9 @@ #include "dbgutil.h" #include #include //has the CLR_ID_V4_DESKTOP guid in it +#include #include "palclr.h" -#ifndef IMAGE_FILE_MACHINE_ARMNT -#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian -#endif - -#ifndef IMAGE_FILE_MACHINE_ARM64 -#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // ARM64 Little-Endian -#endif - //***************************************************************************** // CLRDebuggingImpl implementation (ICLRDebugging) //***************************************************************************** @@ -758,15 +751,17 @@ HRESULT CLRDebuggingImpl::FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) W const WCHAR* pHostArch = W("arm64"); #elif defined(HOST_RISCV64) const WCHAR* pHostArch = W("riscv64"); +#elif defined(HOST_LOONGARCH64) + const WCHAR* pHostArch = W("loongarch64"); #else _ASSERTE(!"Unknown host arch"); return E_NOTIMPL; #endif const WCHAR* pDacBaseName = NULL; - if(m_skuId == CLR_ID_V4_DESKTOP) + if (m_skuId == CLR_ID_V4_DESKTOP) pDacBaseName = CLR_DAC_MODULE_NAME_W; - else if(m_skuId == CLR_ID_CORECLR || m_skuId == CLR_ID_PHONE_CLR || m_skuId == CLR_ID_ONECORE_CLR) + else if (m_skuId == CLR_ID_CORECLR || m_skuId == CLR_ID_PHONE_CLR || m_skuId == CLR_ID_ONECORE_CLR) pDacBaseName = CORECLR_DAC_MODULE_NAME_W; else { @@ -774,23 +769,33 @@ HRESULT CLRDebuggingImpl::FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) W return E_UNEXPECTED; } + _ASSERTE(targetImageFileMachine != IMAGE_FILE_MACHINE_ARM64X && targetImageFileMachine != IMAGE_FILE_MACHINE_ARM64EC); + const WCHAR* pTargetArch = NULL; - if(targetImageFileMachine == IMAGE_FILE_MACHINE_I386) + if (targetImageFileMachine == IMAGE_FILE_MACHINE_I386) { pTargetArch = W("x86"); } - else if(targetImageFileMachine == IMAGE_FILE_MACHINE_AMD64) + else if (targetImageFileMachine == IMAGE_FILE_MACHINE_AMD64) { pTargetArch = W("amd64"); } - else if(targetImageFileMachine == IMAGE_FILE_MACHINE_ARMNT) + else if (targetImageFileMachine == IMAGE_FILE_MACHINE_ARMNT) { pTargetArch = W("arm"); } - else if(targetImageFileMachine == IMAGE_FILE_MACHINE_ARM64) + else if (targetImageFileMachine == IMAGE_FILE_MACHINE_ARM64) { pTargetArch = W("arm64"); } + else if (targetImageFileMachine == IMAGE_FILE_MACHINE_RISCV64) + { + pTargetArch = W("riscv64"); + } + else if (targetImageFileMachine == IMAGE_FILE_MACHINE_LOONGARCH64) + { + pTargetArch = W("loongarch64"); + } else { _ASSERTE(!"Unknown target image file machine type"); @@ -798,9 +803,9 @@ HRESULT CLRDebuggingImpl::FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) W } const WCHAR* pBuildFlavor = W(""); - if(pVersion->dwFileFlags & VS_FF_DEBUG) + if (pVersion->dwFileFlags & VS_FF_DEBUG) { - if(pVersion->dwFileFlags & VS_FF_SPECIALBUILD) + if (pVersion->dwFileFlags & VS_FF_SPECIALBUILD) pBuildFlavor = W(".dbg"); else pBuildFlavor = W(".chk"); @@ -811,17 +816,17 @@ HRESULT CLRDebuggingImpl::FormatLongDacModuleName(_Inout_updates_z_(cchBuffer) W // have to be a tight estimate, just make sure its >= the biggest possible DAC name // and it can be calculated statically DWORD minCchBuffer = - (DWORD) wcslen(CLR_DAC_MODULE_NAME_W) + (DWORD) wcslen(CORECLR_DAC_MODULE_NAME_W) + // max name + (DWORD) u16_strlen(CLR_DAC_MODULE_NAME_W) + (DWORD) u16_strlen(CORECLR_DAC_MODULE_NAME_W) + // max name 10 + // max host arch 10 + // max target arch 40 + // max version 10 + // max build flavor - (DWORD) wcslen(W("name_host_target_version.flavor.dll")) + // max intermediate formatting chars + (DWORD) u16_strlen(W("name_host_target_version.flavor.dll")) + // max intermediate formatting chars 1; // null terminator // validate the output buffer is larger than our estimate above _ASSERTE(cchBuffer >= minCchBuffer); - if(!(cchBuffer >= minCchBuffer)) return E_INVALIDARG; + if (!(cchBuffer >= minCchBuffer)) return E_INVALIDARG; swprintf_s(pBuffer, cchBuffer, W("%s_%s_%s_%u.%u.%u.%02u%s.dll"), pDacBaseName, diff --git a/src/dbgshim/debugshim.h b/src/dbgshim/debugshim.h index 8346258d5c..6843bf6d2b 100644 --- a/src/dbgshim/debugshim.h +++ b/src/dbgshim/debugshim.h @@ -15,6 +15,7 @@ #include "sstring.h" #include #include +#include #include "runtimeinfo.h" #if defined (HOST_WINDOWS) && defined(HOST_X86) @@ -87,7 +88,7 @@ struct ClrInfo #else WindowsTarget = TRUE; #endif - IndexType = LIBRARY_PROVIDER_INDEX_TYPE::Unknown; + IndexType = LIBRARY_PROVIDER_INDEX_TYPE::UnknownIndex; memset(&RuntimeBuildId, 0, sizeof(RuntimeBuildId)); RuntimeBuildIdSize = 0; diff --git a/src/shared/inc/getproductversionnumber.h b/src/dbgshim/getproductversionnumber.h similarity index 100% rename from src/shared/inc/getproductversionnumber.h rename to src/dbgshim/getproductversionnumber.h diff --git a/src/shared/utilcode/securityutil.cpp b/src/dbgshim/securityutil.cpp similarity index 100% rename from src/shared/utilcode/securityutil.cpp rename to src/dbgshim/securityutil.cpp diff --git a/src/shared/inc/securityutil.h b/src/dbgshim/securityutil.h similarity index 100% rename from src/shared/inc/securityutil.h rename to src/dbgshim/securityutil.h diff --git a/src/shared/utilcode/securitywrapper.cpp b/src/dbgshim/securitywrapper.cpp similarity index 100% rename from src/shared/utilcode/securitywrapper.cpp rename to src/dbgshim/securitywrapper.cpp diff --git a/src/shared/inc/securitywrapper.h b/src/dbgshim/securitywrapper.h similarity index 100% rename from src/shared/inc/securitywrapper.h rename to src/dbgshim/securitywrapper.h diff --git a/src/dbgshim/stdafx.h b/src/dbgshim/stdafx.h new file mode 100644 index 0000000000..18b820306f --- /dev/null +++ b/src/dbgshim/stdafx.h @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +//***************************************************************************** +// stdafx.h +// + +// +// Common include file for utility code. +//***************************************************************************** +#pragma once + +#include +#include +#include + +#define IN_WINFIX_CPP + +#include + +#include "volatile.h" +#include "static_assert.h" + diff --git a/src/shared/pal/inc/rt/cpp/stdint.h b/src/inc/corcompile.h similarity index 74% rename from src/shared/pal/inc/rt/cpp/stdint.h rename to src/inc/corcompile.h index b23533a294..03ad98aa79 100644 --- a/src/shared/pal/inc/rt/cpp/stdint.h +++ b/src/inc/corcompile.h @@ -1,4 +1,4 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include "palrt.h" +// Empty version of the runtime's corcompile.h diff --git a/src/inc/ntimageex.h b/src/inc/ntimageex.h new file mode 100644 index 0000000000..b249b74a4c --- /dev/null +++ b/src/inc/ntimageex.h @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#pragma once + +#ifndef IMAGE_FILE_MACHINE_ARMNT +#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian +#endif + +#ifndef IMAGE_FILE_MACHINE_ARM64 +#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // ARM64 Little-Endian +#endif + +#ifndef IMAGE_FILE_MACHINE_ARM64EC +#define IMAGE_FILE_MACHINE_ARM64EC 0xA641 +#endif + +#ifndef IMAGE_FILE_MACHINE_ARM64X +#define IMAGE_FILE_MACHINE_ARM64X 0xA64E +#endif + +#ifndef IMAGE_FILE_MACHINE_RISCV64 +#define IMAGE_FILE_MACHINE_RISCV64 0x5064 // RISCV64 +#endif + +#ifndef IMAGE_FILE_MACHINE_LOONGARCH64 +#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264 // LOONGARCH64 +#endif + diff --git a/src/shared/inc/releaseholder.h b/src/inc/releaseholder.h similarity index 92% rename from src/shared/inc/releaseholder.h rename to src/inc/releaseholder.h index f9da8d8390..620964d9fe 100644 --- a/src/shared/inc/releaseholder.h +++ b/src/inc/releaseholder.h @@ -17,7 +17,7 @@ class ReleaseHolder { public: ReleaseHolder() - : m_ptr(NULL) + : m_ptr(nullptr) {} ReleaseHolder(T* ptr) @@ -59,16 +59,16 @@ class ReleaseHolder T* Detach() { T* pT = m_ptr; - m_ptr = NULL; + m_ptr = nullptr; return pT; } void Release() { - if (m_ptr != NULL) + if (m_ptr != nullptr) { m_ptr->Release(); - m_ptr = NULL; + m_ptr = nullptr; } } diff --git a/src/shared/pal/inc/rt/intsafe.h b/src/inc/rt/intsafe.h similarity index 98% rename from src/shared/pal/inc/rt/intsafe.h rename to src/inc/rt/intsafe.h index 23e8969cf8..7f670803d6 100644 --- a/src/shared/pal/inc/rt/intsafe.h +++ b/src/inc/rt/intsafe.h @@ -31,16 +31,16 @@ #define LODWORD(_qw) ((ULONG)(_qw)) #if defined(MIDL_PASS) || defined(RC_INVOKED) || defined(_M_CEE_PURE) \ - || defined(_M_AMD64) || defined(__ARM_ARCH) || defined(_M_S390X) || defined(_M_RISCV64) + || defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_S390X) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) #ifndef UInt32x32To64 -#define UInt32x32To64(a, b) ((unsigned __int64)((ULONG)(a)) * (unsigned __int64)((ULONG)(b))) +#define UInt32x32To64(a, b) ((uint64_t)((ULONG)(a)) * (uint64_t)((ULONG)(b))) #endif -#elif defined(_M_IX86) +#elif defined(TARGET_X86) || defined(TARGET_ARM) #ifndef UInt32x32To64 -#define UInt32x32To64(a, b) (unsigned __int64)((unsigned __int64)(ULONG)(a) * (ULONG)(b)) +#define UInt32x32To64(a, b) (uint64_t)((uint64_t)(ULONG)(a) * (ULONG)(b)) #endif #else @@ -344,7 +344,7 @@ UIntToLong( IN UINT Operand, OUT LONG* Result) { - if (Operand <= _I32_MAX) + if (Operand <= INT32_MAX) { *Result = (LONG)Operand; return S_OK; @@ -497,7 +497,7 @@ ULongToLong( IN ULONG Operand, OUT LONG* Result) { - if (Operand <= _I32_MAX) + if (Operand <= INT32_MAX) { *Result = (LONG)Operand; return S_OK; @@ -539,7 +539,7 @@ ULongLongToLong( IN ULONGLONG Operand, OUT LONG* Result) { - if (Operand <= _I32_MAX) + if (Operand <= INT32_MAX) { *Result = (LONG)Operand; return S_OK; @@ -606,7 +606,7 @@ ULongLongToULong( HRESULT hr = INTSAFE_E_ARITHMETIC_OVERFLOW; *pulResult = ULONG_ERROR; - if (ullOperand <= _UI32_MAX) + if (ullOperand <= UINT32_MAX) { *pulResult = (ULONG)ullOperand; hr = S_OK; diff --git a/src/shared/pal/inc/rt/commctrl.h b/src/inc/rt/oaidl.h similarity index 60% rename from src/shared/pal/inc/rt/commctrl.h rename to src/inc/rt/oaidl.h index 8056bb4532..ed7491c584 100644 --- a/src/shared/pal/inc/rt/commctrl.h +++ b/src/inc/rt/oaidl.h @@ -4,9 +4,15 @@ // // =========================================================================== -// File: commctrl.h +// File: oaidl.h // // =========================================================================== -// dummy commctrl.h for PAL -#include "palrt.h" +#ifndef __OAIDL_H__ +#define __OAIDL_H__ + +// Pointer to IErrorInfo is still used in non-Windows code +// Prevent accidentally using its member +struct IErrorInfo; + +#endif //__OAIDL_H__ diff --git a/src/shared/pal/inc/rt/psapi.h b/src/inc/rt/psapi.h similarity index 100% rename from src/shared/pal/inc/rt/psapi.h rename to src/inc/rt/psapi.h diff --git a/src/shared/pal/inc/rt/tchar.h b/src/inc/rt/tchar.h similarity index 100% rename from src/shared/pal/inc/rt/tchar.h rename to src/inc/rt/tchar.h diff --git a/src/shared/pal/inc/rt/tlhelp32.h b/src/inc/rt/tlhelp32.h similarity index 100% rename from src/shared/pal/inc/rt/tlhelp32.h rename to src/inc/rt/tlhelp32.h diff --git a/src/shared/pal/inc/rt/winapifamily.h b/src/inc/rt/winapifamily.h similarity index 100% rename from src/shared/pal/inc/rt/winapifamily.h rename to src/inc/rt/winapifamily.h diff --git a/src/shared/pal/inc/rt/winternl.h b/src/inc/rt/winternl.h similarity index 100% rename from src/shared/pal/inc/rt/winternl.h rename to src/inc/rt/winternl.h diff --git a/src/shared/pal/inc/rt/winver.h b/src/inc/rt/winver.h similarity index 100% rename from src/shared/pal/inc/rt/winver.h rename to src/inc/rt/winver.h diff --git a/src/shared/pal/inc/rt/share.h b/src/inc/stacktrace.h similarity index 74% rename from src/shared/pal/inc/rt/share.h rename to src/inc/stacktrace.h index b23533a294..03b5a908b2 100644 --- a/src/shared/pal/inc/rt/share.h +++ b/src/inc/stacktrace.h @@ -1,4 +1,4 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#include "palrt.h" +// Empty version of the runtime's stacktrace.h diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 06e258f36b..c932407971 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -1,14 +1,17 @@ +include_directories(${CLR_SRC_NATIVE_DIR}) + if (CLR_CMAKE_HOST_UNIX) add_subdirectory(pal) endif(CLR_CMAKE_HOST_UNIX) +add_subdirectory(minipal) + +include(shared.cmake) + add_subdirectory(inc) -add_subdirectory(dbgutil) +add_subdirectory(debug) if (CLR_CMAKE_HOST_UNIX) - # This prevents inclusion of standard C compiler headers - add_compile_options(-nostdinc) - include_directories(${CLR_SHARED_DIR}/pal/inc/rt/cpp) add_subdirectory(palrt) endif(CLR_CMAKE_HOST_UNIX) diff --git a/src/shared/README.txt b/src/shared/README.txt index ac24276f35..bd1748dbc9 100644 --- a/src/shared/README.txt +++ b/src/shared/README.txt @@ -2,21 +2,71 @@ The "shared" directory contains the common code between the runtime and diagnost It is also shared by the dbgshim and SOS components. -Updated last on 2/7/2022 from the runtime repo commit hash: 4c662b16e3e6fe688f9bbff2a9423fdee799ecfe - -runtime/src/coreclr/inc -> diagnostics/src/shared/inc -runtime/src/coreclr/debug/dbgutil -> diagnostics/src/shared/dbgutil -runtime/src/coreclr/debug/inc/dbgutil.h -> diagnostics/src/shared/inc/dbgutil.h -runtime/src/coreclr/debug/inc/dbgtargetcontext.h -> diagnostics/src/shared/inc/dbgtargetcontext.h -runtime/src/coreclr/debug/inc/runtimeinfo.h -> diagnostics/src/shared/inc/runtimeinfo.h -runtime/src/coreclr/gcdump -> diagnostics/src/shared/gcdump -runtime/src/coreclr/gcinfo/gcinfodumper.cpp -> diagnostics/src/shared/gcdump/gcinfodumper.cpp -runtime/src/coreclr/vm/gcinfodecoder.cpp -> diagnostics/src/shared/gcdump/gcinfodecoder.cpp -runtime/src/coreclr/gc/gcdesc.h -> diagnostics/src/shared/inc/gcdesc.h -runtime/src/coreclr/vm/hillclimbing.h -> diagnostics/src/shared/inc/hillclimbing.h -runtime/src/coreclr/dlls/mscorrc/resource.h -> diagnostics/src/shared/inc/resource.h -runtime/src/coreclr/hosts/inc/coreclrhost.h -> diagnostics/src/shared/inc/coreclrhost.h -runtime/src/native/minipal -> diagnostics/src/shared/minipal -runtime/src/coreclr/pal -> diagnostics/src/shared/pal -runtime/src/coreclr/palrt -> diagnostics/src/shared/palrt -runtime/src/coreclr/utilcode -> diagnostics/src/shared/utilcode +Updated last on 8/14/2024 from the runtime repo commit hash: 96bcf7150deba280a070c6a4d85ca0640e405278 + +runtime/src/coreclr/inc -> diagnostics/src/shared/inc +runtime/src/coreclr/debug/dbgutil -> diagnostics/src/shared/debug/dbgutil +runtime/src/coreclr/debug/inc/dump/dumpcommon.h -> diagnostics/src/shared/debug/inc/dump/dumpcommon.h +runtime/src/coreclr/debug/inc/dbgutil.h -> diagnostics/src/shared/debug/inc/dbgutil.h +runtime/src/coreclr/debug/inc/dbgtargetcontext.h -> diagnostics/src/shared/debug/inc/dbgtargetcontext.h +runtime/src/coreclr/debug/inc/runtimeinfo.h -> diagnostics/src/shared/debug/inc/runtimeinfo.h +runtime/src/coreclr/gcdump -> diagnostics/src/shared/gcdump +runtime/src/coreclr/gcinfo/gcinfodumper.cpp -> diagnostics/src/shared/gcinfo/gcinfodumper.cpp +runtime/src/coreclr/vm/gcinfodecoder.cpp -> diagnostics/src/shared/vm/gcinfodecoder.cpp +runtime/src/coreclr/gc/gcdesc.h -> diagnostics/src/shared/gc/gcdesc.h +runtime/src/coreclr/dlls/mscorrc/resource.h -> diagnostics/src/shared/dlls/mscorrc/resource.h +runtime/src/coreclr/hosts/inc/coreclrhost.h -> diagnostics/src/shared/hosts/inc/coreclrhost.h +runtime/src/coreclr/minipal -> diagnostics/src/shared/minipal +runtime/src/coreclr/pal -> diagnostics/src/shared/pal +runtime/src/coreclr/palrt -> diagnostics/src/shared/palrt +runtime/src/coreclr/utilcode -> diagnostics/src/shared/utilcode + +runtime/src/native/minipal -> diagnostics/src/shared/native/minipal + +runtime/src/coreclr/utilcode/sigparser.cpp -> diagnostics/src/SOS/Strike/sigparser.cpp - contracts removed +runtime/src/coreclr/gcdump -> diagnostics/src/shared/gcdump/gcdump.cpp - SOS can't include utilcode.h +runtime/src/coreclr/gcdump -> diagnostics/src/shared/gcdump/i386/gcdumpx86.cpp - SOS can't include utilcode.h +runtime/src/coreclr/gcdump -> diagnostics/src/shared/palrt/bstr.cpp - needed by dbgshim + +HAVE_PROCFS_MAPS is needed by diagnostics/src/shared/pal/src/thread/process.cpp: + +diagnostics/src/shared/pal/src/configure.cmake +diagnostics/src/shared/pal/src/config.h.in +diagnostics/eng/native/tryrun.cmake + +There are a lot of include and source files that need to be carefully merged from the runtime because +there is functions that the diagnostics repo doesn't need (i.e. Mutexes) and functions that were removed +from the runtime PAL that the diagnostics repo needs (i.e. RemoveDirectoryA). + +diagnostics\src\shared\inc\arrayholder.h - needs #pragma once +diagnostics\src\shared\inc\daccess.h - mostly stripped down except for macros the other shared/inc files need, TADDR needs to be ULONG_PTR for x86 +diagnostics\src\shared\inc\ex.h - stripped some parts of the EX_* macros out +diagnostics\src\shared\inc\holder.h - needs ReleaseHolder #ifndef SOS_INCLUDE out +diagnostics\src\shared\inc\predeftlsslot.h - SOS needs all the old enums for older runtimes + +diagnostics\src\shared\utilcode\clrhost_nodependencies.cpp - remove DbgIsExecutable() +diagnostics\src\shared\utilcode\debug.cpp +diagnostics\src\shared\utilcode\ex.cpp +diagnostics\src\shared\utilcode\util_nodependencies.cpp - gone except OutputDebugStringUtf8() +diagnostics\src\shared\utilcode\hostimpl.cpp - remove ClrSleepEx() +diagnostics\src\shared\utilcode\pedecoder.cpp - remove ForceRelocForDLL() + +diagnostics\src\shared\pal\src\debug\debug.cpp - careful merging +diagnostics\src\shared\pal\src\file\directory.cpp - add RemoveDirectoryA for SOS +diagnostics\src\shared\pal\src\handlemgr\handleapi.cpp + +diagnostics\src\shared\pal\src\safecrt\vsprintf.cpp - vsprintf/vsnprintf needed for SOS %S +diagnostics\src\shared\pal\src\safecrt\mbusafecrt.cpp - need _safecrt_cfltcvt for vsprintf/vsnprint support +diagnostics\src\shared\pal\src\safecrt\mbusafecrt_internal.h + +For swprintf/vswprintf support needed by SOS (files not part of the runtime anymore): + +diagnostics/src/shared/pal/src/safecrt/output.inl +diagnostics/src/shared/pal/src/safecrt/safecrt_output_l.cpp +diagnostics/src/shared/pal/src/safecrt/safecrt_output_s.cpp +diagnostics/src/shared/pal/src/safecrt/safecrt_woutput_s.cpp +diagnostics/src/shared/pal/src/safecrt/swprintf.cpp +diagnostics/src/shared/pal/src/safecrt/vswprint.cpp +diagnostics/src/shared/pal/src/safecrt/xtoa_s.cpp +diagnostics/src/shared/pal/src/safecrt/xtow_s.cpp +diagnostics/src/shared/pal/src/safecrt/xtox_s.inl diff --git a/src/shared/clrdefinitions.cmake b/src/shared/clrdefinitions.cmake new file mode 100644 index 0000000000..0a7a73bd4f --- /dev/null +++ b/src/shared/clrdefinitions.cmake @@ -0,0 +1,282 @@ +include(${CMAKE_CURRENT_LIST_DIR}/clrfeatures.cmake) + +add_compile_definitions($<$>:DACCESS_COMPILE>) + +if (CLR_CMAKE_TARGET_ARCH_ARM64) + if (CLR_CMAKE_TARGET_UNIX) + add_definitions(-DFEATURE_EMULATE_SINGLESTEP) + endif() + add_compile_definitions($<$>>:FEATURE_MULTIREG_RETURN>) +elseif (CLR_CMAKE_TARGET_ARCH_ARM) + if (CLR_CMAKE_HOST_WIN32 AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD) + # Set this to ensure we can use Arm SDK for Desktop binary linkage when doing native (Arm32) build + add_definitions(-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE) + add_definitions(-D_ARM_WORKAROUND_) + endif (CLR_CMAKE_HOST_WIN32 AND NOT DEFINED CLR_CROSS_COMPONENTS_BUILD) + add_definitions(-DFEATURE_EMULATE_SINGLESTEP) +elseif (CLR_CMAKE_TARGET_ARCH_RISCV64) + add_definitions(-DFEATURE_EMULATE_SINGLESTEP) + add_compile_definitions($<$>>:FEATURE_MULTIREG_RETURN>) +endif (CLR_CMAKE_TARGET_ARCH_ARM64) + +if (CLR_CMAKE_TARGET_UNIX) + + if (CLR_CMAKE_TARGET_ARCH_AMD64) + add_compile_definitions($<$>>:UNIX_AMD64_ABI>) + add_compile_definitions($<$>>:FEATURE_MULTIREG_RETURN>) + elseif (CLR_CMAKE_TARGET_ARCH_ARM) + add_compile_definitions($<$>>:UNIX_ARM_ABI>) + elseif (CLR_CMAKE_TARGET_ARCH_I386) + add_compile_definitions($<$>>:UNIX_X86_ABI>) + elseif (CLR_CMAKE_TARGET_ARCH_LOONGARCH64) + add_definitions(-DFEATURE_EMULATE_SINGLESTEP) + endif() + +endif(CLR_CMAKE_TARGET_UNIX) + +if (CLR_CMAKE_TARGET_APPLE AND CLR_CMAKE_TARGET_ARCH_ARM64) + add_compile_definitions($<$>>:OSX_ARM64_ABI>) +endif(CLR_CMAKE_TARGET_APPLE AND CLR_CMAKE_TARGET_ARCH_ARM64) + +if(CLR_CMAKE_TARGET_LINUX_MUSL) + # musl-libc doesn't have fixed stack limit, this define disables some stack pointer + # sanity checks in debug / checked build that rely on a fixed stack limit + add_definitions(-DNO_FIXED_STACK_LIMIT) +endif(CLR_CMAKE_TARGET_LINUX_MUSL) + +add_definitions(-DDEBUGGING_SUPPORTED) +add_compile_definitions($<$>>:PROFILING_SUPPORTED>) +add_compile_definitions($<$>:PROFILING_SUPPORTED_DATA>) + +if(CLR_CMAKE_HOST_WIN32) + add_definitions(-DWIN32) + add_definitions(-D_WIN32) + add_definitions(-DWINVER=0x0602) + add_definitions(-D_WIN32_WINNT=0x0602) + add_definitions(-DWIN32_LEAN_AND_MEAN) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_compile_definitions(NOMINMAX) +endif(CLR_CMAKE_HOST_WIN32) + +if (NOT (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX)) + add_compile_definitions(FEATURE_METADATA_UPDATER) +endif() +if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_WIN32)) + add_compile_definitions(FEATURE_REMAP_FUNCTION) +endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_WIN32)) + +if(CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_TARGET_ARCH_AMD64) +add_compile_definitions(OUT_OF_PROCESS_SETTHREADCONTEXT) +endif(CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_TARGET_ARCH_AMD64) + +if(NOT CLR_CMAKE_TARGET_ARCH_I386) + add_definitions(-DFEATURE_PORTABLE_SHUFFLE_THUNKS) +endif() + +if(CLR_CMAKE_TARGET_UNIX OR NOT CLR_CMAKE_TARGET_ARCH_I386) + add_definitions(-DFEATURE_INSTANTIATINGSTUB_AS_IL) +endif() + +add_compile_definitions(FEATURE_CODE_VERSIONING) +add_definitions(-DFEATURE_COLLECTIBLE_TYPES) + +if(CLR_CMAKE_TARGET_WIN32) + add_definitions(-DFEATURE_COMINTEROP) + add_definitions(-DFEATURE_COMINTEROP_APARTMENT_SUPPORT) + add_definitions(-DFEATURE_COMINTEROP_UNMANAGED_ACTIVATION) + add_definitions(-DFEATURE_IJW) # C++/CLI managed/native interop support +endif(CLR_CMAKE_TARGET_WIN32) + +add_definitions(-DFEATURE_BASICFREEZE) +add_definitions(-DFEATURE_CORECLR) +if(FEATURE_DBGIPC) + add_definitions(-DFEATURE_DBGIPC_TRANSPORT_DI) + add_definitions(-DFEATURE_DBGIPC_TRANSPORT_VM) +endif(FEATURE_DBGIPC) +add_definitions(-DFEATURE_DEFAULT_INTERFACES) +if(FEATURE_AUTO_TRACE) + add_compile_definitions(FEATURE_AUTO_TRACE) +endif(FEATURE_AUTO_TRACE) +if(FEATURE_EVENT_TRACE) + add_compile_definitions(FEATURE_EVENT_TRACE) + add_definitions(-DFEATURE_PERFTRACING) +else(FEATURE_EVENT_TRACE) + add_custom_target(eventing_headers) # add a dummy target to avoid checking for FEATURE_EVENT_TRACE in multiple places +endif(FEATURE_EVENT_TRACE) +if(FEATURE_GDBJIT) + add_definitions(-DFEATURE_GDBJIT) +endif() +if(FEATURE_GDBJIT_FRAME) + add_definitions(-DFEATURE_GDBJIT_FRAME) +endif(FEATURE_GDBJIT_FRAME) +if(FEATURE_GDBJIT_LANGID_CS) + add_definitions(-DFEATURE_GDBJIT_LANGID_CS) +endif(FEATURE_GDBJIT_LANGID_CS) +if(FEATURE_GDBJIT_SYMTAB) + add_definitions(-DFEATURE_GDBJIT_SYMTAB) +endif(FEATURE_GDBJIT_SYMTAB) +if(CLR_CMAKE_TARGET_LINUX) + add_definitions(-DFEATURE_EVENTSOURCE_XPLAT) +endif(CLR_CMAKE_TARGET_LINUX) +# NetBSD doesn't implement this feature +if(NOT CLR_CMAKE_TARGET_NETBSD) + add_definitions(-DFEATURE_HIJACK) +endif(NOT CLR_CMAKE_TARGET_NETBSD) +add_definitions(-DFEATURE_ICASTABLE) +if (CLR_CMAKE_TARGET_WIN32 AND (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_ARM64)) + add_definitions(-DFEATURE_INTEROP_DEBUGGING) +endif (CLR_CMAKE_TARGET_WIN32 AND (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_ARM64)) +if(FEATURE_INTERPRETER) + add_compile_definitions(FEATURE_INTERPRETER) +endif(FEATURE_INTERPRETER) + +if (CLR_CMAKE_TARGET_WIN32) + add_definitions(-DFEATURE_ISYM_READER) +endif(CLR_CMAKE_TARGET_WIN32) + +if(FEATURE_MERGE_JIT_AND_ENGINE) + add_compile_definitions($<$>>:FEATURE_MERGE_JIT_AND_ENGINE>) +endif(FEATURE_MERGE_JIT_AND_ENGINE) +add_compile_definitions(FEATURE_MULTICOREJIT) +if(CLR_CMAKE_TARGET_UNIX) + add_definitions(-DFEATURE_PAL_ANSI) +endif(CLR_CMAKE_TARGET_UNIX) +if(CLR_CMAKE_TARGET_LINUX AND CLR_CMAKE_HOST_LINUX) + add_definitions(-DFEATURE_PERFMAP) +endif(CLR_CMAKE_TARGET_LINUX AND CLR_CMAKE_HOST_LINUX) +if(CLR_CMAKE_TARGET_FREEBSD) + add_compile_definitions(FEATURE_PERFMAP) +endif(CLR_CMAKE_TARGET_FREEBSD) +if(CLR_CMAKE_TARGET_APPLE) + add_compile_definitions(FEATURE_PERFMAP) +endif(CLR_CMAKE_TARGET_APPLE) + +if(FEATURE_COMWRAPPERS) + add_compile_definitions(FEATURE_COMWRAPPERS) +endif(FEATURE_COMWRAPPERS) + +if(FEATURE_OBJCMARSHAL) + add_compile_definitions(FEATURE_OBJCMARSHAL) +endif() + +add_compile_definitions($<$>>:FEATURE_PROFAPI_ATTACH_DETACH>) + +add_definitions(-DFEATURE_READYTORUN) + +set(FEATURE_READYTORUN 1) + +add_compile_definitions(FEATURE_REJIT) + +if (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX) + add_definitions(-DFEATURE_REMOTE_PROC_MEM) +endif (CLR_CMAKE_HOST_UNIX AND CLR_CMAKE_TARGET_UNIX) + +if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64) + add_definitions(-DFEATURE_STUBS_AS_IL) +endif () +if (FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION) + add_definitions(-DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION) +endif(FEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION) +add_definitions(-DFEATURE_SVR_GC) +add_definitions(-DFEATURE_SYMDIFF) +add_compile_definitions(FEATURE_TIERED_COMPILATION) +if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64 OR CLR_CMAKE_TARGET_ARCH_RISCV64) + add_compile_definitions(FEATURE_ON_STACK_REPLACEMENT) +endif (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64 OR CLR_CMAKE_TARGET_ARCH_RISCV64) +add_compile_definitions(FEATURE_PGO) +if (CLR_CMAKE_TARGET_WIN32) + add_definitions(-DFEATURE_TYPEEQUIVALENCE) +endif(CLR_CMAKE_TARGET_WIN32) +if (CLR_CMAKE_TARGET_ARCH_AMD64) + # Enable the AMD64 Unix struct passing JIT-EE interface for all AMD64 platforms, to enable altjit. + add_definitions(-DUNIX_AMD64_ABI_ITF) +endif (CLR_CMAKE_TARGET_ARCH_AMD64) +add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS) +if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64 OR CLR_CMAKE_TARGET_ARCH_RISCV64) + add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP) +endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64 OR CLR_CMAKE_TARGET_ARCH_RISCV64) +if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64 OR CLR_CMAKE_TARGET_ARCH_RISCV64) + add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES) +endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_LOONGARCH64 OR CLR_CMAKE_TARGET_ARCH_RISCV64) + +add_definitions(-D_SECURE_SCL=0) +add_definitions(-DUNICODE) +add_definitions(-D_UNICODE) + +if(CLR_CMAKE_TARGET_WIN32) + if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386) + add_definitions(-DFEATURE_DATABREAKPOINT) + endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386) +endif(CLR_CMAKE_TARGET_WIN32) + +if (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT CLR_CMAKE_TARGET_WIN32) + add_compile_definitions($<$>>:FEATURE_EH_FUNCLETS>) +endif (NOT CLR_CMAKE_TARGET_ARCH_I386 OR NOT CLR_CMAKE_TARGET_WIN32) + +if (CLR_CMAKE_TARGET_WIN32 AND (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64)) + add_definitions(-DFEATURE_SPECIAL_USER_MODE_APC) +endif() + + +# Use this function to enable building with a specific target OS and architecture set of defines +# This is known to work for the set of defines used by the JIT and gcinfo, it is not likely correct for +# other components of the runtime +function(set_target_definitions_to_custom_os_and_arch) + set(oneValueArgs TARGET OS ARCH) + cmake_parse_arguments(TARGETDETAILS "" "${oneValueArgs}" "" ${ARGN}) + + set_target_properties(${TARGETDETAILS_TARGET} PROPERTIES IGNORE_DEFAULT_TARGET_ARCH TRUE) + set_target_properties(${TARGETDETAILS_TARGET} PROPERTIES IGNORE_DEFAULT_TARGET_OS TRUE) + + if ((TARGETDETAILS_OS MATCHES "^unix")) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_UNIX) + if (TARGETDETAILS_ARCH STREQUAL "x64") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_AMD64_ABI) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) + elseif ((TARGETDETAILS_ARCH STREQUAL "arm") OR (TARGETDETAILS_ARCH STREQUAL "armel")) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_ARM_ABI) + elseif (TARGETDETAILS_ARCH STREQUAL "x86") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE UNIX_X86_ABI) + elseif (TARGETDETAILS_ARCH STREQUAL "arm64") + elseif (TARGETDETAILS_ARCH STREQUAL "loongarch64") + endif() + if ((TARGETDETAILS_ARCH STREQUAL "arm64") AND (TARGETDETAILS_OS STREQUAL "unix_osx")) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_APPLE) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE OSX_ARM64_ABI) + endif() + if (TARGETDETAILS_OS STREQUAL "unix_osx") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_APPLE) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_OSX) + endif() + if (TARGETDETAILS_OS STREQUAL "unix_anyos") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_UNIX_ANYOS) + endif() + elseif (TARGETDETAILS_OS MATCHES "^win") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_WINDOWS) + endif((TARGETDETAILS_OS MATCHES "^unix")) + + if (TARGETDETAILS_ARCH STREQUAL "x86") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_X86) + elseif(TARGETDETAILS_ARCH STREQUAL "x64") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_AMD64) + elseif(TARGETDETAILS_ARCH STREQUAL "arm64") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM64) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) + elseif(TARGETDETAILS_ARCH STREQUAL "loongarch64") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_LOONGARCH64) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) + elseif((TARGETDETAILS_ARCH STREQUAL "arm") OR (TARGETDETAILS_ARCH STREQUAL "armel")) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM) + elseif((TARGETDETAILS_ARCH STREQUAL "riscv64")) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_RISCV64) + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_MULTIREG_RETURN) + endif() + + if (TARGETDETAILS_ARCH STREQUAL "armel") + target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE ARM_SOFTFP) + endif() +endfunction() diff --git a/src/shared/clrfeatures.cmake b/src/shared/clrfeatures.cmake new file mode 100644 index 0000000000..85752b0d59 --- /dev/null +++ b/src/shared/clrfeatures.cmake @@ -0,0 +1,41 @@ +if(CLR_CMAKE_TARGET_TIZEN_LINUX) + set(FEATURE_GDBJIT_LANGID_CS 1) +endif() + +if(NOT DEFINED FEATURE_EVENT_TRACE) + set(FEATURE_EVENT_TRACE 1) +endif(NOT DEFINED FEATURE_EVENT_TRACE) + +if(NOT DEFINED FEATURE_PERFTRACING AND FEATURE_EVENT_TRACE) + set(FEATURE_PERFTRACING 1) +endif(NOT DEFINED FEATURE_PERFTRACING AND FEATURE_EVENT_TRACE) + +if(NOT DEFINED FEATURE_DBGIPC) + if(CLR_CMAKE_TARGET_UNIX) + set(FEATURE_DBGIPC 1) + endif() +endif(NOT DEFINED FEATURE_DBGIPC) + +if(NOT DEFINED FEATURE_INTERPRETER) + set(FEATURE_INTERPRETER 0) +endif(NOT DEFINED FEATURE_INTERPRETER) + +if(NOT DEFINED FEATURE_STANDALONE_GC) + set(FEATURE_STANDALONE_GC 1) +endif(NOT DEFINED FEATURE_STANDALONE_GC) + +if(NOT DEFINED FEATURE_AUTO_TRACE) + set(FEATURE_AUTO_TRACE 0) +endif(NOT DEFINED FEATURE_AUTO_TRACE) + +if(NOT DEFINED FEATURE_SINGLE_FILE_DIAGNOSTICS) + set(FEATURE_SINGLE_FILE_DIAGNOSTICS 1) +endif(NOT DEFINED FEATURE_SINGLE_FILE_DIAGNOSTICS) + +if (CLR_CMAKE_TARGET_WIN32 OR CLR_CMAKE_TARGET_UNIX) + set(FEATURE_COMWRAPPERS 1) +endif() + +if (CLR_CMAKE_TARGET_APPLE) + set(FEATURE_OBJCMARSHAL 1) +endif() diff --git a/src/shared/debug/CMakeLists.txt b/src/shared/debug/CMakeLists.txt new file mode 100644 index 0000000000..d5d439b465 --- /dev/null +++ b/src/shared/debug/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(dbgutil) diff --git a/src/shared/dbgutil/CMakeLists.txt b/src/shared/debug/dbgutil/CMakeLists.txt similarity index 95% rename from src/shared/dbgutil/CMakeLists.txt rename to src/shared/debug/dbgutil/CMakeLists.txt index d3fe2c6c6d..b2f7bdc5a8 100644 --- a/src/shared/dbgutil/CMakeLists.txt +++ b/src/shared/debug/dbgutil/CMakeLists.txt @@ -9,8 +9,6 @@ if(CLR_CMAKE_HOST_WIN32 OR CLR_CMAKE_HOST_OSX) include_directories(${CLR_SHARED_DIR}/inc/llvm) endif(CLR_CMAKE_HOST_WIN32 OR CLR_CMAKE_HOST_OSX) -add_definitions(-DPAL_STDCPP_COMPAT) - if(CLR_CMAKE_TARGET_LINUX_MUSL) add_definitions(-DTARGET_LINUX_MUSL) endif(CLR_CMAKE_TARGET_LINUX_MUSL) diff --git a/src/shared/dbgutil/dbgutil.cpp b/src/shared/debug/dbgutil/dbgutil.cpp similarity index 73% rename from src/shared/dbgutil/dbgutil.cpp rename to src/shared/debug/dbgutil/dbgutil.cpp index 984834b46c..91235f40e7 100644 --- a/src/shared/dbgutil/dbgutil.cpp +++ b/src/shared/debug/dbgutil/dbgutil.cpp @@ -15,110 +15,125 @@ #include "corerror.h" #include #include +#include +#include +#include "corhlpr.h" #ifdef HOST_WINDOWS -// Returns the RVA of the resource section for the module specified by the given data target and module base. -// Returns failure if the module doesn't have a resource section. -// -// Arguments -// pDataTarget - dataTarget for the process we are inspecting -// moduleBaseAddress - base address of a module we should inspect -// pwImageFileMachine - updated with the Machine from the IMAGE_FILE_HEADER -// pdwResourceSectionRVA - updated with the resultant RVA on success -HRESULT GetMachineAndResourceSectionRVA(ICorDebugDataTarget* pDataTarget, - ULONG64 moduleBaseAddress, - WORD* pwImageFileMachine, - DWORD* pdwResourceSectionRVA) +namespace { - // Fun code ahead... below is a hand written PE decoder with some of the file offsets hardcoded. - // It supports no more than what we absolutely have to to get to the resources we need. Any of the - // magic numbers used below can be determined by using the public documentation on the web. - // - // Yes utilcode has a PE decoder, no it does not support reading its data through a datatarget - // It was easier to inspect the small portion that I needed than to shove an abstraction layer under - // our utilcode and then make sure everything still worked. - - // SECURITY WARNING: all data provided by the data target should be considered untrusted. - // Do not allow malicious data to cause large reads, memory allocations, buffer overflow, - // or any other undesirable behavior. - - HRESULT hr = S_OK; - - // at offset 3c in the image is a 4 byte file pointer that indicates where the PE signature is - IMAGE_DOS_HEADER dosHeader; - hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress, (BYTE*)&dosHeader, sizeof(dosHeader)); - - // verify there is a 4 byte PE signature there - DWORD peSigFilePointer = 0; - if (SUCCEEDED(hr)) + HRESULT GetMachineAndDirectoryAddress(ICorDebugDataTarget* dataTarget, + ULONG64 moduleBaseAddress, + uint8_t imageDirectory, + WORD* imageFileMachine, + DWORD* directoryRVA) { - peSigFilePointer = dosHeader.e_lfanew; - DWORD peSig = 0; - hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + peSigFilePointer, (BYTE*)&peSig, 4); - if (SUCCEEDED(hr) && peSig != IMAGE_NT_SIGNATURE) + // Fun code ahead... below is a hand written PE decoder with some of the file offsets hardcoded. + // It supports no more than what we absolutely have to get to the PE directory we need. Any of the + // magic numbers used below can be determined by using the public documentation on the web. + // + // Yes utilcode has a PE decoder, no it does not support reading its data through a datatarget + // It was easier to inspect the small portion that I needed than to shove an abstraction layer under + // our utilcode and then make sure everything still worked. + + // SECURITY WARNING: all data provided by the data target should be considered untrusted. + // Do not allow malicious data to cause large reads, memory allocations, buffer overflow, + // or any other undesirable behavior. + + HRESULT hr = S_OK; + + // at offset 3c in the image is a 4 byte file pointer that indicates where the PE signature is + IMAGE_DOS_HEADER dosHeader; + hr = ReadFromDataTarget(dataTarget, moduleBaseAddress, (BYTE*)&dosHeader, sizeof(dosHeader)); + + // verify there is a 4 byte PE signature there + DWORD peSigFilePointer = 0; + if (SUCCEEDED(hr)) { - hr = E_FAIL; // PE signature not present + peSigFilePointer = dosHeader.e_lfanew; + DWORD peSig = 0; + hr = ReadFromDataTarget(dataTarget, moduleBaseAddress + peSigFilePointer, (BYTE*)&peSig, 4); + if (SUCCEEDED(hr) && peSig != IMAGE_NT_SIGNATURE) + { + hr = E_FAIL; // PE signature not present + } } - } - // after the signature is a 20 byte image file header - // we need to parse this to figure out the target architecture - IMAGE_FILE_HEADER imageFileHeader = {}; - if (SUCCEEDED(hr)) - { - hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + peSigFilePointer + 4, (BYTE*)&imageFileHeader, IMAGE_SIZEOF_FILE_HEADER); - } - - WORD optHeaderMagic = 0; - DWORD peOptImageHeaderFilePointer = 0; - if (SUCCEEDED(hr)) - { - if(pwImageFileMachine != NULL) + // after the signature is a 20 byte image file header + // we need to parse this to figure out the target architecture + IMAGE_FILE_HEADER imageFileHeader = {}; + if (SUCCEEDED(hr)) { - *pwImageFileMachine = imageFileHeader.Machine; + hr = ReadFromDataTarget(dataTarget, moduleBaseAddress + peSigFilePointer + 4, (BYTE*)&imageFileHeader, IMAGE_SIZEOF_FILE_HEADER); } - // 4 bytes after the signature is the 20 byte image file header - // 24 bytes after the signature is the image-only header - // at the beginning of the image-only header is a 2 byte magic number indicating its format - peOptImageHeaderFilePointer = peSigFilePointer + IMAGE_SIZEOF_FILE_HEADER + sizeof(DWORD); - hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + peOptImageHeaderFilePointer, (BYTE*)&optHeaderMagic, 2); - } - - // Either 112 or 128 bytes after the beginning of the image-only header is an 8 byte resource table - // depending on whether the image is PE32 or PE32+ - DWORD resourceSectionRVA = 0; - if (SUCCEEDED(hr)) - { - if (optHeaderMagic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) // PE32 + WORD optHeaderMagic = 0; + DWORD peOptImageHeaderFilePointer = 0; + if (SUCCEEDED(hr)) { - IMAGE_OPTIONAL_HEADER32 header32; - hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + peOptImageHeaderFilePointer, - (BYTE*)&header32, sizeof(header32)); - if (SUCCEEDED(hr)) + if(imageFileMachine != NULL) { - resourceSectionRVA = header32.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress; + *imageFileMachine = imageFileHeader.Machine; } + + // 4 bytes after the signature is the 20 byte image file header + // 24 bytes after the signature is the image-only header + // at the beginning of the image-only header is a 2 byte magic number indicating its format + peOptImageHeaderFilePointer = peSigFilePointer + IMAGE_SIZEOF_FILE_HEADER + sizeof(DWORD); + hr = ReadFromDataTarget(dataTarget, moduleBaseAddress + peOptImageHeaderFilePointer, (BYTE*)&optHeaderMagic, 2); } - else if (optHeaderMagic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) //PE32+ + + // Either 112 or 128 bytes after the beginning of the image-only header is an 8 byte resource table + // depending on whether the image is PE32 or PE32+ + DWORD sectionRVA = 0; + if (SUCCEEDED(hr)) { - IMAGE_OPTIONAL_HEADER64 header64; - hr = ReadFromDataTarget(pDataTarget, moduleBaseAddress + peOptImageHeaderFilePointer, - (BYTE*)&header64, sizeof(header64)); - if (SUCCEEDED(hr)) + if (optHeaderMagic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) // PE32 { - resourceSectionRVA = header64.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress; + IMAGE_OPTIONAL_HEADER32 header32; + hr = ReadFromDataTarget(dataTarget, moduleBaseAddress + peOptImageHeaderFilePointer, + (BYTE*)&header32, sizeof(header32)); + if (SUCCEEDED(hr)) + { + sectionRVA = header32.DataDirectory[imageDirectory].VirtualAddress; + } + } + else if (optHeaderMagic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) //PE32+ + { + IMAGE_OPTIONAL_HEADER64 header64; + hr = ReadFromDataTarget(dataTarget, moduleBaseAddress + peOptImageHeaderFilePointer, + (BYTE*)&header64, sizeof(header64)); + if (SUCCEEDED(hr)) + { + sectionRVA = header64.DataDirectory[imageDirectory].VirtualAddress; + } + } + else + { + hr = E_FAIL; // Invalid PE } } - else - { - hr = E_FAIL; // Invalid PE - } + + *directoryRVA = sectionRVA; + return hr; } +} - *pdwResourceSectionRVA = resourceSectionRVA; - return S_OK; +// Returns the RVA of the resource section for the module specified by the given data target and module base. +// Returns failure if the module doesn't have a resource section. +// +// Arguments +// pDataTarget - dataTarget for the process we are inspecting +// moduleBaseAddress - base address of a module we should inspect +// pwImageFileMachine - updated with the Machine from the IMAGE_FILE_HEADER +// pdwResourceSectionRVA - updated with the resultant RVA on success +HRESULT GetMachineAndResourceSectionRVA(ICorDebugDataTarget* pDataTarget, + ULONG64 moduleBaseAddress, + WORD* pwImageFileMachine, + DWORD* pdwResourceSectionRVA) +{ + return GetMachineAndDirectoryAddress(pDataTarget, moduleBaseAddress, IMAGE_DIRECTORY_ENTRY_RESOURCE, pwImageFileMachine, pdwResourceSectionRVA); } HRESULT GetResourceRvaFromResourceSectionRva(ICorDebugDataTarget* pDataTarget, @@ -238,7 +253,7 @@ HRESULT GetResourceRvaFromResourceSectionRvaByName(ICorDebugDataTarget* pDataTar // pNextLevelRVA - out - The RVA for the next level tree directory or the RVA of the resource entry // // Returns: -// S_OK if succesful or an appropriate failing HRESULT +// S_OK if successful or an appropriate failing HRESULT HRESULT GetNextLevelResourceEntryRVA(ICorDebugDataTarget* pDataTarget, DWORD id, ULONG64 moduleBaseAddress, @@ -305,7 +320,7 @@ HRESULT GetNextLevelResourceEntryRVA(ICorDebugDataTarget* pDataTarget, // pNextLevelRVA - out - The RVA for the next level tree directory or the RVA of the resource entry // // Returns: -// S_OK if succesful or an appropriate failing HRESULT +// S_OK if successful or an appropriate failing HRESULT HRESULT GetNextLevelResourceEntryRVAByName(ICorDebugDataTarget* pDataTarget, LPCWSTR pwzName, ULONG64 moduleBaseAddress, @@ -314,7 +329,7 @@ HRESULT GetNextLevelResourceEntryRVAByName(ICorDebugDataTarget* pDataTarget, DWORD* pNextLevelRva) { HRESULT hr = S_OK; - DWORD nameLength = (DWORD)wcslen(pwzName); + DWORD nameLength = (DWORD)u16_strlen(pwzName); WCHAR entryName[50]; assert(nameLength < 50); // this implementation won't support matching a name longer // than 50 characters. We only look up the hard coded name @@ -424,4 +439,4 @@ HRESULT ReadFromDataTarget(ICorDebugDataTarget* pDataTarget, } return hr; -} \ No newline at end of file +} diff --git a/src/shared/dbgutil/dbgutil.vcxproj b/src/shared/debug/dbgutil/dbgutil.vcxproj similarity index 100% rename from src/shared/dbgutil/dbgutil.vcxproj rename to src/shared/debug/dbgutil/dbgutil.vcxproj diff --git a/src/shared/debug/dbgutil/dbgutil.vcxproj.user b/src/shared/debug/dbgutil/dbgutil.vcxproj.user new file mode 100644 index 0000000000..88a550947e --- /dev/null +++ b/src/shared/debug/dbgutil/dbgutil.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/shared/dbgutil/elfreader.cpp b/src/shared/debug/dbgutil/elfreader.cpp similarity index 96% rename from src/shared/dbgutil/elfreader.cpp rename to src/shared/debug/dbgutil/elfreader.cpp index 4b5f7347e3..b537b4e283 100644 --- a/src/shared/dbgutil/elfreader.cpp +++ b/src/shared/debug/dbgutil/elfreader.cpp @@ -46,7 +46,7 @@ class ElfReaderFromFile : public ElfReader uint64_t End; uint64_t FileOffset; }; - PAL_FILE* m_file; + FILE* m_file; std::vector m_programHeaders; public: @@ -59,7 +59,7 @@ class ElfReaderFromFile : public ElfReader { if (m_file != NULL) { - PAL_fclose(m_file); + fclose(m_file); m_file = NULL; } } @@ -103,11 +103,11 @@ class ElfReaderFromFile : public ElfReader { return false; } - if (PAL_fseek(m_file, (LONG_PTR)address, SEEK_SET) != 0) + if (fseek(m_file, (LONG_PTR)address, SEEK_SET) != 0) { return false; } - size_t read = PAL_fread(buffer, 1, size, m_file); + size_t read = fread(buffer, 1, size, m_file); return read > 0; } }; @@ -238,11 +238,11 @@ class ElfReaderExport : public ElfReader extern "C" bool TryGetSymbol(ICorDebugDataTarget* dataTarget, uint64_t baseAddress, const char* symbolName, uint64_t* symbolAddress) { - ElfReaderExport reader(dataTarget); - if (reader.PopulateForSymbolLookup(baseAddress)) + ElfReaderExport elfreader(dataTarget); + if (elfreader.PopulateForSymbolLookup(baseAddress)) { uint64_t symbolOffset; - if (reader.TryLookupSymbol(symbolName, &symbolOffset)) + if (elfreader.TryLookupSymbol(symbolName, &symbolOffset)) { *symbolAddress = baseAddress + symbolOffset; return true; @@ -294,7 +294,7 @@ ElfReader::~ElfReader() // // Initialize the ELF reader from a module the base address. This function -// caches the info neccessary in the ElfReader class look up symbols. +// caches the info necessary in the ElfReader class look up symbols. // bool ElfReader::PopulateForSymbolLookup(uint64_t baseAddress) @@ -306,11 +306,12 @@ ElfReader::PopulateForSymbolLookup(uint64_t baseAddress) // Enumerate program headers searching for the PT_DYNAMIC header, etc. if (!EnumerateProgramHeaders( baseAddress, -#ifdef TARGET_LINUX_MUSL - // On linux-musl, the below dynamic entries for hash, string table, etc. are - // RVAs instead of absolute address like on all other Linux distros. Get - // the "loadbias" (basically the base address of the module) and add to - // these RVAs. +#if defined(TARGET_LINUX_MUSL) || defined(TARGET_RISCV64) + // On musl based platforms (Alpine) and RISCV64 (VisionFive2 board), + // the below dynamic entries for hash, + // string table, etc. are RVAs instead of absolute address like on all + // other Linux distros. Get the "loadbias" (basically the base address + // of the module) and add to these RVAs. &loadbias, #else nullptr, diff --git a/src/shared/dbgutil/elfreader.h b/src/shared/debug/dbgutil/elfreader.h similarity index 100% rename from src/shared/dbgutil/elfreader.h rename to src/shared/debug/dbgutil/elfreader.h diff --git a/src/shared/dbgutil/machoreader.cpp b/src/shared/debug/dbgutil/machoreader.cpp similarity index 91% rename from src/shared/dbgutil/machoreader.cpp rename to src/shared/debug/dbgutil/machoreader.cpp index a5b4434789..89bf9ff26c 100644 --- a/src/shared/dbgutil/machoreader.cpp +++ b/src/shared/debug/dbgutil/machoreader.cpp @@ -27,7 +27,7 @@ class MachOReaderFromFile : public MachOReader { private: - PAL_FILE* m_file; + FILE* m_file; public: MachOReaderFromFile() : @@ -52,11 +52,11 @@ class MachOReaderFromFile : public MachOReader { return false; } - if (PAL_fseek(m_file, (LONG)(intptr_t)address, SEEK_SET) != 0) + if (fseek(m_file, (LONG)(intptr_t)address, SEEK_SET) != 0) { return false; } - size_t read = PAL_fread(buffer, 1, size, m_file); + size_t read = fread(buffer, 1, size, m_file); return read > 0; } }; @@ -523,43 +523,25 @@ MachOReader::MachOReader() } bool -MachOReader::EnumerateModules(mach_vm_address_t address, mach_header_64* header) +MachOReader::EnumerateModules(mach_vm_address_t dyldInfoAddress) { - _ASSERTE(header->magic == MH_MAGIC_64); - _ASSERTE(header->filetype == MH_DYLINKER); - - MachOModule dylinker(*this, false, address, header); - - // Search for symbol for the dyld image info cache - uint64_t dyldInfoAddress = 0; - if (!dylinker.TryLookupSymbol("dyld_all_image_infos", &dyldInfoAddress)) - { - Trace("ERROR: Can not find the _dyld_all_image_infos symbol\n"); - return false; - } - // Read the all image info from the dylinker image dyld_all_image_infos dyldInfo; - if (!ReadMemory((void*)dyldInfoAddress, &dyldInfo, sizeof(dyld_all_image_infos))) { Trace("ERROR: Failed to read dyld_all_image_infos at %p\n", (void*)dyldInfoAddress); return false; } - std::string dylinkerPath; - if (!ReadString(dyldInfo.dyldPath, dylinkerPath)) + Trace("MOD: infoArray %p infoArrayCount %d\n", dyldInfo.infoArray, dyldInfo.infoArrayCount); + + // Create the dyld module info + if (!TryRegisterModule(dyldInfo.dyldImageLoadAddress, dyldInfo.dyldPath, true)) { - Trace("ERROR: Failed to read name at %p\n", dyldInfo.dyldPath); + Trace("ERROR: Failed to read dyld header at %p\n", dyldInfo.dyldImageLoadAddress); return false; } - dylinker.SetName(dylinkerPath); - Trace("MOD: %016llx %08x %s\n", dylinker.BaseAddress(), dylinker.Header().flags, dylinker.Name().c_str()); - VisitModule(dylinker); - void* imageInfosAddress = (void*)dyldInfo.infoArray; size_t imageInfosSize = dyldInfo.infoArrayCount * sizeof(dyld_image_info); - Trace("MOD: infoArray %p infoArrayCount %d\n", dyldInfo.infoArray, dyldInfo.infoArrayCount); - ArrayHolder imageInfos = new (std::nothrow) dyld_image_info[dyldInfo.infoArrayCount]; if (imageInfos == nullptr) { @@ -573,22 +555,39 @@ MachOReader::EnumerateModules(mach_vm_address_t address, mach_header_64* header) } for (int i = 0; i < dyldInfo.infoArrayCount; i++) { - mach_vm_address_t imageAddress = (mach_vm_address_t)imageInfos[i].imageLoadAddress; - const char* imageFilePathAddress = imageInfos[i].imageFilePath; + // Ignore any errors and continue to next module + TryRegisterModule(imageInfos[i].imageLoadAddress, imageInfos[i].imageFilePath, false); + } + return true; +} - std::string imagePath; - if (!ReadString(imageFilePathAddress, imagePath)) - { - Trace("ERROR: Failed to read image name at %p\n", imageFilePathAddress); - continue; - } - MachOModule module(*this, false, imageAddress, nullptr, &imagePath); - if (!module.ReadHeader()) +bool +MachOReader::TryRegisterModule(const struct mach_header* imageAddress, const char* imageFilePathAddress, bool dylinker) +{ + std::string imagePath; + if (!ReadString(imageFilePathAddress, imagePath)) + { + return false; + } + + MachOModule module(*this, false, (mach_vm_address_t)imageAddress, nullptr, &imagePath); + if (!module.ReadHeader()) + { + return false; + } + Trace("MOD: %016llx %08x %s\n", imageAddress, module.Header().flags, imagePath.c_str()); + VisitModule(module); + if (dylinker) + { + // Make sure the memory for the symbol and string tables are in the core dump for our + // dump readers which still use this symbol to enumerate modules. + uint64_t dyldInfoAddress = 0; + if (!module.TryLookupSymbol("dyld_all_image_infos", &dyldInfoAddress)) { - continue; + Trace("ERROR: Can not find the _dyld_all_image_infos symbol\n"); + return false; } - Trace("MOD: %016llx %08x %s\n", imageAddress, module.Header().flags, imagePath.c_str()); - VisitModule(module); + Trace("MOD: dyldInfoAddress %016llx\n", dyldInfoAddress); } return true; } @@ -611,4 +610,4 @@ MachOReader::ReadString(const char* address, std::string& str) str.append(1, c); } return true; -} \ No newline at end of file +} diff --git a/src/shared/dbgutil/machoreader.h b/src/shared/debug/dbgutil/machoreader.h similarity index 92% rename from src/shared/dbgutil/machoreader.h rename to src/shared/debug/dbgutil/machoreader.h index 2492705c15..861469084c 100644 --- a/src/shared/dbgutil/machoreader.h +++ b/src/shared/debug/dbgutil/machoreader.h @@ -57,9 +57,10 @@ class MachOReader friend MachOModule; public: MachOReader(); - bool EnumerateModules(mach_vm_address_t address, mach_header_64* header); + bool EnumerateModules(mach_vm_address_t dyldInfoAddress); private: + bool TryRegisterModule(const struct mach_header* imageAddress, const char* imageFilePathAddress, bool dylinker); bool ReadString(const char* address, std::string& str); virtual void VisitModule(MachOModule& module) { }; virtual void VisitSegment(MachOModule& module, const segment_command_64& segment) { }; diff --git a/src/shared/inc/dbgtargetcontext.h b/src/shared/debug/inc/dbgtargetcontext.h similarity index 80% rename from src/shared/inc/dbgtargetcontext.h rename to src/shared/debug/inc/dbgtargetcontext.h index 4970caed05..dab7ca29c7 100644 --- a/src/shared/inc/dbgtargetcontext.h +++ b/src/shared/debug/inc/dbgtargetcontext.h @@ -11,7 +11,7 @@ // // The right side of the debugger can be built to target multiple platforms. This means it is not // safe to use the CONTEXT structure directly: the context of the platform we're building for might not match -// that of the one the debugger is targetting. So all right side code will use the DT_CONTEXT abstraction +// that of the one the debugger is targeting. So all right side code will use the DT_CONTEXT abstraction // instead. When the debugger target is the local platform this will just resolve back into CONTEXT, but cross // platform we'll provide a hand-rolled version. // @@ -25,20 +25,26 @@ // ByteSwapContext. // -// -// **** NOTE: Keep these in sync with pal/inc/pal.h **** -// +// **** +// **** NOTE: T_CONTEXT (in pal/inc/pal.h) can now be larger than DT_CONTEXT (currently T_CONTEXT on Linux/MacOS +// **** x64 includes the XSTATE registers). This means the following: +// **** +// **** 1) The DBI/DAC APIs cannot assume that incoming context buffers are T_CONTEXT sized. +// **** 2) When the DAC calls the supplied data target's context APIs, the size of the context buffer must +// **** be the size of the DT_CONTEXT for compatiblity. +// **** 3) DBI/DAC code can not cast and copy from a T_CONTEXT into a DT_CONTEXT buffer. +// **** // This odd define pattern is needed because in DBI we set _TARGET_ to match the host and // DBG_TARGET to control our targeting. In x-plat DBI DBG_TARGET won't match _TARGET_ and // DBG_TARGET needs to take precedence -#if defined(DBG_TARGET_X86) +#if defined(TARGET_X86) #define DTCONTEXT_IS_X86 -#elif defined (DBG_TARGET_AMD64) +#elif defined (TARGET_AMD64) #define DTCONTEXT_IS_AMD64 -#elif defined (DBG_TARGET_ARM) +#elif defined (TARGET_ARM) #define DTCONTEXT_IS_ARM -#elif defined (DBG_TARGET_ARM64) +#elif defined (TARGET_ARM64) #define DTCONTEXT_IS_ARM64 #elif defined (TARGET_X86) #define DTCONTEXT_IS_X86 @@ -48,10 +54,14 @@ #define DTCONTEXT_IS_ARM #elif defined (TARGET_ARM64) #define DTCONTEXT_IS_ARM64 +#elif defined (TARGET_LOONGARCH64) +#define DTCONTEXT_IS_LOONGARCH64 #elif defined (TARGET_RISCV64) #define DTCONTEXT_IS_RISCV64 #endif +#define CONTEXT_AREA_MASK 0xffff + #if defined(DTCONTEXT_IS_X86) #define DT_SIZE_OF_80387_REGISTERS 80 @@ -116,6 +126,8 @@ typedef struct { } DT_CONTEXT; +static_assert(sizeof(DT_CONTEXT) == sizeof(T_CONTEXT), "DT_CONTEXT size must equal the T_CONTEXT size on X86"); + // Since the target is little endian in this case we only have to provide a real implementation of // ByteSwapContext if the platform we're building on is big-endian. #ifdef BIGENDIAN @@ -278,6 +290,12 @@ typedef struct DECLSPEC_ALIGN(16) { DWORD64 LastExceptionFromRip; } DT_CONTEXT; +#if !defined(CROSS_COMPILE) && !defined(TARGET_WINDOWS) +static_assert(sizeof(DT_CONTEXT) == offsetof(T_CONTEXT, XStateFeaturesMask), "DT_CONTEXT must not include the XSTATE registers on AMD64"); +#else +static_assert(sizeof(DT_CONTEXT) == sizeof(T_CONTEXT), "DT_CONTEXT size must equal the T_CONTEXT size on AMD64"); +#endif + #elif defined(DTCONTEXT_IS_ARM) #define DT_CONTEXT_ARM 0x00200000L @@ -293,6 +311,7 @@ typedef struct DECLSPEC_ALIGN(16) { #define DT_ARM_MAX_BREAKPOINTS 8 #define DT_ARM_MAX_WATCHPOINTS 1 + typedef struct { ULONGLONG Low; LONGLONG High; @@ -358,6 +377,8 @@ typedef DECLSPEC_ALIGN(8) struct { } DT_CONTEXT; +static_assert(sizeof(DT_CONTEXT) == sizeof(T_CONTEXT), "DT_CONTEXT size must equal the T_CONTEXT size on ARM32"); + #elif defined(DTCONTEXT_IS_ARM64) #define DT_CONTEXT_ARM64 0x00400000L @@ -449,6 +470,82 @@ typedef DECLSPEC_ALIGN(16) struct { } DT_CONTEXT; + +#if !defined(CROSS_COMPILE) && !defined(TARGET_WINDOWS) +static_assert(sizeof(DT_CONTEXT) == offsetof(T_CONTEXT, XStateFeaturesMask), "DT_CONTEXT must not include the SVE registers on AMD64"); +#else +static_assert(sizeof(DT_CONTEXT) == sizeof(T_CONTEXT), "DT_CONTEXT size must equal the T_CONTEXT size on ARM64"); +#endif + +#elif defined(DTCONTEXT_IS_LOONGARCH64) + +#define DT_CONTEXT_LOONGARCH64 0x00800000L + +#define DT_CONTEXT_CONTROL (DT_CONTEXT_LOONGARCH64 | 0x1L) +#define DT_CONTEXT_INTEGER (DT_CONTEXT_LOONGARCH64 | 0x2L) +#define DT_CONTEXT_FLOATING_POINT (DT_CONTEXT_LOONGARCH64 | 0x4L) +#define DT_CONTEXT_DEBUG_REGISTERS (DT_CONTEXT_LOONGARCH64 | 0x8L) + +#define DT_CONTEXT_FULL (DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER | DT_CONTEXT_FLOATING_POINT) +#define DT_CONTEXT_ALL (DT_CONTEXT_CONTROL | DT_CONTEXT_INTEGER | DT_CONTEXT_FLOATING_POINT | DT_CONTEXT_DEBUG_REGISTERS) + +#define DT_LOONGARCH64_MAX_BREAKPOINTS 8 +#define DT_LOONGARCH64_MAX_WATCHPOINTS 2 + +typedef struct DECLSPEC_ALIGN(16) { + // + // Control flags. + // + + /* +0x000 */ DWORD ContextFlags; + + // + // Integer registers + // + DWORD64 R0; + DWORD64 Ra; + DWORD64 Tp; + DWORD64 Sp; + DWORD64 A0; + DWORD64 A1; + DWORD64 A2; + DWORD64 A3; + DWORD64 A4; + DWORD64 A5; + DWORD64 A6; + DWORD64 A7; + DWORD64 T0; + DWORD64 T1; + DWORD64 T2; + DWORD64 T3; + DWORD64 T4; + DWORD64 T5; + DWORD64 T6; + DWORD64 T7; + DWORD64 T8; + DWORD64 X0; + DWORD64 Fp; + DWORD64 S0; + DWORD64 S1; + DWORD64 S2; + DWORD64 S3; + DWORD64 S4; + DWORD64 S5; + DWORD64 S6; + DWORD64 S7; + DWORD64 S8; + DWORD64 Pc; + + // + // Floating Point Registers: FPR64/LSX/LASX. + // + ULONGLONG F[4*32]; + DWORD64 Fcc; + DWORD Fcsr; +} DT_CONTEXT; + +static_assert(sizeof(DT_CONTEXT) == sizeof(T_CONTEXT), "DT_CONTEXT size must equal the T_CONTEXT size"); + #elif defined(DTCONTEXT_IS_RISCV64) #define DT_CONTEXT_RISCV64 0x01000000L @@ -521,5 +618,4 @@ static_assert(sizeof(DT_CONTEXT) == sizeof(T_CONTEXT), "DT_CONTEXT size must equ #error Unsupported platform #endif - #endif // __DBG_TARGET_CONTEXT_INCLUDED diff --git a/src/shared/inc/dbgutil.h b/src/shared/debug/inc/dbgutil.h similarity index 96% rename from src/shared/inc/dbgutil.h rename to src/shared/debug/inc/dbgutil.h index 2120cf0dfb..ed34de6d35 100644 --- a/src/shared/inc/dbgutil.h +++ b/src/shared/debug/inc/dbgutil.h @@ -58,7 +58,7 @@ HRESULT GetResourceRvaFromResourceSectionRvaByName(ICorDebugDataTarget* pDataTar // pNextLevelRVA - out - The RVA for the next level tree directory or the RVA of the resource entry // // Returns: -// S_OK if succesful or an appropriate failing HRESULT +// S_OK if successful or an appropriate failing HRESULT HRESULT GetNextLevelResourceEntryRVA(ICorDebugDataTarget* pDataTarget, DWORD id, ULONG64 moduleBaseAddress, @@ -77,7 +77,7 @@ HRESULT GetNextLevelResourceEntryRVA(ICorDebugDataTarget* pDataTarget, // pNextLevelRVA - out - The RVA for the next level tree directory or the RVA of the resource entry // // Returns: -// S_OK if succesful or an appropriate failing HRESULT +// S_OK if successful or an appropriate failing HRESULT HRESULT GetNextLevelResourceEntryRVAByName(ICorDebugDataTarget* pDataTarget, LPCWSTR pwzName, ULONG64 moduleBaseAddress, diff --git a/src/shared/inc/dumpcommon.h b/src/shared/debug/inc/dump/dumpcommon.h similarity index 100% rename from src/shared/inc/dumpcommon.h rename to src/shared/debug/inc/dump/dumpcommon.h diff --git a/src/shared/inc/runtimeinfo.h b/src/shared/debug/inc/runtimeinfo.h similarity index 89% rename from src/shared/inc/runtimeinfo.h rename to src/shared/debug/inc/runtimeinfo.h index ef493ff386..456ee0cc58 100644 --- a/src/shared/inc/runtimeinfo.h +++ b/src/shared/debug/inc/runtimeinfo.h @@ -5,7 +5,8 @@ // The first byte of the index is the count of bytes typedef unsigned char SYMBOL_INDEX; -#define RUNTIME_INFO_SIGNATURE "DotNetRuntimeInfo" +#define RUNTIME_INFO_SIGNATURE "DotNetRuntimeInfo" +#define RUNTIME_INFO_VERSION 2 // Make sure that if you update this structure // - You do so in a in a way that it is backwards compatible. For example, only tail append to this. diff --git a/src/shared/inc/resource.h b/src/shared/dlls/mscorrc/resource.h similarity index 91% rename from src/shared/inc/resource.h rename to src/shared/dlls/mscorrc/resource.h index 7a8f148456..24e82ff5af 100644 --- a/src/shared/inc/resource.h +++ b/src/shared/dlls/mscorrc/resource.h @@ -24,8 +24,6 @@ // Resource strings for MDA descriptions. //----------------------------------------------------------------------------- -#define MDARC_DEBUGGER_FIBER_MODE_NOT_SUPPORTED 0x1934 - #define IDS_RTL 0x01F5 #define IDS_DS_ACTIVESESSIONS 0x1701 @@ -48,7 +46,6 @@ #define IDS_EE_LOAD_BAD_MAIN_SIG 0x1712 #define IDS_EE_COM_UNSUPPORTED_TYPE 0x1713 -#define IDS_EE_NOTNDIRECT 0x1719 #define IDS_EE_RETHROW_NOT_ALLOWED 0x171d #define IDS_EE_INVALID_OLE_VARIANT 0x171e @@ -126,7 +123,7 @@ #define IDS_CLASSLOAD_BADFORMAT 0x1774 #define IDS_CLASSLOAD_BYREFARRAY 0x1775 #define IDS_CLASSLOAD_BYREFLIKEARRAY 0x1776 -#define IDS_CLASSLOAD_MISSINGMETHOD 0x1777 +#define IDS_CLASSLOAD_VOIDARRAY 0x1777 #define IDS_CLASSLOAD_STATICVIRTUAL 0x1778 #define IDS_CLASSLOAD_REDUCEACCESS 0x1779 #define IDS_CLASSLOAD_BADPINVOKE 0x177a @@ -170,25 +167,27 @@ #define IDS_CLASSLOAD_MI_BADRETURNTYPE 0x17a8 #define IDS_CLASSLOAD_STATICVIRTUAL_NOTIMPL 0x17a9 +#define IDS_INVALID_RECURSIVE_GENERIC_FIELD_LOAD 0x17aa #define IDS_CLASSLOAD_TOOMANYGENERICARGS 0x17ab -#define IDS_ERROR 0x17b0 -#define IDS_DEBUG_SERVICE_CAPTION 0x17b4 + +#define IDS_CLASSLOAD_INLINE_ARRAY_FIELD_COUNT 0x17ac +#define IDS_CLASSLOAD_INLINE_ARRAY_LENGTH 0x17ad +#define IDS_CLASSLOAD_INLINE_ARRAY_EXPLICIT 0x17ae + +#define IDS_CLASSLOAD_BYREF_OF_BYREF 0x17af +#define IDS_CLASSLOAD_POINTER_OF_BYREF 0x17b0 + #define IDS_DEBUG_USERBREAKPOINT 0x17b6 -#define IDS_DEBUG_UNHANDLEDEXCEPTION 0x17b7 -#define IDS_DEBUG_UNHANDLEDEXCEPTION_IPC 0x17b8 + #define IDS_PERFORMANCEMON_FUNCNOTFOUND 0x17bb #define IDS_PERFORMANCEMON_FUNCNOTFOUND_TITLE 0x17bc #define IDS_PERFORMANCEMON_PSAPINOTFOUND 0x17bd #define IDS_PERFORMANCEMON_PSAPINOTFOUND_TITLE 0x17be -#define IDS_DEBUG_UNHANDLED_EXCEPTION_MSG 0x17c0 -#define IDS_DEBUG_USER_BREAKPOINT_MSG 0x17c1 - #define IDS_INVALID_REDIM 0x17c3 #define IDS_INVALID_PINVOKE_CALLCONV 0x17c4 #define IDS_CLASSLOAD_NSTRUCT_EXPLICIT_OFFSET 0x17c7 #define IDS_EE_BADPINVOKEFIELD_NOTMARSHALABLE 0x17c9 -#define IDS_WRONGSIZEARRAY_IN_NSTRUCT 0x17ca #define IDS_EE_INVALIDLCIDPARAM 0x17cd #define IDS_EE_BADMARSHAL_NESTEDARRAY 0x17ce @@ -196,16 +195,13 @@ #define IDS_EE_CANNOT_COERCE_BYREF_VARIANT 0x17d2 #define IDS_EE_WRAPPER_MUST_HAVE_DEF_CONS 0x17d3 #define IDS_EE_INVALID_STD_DISPID_NAME 0x17d4 -#define IDS_EE_NO_IDISPATCH_ON_TARGET 0x17d5 + #define IDS_EE_NON_STD_NAME_WITH_STD_DISPID 0x17d6 #define IDS_EE_INVOKE_NEW_ENUM_INVALID_RETURN 0x17d7 #define IDS_EE_COM_OBJECT_RELEASE_RACE 0x17d8 #define IDS_EE_COM_OBJECT_NO_LONGER_HAS_WRAPPER 0x17d9 -#define IDS_EE_CALLBACK_NOT_CALLED_FROM_CCTOR 0x17da -#define IDS_EE_CALLBACK_ALREADY_REGISTERED 0x17de #define IDS_EE_NDIRECT_BADNATL_CALLCONV 0x17df #define IDS_EE_CANNOTCAST 0x17e0 -#define IDS_EE_NOTISOMORPHIC 0x17e1 #define IDS_EE_NOCUSTOMMARSHALER 0x17e7 #define IDS_EE_SIZECONTROLOUTOFRANGE 0x17e8 @@ -214,32 +210,23 @@ #define IDS_EE_INVALID_VT_FOR_CUSTOM_MARHALER 0x17ec #define IDS_EE_BAD_COMEXTENDS_CLASS 0x17ed -#define IDS_EE_ERRORTITLE 0x17f0 -#define IDS_EE_ERRORMESSAGETEMPLATE 0x17f1 - #define IDS_EE_LOCAL_COGETCLASSOBJECT_FAILED 0x17f5 #define IDS_EE_MISSING_FIELD 0x17f7 #define IDS_EE_MISSING_METHOD 0x17f8 -#define IDS_EE_INTERFACE_NOT_DISPATCH_BASED 0x17f9 - #define IDS_EE_UNHANDLED_EXCEPTION 0x17fc #define IDS_EE_EXCEPTION_TOSTRING_FAILED 0x17fd #define IDS_CLASSLOAD_EQUIVALENTSTRUCTMETHODS 0x17fe #define IDS_CLASSLOAD_EQUIVALENTSTRUCTFIELDS 0x17ff -#define IDS_EE_NO_IDISPATCH 0x1a02 - - #define IDS_EE_SIGTOOCOMPLEX 0x1a03 #define IDS_EE_STRUCTTOOCOMPLEX 0x1a04 #define IDS_EE_STRUCTARRAYTOOLARGE 0x1a05 #define IDS_EE_BADMARSHALFIELD_NOSTRINGBUILDER 0x1a06 -#define IDS_EE_NAME_UNKNOWN 0x1a07 + #define IDS_EE_NO_BACKING_CLASS_FACTORY 0x1a0b -#define IDS_EE_NAME_UNKNOWN_UNQ 0x1a0c #define IDS_EE_STRING_TOOLONG 0x1a0d #define IDS_EE_VARARG_NOT_SUPPORTED 0x1a0f @@ -254,9 +241,6 @@ #define IDS_EE_METHOD_NOT_FOUND_ON_EV_PROV 0x1a24 #define IDS_EE_BAD_COMEVENTITF_CLASS 0x1a25 -#define IDS_EE_COREXEMAIN2_FAILED_TITLE 0x1a2b -#define IDS_EE_COREXEMAIN2_FAILED_TEXT 0x1a2c - #define IDS_EE_ICUSTOMMARSHALERNOTIMPL 0x1a2e #define IDS_EE_GETINSTANCENOTIMPL 0x1a2f @@ -276,9 +260,6 @@ #define IDS_EE_BADMARSHAL_RETURNSHCOMTONATIVE 0x1a3c #define IDS_EE_BADMARSHAL_SAFEHANDLE 0x1a3d -#define IDS_EE_SAFEHANDLECLOSED 0x1a3f -#define IDS_EE_SAFEHANDLECANNOTSETHANDLE 0x1a40 - #define IDS_EE_BADMARSHAL_ABSTRACTRETSAFEHANDLE 0x1a44 #define IDS_EE_SH_IN_VARIANT_NOT_SUPPORTED 0x1a47 @@ -298,6 +279,7 @@ #define IDS_EE_BADMARSHAL_ABSTRACTOUTCRITICALHANDLE 0x1a63 #define IDS_EE_BADMARSHAL_RETURNCHCOMTONATIVE 0x1a64 #define IDS_EE_BADMARSHAL_CRITICALHANDLE 0x1a65 +#define IDS_EE_BADMARSHAL_INT128_RESTRICTION 0x1a66 #define IDS_EE_BADMARSHAL_ABSTRACTRETCRITICALHANDLE 0x1a6a #define IDS_EE_CH_IN_VARIANT_NOT_SUPPORTED 0x1a6b @@ -320,9 +302,7 @@ #define IDS_CLASSLOAD_OVERLAPPING_INTERFACES 0x1a80 #define IDS_CLASSLOAD_32BITCLRLOADING64BITASSEMBLY 0x1a81 -#define IDS_EE_ASSEMBLY_GETTYPE_CANNONT_HAVE_ASSEMBLY_SPEC 0x1a84 -#define IDS_EE_CANNOT_HAVE_ASSEMBLY_SPEC 0x1a86 #define IDS_EE_NEEDS_ASSEMBLY_SPEC 0x1a87 #define IDS_EE_FILELOAD_ERROR_GENERIC 0x1a88 @@ -365,15 +345,10 @@ #define IDS_EE_OUT_OF_SYNCBLOCKS 0x1aae #define IDS_CLASSLOAD_MI_CANNOT_OVERRIDE 0x1ab3 -#define IDS_CLASSLOAD_COLLECTIBLEFIXEDVTATTR 0x1ab6 #define IDS_CLASSLOAD_EQUIVALENTBADTYPE 0x1ab7 #define IDS_EE_CODEEXECUTION_CONTAINSGENERICVAR 0x1abb #define IDS_CLASSLOAD_WRONGCPU 0x1abc -#define IDS_EE_CREATEINSTANCEFROMAPP_FAILED 0x1abd -#define IDS_IBC_MISSING_EXTERNAL_TYPE 0x1ac5 -#define IDS_IBC_MISSING_EXTERNAL_METHOD 0x1ac6 -#define IDS_EE_HWINTRINSIC_NGEN_DISALLOWED 0x1ac7 #define IDS_CLASSLOAD_MI_FINAL_IMPL 0x1ac8 #define IDS_CLASSLOAD_AMBIGUOUS_OVERRIDE 0x1ac9 #define IDS_CLASSLOAD_UNSUPPORTED_DISPATCH 0x1aca @@ -442,16 +417,15 @@ #define BFA_BAD_SIGNATURE 0x2044 #define BFA_TYPEREG_NAME_TOO_LONG 0x2045 #define BFA_BAD_TYPEREF_TOKEN 0x2046 -#define BFA_BAD_CLASS_INT_CA 0x2047 #define BFA_BAD_CLASS_INT_CA_FORMAT 0x2048 #define BFA_BAD_COMPLUS_SIG 0x2049 #define BFA_BAD_ELEM_IN_SIZEOF 0x204b #define BFA_IJW_IN_COLLECTIBLE_ALC 0x204c +#define BFA_INVALID_UNSAFEACCESSOR 0x204d #define IDS_CLASSLOAD_INTERFACE_NO_ACCESS 0x204f #define BFA_BAD_CA_HEADER 0x2050 -#define BFA_BAD_STRING_TOKEN 0x2052 #define BFA_BAD_STRING_TOKEN_RANGE 0x2053 #define BFA_FIXUP_WRONG_PLATFORM 0x2054 #define BFA_UNEXPECTED_GENERIC_TOKENTYPE 0x2055 @@ -461,7 +435,6 @@ #define BFA_UNEXPECTED_ARRAY_TYPE 0x2059 #define BFA_BAD_VISIBILITY 0x205a #define BFA_FAMILY_ON_GLOBAL 0x205b -#define BFA_NOFIND_EXPORTED_TYPE 0x205c #define BFA_NOT_AN_ARRAY 0x205d #define BFA_EXPECTED_METHODDEF_OR_MEMBERREF 0x205e @@ -502,8 +475,8 @@ #define IDS_ER_STACK_OVERFLOW 0x208a #define IDS_ER_STACK 0x208b #define IDS_ER_WORDAT 0x208c -#define IDS_ER_UNMANAGEDFAILFASTMSG 0x208d -#define IDS_ER_UNHANDLEDEXCEPTIONINFO 0x208e + + #define IDS_ER_MESSAGE_TRUNCATE 0x208f #define IDS_EE_OBJECT_TO_VARIANT_NOT_SUPPORTED 0x2090 @@ -512,8 +485,6 @@ #define IDS_EE_BADMARSHALFIELD_DECIMAL 0x2099 #define IDS_EE_CANNOTCASTSAME 0x209a -#define IDS_EE_CANNOTCAST_HELPER_BYTE 0x209b -#define IDS_EE_CANNOTCAST_HELPER_PATH 0x209c // For ForwardInteropStubAttribute #ifdef FEATURE_COMINTEROP @@ -524,8 +495,6 @@ #define IDS_EE_INTEROP_STUB_CA_NO_ACCESS_TO_STUB_METHOD 0x2111 #endif -#define IDS_EE_INTEROP_CODE_SIZE_COMMENT 0x2112 - #define BFA_REFERENCE_ASSEMBLY 0x2113 #define IDS_E_FIELDACCESS 0x2114 @@ -568,12 +537,11 @@ #define IDS_HOST_ASSEMBLY_RESOLVER_ASSEMBLY_ALREADY_LOADED_IN_CONTEXT 0x2636 #define IDS_HOST_ASSEMBLY_RESOLVER_DYNAMICALLY_EMITTED_ASSEMBLIES_UNSUPPORTED 0x2637 -#define IDS_HOST_ASSEMBLY_RESOLVER_INCOMPATIBLE_BINDING_CONTEXT 0x2638 #define IDS_NATIVE_IMAGE_CANNOT_BE_LOADED_MULTIPLE_TIMES 0x263a -#define IDS_CLASSLOAD_BYREFLIKE_STATICFIELD 0x263b -#define IDS_CLASSLOAD_BYREFLIKE_INSTANCEFIELD 0x263c +#define IDS_CLASSLOAD_BYREF_OR_BYREFLIKE_STATICFIELD 0x263b +#define IDS_CLASSLOAD_BYREF_OR_BYREFLIKE_INSTANCEFIELD 0x263c #define IDS_EE_NDIRECT_LOADLIB_LINUX 0x263e #define IDS_EE_NDIRECT_LOADLIB_MAC 0x263f #define IDS_EE_NDIRECT_GETPROCADDRESS_UNIX 0x2640 diff --git a/src/shared/inc/gcdesc.h b/src/shared/gc/gcdesc.h similarity index 97% rename from src/shared/inc/gcdesc.h rename to src/shared/gc/gcdesc.h index 2a9ca3529d..6c3b86af8b 100644 --- a/src/shared/inc/gcdesc.h +++ b/src/shared/gc/gcdesc.h @@ -160,7 +160,9 @@ class CGCDesc { // If it doesn't contain pointers, there isn't a GCDesc PTR_MethodTable mt(pMT); - +#ifndef SOS_INCLUDE + _ASSERTE(mt->ContainsGCPointers()); +#endif return PTR_CGCDesc(mt); } @@ -193,7 +195,7 @@ class CGCDesc { size_t NumOfPointers = 0; - if (pMT->ContainsPointers()) + if (pMT->ContainsGCPointers()) { CGCDesc* map = GetCGCDescFromMT(pMT); CGCDescSeries* cur = map->GetHighestSeries(); @@ -214,14 +216,14 @@ class CGCDesc /* Handle the repeating case - array of valuetypes */ for (ptrdiff_t __i = 0; __i > cnt; __i--) { - NumOfPointers += cur->val_serie[__i].nptrs; + NumOfPointers += (cur->val_serie + __i)->nptrs; } NumOfPointers *= NumComponents; } } -#ifndef FEATURE_REDHAWK +#ifndef FEATURE_NATIVEAOT if (pMT->Collectible()) { NumOfPointers += 1; diff --git a/src/shared/gcdump/gcdump.cpp b/src/shared/gcdump/gcdump.cpp index 2ce81887f3..8575619db9 100644 --- a/src/shared/gcdump/gcdump.cpp +++ b/src/shared/gcdump/gcdump.cpp @@ -10,6 +10,9 @@ * to the standard code-manager spec. */ +#if !defined(TARGET_UNIX) && !defined(SOS_INCLUDE) +#include "utilcode.h" // For _ASSERTE() +#endif #include "gcdump.h" /*****************************************************************************/ diff --git a/src/shared/gcdump/gcdump.vcxproj b/src/shared/gcdump/gcdump.vcxproj index 298ca74072..e48980a465 100644 --- a/src/shared/gcdump/gcdump.vcxproj +++ b/src/shared/gcdump/gcdump.vcxproj @@ -21,8 +21,6 @@ - - diff --git a/src/shared/gcdump/gcdump.vcxproj.filters b/src/shared/gcdump/gcdump.vcxproj.filters index 142ddad450..365bd29d6e 100644 --- a/src/shared/gcdump/gcdump.vcxproj.filters +++ b/src/shared/gcdump/gcdump.vcxproj.filters @@ -11,7 +11,5 @@ - - \ No newline at end of file diff --git a/src/shared/gcdump/gcdumpnonx86.cpp b/src/shared/gcdump/gcdumpnonx86.cpp index 2492c4d29e..919bf60d88 100644 --- a/src/shared/gcdump/gcdumpnonx86.cpp +++ b/src/shared/gcdump/gcdumpnonx86.cpp @@ -69,7 +69,45 @@ PCSTR GetRegName (UINT32 regnum) static CHAR szRegName[16]; _snprintf_s(szRegName, ARRAY_SIZE(szRegName), sizeof(szRegName), "r%u", regnum); return szRegName; +#elif defined(TARGET_LOONGARCH64) + switch (regnum) + { + case 0: return "r0"; + case 1: return "ra"; + case 2: return "tp"; + case 3: return "sp"; + case 4: return "a0"; + case 5: return "a1"; + case 6: return "a2"; + case 7: return "a3"; + case 8: return "a4"; + case 9: return "a5"; + case 10: return "a6"; + case 11: return "a7"; + case 12: return "t0"; + case 13: return "t1"; + case 14: return "t2"; + case 15: return "t3"; + case 16: return "t4"; + case 17: return "t5"; + case 18: return "t6"; + case 19: return "t7"; + case 20: return "t8"; + case 21: return "x0"; + case 22: return "fp"; + case 23: return "s0"; + case 24: return "s1"; + case 25: return "s2"; + case 26: return "s3"; + case 27: return "s4"; + case 28: return "s5"; + case 29: return "s6"; + case 30: return "s7"; + case 31: return "s8"; + case 32: return "pc"; + } + return "???"; #elif defined(TARGET_RISCV64) switch (regnum) { @@ -324,14 +362,13 @@ size_t GCDump::DumpGCTable(PTR_CBYTE gcInfoBlock, | DECODE_GC_LIFETIMES | DECODE_PROLOG_LENGTH | DECODE_RETURN_KIND -#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) | DECODE_HAS_TAILCALLS #endif ), 0); - if (NO_SECURITY_OBJECT != hdrdecoder.GetSecurityObjectStackSlot() || - NO_GENERICS_INST_CONTEXT != hdrdecoder.GetGenericsInstContextStackSlot() || + if (NO_GENERICS_INST_CONTEXT != hdrdecoder.GetGenericsInstContextStackSlot() || NO_GS_COOKIE == hdrdecoder.GetGSCookieStackSlot()) { gcPrintf("Prolog size: "); @@ -339,25 +376,6 @@ size_t GCDump::DumpGCTable(PTR_CBYTE gcInfoBlock, gcPrintf("%d\n", prologSize); } - gcPrintf("Security object: "); - if (NO_SECURITY_OBJECT == hdrdecoder.GetSecurityObjectStackSlot()) - { - gcPrintf("\n"); - } - else - { - INT32 ofs = hdrdecoder.GetSecurityObjectStackSlot(); - char sign = '+'; - - if (ofs < 0) - { - sign = '-'; - ofs = -ofs; - } - - gcPrintf("caller.sp%c%x\n", sign, ofs); - } - gcPrintf("GS cookie: "); if (NO_GS_COOKIE == hdrdecoder.GetGSCookieStackSlot()) { @@ -477,7 +495,7 @@ size_t GCDump::DumpGCTable(PTR_CBYTE gcInfoBlock, #ifdef TARGET_AMD64 gcPrintf("Wants Report Only Leaf: %u\n", hdrdecoder.WantsReportOnlyLeaf()); -#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) gcPrintf("Has tailcalls: %u\n", hdrdecoder.HasTailCalls()); #endif // TARGET_AMD64 #ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA @@ -569,5 +587,5 @@ void GCDump::DumpPtrsInFrame(PTR_CBYTE gcInfoBlock, #define GET_CALLER_SP(pREGDISPLAY) ((size_t)GetSP(pREGDISPLAY->pCallerContext)) #define VALIDATE_OBJECTREF(objref, fDeep) ((void)0) #define VALIDATE_ROOT(isInterior, hCallBack, pObjRef) ((void)0) -#include "gcinfodecoder.cpp" -#include "gcinfodumper.cpp" +#include "../vm/gcinfodecoder.cpp" +#include "../gcinfo/gcinfodumper.cpp" diff --git a/src/shared/gcdump/i386/gcdumpx86.cpp b/src/shared/gcdump/i386/gcdumpx86.cpp index 58fc79c3f8..680504db6f 100644 --- a/src/shared/gcdump/i386/gcdumpx86.cpp +++ b/src/shared/gcdump/i386/gcdumpx86.cpp @@ -8,6 +8,9 @@ #ifdef TARGET_X86 /*****************************************************************************/ +#if !defined(TARGET_UNIX) && !defined(SOS_INCLUDE) +#include "utilcode.h" // For _ASSERTE() +#endif #include "gcdump.h" @@ -36,7 +39,7 @@ const char * RegName(unsigned reg) "EDI" }; - _ASSERTE(reg < ARRAY_SIZE(regNames)); + _ASSERTE(reg < (sizeof(regNames)/sizeof(regNames[0]))); return regNames[reg]; } @@ -51,7 +54,7 @@ const char * CalleeSavedRegName(unsigned reg) "EBP" }; - _ASSERTE(reg < ARRAY_SIZE(regNames)); + _ASSERTE(reg < (sizeof(regNames)/sizeof(regNames[0]))); return regNames[reg]; } @@ -151,7 +154,8 @@ size_t GCDump::DumpInfoHdr (PTR_CBYTE gcInfoBlock, gcPrintf(" GuardStack cookie = [%s%u]\n", header->ebpFrame ? "EBP-" : "ESP+", header->gsCookieOffset); if (header->syncStartOffset != INVALID_SYNC_OFFSET) - gcPrintf(" Sync region = [%u,%u]\n", + gcPrintf(" Sync region = [%u,%u] ([0x%x,0x%x])\n", + header->syncStartOffset, header->syncEndOffset, header->syncStartOffset, header->syncEndOffset); if (header->epilogCount > 1 || (header->epilogCount != 0 && @@ -452,10 +456,10 @@ size_t GCDump::DumpGCTable(PTR_CBYTE table, /* non-ptr arg push */ curOffs += (val & 0x07); -#ifndef UNIX_X86_ABI - // For x86/Linux, non-ptr arg pushes can be reported even for EBP frames +#ifndef FEATURE_EH_FUNCLETS + // For funclets, non-ptr arg pushes can be reported even for EBP frames _ASSERTE(!header.ebpFrame); -#endif // UNIX_X86_ABI +#endif // FEATURE_EH_FUNCLETS argCnt++; DumpEncoding(bp, table-bp); bp = table; @@ -830,10 +834,7 @@ size_t GCDump::DumpGCTable(PTR_CBYTE table, if (callPndTab) { -#if defined(_DEBUG) && !defined(STRIKE) - // note: _ASSERTE is a no-op for strike PTR_CBYTE offsStart = table; -#endif gcPrintf(" argOffs(%d) =", callPndTabCnt); for (unsigned i=0; i < callPndTabCnt; i++) { diff --git a/src/shared/gcdump/gcinfodumper.cpp b/src/shared/gcinfo/gcinfodumper.cpp similarity index 83% rename from src/shared/gcdump/gcinfodumper.cpp rename to src/shared/gcinfo/gcinfodumper.cpp index f7b483be3d..99ef186d38 100644 --- a/src/shared/gcdump/gcinfodumper.cpp +++ b/src/shared/gcinfo/gcinfodumper.cpp @@ -1,6 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +#ifndef SOS_INCLUDE +#include "common.h" +#endif #include "gcinfodumper.h" #include "gcinfodecoder.h" @@ -40,7 +43,7 @@ size_t GcInfoDumper::GetGCInfoSize() //static* void GcInfoDumper::LivePointerCallback ( LPVOID hCallback, // callback data - OBJECTREF* pObject, // address of obect-reference we are reporting + OBJECTREF* pObject, // address of object-reference we are reporting uint32_t flags // is this a pinned and/or interior pointer DAC_ARG(DacSlotLocation loc)) // the location of the slot { @@ -107,7 +110,7 @@ BOOL GcInfoDumper::ReportPointerRecord ( }; static RegisterInfo rgRegisters[] = { -#define REG(reg, field) { FIELD_OFFSET(T_CONTEXT, field) } +#define REG(reg, field) { offsetof(T_CONTEXT, field) } #ifdef TARGET_AMD64 REG(rax, Rax), @@ -128,13 +131,13 @@ BOOL GcInfoDumper::ReportPointerRecord ( REG(r15, R15), #elif defined(TARGET_ARM) #undef REG -#define REG(reg, field) { FIELD_OFFSET(ArmVolatileContextPointer, field) } +#define REG(reg, field) { offsetof(ArmVolatileContextPointer, field) } REG(r0, R0), REG(r1, R1), REG(r2, R2), REG(r3, R3), #undef REG -#define REG(reg, field) { FIELD_OFFSET(T_KNONVOLATILE_CONTEXT_POINTERS, field) } +#define REG(reg, field) { offsetof(T_KNONVOLATILE_CONTEXT_POINTERS, field) } REG(r4, R4), REG(r5, R5), REG(r6, R6), @@ -143,14 +146,14 @@ BOOL GcInfoDumper::ReportPointerRecord ( REG(r9, R9), REG(r10, R10), REG(r11, R11), - { FIELD_OFFSET(ArmVolatileContextPointer, R12) }, - { FIELD_OFFSET(T_CONTEXT, Sp) }, - { FIELD_OFFSET(T_KNONVOLATILE_CONTEXT_POINTERS, Lr) }, - { FIELD_OFFSET(T_CONTEXT, Sp) }, - { FIELD_OFFSET(T_KNONVOLATILE_CONTEXT_POINTERS, R7) }, + { offsetof(ArmVolatileContextPointer, R12) }, + { offsetof(T_CONTEXT, Sp) }, + { offsetof(T_KNONVOLATILE_CONTEXT_POINTERS, Lr) }, + { offsetof(T_CONTEXT, Sp) }, + { offsetof(T_KNONVOLATILE_CONTEXT_POINTERS, R7) }, #elif defined(TARGET_ARM64) #undef REG -#define REG(reg, field) { FIELD_OFFSET(Arm64VolatileContextPointer, field) } +#define REG(reg, field) { offsetof(Arm64VolatileContextPointer, field) } REG(x0, X0), REG(x1, X1), REG(x2, X2), @@ -170,7 +173,7 @@ BOOL GcInfoDumper::ReportPointerRecord ( REG(x16, X16), REG(x17, X17), #undef REG -#define REG(reg, field) { FIELD_OFFSET(T_KNONVOLATILE_CONTEXT_POINTERS, field) } +#define REG(reg, field) { offsetof(T_KNONVOLATILE_CONTEXT_POINTERS, field) } REG(x19, X19), REG(x20, X20), REG(x21, X21), @@ -183,15 +186,53 @@ BOOL GcInfoDumper::ReportPointerRecord ( REG(x28, X28), REG(Fp, Fp), REG(Lr, Lr), - { FIELD_OFFSET(T_CONTEXT, Sp) }, + { offsetof(T_CONTEXT, Sp) }, +#undef REG +#elif defined(TARGET_LOONGARCH64) +#undef REG +#define REG(reg, field) { offsetof(T_KNONVOLATILE_CONTEXT_POINTERS, field) } +#define vREG(reg, field) { offsetof(LoongArch64VolatileContextPointer, field) } + vREG(zero, R0), + REG(ra, Ra), + REG(tp, Tp), + { offsetof(T_CONTEXT, Sp) }, + vREG(a0, A0), + vREG(a1, A1), + vREG(a2, A2), + vREG(a3, A3), + vREG(a4, A4), + vREG(a5, A5), + vREG(a6, A6), + vREG(a7, A7), + vREG(t0, T0), + vREG(t1, T1), + vREG(t2, T2), + vREG(t3, T3), + vREG(t4, T4), + vREG(t5, T5), + vREG(t6, T6), + vREG(t7, T7), + vREG(t8, T8), + vREG(x0, X0), + REG(fp, Fp), + REG(s0, S0), + REG(s1, S1), + REG(s2, S2), + REG(s3, S3), + REG(s4, S4), + REG(s5, S5), + REG(s6, S6), + REG(s7, S7), + REG(s8, S8), +#undef vREG #undef REG #elif defined(TARGET_RISCV64) #undef REG -#define REG(reg, field) { FIELD_OFFSET(T_KNONVOLATILE_CONTEXT_POINTERS, field) } -#define vREG(reg, field) { FIELD_OFFSET(RiscV64VolatileContextPointer, field) } +#define REG(reg, field) { offsetof(T_KNONVOLATILE_CONTEXT_POINTERS, field) } +#define vREG(reg, field) { offsetof(RiscV64VolatileContextPointer, field) } vREG(zero, R0), REG(Ra, Ra), - { FIELD_OFFSET(T_CONTEXT, Sp) }, + { offsetof(T_CONTEXT, Sp) }, REG(Gp, Gp), REG(Tp, Tp), vREG(t0, T0), @@ -229,22 +270,28 @@ PORTABILITY_ASSERT("GcInfoDumper::ReportPointerRecord is not implemented on this }; + const UINT nCONTEXTRegisters = sizeof(rgRegisters)/sizeof(rgRegisters[0]); + UINT iFirstRegister; UINT iSPRegister; + UINT nRegisters; iFirstRegister = 0; + nRegisters = nCONTEXTRegisters; #ifdef TARGET_AMD64 - iSPRegister = (FIELD_OFFSET(CONTEXT, Rsp) - FIELD_OFFSET(CONTEXT, Rax)) / sizeof(ULONGLONG); + iSPRegister = (offsetof(CONTEXT, Rsp) - offsetof(CONTEXT, Rax)) / sizeof(ULONGLONG); #elif defined(TARGET_ARM64) - iSPRegister = (FIELD_OFFSET(T_CONTEXT, Sp) - FIELD_OFFSET(T_CONTEXT, X0)) / sizeof(ULONGLONG); + iSPRegister = (offsetof(T_CONTEXT, Sp) - offsetof(T_CONTEXT, X0)) / sizeof(ULONGLONG); #elif defined(TARGET_ARM) - iSPRegister = (FIELD_OFFSET(T_CONTEXT, Sp) - FIELD_OFFSET(T_CONTEXT, R0)) / sizeof(ULONG); + iSPRegister = (offsetof(T_CONTEXT, Sp) - offsetof(T_CONTEXT, R0)) / sizeof(ULONG); UINT iBFRegister = m_StackBaseRegister; +#elif defined(TARGET_LOONGARCH64) + iSPRegister = (offsetof(T_CONTEXT, Sp) - offsetof(T_CONTEXT, R0)) / sizeof(ULONGLONG); #elif defined(TARGET_RISCV64) - iSPRegister = (FIELD_OFFSET(T_CONTEXT, Sp) - FIELD_OFFSET(T_CONTEXT, R0)) / sizeof(ULONGLONG); + iSPRegister = (offsetof(T_CONTEXT, Sp) - offsetof(T_CONTEXT, R0)) / sizeof(ULONGLONG); #endif -#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) BYTE* pContext = (BYTE*)&(pRD->volatileCurrContextPointers); #else BYTE* pContext = (BYTE*)pRD->pCurrentContext; @@ -254,7 +301,7 @@ PORTABILITY_ASSERT("GcInfoDumper::ReportPointerRecord is not implemented on this { SIZE_T *pReg = NULL; - for (UINT iReg = 0; iReg < ARRAY_SIZE(rgRegisters); iReg++) + for (UINT iReg = 0; iReg < nRegisters; iReg++) { UINT iEncodedReg = iFirstRegister + iReg; #ifdef TARGET_ARM @@ -312,6 +359,19 @@ PORTABILITY_ASSERT("GcInfoDumper::ReportPointerRecord is not implemented on this { break; } +#elif defined(TARGET_LOONGARCH64) + bool isVolatile = (iReg == 0 || (iReg >= 4 && iReg <= 21)); + if (ctx == 0) + { + if (!isVolatile) + { + continue; + } + } + else if (isVolatile) // skip volatile registers for second context + { + continue; + } #elif defined(TARGET_RISCV64) bool isVolatile = (iReg == 0 || (iReg >= 5 && iReg <= 7) || (iReg >= 10 && iReg <= 17) || iReg >= 28); if (ctx == 0) @@ -327,7 +387,7 @@ PORTABILITY_ASSERT("GcInfoDumper::ReportPointerRecord is not implemented on this } #endif { - _ASSERTE(iReg < ARRAY_SIZE(rgRegisters)); + _ASSERTE(iReg < nCONTEXTRegisters); #ifdef TARGET_ARM pReg = *(SIZE_T**)(pContext + rgRegisters[iReg].cbContextOffset); if (iEncodedReg == 12) @@ -343,7 +403,7 @@ PORTABILITY_ASSERT("GcInfoDumper::ReportPointerRecord is not implemented on this pReg = *(SIZE_T**)((BYTE*)pRD->pCurrentContextPointers + rgRegisters[iEncodedReg].cbContextOffset); } -#elif defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#elif defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) pReg = *(SIZE_T**)(pContext + rgRegisters[iReg].cbContextOffset); if (iEncodedReg == iSPRegister) { @@ -416,14 +476,14 @@ PORTABILITY_ASSERT("GcInfoDumper::ReportPointerRecord is not implemented on this GcStackSlotBase base; if (iSPRegister == iEncodedReg) { -#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) base = GC_SP_REL; #else if (0 == ctx) base = GC_SP_REL; else base = GC_CALLER_SP_REL; -#endif //defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#endif //defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) } else { @@ -445,7 +505,7 @@ PORTABILITY_ASSERT("GcInfoDumper::ReportPointerRecord is not implemented on this } } -#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) pContext = (BYTE*)pRD->pCurrentContextPointers; #else pContext = (BYTE*)pRD->pCallerContext; @@ -650,6 +710,37 @@ GcInfoDumper::EnumerateStateChangesResults GcInfoDumper::EnumerateStateChanges ( { *(ppVolatileReg+iReg) = ®disp.pCurrentContext->X0 + iReg; } +#elif defined(TARGET_LOONGARCH64) + FILL_REGS(pCurrentContext->R0, 33); + FILL_REGS(pCallerContext->R0, 33); + + regdisp.pCurrentContextPointers = ®disp.ctxPtrsOne; + regdisp.pCallerContextPointers = ®disp.ctxPtrsTwo; + + ULONG64 **ppCurrentReg = ®disp.pCurrentContextPointers->S0; + ULONG64 **ppCallerReg = ®disp.pCallerContextPointers->S0; + + // Set S0-S8 + for (iReg = 0; iReg < 9; iReg++) + { + *(ppCurrentReg + iReg) = ®disp.pCurrentContext->S0 + iReg; + *(ppCallerReg + iReg) = ®disp.pCallerContext->S0 + iReg; + } + + // Set Ra, Tp, Fp + regdisp.pCurrentContextPointers->Ra = ®disp.pCurrentContext->Ra; + regdisp.pCallerContextPointers->Ra = ®disp.pCallerContext->Ra; + regdisp.pCurrentContextPointers->Tp = ®disp.pCurrentContext->Tp; + regdisp.pCallerContextPointers->Tp = ®disp.pCallerContext->Tp; + regdisp.pCurrentContextPointers->Fp = ®disp.pCurrentContext->Fp; + regdisp.pCallerContextPointers->Fp = ®disp.pCallerContext->Fp; + + ULONG64 **ppVolatileReg = ®disp.volatileCurrContextPointers.A0; + for (iReg = 0; iReg < 18; iReg++) + { + *(ppVolatileReg+iReg) = ®disp.pCurrentContext->A0 + iReg; + } + regdisp.volatileCurrContextPointers.R0 = ®disp.pCurrentContext->R0; #elif defined(TARGET_RISCV64) FILL_REGS(pCurrentContext->R0, 33); FILL_REGS(pCallerContext->R0, 33); @@ -703,7 +794,7 @@ GcInfoDumper::EnumerateStateChangesResults GcInfoDumper::EnumerateStateChanges ( regdisp.volatileCurrContextPointers.T5 = ®disp.pCurrentContext->T5; regdisp.volatileCurrContextPointers.T6 = ®disp.pCurrentContext->T6; #else -PORTABILITY_ASSERT("GcInfoDumper::EnumerateStateChanges is not implemented on this platform.") +PORTABILITY_ASSERT("GcInfoDumper::EnumerateStateChanges is not implemented on this platform."); #endif #undef FILL_REGS @@ -749,9 +840,9 @@ PORTABILITY_ASSERT("GcInfoDumper::EnumerateStateChanges is not implemented on th (GcInfoDecoderFlags)( DECODE_SECURITY_OBJECT | DECODE_CODE_LENGTH | DECODE_VARARG -#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) | DECODE_HAS_TAILCALLS -#endif // TARGET_ARM || TARGET_ARM64 || TARGET_RISCV64 +#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64 || TARGET_RISCV64 | DECODE_INTERRUPTIBILITY), offset); @@ -770,7 +861,7 @@ PORTABILITY_ASSERT("GcInfoDumper::EnumerateStateChanges is not implemented on th #ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED UINT32 safePointOffset = offset; -#if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) safePointOffset++; #endif if(safePointDecoder.IsSafePoint(safePointOffset)) diff --git a/src/shared/inc/coreclrhost.h b/src/shared/hosts/inc/coreclrhost.h similarity index 90% rename from src/shared/inc/coreclrhost.h rename to src/shared/hosts/inc/coreclrhost.h index 46a3119d62..01eeac600a 100644 --- a/src/shared/inc/coreclrhost.h +++ b/src/shared/hosts/inc/coreclrhost.h @@ -47,6 +47,24 @@ CORECLR_HOSTING_API(coreclr_initialize, void** hostHandle, unsigned int* domainId); +// +// Type of the callback function that can be set by the coreclr_set_error_writer +// +typedef void (*coreclr_error_writer_callback_fn) (const char *message); + +// +// Set callback for writing error logging +// +// Parameters: +// errorWriter - callback that will be called for each line of the error info +// - passing in NULL removes a callback that was previously set +// +// Returns: +// S_OK +// +CORECLR_HOSTING_API(coreclr_set_error_writer, + coreclr_error_writer_callback_fn errorWriter); + // // Shutdown CoreCLR. It unloads the app domain and stops the CoreCLR host. // diff --git a/src/shared/inc/CMakeLists.txt b/src/shared/inc/CMakeLists.txt index 057306a18e..2e5a13de9c 100644 --- a/src/shared/inc/CMakeLists.txt +++ b/src/shared/inc/CMakeLists.txt @@ -29,7 +29,7 @@ if(CLR_CMAKE_HOST_WIN32) set(OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}_i.c) list(APPEND CORGUIDS_SOURCES ${OUT_NAME}) add_custom_command(OUTPUT ${OUT_NAME} - COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /no_stamp /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL} + COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /nologo /no_stamp /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL} COMMENT "Compiling ${GENERATE_IDL}") endforeach(GENERATE_IDL) @@ -58,4 +58,4 @@ if(FEATURE_JIT_PITCHING) endif(FEATURE_JIT_PITCHING) # Compile *_i.cpp to lib -add_library(corguids ${CORGUIDS_SOURCES}) +add_library_clr(corguids OBJECT ${CORGUIDS_SOURCES}) diff --git a/src/shared/inc/bitvector.h b/src/shared/inc/bitvector.h index 469b1d4472..b957bdadc5 100644 --- a/src/shared/inc/bitvector.h +++ b/src/shared/inc/bitvector.h @@ -32,7 +32,9 @@ #define UNDEF_ASSERTE #endif +#ifndef FEATURE_NATIVEAOT #define USE_BITVECTOR 1 +#endif #if USE_BITVECTOR /* The bitvector class is meant to be a drop in replacement for an integer @@ -198,7 +200,7 @@ class BitVector { } } - // Note that that is set difference, not subtration + // Note that this is set difference, not subtration void operator -=(const BitVector& arg) { WRAPPER_NO_CONTRACT; @@ -399,7 +401,7 @@ typedef BitVector ptrArgTP; #else // !USE_BITVECTOR -typedef unsigned __int64 ptrArgTP; +typedef uint64_t ptrArgTP; // Maximum number of bits in our bitvector #define MAX_PTRARG_OFS (sizeof(ptrArgTP) * 8) diff --git a/src/shared/inc/cfi.h b/src/shared/inc/cfi.h new file mode 100644 index 0000000000..3d7ec0f4cc --- /dev/null +++ b/src/shared/inc/cfi.h @@ -0,0 +1,32 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef CFI_H_ +#define CFI_H_ + +#define DWARF_REG_ILLEGAL -1 +enum CFI_OPCODE +{ + CFI_ADJUST_CFA_OFFSET, // Offset is adjusted relative to the current one. + CFI_DEF_CFA_REGISTER, // New register is used to compute CFA + CFI_REL_OFFSET // Register is saved at offset from the current CFA +}; + +struct CFI_CODE +{ + unsigned char CodeOffset;// Offset from the start of code the frame covers. + unsigned char CfiOpCode; + short DwarfReg; // Dwarf register number. 0~32 for x64. + int Offset; + CFI_CODE(unsigned char codeOffset, unsigned char cfiOpcode, + short dwarfReg, int offset) + : CodeOffset(codeOffset) + , CfiOpCode(cfiOpcode) + , DwarfReg(dwarfReg) + , Offset(offset) + {} +}; +typedef CFI_CODE* PCFI_CODE; + +#endif // CFI_H + diff --git a/src/shared/inc/check.h b/src/shared/inc/check.h index c033965d40..21d717c13e 100644 --- a/src/shared/inc/check.h +++ b/src/shared/inc/check.h @@ -8,7 +8,6 @@ // Assertion checking infrastructure // --------------------------------------------------------------------------- - #ifndef CHECK_H_ #define CHECK_H_ @@ -16,6 +15,18 @@ #include "daccess.h" #include "unreachable.h" +// Use the C++ detection idiom (https://isocpp.org/blog/2017/09/detection-idiom-a-stopgap-for-concepts-simon-brand) +template struct make_void { using type = void; }; +template using void_t = typename make_void::type; + +// Macros for creating type traits to check if a member exists +#define DEFINE_MEMBER_EXISTENCE_CHECK(Member) \ +template \ +struct has_##Member : std::false_type {}; \ +\ +template \ +struct has_##Member().Member)>> : std::true_type {}; + #ifdef _DEBUG #ifdef _MSC_VER @@ -111,7 +122,7 @@ class CHECK #ifdef _DEBUG , m_condition (NULL) , m_file(NULL) - , m_line(NULL) + , m_line(0) , m_pCount(NULL) #endif {} @@ -151,7 +162,6 @@ class CHECK #endif }; - //-------------------------------------------------------------------------------- // These CHECK macros are the correct way to propagate an assertion. These // routines are designed for use inside "Check" routines. Such routines may @@ -167,7 +177,7 @@ class CHECK // Note that CONTRACT_CHECK contracts do not support postconditions. // // CHECK: Check the given condition, return a CHECK failure if FALSE -// CHECK_MSG: Same, but include a message paramter if the check fails +// CHECK_MSG: Same, but include a message parameter if the check fails // CHECK_OK: Return a successful check value; //-------------------------------------------------------------------------------- @@ -282,19 +292,34 @@ do \ #if CHECK_INVARIANTS +DEFINE_MEMBER_EXISTENCE_CHECK(Invariant); +DEFINE_MEMBER_EXISTENCE_CHECK(InternalInvariant); + +template +typename std::enable_if::value, CHECK>::type CheckInvariantOnly(TYPENAME &obj) +{ + CHECK(obj.Invariant()); + CHECK_OK; +} + +template +typename std::enable_if::value, CHECK>::type CheckInvariantOnly(TYPENAME &obj) { CHECK_OK; } + +template +typename std::enable_if::value, CHECK>::type CheckInternalInvariantOnly(TYPENAME &obj) +{ + CHECK(obj.InternalInvariant()); + CHECK_OK; +} + +template +typename std::enable_if::value, CHECK>::type CheckInternalInvariantOnly(TYPENAME &obj) { CHECK_OK; } + template CHECK CheckInvariant(TYPENAME &obj) { -#if defined(_MSC_VER) || defined(__llvm__) - __if_exists(TYPENAME::Invariant) - { - CHECK(obj.Invariant()); - } - __if_exists(TYPENAME::InternalInvariant) - { - CHECK(obj.InternalInvariant()); - } -#endif + CheckInvariantOnly(obj); + CheckInternalInvariantOnly(obj); CHECK_OK; } @@ -331,8 +356,9 @@ enum IsNullOK }; #if CHECK_INVARIANTS +DEFINE_MEMBER_EXISTENCE_CHECK(Check); template -CHECK CheckPointer(TYPENAME *o, IsNullOK ok = NULL_NOT_OK) +typename std::enable_if::value, CHECK>::type CheckPointer(TYPENAME *o, IsNullOK ok = NULL_NOT_OK) { if (o == NULL) { @@ -340,29 +366,35 @@ CHECK CheckPointer(TYPENAME *o, IsNullOK ok = NULL_NOT_OK) } else { -#if defined(_MSC_VER) || defined(__llvm__) - __if_exists(TYPENAME::Check) - { - CHECK(o->Check()); - } -#endif + CHECK(o->Check()); } CHECK_OK; } template -CHECK CheckValue(TYPENAME &val) +typename std::enable_if::value, CHECK>::type CheckPointer(TYPENAME *o, IsNullOK ok = NULL_NOT_OK) { -#if defined(_MSC_VER) || defined(__llvm__) - __if_exists(TYPENAME::Check) + if (o == NULL) { - CHECK(val.Check()); + CHECK_MSG(ok, "Illegal null pointer"); } -#endif + CHECK_OK; +} + +template +typename std::enable_if::value, CHECK>::type CheckValue(TYPENAME &val) +{ + CHECK(val.Check()); CHECK(CheckInvariant(val)); + CHECK_OK; +} +template +typename std::enable_if::value, CHECK>::type CheckValue(TYPENAME &val) +{ + CHECK(CheckInvariant(val)); CHECK_OK; } #else // CHECK_INVARIANTS @@ -502,11 +534,9 @@ CHECK CheckValue(TYPENAME &val) #endif // _PREFAST_ || _PREFIX_ - #define COMPILER_ASSUME(_condition) \ COMPILER_ASSUME_MSG(_condition, "") - //-------------------------------------------------------------------------------- // PREFIX_ASSUME_MSG and PREFAST_ASSUME_MSG are just another name // for COMPILER_ASSUME_MSG @@ -543,18 +573,17 @@ CHECK CheckValue(TYPENAME &val) #define UNREACHABLE() \ UNREACHABLE_MSG("") -#ifdef __llvm__ - -// LLVM complains if a function does not return what it says. -#define UNREACHABLE_RET() do { UNREACHABLE(); return 0; } while (0) -#define UNREACHABLE_MSG_RET(_message) UNREACHABLE_MSG(_message); return 0; +#define UNREACHABLE_RET() \ + do { \ + UNREACHABLE(); \ + return 0; \ + } while (0) -#else // __llvm__ - -#define UNREACHABLE_RET() UNREACHABLE() -#define UNREACHABLE_MSG_RET(_message) UNREACHABLE_MSG(_message) - -#endif // __llvm__ else +#define UNREACHABLE_MSG_RET(_message) \ + do { \ + UNREACHABLE_MSG(_message); \ + return 0; \ + } while (0) #ifdef _DEBUG_IMPL @@ -573,7 +602,6 @@ CHECK CheckValue(TYPENAME &val) #endif - //-------------------------------------------------------------------------------- // STRESS_CHECK represents a check which is included in a free build // @todo: behavior on trigger @@ -671,8 +699,6 @@ CHECK CheckValue(TYPENAME &val) #endif - - //-------------------------------------------------------------------------------- // Common base level checks //-------------------------------------------------------------------------------- @@ -684,6 +710,9 @@ CHECK CheckAligned(UINT value, UINT alignment); CHECK CheckAligned(ULONG value, UINT alignment); #endif CHECK CheckAligned(UINT64 value, UINT alignment); +#ifdef __APPLE__ +CHECK CheckAligned(SIZE_T value, UINT alignment); +#endif CHECK CheckAligned(const void *address, UINT alignment); CHECK CheckOverflow(UINT value1, UINT value2); @@ -691,6 +720,9 @@ CHECK CheckOverflow(UINT value1, UINT value2); CHECK CheckOverflow(ULONG value1, ULONG value2); #endif CHECK CheckOverflow(UINT64 value1, UINT64 value2); +#ifdef __APPLE__ +CHECK CheckOverflow(SIZE_T value1, SIZE_T value2); +#endif CHECK CheckOverflow(PTR_CVOID address, UINT offset); #if defined(_MSC_VER) CHECK CheckOverflow(const void *address, ULONG offset); @@ -702,11 +734,17 @@ CHECK CheckUnderflow(UINT value1, UINT value2); CHECK CheckUnderflow(ULONG value1, ULONG value2); #endif CHECK CheckUnderflow(UINT64 value1, UINT64 value2); +#ifdef __APPLE__ +CHECK CheckUnderflow(SIZE_T value1, SIZE_T value2); +#endif CHECK CheckUnderflow(const void *address, UINT offset); #if defined(_MSC_VER) CHECK CheckUnderflow(const void *address, ULONG offset); #endif CHECK CheckUnderflow(const void *address, UINT64 offset); +#ifdef __APPLE__ +CHECK CheckUnderflow(const void *address, SIZE_T offset); +#endif CHECK CheckUnderflow(const void *address, void *address2); CHECK CheckZeroedMemory(const void *memory, SIZE_T size); diff --git a/src/shared/inc/check.inl b/src/shared/inc/check.inl index f234e988fa..34a2956d1b 100644 --- a/src/shared/inc/check.inl +++ b/src/shared/inc/check.inl @@ -156,6 +156,15 @@ inline CHECK CheckAligned(UINT64 value, UINT alignment) CHECK_OK; } +#ifdef __APPLE__ +inline CHECK CheckAligned(SIZE_T value, UINT alignment) +{ + STATIC_CONTRACT_WRAPPER; + CHECK(AlignmentTrim(value, alignment) == 0); + CHECK_OK; +} +#endif + inline CHECK CheckAligned(const void *address, UINT alignment) { STATIC_CONTRACT_WRAPPER; @@ -183,6 +192,14 @@ inline CHECK CheckOverflow(UINT64 value1, UINT64 value2) CHECK_OK; } +#ifdef __APPLE__ +inline CHECK CheckOverflow(SIZE_T value1, SIZE_T value2) +{ + CHECK(value1 + value2 >= value1); + CHECK_OK; +} +#endif + inline CHECK CheckOverflow(PTR_CVOID address, UINT offset) { TADDR targetAddr = dac_cast(address); @@ -220,6 +237,14 @@ inline CHECK CheckOverflow(const void *address, UINT64 offset) CHECK_OK; } +#ifdef __APPLE__ +inline CHECK CheckOverflow(const void *address, SIZE_T offset) +{ + CHECK((UINT64) address + offset >= (UINT64) address); + + CHECK_OK; +} +#endif // __APPLE__ inline CHECK CheckUnderflow(UINT value1, UINT value2) { @@ -246,6 +271,15 @@ inline CHECK CheckUnderflow(UINT64 value1, UINT64 value2) CHECK_OK; } +#ifdef __APPLE__ +inline CHECK CheckUnderflow(SIZE_T value1, SIZE_T value2) +{ + CHECK(value1 - value2 <= value1); + + CHECK_OK; +} +#endif + inline CHECK CheckUnderflow(const void *address, UINT offset) { #if POINTER_BITS == 32 @@ -282,6 +316,20 @@ inline CHECK CheckUnderflow(const void *address, UINT64 offset) CHECK_OK; } +#ifdef __APPLE__ +inline CHECK CheckUnderflow(const void *address, SIZE_T offset) +{ +#if POINTER_BITS == 32 + CHECK(offset >> 32 == 0); + CHECK((UINT) (SIZE_T) address - (UINT) offset <= (UINT) (SIZE_T) address); +#else + CHECK((UINT64) address - offset <= (UINT64) address); +#endif + + CHECK_OK; +} +#endif + inline CHECK CheckUnderflow(const void *address, void *address2) { #if POINTER_BITS == 32 diff --git a/src/shared/inc/clr_std/algorithm b/src/shared/inc/clr_std/algorithm deleted file mode 100644 index ebd21b09c5..0000000000 --- a/src/shared/inc/clr_std/algorithm +++ /dev/null @@ -1,118 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// -// clr_std/algorithm -// -// Copy of some key Standard Template Library functionality - -#ifdef _MSC_VER -#pragma once -#endif - -#ifdef USE_STL -#include -#else -#ifndef __clr_std_algorithm_h__ -#define __clr_std_algorithm_h__ - -namespace std -{ - template - iter find_if ( iter first, iter last, CompareFunc comp ) - { - for ( ; first!=last ; first++ ) - if ( comp(*first) ) - break; - return first; - } - - template - iter find(iter first, iter last, const T& val) - { - for (;first != last; first++) - { - if (*first == val) - break; - } - return first; - } - - template - iter qsort_partition( iter first, iter last, iter pivot, comp compare ) - { - iter lastMinusOne = last - 1; - swap(pivot, lastMinusOne); - - // Pivot is at end - pivot = last - 1; - - iter partitionLoc = first; - - for (iter partitionWalk = first; partitionWalk != pivot; ++partitionWalk) - { - if (compare(*partitionWalk, *pivot)) - { - swap(*partitionWalk, *partitionLoc); - partitionLoc++; - } - } - swap(*pivot, *partitionLoc); - - return partitionLoc; - } - - template - void sort_worker ( iter first, iter last, comp compare ) - { - typename iter::difference_type RangeSize = last - first; - - // When down to a list of size 1, be done - if (RangeSize < 2) - return; - - // Pick pivot - - // Use simple pick middle algorithm - iter pivotLoc = first + (RangeSize / 2); - - // Partition - pivotLoc = qsort_partition(first, last, pivotLoc, compare); - - // Sort first array - sort_worker(first, pivotLoc, compare); - - // Sort second array - sort_worker(pivotLoc + 1, last, compare); - } - - template - void sort ( iter first, iter last, comp compare ) - { - sort_worker(first, last, compare); - if (first != last) - { - for (iter i = first; i < (last - 1); i++) - { - // Assert that the sort function works. - assert(!compare(*(i+1), *i)); - } - } - } - - template - OutIter transform( InIter first, InIter last, OutIter dest, Fn1 func ) - { - for ( ; first!=last ; ++first, ++dest ) - *dest = func(*first); - return dest; - } - -} // namespace std - -#endif /* __clr_std_algorithm_h__ */ - -#endif // !USE_STL - -// Help the VIM editor figure out what kind of file this no-extension file is. -// vim: filetype=cpp diff --git a/src/shared/inc/clr_std/string b/src/shared/inc/clr_std/string deleted file mode 100644 index 59ac67b986..0000000000 --- a/src/shared/inc/clr_std/string +++ /dev/null @@ -1,425 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// -// clr_std/string -// -// Copy of some key Standard Template Library functionality -// -// This was created for use with SuperPMI. It has the minimal functionality needed by SuperPMI. It hasn't -// been tested elsewhere. - -#ifdef _MSC_VER -#pragma once -#endif - -#ifdef USE_STL -#include -#else -#ifndef __clr_std_string_h__ -#define __clr_std_string_h__ - -#include "clr_std/vector" - -namespace std -{ - -template -class basic_string -{ -public: - typedef T value_type; - typedef size_t size_type; - typedef typename vector::iterator iterator; - typedef typename vector::const_iterator const_iterator; - - basic_string() - : m_string(1) // start with a string of length 1 for null terminator - { - m_string[0] = T(); - } - - basic_string(const basic_string& _Right) - { - assign(_Right); - } - - // Initialize a string with _Count characters from the string pointed at by _Ptr. - // If you want to include the trailing null character, _Count needs to include that. - basic_string(const value_type* _Ptr, size_type _Count) - : m_string(_Count + 1) // add 1 for a null terminator - { - copy(_Ptr, _Count); - } - - basic_string(const value_type* _Ptr) : basic_string(_Ptr, c_len(_Ptr)) - { - } - - void reserve(size_t newcapacity) - { - m_string.reserve(newcapacity + 1); // add 1 for the null terminator - } - - // - // Assignment - // - - basic_string& operator=(const basic_string& _Right) - { - if (this != &_Right) - { - assign(_Right); - } - return (*this); - } - - basic_string& assign(const basic_string& _Right) - { - m_string.resize(_Right.size() + 1); // +1 for null terminator - copy(_Right); - return (*this); - } - - // - // Basic data copying - // - - void copy(const basic_string& _Right) - { - assert(size() >= _Right.size()); - size_type i; - for (i = 0; i < _Right.size(); i++) - { - m_string[i] = _Right.m_string[i]; - } - m_string[i] = T(); - } - - void copy(const value_type* _Ptr, size_type _Count) - { - assert(size() >= _Count); - size_type i; - for (i = 0; i < _Count; i++) - { - m_string[i] = _Ptr[i]; - } - m_string[i] = T(); - } - - // - // Appending - // - - // Append a C-style string to the string. - basic_string& operator+=(const value_type* _Ptr) - { - size_type oldsize = size(); // doesn't include null terminator - size_type addsize = c_len(_Ptr); // doesn't include null terminator - size_type newsize = oldsize + addsize + 1; - m_string.resize(newsize); - size_type i; - for (i = oldsize; i < newsize - 1; i++) - { - m_string[i] = *_Ptr++; - } - m_string[i] = T(); - return (*this); - } - - basic_string& operator+=(const basic_string& _Right) - { - size_type oldsize = size(); // doesn't include null terminator - size_type addsize = _Right.size(); // doesn't include null terminator - size_type newsize = oldsize + addsize + 1; - m_string.resize(newsize); - size_type new_index = oldsize, right_index = 0; - while (right_index < addsize) - { - m_string[new_index] = _Right.m_string[right_index]; - ++new_index; - ++right_index; - } - m_string[new_index] = T(); - return (*this); - } - - basic_string& operator+=(value_type _Ch) - { - size_type oldsize = size(); // doesn't include null terminator - m_string[oldsize] = _Ch; // Replace the null terminator with the new symbol. - m_string.push_back(T()); // Return the replaced terminator again. - return (*this); - } - - ~basic_string() - { - // vector destructor does all the work - } - - size_t size() const - { - assert(m_string.size() > 0); - return m_string.size() - 1; // Don't report the null terminator. - } - - size_t length() const - { - return size(); - } - - T& operator[](size_t iIndex) - { - assert(iIndex < size() + 1); // allow looking at the null terminator - return m_string[iIndex]; - } - - const T* c_str() const - { - return m_string.data(); - } - - iterator begin() - { - return m_string.begin(); - } - - iterator end() - { - return m_string.end(); - } - - const_iterator cbegin() const - { - return m_string.cbegin(); - } - - const_iterator cend() const - { - return m_string.cend(); - } - - basic_string substr(size_type _Off = 0, size_type _Count = npos) const - { - size_type cursize = size(); - if (_Off >= cursize) - { - // result will be empty - return basic_string(); - } - else - { - if ((_Count == npos) || // No count specified; take the whole string suffix - (_Off + _Count > cursize)) // Count specified is too many characters; just take the whole suffix - { - _Count = cursize - _Off; - } - return basic_string(m_string.data() + _Off, _Count); - } - } - - size_type find_last_of(value_type _Ch) const - { - for (size_type _Off = size(); _Off != 0; _Off--) - { - if (m_string[_Off - 1] == _Ch) - { - return _Off - 1; - } - } - return npos; - } - - bool empty() const - { - return size() == 0; - } - - int compare(const basic_string& _Str) const - { - size_type i; - size_type compareSize = size(); - if (_Str.size() < compareSize) - { - // This string is longer; compare character-by-character only as many characters as we have. - compareSize = _Str.size(); - } - for (i = 0; i < compareSize; i++) - { - if (m_string[i] != _Str.m_string[i]) - { - if (m_string[i] < _Str.m_string[i]) - { - return -1; - } - else - { - return 1; - } - } - } - - // All the characters we compared were identical, but one string might be longer than the other. - if (size() == _Str.size()) - { - // We compared everything. - return 0; - } - else if (size() < _Str.size()) - { - // _Str has more characters than this. - return -1; - } - else - { - // this has more characters than _Str - return 1; - } - } - - static const size_type npos = size_type(-1); - -private: - - // Compute the length in characters of a null-terminated C-style string, not including the trailing null character. - // _Ptr must not be nullptr. - size_type c_len(const value_type* _Ptr) - { - size_type count; - for (count = 0; *_Ptr != T(); _Ptr++) - { - count++; - } - return count; - } - - vector m_string; // use a vector<> to represent the string, to avoid reimplementing similar functionality - -}; // class basic_string - -// -// String class instantiations -// - -typedef basic_string string; - -// -// Numeric conversions -// - -// convert integer T to string -template inline -string _IntToString(const char *_Fmt, T _Val) -{ - const size_t MaxIntBufSize = 21; /* can hold -2^63 and 2^64 - 1, plus NUL */ - char buf[MaxIntBufSize]; - int len = sprintf_s(buf, MaxIntBufSize, _Fmt, _Val); - return (string(buf, len)); -} - -inline string to_string(int _Val) -{ - return (_IntToString("%d", _Val)); -} - -inline string to_string(unsigned int _Val) -{ - return (_IntToString("%u", _Val)); -} - -inline string to_string(long _Val) -{ - return (_IntToString("%ld", _Val)); -} - -inline string to_string(unsigned long _Val) -{ - return (_IntToString("%lu", _Val)); -} - -inline string to_string(long long _Val) -{ - return (_IntToString("%lld", _Val)); -} - -inline string to_string(unsigned long long _Val) -{ - return (_IntToString("%llu", _Val)); -} - -// -// Comparisons -// - -template inline -bool operator==( - const basic_string& _Left, - const basic_string& _Right) -{ - return (_Left.compare(_Right) == 0); -} - -template inline -bool operator!=( - const basic_string& _Left, - const basic_string& _Right) -{ - return (!(_Left == _Right)); -} - -template inline -bool operator<( - const basic_string& _Left, - const basic_string& _Right) -{ - return (_Left.compare(_Right) < 0); -} - -template inline -bool operator>( - const basic_string& _Left, - const basic_string& _Right) -{ - return (_Right < _Left); -} - -template inline -bool operator<=( - const basic_string& _Left, - const basic_string& _Right) -{ - return (!(_Right < _Left)); -} - -template inline -bool operator>=( - const basic_string& _Left, - const basic_string& _Right) -{ - return (!(_Left < _Right)); -} - -// -// String concatenation and other string operations -// - -template inline -basic_string operator+( - const basic_string& _Left, - const basic_string& _Right) -{ - basic_string ret; - ret.reserve(_Left.size() + _Right.size()); - ret += _Left; - ret += _Right; - return ret; -} - -}; // namespace std - -#endif /* __clr_std_string_h__ */ - -#endif // !USE_STL - -// Help the VIM editor figure out what kind of file this no-extension file is. -// vim: filetype=cpp diff --git a/src/shared/inc/clr_std/type_traits b/src/shared/inc/clr_std/type_traits deleted file mode 100644 index 12af99d5c4..0000000000 --- a/src/shared/inc/clr_std/type_traits +++ /dev/null @@ -1,627 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// -// clr_std/utility -// -// Copy of some key Standard Template Library functionality. -// See http://msdn.microsoft.com/en-us/library/bb982077.aspx for documentation. -// - -#ifdef _MSC_VER -#pragma once -#endif - -#ifndef __clr_std_type_traits_h__ -#define __clr_std_type_traits_h__ - -#ifdef USE_STL - -#include - -#else - -namespace std -{ - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS remove_const - template - struct remove_const - { // remove top level const qualifier - typedef _Ty type; - }; - - template - struct remove_const - { // remove top level const qualifier - typedef _Ty type; - }; - - template - struct remove_const - { // remove top level const qualifier - typedef _Ty type[]; - }; - - template - struct remove_const - { // remove top level const qualifier - typedef _Ty type[_Nx]; - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS remove_volatile - template - struct remove_volatile - { // remove top level volatile qualifier - typedef _Ty type; - }; - - template - struct remove_volatile - { // remove top level volatile qualifier - typedef _Ty type; - }; - - template - struct remove_volatile - { // remove top level volatile qualifier - typedef _Ty type[]; - }; - - template - struct remove_volatile - { // remove top level volatile qualifier - typedef _Ty type[_Nx]; - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS remove_cv - template - struct remove_cv - { // remove top level const and volatile qualifiers - typedef typename remove_const::type>::type type; - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE remove_reference - template - struct remove_reference - { // remove reference - typedef T type; - }; - - template - struct remove_reference - { // remove reference - typedef T type; - }; - - template - struct remove_reference - { // remove rvalue reference - typedef T type; - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE remove_pointer - template - struct remove_pointer - { // remove pointer - typedef T type; - }; - - template - struct remove_pointer - { // remove pointer - typedef T type; - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE FUNCTION identity - template - struct identity - { // map T to type unchanged - typedef T type; - - inline - const T& operator()(const T& left) const - { // apply identity operator to operand - return (left); - } - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS integral_constant - template - struct integral_constant - { // convenient template for integral constant types - static const _Ty value = _Val; - - typedef _Ty value_type; - typedef integral_constant<_Ty, _Val> type; - }; - - typedef integral_constant true_type; - typedef integral_constant false_type; - - // TEMPLATE CLASS _Cat_base - template - struct _Cat_base - : false_type - { // base class for type predicates - }; - - template<> - struct _Cat_base - : true_type - { // base class for type predicates - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS enable_if - template - struct enable_if - { // type is undefined for assumed !_Test - }; - - template - struct enable_if - { // type is _Type for _Test - typedef _Type type; - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS conditional - template - struct conditional - { // type is _Ty2 for assumed !_Test - typedef _Ty2 type; - }; - - template - struct conditional - { // type is _Ty1 for _Test - typedef _Ty1 type; - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS make_unsigned - template - struct make_unsigned - { - }; - - template<> - struct make_unsigned - { - typedef unsigned int type; - }; - -#ifndef HOST_UNIX - - template<> - struct make_unsigned - { - typedef unsigned long type; - }; - -#endif // !HOST_UNIX - - template<> - struct make_unsigned<__int64> - { - typedef unsigned __int64 type; - }; - - template<> - struct make_unsigned - { - typedef size_t type; - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS make_signed - template - struct make_signed - { - }; - - template<> - struct make_signed - { - typedef signed int type; - }; - -#ifndef HOST_UNIX - - template<> - struct make_signed - { - typedef signed long type; - }; - -#endif // !HOST_UNIX - - template<> - struct make_signed - { - typedef signed __int64 type; - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS is_lvalue_reference - template - struct is_lvalue_reference - : false_type - { // determine whether _Ty is an lvalue reference - }; - - template - struct is_lvalue_reference<_Ty&> - : true_type - { // determine whether _Ty is an lvalue reference - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS is_rvalue_reference - template - struct is_rvalue_reference - : false_type - { // determine whether _Ty is an rvalue reference - }; - - template - struct is_rvalue_reference<_Ty&&> - : true_type - { // determine whether _Ty is an rvalue reference - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS is_reference - template - struct is_reference - : conditional< - is_lvalue_reference<_Ty>::value || is_rvalue_reference<_Ty>::value, - true_type, - false_type>::type - { // determine whether _Ty is a reference - }; - - // TEMPLATE CLASS is_pointer - template - struct is_pointer - : false_type - { // determine whether _Ty is a pointer - }; - - template - struct is_pointer<_Ty *> - : true_type - { // determine whether _Ty is a pointer - }; - - // TEMPLATE CLASS _Is_integral - template - struct _Is_integral - : false_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - -// On Unix 'long' is a 64-bit type (same as __int64) and the following two definitions -// conflict with _Is_integral and _Is_integral. -#ifndef HOST_UNIX - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; -#endif /* HOST_UNIX */ - - #if _HAS_CHAR16_T_LANGUAGE_SUPPORT - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - #endif /* _HAS_CHAR16_T_LANGUAGE_SUPPORT */ - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - template<> - struct _Is_integral - : true_type - { // determine whether _Ty is integral - }; - - // TEMPLATE CLASS is_integral - template - struct is_integral - : _Is_integral::type> - { // determine whether _Ty is integral - }; - - // TEMPLATE CLASS _Is_floating_point - template - struct _Is_floating_point - : false_type - { // determine whether _Ty is floating point - }; - - template<> - struct _Is_floating_point - : true_type - { // determine whether _Ty is floating point - }; - - template<> - struct _Is_floating_point - : true_type - { // determine whether _Ty is floating point - }; - -// In PAL, we define long as int and so this becomes int double, -// which is a nonsense -#ifndef HOST_UNIX - template<> - struct _Is_floating_point - : true_type - { // determine whether _Ty is floating point - }; -#endif - - // TEMPLATE CLASS is_floating_point - template - struct is_floating_point - : _Is_floating_point::type> - { // determine whether _Ty is floating point - }; - - // TEMPLATE CLASS is_arithmetic - template - struct is_arithmetic - : _Cat_base::value - || is_floating_point<_Ty>::value> - { // determine whether _Ty is an arithmetic type - }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS is_signed - template - struct is_signed : conditional< - static_cast::type>(-1) < 0, true_type, false_type>::type {}; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS is_same - template - struct is_same : false_type { }; - - //----------------------------------------------------------------------------------------- - template - struct is_same : true_type { }; - - //----------------------------------------------------------------------------------------- - // TEMPLATE CLASS is_base_of -#ifdef _MSC_VER - - template - struct is_base_of : - conditional<__is_base_of( TBase, TDerived), true_type, false_type>::type {}; - -#else - namespace detail - { - //------------------------------------------------------------------------------------- - // Helper types Small and Big - guarantee that sizeof(Small) < sizeof(Big) - // - - template - struct conversion_helper - { - typedef char Small; - struct Big { char dummy[2]; }; - static Big Test(...); - static Small Test(U); - static T MakeT(); - }; - - //------------------------------------------------------------------------------------- - // class template conversion - // Figures out the conversion relationships between two types - // Invocations (T and U are types): - // a) conversion::exists - // returns (at compile time) true if there is an implicit conversion from T - // to U (example: Derived to Base) - // b) conversion::exists2Way - // returns (at compile time) true if there are both conversions from T - // to U and from U to T (example: int to char and back) - // c) conversion::sameType - // returns (at compile time) true if T and U represent the same type - // - // NOTE: might not work if T and U are in a private inheritance hierarchy. - // - - template - struct conversion - { - typedef detail::conversion_helper H; - static const bool exists = sizeof(typename H::Small) == sizeof((H::Test(H::MakeT()))); - static const bool exists2Way = exists && conversion::exists; - static const bool sameType = false; - }; - - template - struct conversion - { - static const bool exists = true; - static const bool exists2Way = true; - static const bool sameType = true; - }; - - template - struct conversion - { - static const bool exists = false; - static const bool exists2Way = false; - static const bool sameType = false; - }; - - template - struct conversion - { - static const bool exists = false; - static const bool exists2Way = false; - static const bool sameType = false; - }; - - template <> - struct conversion - { - static const bool exists = true; - static const bool exists2Way = true; - static const bool sameType = true; - }; - } // detail - - // Note that we need to compare pointer types here, since conversion of types by-value - // just tells us whether or not an implicit conversion constructor exists. We handle - // type parameters that are already pointers specially; see below. - template - struct is_base_of : - conditional::exists, true_type, false_type>::type {}; - - // Specialization to handle type parameters that are already pointers. - template - struct is_base_of : - conditional::exists, true_type, false_type>::type {}; - - // Specialization to handle invalid mixing of pointer types. - template - struct is_base_of : - false_type {}; - - // Specialization to handle invalid mixing of pointer types. - template - struct is_base_of : - false_type {}; - -#endif - - namespace detail - { - template - using void_t = void; - } - // Always false dependent-value for static_asserts. - template - struct _Always_false - { - const bool value = false; - }; - - template - struct _Add_reference { // add reference (non-referenceable type) - using _Lvalue = _Ty; - using _Rvalue = _Ty; - }; - - template - struct _Add_reference<_Ty, detail::void_t<_Ty&>> { // (referenceable type) - using _Lvalue = _Ty&; - using _Rvalue = _Ty&&; - }; - - template - struct add_lvalue_reference { - using type = typename _Add_reference<_Ty>::_Lvalue; - }; - - template - struct add_rvalue_reference { - using type = typename _Add_reference<_Ty>::_Rvalue; - }; - - template - typename add_rvalue_reference<_Ty>::type declval() noexcept - { - static_assert(_Always_false<_Ty>::value, "Calling declval is ill-formed, see N4892 [declval]/2."); - } -} // namespace std - -#endif // !USE_STL - -#define REM_CONST(T) typename std::remove_const< T >::type -#define REM_CV(T) typename std::remove_cv< T >::type -#define REM_REF(T) typename std::remove_reference< T >::type - -#define REF_T(T) REM_REF(T) & -#define REF_CT(T) REM_REF(REM_CONST(T)) const & - -#endif // __clr_std_type_traits_h__ - -// Help the VIM editor figure out what kind of file this no-extension file is. -// vim: filetype=cpp diff --git a/src/shared/inc/clr_std/utility b/src/shared/inc/clr_std/utility deleted file mode 100644 index 1b6b5a7b72..0000000000 --- a/src/shared/inc/clr_std/utility +++ /dev/null @@ -1,253 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// -// clr_std/utility -// -// Copy of some key Standard Template Library functionality -// See http://msdn.microsoft.com/en-us/library/bb982077.aspx for documentation. -// - -#ifdef _MSC_VER -#pragma once -#endif - -#ifdef USE_STL -#include -#else -#ifndef __clr_std_utility_h__ -#define __clr_std_utility_h__ - -#include "clr_std/type_traits" - -namespace std -{ - //----------------------------------------------------------------------------------------- - // TEMPLATE FUNCTION move - template inline - typename remove_reference::type&& - move(T&& arg) - { // forward _Arg as movable - return ((typename remove_reference::type&&)arg); - } - - //----------------------------------------------------------------------------------------- - // TEMPLATE FUNCTION swap (from ) - template inline - void swap(T& left, T& right) - { // exchange values stored at left and right - T tmp = std::move(left); - left = std::move(right); - right = std::move(tmp); - } - - //----------------------------------------------------------------------------------------- - // TEMPLATE FUNCTION forward - template inline - T&& - forward(typename identity::type& _Arg) - { // forward _Arg, given explicitly specified type parameter - return ((T&&)_Arg); - } -} - -namespace std -{ - //----------------------------------------------------------------------------------------- - // TEMPLATE STRUCT pair - template - struct pair - { // store a pair of values - typedef pair<_Ty1, _Ty2> _Myt; - typedef _Ty1 first_type; - typedef _Ty2 second_type; - - pair() - : first(_Ty1()), second(_Ty2()) - { // construct from defaults - } - - pair(const _Ty1& _Val1, const _Ty2& _Val2) - : first(_Val1.first), second(_Val2.second) - { // construct from specified values - } - - template - pair(pair<_Other1, _Other2>& _Right) - : first(_Right.first), second(_Right.second) - { // construct from compatible pair - } - - template - pair(const pair<_Other1, _Other2>& _Right) - : first(_Right.first), second(_Right.second) - { // construct from compatible pair - } - - void swap(_Myt& _Right) - { // exchange contents with _Right - if (this != &_Right) - { // different, worth swapping - swap(this->first, _Right.first); - swap(this->second, _Right.second); - } - } - - _Myt& operator=(const _Myt& _Right) - { // assign from copied pair - this->first = _Right.first; - this->second = _Right.second; - return (*this); - } - - typedef typename remove_reference<_Ty1>::type _Ty1x; - typedef typename remove_reference<_Ty2>::type _Ty2x; - - pair(_Ty1x&& _Val1, _Ty2x&& _Val2) - : first(std::move(_Val1)), - second(std::move(_Val2)) - { // construct from specified values - } - - pair(const _Ty1x& _Val1, _Ty2x&& _Val2) - : first(_Val1), - second(std::move(_Val2)) - { // construct from specified values - } - - pair(_Ty1x&& _Val1, const _Ty2x& _Val2) - : first(std::move(_Val1)), - second(_Val2) - { // construct from specified values - } - - template - pair(_Other1&& _Val1, _Other2&& _Val2) - : first(std::move(_Val1)), - second(std::move(_Val2)) - { // construct from moved values - } - - template - pair(pair<_Other1, _Other2>&& _Right) - : first(std::move(_Right.first)), - second(std::move(_Right.second)) - { // construct from moved compatible pair - } - - pair& operator=(pair<_Ty1, _Ty2>&& _Right) - { // assign from moved pair - this->first = std::move(_Right.first); - this->second = std::move(_Right.second); - return (*this); - } - - void swap(_Myt&& _Right) - { // exchange contents with _Right - if (this != &_Right) - { // different, worth swapping - this->first = std::move(_Right.first); - this->second = std::move(_Right.second); - } - } - - _Ty1 first; // the first stored value - _Ty2 second; // the second stored value - }; // struct pair - - //----------------------------------------------------------------------------------------- - // pair TEMPLATE FUNCTIONS - - template inline - void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>& _Right) - { // swap _Left and _Right pairs - _Left.swap(_Right); - } - - template inline - void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>&& _Right) - { // swap _Left and _Right pairs - typedef pair<_Ty1, _Ty2> _Myt; - _Left.swap(std::forward<_Myt>(_Right)); - } - - template inline - void swap( - pair<_Ty1, _Ty2>&& _Left, - pair<_Ty1, _Ty2>& _Right) - { // swap _Left and _Right pairs - typedef pair<_Ty1, _Ty2> _Myt; - _Right.swap(std::forward<_Myt>(_Left)); - } - - template inline - bool operator==( - const pair<_Ty1, _Ty2>& _Left, - const pair<_Ty1, _Ty2>& _Right) - { // test for pair equality - return (_Left.first == _Right.first && _Left.second == _Right.second); - } - - template inline - bool operator!=( - const pair<_Ty1, _Ty2>& _Left, - const pair<_Ty1, _Ty2>& _Right) - { // test for pair inequality - return (!(_Left == _Right)); - } - - template inline - bool operator<( - const pair<_Ty1, _Ty2>& _Left, - const pair<_Ty1, _Ty2>& _Right) - { // test if _Left < _Right for pairs - return (_Left.first < _Right.first || - (!(_Right.first < _Left.first) && _Left.second < _Right.second)); - } - - template inline - bool operator>( - const pair<_Ty1, _Ty2>& _Left, - const pair<_Ty1, _Ty2>& _Right) - { // test if _Left > _Right for pairs - return (_Right < _Left); - } - - template inline - bool operator<=( - const pair<_Ty1, _Ty2>& _Left, - const pair<_Ty1, _Ty2>& _Right) - { // test if _Left <= _Right for pairs - return (!(_Right < _Left)); - } - - template inline - bool operator>=( - const pair<_Ty1, _Ty2>& _Left, - const pair<_Ty1, _Ty2>& _Right) - { // test if _Left >= _Right for pairs - return (!(_Left < _Right)); - } - - template inline - _InIt begin( - const pair<_InIt, _InIt>& _Pair) - { // return first element of pair - return (_Pair.first); - } - - template inline - _InIt end( - const pair<_InIt, _InIt>& _Pair) - { // return second element of pair - return (_Pair.second); - } - -} // namespace std - -#endif /* __clr_std_utility_h__ */ - -#endif // !USE_STL - -// Help the VIM editor figure out what kind of file this no-extension file is. -// vim: filetype=cpp diff --git a/src/shared/inc/clr_std/vector b/src/shared/inc/clr_std/vector deleted file mode 100644 index c10ecf6ba5..0000000000 --- a/src/shared/inc/clr_std/vector +++ /dev/null @@ -1,435 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// -// clr_std/vector -// -// Copy of some key Standard Template Library functionality -// - -#ifdef _MSC_VER -#pragma once -#endif - -#ifdef USE_STL -#include -#else -#ifndef __clr_std_vector_h__ -#define __clr_std_vector_h__ - -// This is defined in the debugmacrosext.h header, but don't take a dependency on that. -#ifndef INDEBUG -#ifdef _DEBUG -#define INDEBUG(x) x -#else -#define INDEBUG(x) -#endif -#endif // !def INDEBUG - -namespace std -{ - template - class vector - { - public: - class const_iterator; - - class iterator - { - friend class std::vector::const_iterator; - public: - typedef T value_type; - typedef ptrdiff_t difference_type; - typedef T* pointer; - typedef T& reference; - - typedef class vector::iterator _MyIter; - - _MyIter &operator++() - { - m_ptr++; - return *this; - } - - _MyIter operator++(int) - { - // post-increment ++ - _MyIter myiter(m_ptr); - m_ptr++; - return myiter; - } - - _MyIter &operator--() - { - m_ptr--; - return *this; - } - - _MyIter operator--(int) - { - // post-decrement -- - _MyIter myiter(m_ptr); - m_ptr--; - return myiter; - } - - _MyIter operator- (ptrdiff_t n) - { - _MyIter myiter(m_ptr); - myiter.m_ptr -= n; - return myiter; - } - - ptrdiff_t operator- (_MyIter right) - { - _MyIter myiter(m_ptr); - return myiter.m_ptr - right.m_ptr; - } - - _MyIter operator+ (ptrdiff_t n) - { - _MyIter myiter(m_ptr); - myiter.m_ptr += n; - return myiter; - } - - T* operator->() const - { - return m_ptr; - } - - T & operator*() const - { - return *m_ptr; - } - - bool operator==(const _MyIter& _Right) const - { - bool equals = this->m_ptr == _Right.m_ptr; - return equals; - } - - bool operator!=(const _MyIter& _Right) const - { - bool equals = this->m_ptr == _Right.m_ptr; - return !equals; - } - - bool operator<(const _MyIter& _Right) const - { - return this->m_ptr < _Right.m_ptr; - } - - bool operator>(const _MyIter& _Right) const - { - return this->m_ptr > _Right.m_ptr; - } - public: - explicit iterator(T* ptr) - { - m_ptr = ptr; - } - - private: - T* m_ptr; - }; // class iterator - - class const_iterator - { - public: - typedef class vector::const_iterator _MyIter; - typedef class vector::iterator _MyNonConstIter; - - _MyIter &operator++() - { - m_ptr++; - return *this; - } - - _MyIter operator++(int) - { - // post-increment ++ - _MyIter myiter(m_ptr); - m_ptr++; - return myiter; - } - - const T* operator->() const - { - return m_ptr; - } - - const T & operator*() const - { - return *m_ptr; - } - - bool operator==(const _MyIter& _Right) const - { - bool equals = this->m_ptr == _Right.m_ptr; - return equals; - } - - bool operator!=(const _MyIter& _Right) const - { - bool equals = this->m_ptr == _Right.m_ptr; - return !equals; - } - - public: - explicit const_iterator(T* ptr) - { - m_ptr = ptr; - } - const_iterator(const _MyNonConstIter &nonConstIterator) - { - m_ptr = nonConstIterator.m_ptr; - } - - private: - T* m_ptr; - }; // class const iterator - - - public: - explicit vector(size_t n = 0) - { - m_size = 0; - m_capacity = 0; - m_pelements = NULL; - m_isBufferOwner = true; - resize(n); - } - - ~vector() - { - if (m_isBufferOwner) - { - erase(m_pelements, 0, m_size); - delete [] (BYTE*)m_pelements; // cast to BYTE* as we don't want this delete to invoke T's dtor - } - else - { - m_size = 0; - m_capacity = 0; - } - } - - - size_t size() const - { - return m_size; - } - - T & operator[](size_t iIndex) - { - assert(iIndex < m_size); - return m_pelements[iIndex]; - } - - T & operator[](size_t iIndex) const - { - assert(iIndex < m_size); - return m_pelements[iIndex]; - } - - void resize(size_t newsize) - { - assert(m_isBufferOwner); - size_t oldsize = this->size(); - resize_noinit(newsize); - if (newsize > oldsize) - { - fill_uninitialized_with_default_value(m_pelements, oldsize, newsize); - } - } - - void clear() - { - assert(m_isBufferOwner); - resize(0); - } - - void resize(size_t newsize, T c) - { - assert(m_isBufferOwner); - size_t oldsize = this->size(); - resize_noinit(newsize); - if (newsize > oldsize) - { - for (size_t i = oldsize; i < newsize; i++) - { - m_pelements[i] = c; - } - } - } - - void wrap(size_t numElements, T* pElements) - { - m_size = numElements; - m_pelements = pElements; - m_isBufferOwner = false; - } - - void resize_noinit(size_t newsize) - { - assert(m_isBufferOwner); - size_t oldsize = this->size(); - if (newsize < oldsize) - { - // Shrink - erase(m_pelements, newsize, oldsize); - } - else if (newsize > oldsize) - { - // Grow - reserve(newsize); - } - m_size = newsize; - } - - void push_back(const T & val) - { - assert(m_isBufferOwner); - if (m_size + 1 < m_size) - { - assert("push_back: overflow"); - // @todo: how to throw. - } - resize(m_size + 1, val); - } - - void reserve(size_t newcapacity) - { - assert(m_isBufferOwner); - if (newcapacity > m_capacity) - { - // To avoid resizing for every element that gets added to a vector, we - // allocate at least twice the old capacity, or 16 elements, whichever is greater. - newcapacity = max(newcapacity, max(m_capacity * 2, 16)); - - size_t bytesNeeded = newcapacity * sizeof(T); - if (bytesNeeded / sizeof(T) != newcapacity) - { - assert("resize: overflow"); - // @todo: how to throw something here? - } - - - T *pelements = (T*)(new BYTE[bytesNeeded]); // Allocate as BYTE array to avoid automatic construction - INDEBUG(memset(pelements, 0xcc, bytesNeeded)); - for (size_t i = 0; i < m_size; i++) - { - pelements[i] = m_pelements[i]; - } - - erase(m_pelements, 0, m_size); - delete [] (BYTE*)m_pelements; // cast to BYTE* as we don't want this delete to invoke T's dtor - - m_pelements = pelements; - m_capacity = newcapacity; - } - } - - iterator begin() - { - return iterator(m_pelements); - } - - iterator end() - { - return iterator(m_pelements + m_size); - } - - const_iterator cbegin() const - { - return const_iterator(m_pelements); - } - - const_iterator cend() const - { - return const_iterator(m_pelements + m_size); - } - - iterator erase(iterator position) - { - assert(m_isBufferOwner); - assert((position > begin() || position == begin()) && position < end()); - ptrdiff_t index = position - begin(); - erase(m_pelements, index, index + 1); - memcpy(&m_pelements[index], &m_pelements[index + 1], sizeof(T) * (m_size - index - 1)); - --m_size; - return iterator(m_pelements + (position - begin())); - } - - iterator erase(iterator position, iterator positionEnd) - { - assert(m_isBufferOwner); - assert((position > begin() || position == begin()) && position < end()); - ptrdiff_t index = position - begin(); - ptrdiff_t elements = positionEnd - position; - erase(m_pelements, index, index + elements); - memcpy(&m_pelements[index], &m_pelements[index + elements], sizeof(T) * (m_size - index - elements)); - m_size -= elements; - return iterator(m_pelements + (position - begin())); - } - - T* data() - { - return m_pelements; - } - - const T* data() const - { - return m_pelements; - } - - private: - // Transition a subset of the array from uninitialized to initialized with default value for T. - static void fill_uninitialized_with_default_value(T* pelements, size_t startIdx, size_t endIdx) - { - assert(startIdx <= endIdx); - assert(pelements != NULL || startIdx == endIdx); - for (size_t i = startIdx; i < endIdx; i++) - { - INDEBUG(assert(0xcc == *((BYTE*)&pelements[i]))); - pelements[i] = T(); - } - } - - // Transition a subset of the array from a valid value of T to uninitialized. - static void erase(T* pelements, size_t startIdx, size_t endIdx) - { - assert(startIdx <= endIdx); - assert(pelements != NULL || startIdx == endIdx); - for (size_t i = startIdx; i < endIdx; i++) - { - pelements[i].~T(); - } - - INDEBUG(memset(&pelements[startIdx], 0xcc, (endIdx - startIdx) * sizeof(T))); - } - - private: - size_t m_size; //# of elements - size_t m_capacity; //# of elements allocated - T *m_pelements; //actual array - // invariants: - // dimensions == m_capacity - // elements 0 thru m_size-1 always contain constructed T values. - // elements from m_size thru m_capacity - 1 contain memory garbage (0xcc in DEBUG). - bool m_isBufferOwner; // indicate if this vector creates its own buffer, or wraps an existing buffer. - - - - - }; // class vector - -}; // namespace std - -#endif /* __clr_std_vector_h__ */ - -#endif // !USE_STL - -// Help the VIM editor figure out what kind of file this no-extension file is. -// vim: filetype=cpp diff --git a/src/shared/inc/clrconfignocache.h b/src/shared/inc/clrconfignocache.h new file mode 100644 index 0000000000..01675a2420 --- /dev/null +++ b/src/shared/inc/clrconfignocache.h @@ -0,0 +1,98 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// -------------------------------------------------------------------------------------------------- +// clrconfignocache.h +// +// Logic for resolving configuration names. +// + +#include + +// Config prefixes +#define COMPLUS_PREFIX_A "COMPlus_" +#define COMPLUS_PREFIX W("COMPlus_") +#define LEN_OF_COMPLUS_PREFIX STRING_LENGTH(COMPLUS_PREFIX_A) + +#define DOTNET_PREFIX_A "DOTNET_" +#define DOTNET_PREFIX W("DOTNET_") +#define LEN_OF_DOTNET_PREFIX STRING_LENGTH(DOTNET_PREFIX_A) + +class CLRConfigNoCache +{ + const char* _value; + + CLRConfigNoCache() = default; + CLRConfigNoCache(LPCSTR cfg) : _value { cfg } + { } + +public: + bool IsSet() const { return _value != NULL; } + + LPCSTR AsString() const + { + _ASSERTE(IsSet()); + return _value; + } + + bool TryAsInteger(int radix, DWORD& result) const + { + _ASSERTE(IsSet()); + + errno = 0; + LPSTR endPtr; + unsigned long rawResult = strtoul(_value, &endPtr, radix); + if ((DWORD)rawResult != rawResult || errno == ERANGE) + { + return false; + } + + result = (DWORD)rawResult; + bool fSuccess = endPtr != _value; + return fSuccess; + } + + static CLRConfigNoCache Get(LPCSTR cfg, bool noPrefix = false, char*(*getEnvFptr)(const char*) = nullptr) + { + char nameBuffer[64]; + const char* fallbackPrefix = NULL; + const size_t namelen = strlen(cfg); + + if (noPrefix) + { + if (namelen >= ARRAY_SIZE(nameBuffer)) + { + _ASSERTE(!"Environment variable name too long."); + return {}; + } + + *nameBuffer = '\0'; + } + else + { + bool dotnetValid = namelen < (size_t)(STRING_LENGTH(nameBuffer) - LEN_OF_DOTNET_PREFIX); + bool complusValid = namelen < (size_t)(STRING_LENGTH(nameBuffer) - LEN_OF_COMPLUS_PREFIX); + if (!dotnetValid || !complusValid) + { + _ASSERTE(!"Environment variable name too long."); + return {}; + } + + // Priority order is DOTNET_ and then COMPlus_. + strcpy_s(nameBuffer, ARRAY_SIZE(nameBuffer), DOTNET_PREFIX_A); + fallbackPrefix = COMPLUS_PREFIX_A; + } + + strcat_s(nameBuffer, ARRAY_SIZE(nameBuffer), cfg); + + LPCSTR val = getEnvFptr != NULL ? getEnvFptr(nameBuffer) : getenv(nameBuffer); + if (val == NULL && fallbackPrefix != NULL) + { + strcpy_s(nameBuffer, ARRAY_SIZE(nameBuffer), fallbackPrefix); + strcat_s(nameBuffer, ARRAY_SIZE(nameBuffer), cfg); + val = getEnvFptr != NULL ? getEnvFptr(nameBuffer) : getenv(nameBuffer); + } + + return { val }; + } +}; diff --git a/src/shared/inc/clrdata.idl b/src/shared/inc/clrdata.idl index 2663a7b057..81b0e0bc7f 100644 --- a/src/shared/inc/clrdata.idl +++ b/src/shared/inc/clrdata.idl @@ -308,10 +308,12 @@ interface ICLRDataLoggingCallback : IUnknown typedef enum CLRDataEnumMemoryFlags { CLRDATA_ENUM_MEM_DEFAULT = 0x0, - CLRDATA_ENUM_MEM_MINI = CLRDATA_ENUM_MEM_DEFAULT, // generating skinny mini-dump - CLRDATA_ENUM_MEM_HEAP = 0x1, // generating heap dump - CLRDATA_ENUM_MEM_TRIAGE = 0x2, // generating triage mini-dump - + CLRDATA_ENUM_MEM_MINI = CLRDATA_ENUM_MEM_DEFAULT, // generating skinny mini-dump + CLRDATA_ENUM_MEM_HEAP = 0x1, // generating heap dump + CLRDATA_ENUM_MEM_TRIAGE = 0x2, // generating triage mini-dump + /* Generate heap dumps faster with less memory usage than CLRDATA_ENUM_MEM_HEAP by adding + the loader heaps instead of traversing all the individual runtime data structures. */ + CLRDATA_ENUM_MEM_HEAP2 = 0x3, /* More bits to be added here later */ } CLRDataEnumMemoryFlags; diff --git a/src/shared/inc/clrhost.h b/src/shared/inc/clrhost.h index d8fe0c597c..a1d22b6ee2 100644 --- a/src/shared/inc/clrhost.h +++ b/src/shared/inc/clrhost.h @@ -8,15 +8,17 @@ #ifndef __CLRHOST_H__ #define __CLRHOST_H__ +#include + #include "windows.h" // worth to include before mscoree.h so we are guaranteed to pick few definitions -#ifdef CreateSemaphore -#undef CreateSemaphore -#endif + #include "mscoree.h" #include "clrinternal.h" #include "switches.h" #include "holder.h" -#include "new.hpp" + +using std::nothrow; + #include "staticcontract.h" #include "predeftlsslot.h" #include "safemath.h" @@ -65,14 +67,10 @@ BOOL ClrVirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWO HANDLE ClrGetProcessExecutableHeap(); #endif -#ifdef FAILPOINTS_ENABLED -extern int RFS_HashStack(); -#endif - -// Critical section support for CLR DLLs other than the the EE. +// Critical section support for CLR DLLs other than the EE. // Include the header defining each Crst type and its corresponding level (relative rank). This is // auto-generated from a tool that takes a high-level description of each Crst type and its dependencies. -#include "crsttypes.h" +#include "crsttypes_generated.h" // critical section api CRITSEC_COOKIE ClrCreateCriticalSection(CrstType type, CrstFlags flags); @@ -80,15 +78,25 @@ void ClrDeleteCriticalSection(CRITSEC_COOKIE cookie); void ClrEnterCriticalSection(CRITSEC_COOKIE cookie); void ClrLeaveCriticalSection(CRITSEC_COOKIE cookie); +DWORD ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable); + // Rather than use the above APIs directly, it is recommended that holder classes // be used. This guarantees that the locks will be vacated when the scope is popped, // either on exception or on return. -typedef Holder CRITSEC_Holder; +typedef Holder CRITSEC_Holder; // Use this holder to manage CRITSEC_COOKIE allocation to ensure it will be released if anything goes wrong FORCEINLINE void VoidClrDeleteCriticalSection(CRITSEC_COOKIE cs) { if (cs != NULL) ClrDeleteCriticalSection(cs); } -typedef Wrapper, VoidClrDeleteCriticalSection, NULL> CRITSEC_AllocationHolder; +typedef Wrapper, VoidClrDeleteCriticalSection, 0> CRITSEC_AllocationHolder; + +#ifndef DACCESS_COMPILE +// Suspend/resume APIs that fail-fast on errors +#ifdef TARGET_WINDOWS +DWORD ClrSuspendThread(HANDLE hThread); +#endif // TARGET_WINDOWS +DWORD ClrResumeThread(HANDLE hThread); +#endif // !DACCESS_COMPILE DWORD GetClrModulePathName(SString& buffer); diff --git a/src/shared/inc/clrinternal.idl b/src/shared/inc/clrinternal.idl index 57ba59f8a5..e2efa1f685 100644 --- a/src/shared/inc/clrinternal.idl +++ b/src/shared/inc/clrinternal.idl @@ -20,7 +20,7 @@ import "mscoree.idl"; // security sense but short of deliberate 3rd party spoofing it should provide a good identity. // // Using a different ID allows us to completely hide different CLR SKUs from each other. The recommendation is to keep -// the ID contant between different versions of the same SKU and use mscordbi's logic to determine whether a given +// the ID constant between different versions of the same SKU and use mscordbi's logic to determine whether a given // version is compatible. This allows debuggers to give different errors for 'future version of the CLR I don't // support' vs. 'No CLR is loaded at all.' // @@ -32,8 +32,8 @@ cpp_quote("EXTERN_GUID(CLR_ID_V4_DESKTOP, 0x267f3989, 0xd786, 0x4b9a, 0x9a, 0xf6 // GUID CLR_ID_CORECLR : uuid{8CB8E075-0A91-408E-9228-D66E00A3BFF6} cpp_quote("EXTERN_GUID(CLR_ID_CORECLR, 0x8CB8E075, 0x0A91, 0x408E, 0x92, 0x28, 0xD6, 0x6E, 0x00, 0xA3, 0xBF, 0xF6 );") -// This guid first appears in the CoreCLR port to Windows Phone 8 - note that it is seperate from the CoreCLR id because it will -// potentially have a different verioning lineage than CoreCLR +// This guid first appears in the CoreCLR port to Windows Phone 8 - note that it is separate from the CoreCLR id because it will +// potentially have a different versioning lineage than CoreCLR // GUID CLR_ID_PHONE_CLR : uuid{E7237E9C-31C0-488C-AD48-324D3E7ED92A} cpp_quote("EXTERN_GUID(CLR_ID_PHONE_CLR, 0xE7237E9C, 0x31C0, 0x488C, 0xAD, 0x48, 0x32, 0x4D, 0x3E, 0x7E, 0xD9, 0x2A);") diff --git a/src/shared/inc/clrnt.h b/src/shared/inc/clrnt.h index bd541d4284..e555f5ead2 100644 --- a/src/shared/inc/clrnt.h +++ b/src/shared/inc/clrnt.h @@ -6,15 +6,7 @@ #define CLRNT_H_ #include "staticcontract.h" - -// -// This file is the result of some changes to the SDK header files. -// In particular, nt.h and some of its dependencies are no longer -// available except as "nonship" files. As a result, this file -// was created as a simple cut and past of structures and functions -// from NT that are either not yet documented or have been overlooked -// as being part of the platform SDK. -// +#include "cfi.h" // // ALL PLATFORMS @@ -45,14 +37,9 @@ #define LOCALE_NAME_MAX_LENGTH 85 #endif // !LOCALE_NAME_MAX_LENGTH -#ifndef SUBLANG_CUSTOM_DEFAULT -#define SUBLANG_CUSTOM_DEFAULT 0x03 // default custom language/locale -#define SUBLANG_CUSTOM_UNSPECIFIED 0x04 // custom language/locale -#define LOCALE_CUSTOM_DEFAULT \ - (MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT)) -#define LOCALE_CUSTOM_UNSPECIFIED \ - (MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT)) -#endif // !SUBLANG_CUSTOM_DEFAULT +#ifndef IMAGE_FILE_MACHINE_RISCV64 +#define IMAGE_FILE_MACHINE_RISCV64 0x5064 // RISCV64 +#endif // !IMAGE_FILE_MACHINE_RISCV64 #ifndef __out_xcount_opt #define __out_xcount_opt(var) __out @@ -94,659 +81,17 @@ typedef signed char SCHAR; typedef SCHAR *PSCHAR; typedef LONG NTSTATUS; -#ifndef HOST_UNIX +#ifdef HOST_WINDOWS -#define TLS_MINIMUM_AVAILABLE 64 // winnt #define TLS_EXPANSION_SLOTS 1024 -typedef enum _THREADINFOCLASS { - ThreadBasicInformation, - ThreadTimes, - ThreadPriority, - ThreadBasePriority, - ThreadAffinityMask, - ThreadImpersonationToken, - ThreadDescriptorTableEntry, - ThreadEnableAlignmentFaultFixup, - ThreadEventPair_Reusable, - ThreadQuerySetWin32StartAddress, - ThreadZeroTlsCell, - ThreadPerformanceCount, - ThreadAmILastThread, - ThreadIdealProcessor, - ThreadPriorityBoost, - ThreadSetTlsArrayAddress, - ThreadIsIoPending, - ThreadHideFromDebugger, - ThreadBreakOnTermination, - MaxThreadInfoClass - } THREADINFOCLASS; - -typedef enum _SYSTEM_INFORMATION_CLASS { - SystemBasicInformation, - SystemProcessorInformation, // obsolete...delete - SystemPerformanceInformation, - SystemTimeOfDayInformation, - SystemPathInformation, - SystemProcessInformation, - SystemCallCountInformation, - SystemDeviceInformation, - SystemProcessorPerformanceInformation, - SystemFlagsInformation, - SystemCallTimeInformation, - SystemModuleInformation, - SystemLocksInformation, - SystemStackTraceInformation, - SystemPagedPoolInformation, - SystemNonPagedPoolInformation, - SystemHandleInformation, - SystemObjectInformation, - SystemPageFileInformation, - SystemVdmInstemulInformation, - SystemVdmBopInformation, - SystemFileCacheInformation, - SystemPoolTagInformation, - SystemInterruptInformation, - SystemDpcBehaviorInformation, - SystemFullMemoryInformation, - SystemLoadGdiDriverInformation, - SystemUnloadGdiDriverInformation, - SystemTimeAdjustmentInformation, - SystemSummaryMemoryInformation, - SystemMirrorMemoryInformation, - SystemPerformanceTraceInformation, - SystemObsolete0, - SystemExceptionInformation, - SystemCrashDumpStateInformation, - SystemKernelDebuggerInformation, - SystemContextSwitchInformation, - SystemRegistryQuotaInformation, - SystemExtendServiceTableInformation, - SystemPrioritySeperation, - SystemVerifierAddDriverInformation, - SystemVerifierRemoveDriverInformation, - SystemProcessorIdleInformation, - SystemLegacyDriverInformation, - SystemCurrentTimeZoneInformation, - SystemLookasideInformation, - SystemTimeSlipNotification, - SystemSessionCreate, - SystemSessionDetach, - SystemSessionInformation, - SystemRangeStartInformation, - SystemVerifierInformation, - SystemVerifierThunkExtend, - SystemSessionProcessInformation, - SystemLoadGdiDriverInSystemSpace, - SystemNumaProcessorMap, - SystemPrefetcherInformation, - SystemExtendedProcessInformation, - SystemRecommendedSharedDataAlignment, - SystemComPlusPackage, - SystemNumaAvailableMemory, - SystemProcessorPowerInformation, - SystemEmulationBasicInformation, - SystemEmulationProcessorInformation, - SystemExtendedHandleInformation, - SystemLostDelayedWriteInformation -} SYSTEM_INFORMATION_CLASS; - -typedef enum _EVENT_INFORMATION_CLASS { - EventBasicInformation - } EVENT_INFORMATION_CLASS; - -typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION { - LARGE_INTEGER IdleTime; - LARGE_INTEGER KernelTime; - LARGE_INTEGER UserTime; - LARGE_INTEGER DpcTime; // DEVL only - LARGE_INTEGER InterruptTime; // DEVL only - ULONG InterruptCount; -} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; - -typedef enum _EVENT_TYPE { - NotificationEvent, - SynchronizationEvent - } EVENT_TYPE; - -typedef struct _EVENT_BASIC_INFORMATION { - EVENT_TYPE EventType; - LONG EventState; -} EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION; - -#define RTL_MEG (1024UL * 1024UL) -#define RTLP_IMAGE_MAX_DOS_HEADER ( 256UL * RTL_MEG) - -typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION { - BOOLEAN KernelDebuggerEnabled; - BOOLEAN KernelDebuggerNotPresent; -} SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION; - -typedef struct _STRING { - USHORT Length; - USHORT MaximumLength; -#ifdef MIDL_PASS - [size_is(MaximumLength), length_is(Length) ] -#endif // MIDL_PASS - PCHAR Buffer; -} STRING; -typedef STRING *PSTRING; - -typedef STRING ANSI_STRING; -typedef PSTRING PANSI_STRING; - -typedef STRING OEM_STRING; -typedef PSTRING POEM_STRING; -typedef CONST STRING* PCOEM_STRING; - -typedef struct _UNICODE_STRING { - USHORT Length; - USHORT MaximumLength; -#ifdef MIDL_PASS - [size_is(MaximumLength / 2), length_is((Length) / 2) ] USHORT * Buffer; -#else // MIDL_PASS - PWSTR Buffer; -#endif // MIDL_PASS -} UNICODE_STRING; -typedef UNICODE_STRING *PUNICODE_STRING; -typedef const UNICODE_STRING *PCUNICODE_STRING; -#define UNICODE_NULL ((WCHAR)0) // winnt - -typedef struct _STRING32 { - USHORT Length; - USHORT MaximumLength; - ULONG Buffer; -} STRING32; -typedef STRING32 *PSTRING32; - -typedef STRING32 UNICODE_STRING32; -typedef UNICODE_STRING32 *PUNICODE_STRING32; - -typedef STRING32 ANSI_STRING32; -typedef ANSI_STRING32 *PANSI_STRING32; - - -typedef struct _STRING64 { - USHORT Length; - USHORT MaximumLength; - ULONGLONG Buffer; -} STRING64; -typedef STRING64 *PSTRING64; - -typedef STRING64 UNICODE_STRING64; -typedef UNICODE_STRING64 *PUNICODE_STRING64; - -typedef STRING64 ANSI_STRING64; -typedef ANSI_STRING64 *PANSI_STRING64; - -#define GDI_HANDLE_BUFFER_SIZE32 34 -#define GDI_HANDLE_BUFFER_SIZE64 60 - -#if !defined(TARGET_AMD64) -#define GDI_HANDLE_BUFFER_SIZE GDI_HANDLE_BUFFER_SIZE32 -#else -#define GDI_HANDLE_BUFFER_SIZE GDI_HANDLE_BUFFER_SIZE64 -#endif - -typedef ULONG GDI_HANDLE_BUFFER32[GDI_HANDLE_BUFFER_SIZE32]; -typedef ULONG GDI_HANDLE_BUFFER64[GDI_HANDLE_BUFFER_SIZE64]; -typedef ULONG GDI_HANDLE_BUFFER [GDI_HANDLE_BUFFER_SIZE ]; - - -typedef struct _PEB_LDR_DATA { - ULONG Length; - BOOLEAN Initialized; - HANDLE SsHandle; - LIST_ENTRY InLoadOrderModuleList; - LIST_ENTRY InMemoryOrderModuleList; - LIST_ENTRY InInitializationOrderModuleList; - PVOID EntryInProgress; -} PEB_LDR_DATA, *PPEB_LDR_DATA; - -typedef struct _PEB_FREE_BLOCK { - struct _PEB_FREE_BLOCK *Next; - ULONG Size; -} PEB_FREE_BLOCK, *PPEB_FREE_BLOCK; +// Included for TEB::ReservedForOle, TlsSlots, TlsExpansionSlots +#include -typedef PVOID* PPVOID; +// Alias for TEB::ThreadLocalStoragePointer +#define ThreadLocalStoragePointer Reserved1[11] -typedef -VOID -(*PPS_POST_PROCESS_INIT_ROUTINE) ( - VOID - ); - -typedef struct _LDR_DATA_TABLE_ENTRY { - LIST_ENTRY InLoadOrderLinks; - LIST_ENTRY InMemoryOrderLinks; - LIST_ENTRY InInitializationOrderLinks; - PVOID DllBase; - PVOID EntryPoint; - ULONG SizeOfImage; - UNICODE_STRING FullDllName; - UNICODE_STRING BaseDllName; - ULONG Flags; - USHORT LoadCount; - USHORT TlsIndex; - union _foo { - LIST_ENTRY HashLinks; - struct _bar { - PVOID SectionPointer; - ULONG CheckSum; - }; - }; - union _foo2 { - struct _bar2 { - ULONG TimeDateStamp; - }; - struct _bar3 { - PVOID LoadedImports; - }; - }; - PVOID EntryPointActivationContext; -} LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY; - -#define TYPE3(arg) arg - -typedef struct _PEB { - BOOLEAN InheritedAddressSpace; // These four fields cannot change unless the - BOOLEAN ReadImageFileExecOptions; // - BOOLEAN BeingDebugged; // - BOOLEAN SpareBool; // - HANDLE Mutant; // INITIAL_PEB structure is also updated. - - PVOID ImageBaseAddress; - PPEB_LDR_DATA Ldr; - TYPE3(struct _RTL_USER_PROCESS_PARAMETERS*) ProcessParameters; - PVOID SubSystemData; - PVOID ProcessHeap; - TYPE3(struct _RTL_CRITICAL_SECTION*) FastPebLock; - PVOID FastPebLockRoutine; - PVOID FastPebUnlockRoutine; - ULONG EnvironmentUpdateCount; - PVOID KernelCallbackTable; - ULONG SystemReserved[1]; - - struct _foo { - ULONG ExecuteOptions : 2; - ULONG SpareBits : 30; - }; - - - PPEB_FREE_BLOCK FreeList; - ULONG TlsExpansionCounter; - PVOID TlsBitmap; - ULONG TlsBitmapBits[2]; // TLS_MINIMUM_AVAILABLE bits - PVOID ReadOnlySharedMemoryBase; - PVOID ReadOnlySharedMemoryHeap; - PPVOID ReadOnlyStaticServerData; - PVOID AnsiCodePageData; - PVOID OemCodePageData; - PVOID UnicodeCaseTableData; - - // - // Useful information for LdrpInitialize - ULONG NumberOfProcessors; - ULONG NtGlobalFlag; - - // - // Passed up from MmCreatePeb from Session Manager registry key - // - - LARGE_INTEGER CriticalSectionTimeout; - SIZE_T HeapSegmentReserve; - SIZE_T HeapSegmentCommit; - SIZE_T HeapDeCommitTotalFreeThreshold; - SIZE_T HeapDeCommitFreeBlockThreshold; - - // - // Where heap manager keeps track of all heaps created for a process - // Fields initialized by MmCreatePeb. ProcessHeaps is initialized - // to point to the first free byte after the PEB and MaximumNumberOfHeaps - // is computed from the page size used to hold the PEB, less the fixed - // size of this data structure. - // - - ULONG NumberOfHeaps; - ULONG MaximumNumberOfHeaps; - PPVOID ProcessHeaps; - - // - // - PVOID GdiSharedHandleTable; - PVOID ProcessStarterHelper; - ULONG GdiDCAttributeList; - PVOID LoaderLock; - - // - // Following fields filled in by MmCreatePeb from system values and/or - // image header. - // - - ULONG OSMajorVersion; - ULONG OSMinorVersion; - USHORT OSBuildNumber; - USHORT OSCSDVersion; - ULONG OSPlatformId; - ULONG ImageSubsystem; - ULONG ImageSubsystemMajorVersion; - ULONG ImageSubsystemMinorVersion; - ULONG_PTR ImageProcessAffinityMask; - GDI_HANDLE_BUFFER GdiHandleBuffer; - PPS_POST_PROCESS_INIT_ROUTINE PostProcessInitRoutine; - - PVOID TlsExpansionBitmap; - ULONG TlsExpansionBitmapBits[32]; // TLS_EXPANSION_SLOTS bits - - // - // Id of the Hydra session in which this process is running - // - ULONG SessionId; - - // - // Filled in by LdrpInstallAppcompatBackend - // - ULARGE_INTEGER AppCompatFlags; - - // - // ntuser appcompat flags - // - ULARGE_INTEGER AppCompatFlagsUser; - - // - // Filled in by LdrpInstallAppcompatBackend - // - PVOID pShimData; - - // - // Filled in by LdrQueryImageFileExecutionOptions - // - PVOID AppCompatInfo; - - // - // Used by GetVersionExW as the szCSDVersion string - // - UNICODE_STRING CSDVersion; - - // - // Fusion stuff - // - PVOID ActivationContextData; - PVOID ProcessAssemblyStorageMap; - PVOID SystemDefaultActivationContextData; - PVOID SystemAssemblyStorageMap; - - // - // Enforced minimum initial commit stack - // - SIZE_T MinimumStackCommit; - -} PEB, *PPEB; - -#define ACTIVATION_CONTEXT_STACK_FLAG_QUERIES_DISABLED (0x00000001) - -typedef struct _ACTIVATION_CONTEXT_STACK { - ULONG Flags; - ULONG NextCookieSequenceNumber; - PVOID ActiveFrame; - LIST_ENTRY FrameListCache; - -#if NT_SXS_PERF_COUNTERS_ENABLED - struct _ACTIVATION_CONTEXT_STACK_PERF_COUNTERS { - ULONGLONG Activations; - ULONGLONG ActivationCycles; - ULONGLONG Deactivations; - ULONGLONG DeactivationCycles; - } Counters; -#endif // NT_SXS_PERF_COUNTERS_ENABLED -} ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK; - -typedef const ACTIVATION_CONTEXT_STACK *PCACTIVATION_CONTEXT_STACK; - -#define TEB_ACTIVE_FRAME_CONTEXT_FLAG_EXTENDED (0x00000001) - -typedef struct _TEB_ACTIVE_FRAME_CONTEXT { - ULONG Flags; - PCSTR FrameName; -} TEB_ACTIVE_FRAME_CONTEXT, *PTEB_ACTIVE_FRAME_CONTEXT; - -typedef const struct _TEB_ACTIVE_FRAME_CONTEXT *PCTEB_ACTIVE_FRAME_CONTEXT; - -typedef struct _TEB_ACTIVE_FRAME_CONTEXT_EX { - TEB_ACTIVE_FRAME_CONTEXT BasicContext; - PCSTR SourceLocation; // e.g. "Z:\foo\bar\baz.c" -} TEB_ACTIVE_FRAME_CONTEXT_EX, *PTEB_ACTIVE_FRAME_CONTEXT_EX; - -typedef const struct _TEB_ACTIVE_FRAME_CONTEXT_EX *PCTEB_ACTIVE_FRAME_CONTEXT_EX; - -#define TEB_ACTIVE_FRAME_FLAG_EXTENDED (0x00000001) - -typedef struct _TEB_ACTIVE_FRAME { - ULONG Flags; - TYPE3(struct _TEB_ACTIVE_FRAME*) Previous; - PCTEB_ACTIVE_FRAME_CONTEXT Context; -} TEB_ACTIVE_FRAME, *PTEB_ACTIVE_FRAME; - -typedef const struct _TEB_ACTIVE_FRAME *PCTEB_ACTIVE_FRAME; - -typedef struct _TEB_ACTIVE_FRAME_EX { - TEB_ACTIVE_FRAME BasicFrame; - PVOID ExtensionIdentifier; // use address of your DLL Main or something unique to your mapping in the address space -} TEB_ACTIVE_FRAME_EX, *PTEB_ACTIVE_FRAME_EX; - -typedef const struct _TEB_ACTIVE_FRAME_EX *PCTEB_ACTIVE_FRAME_EX; - -typedef struct _CLIENT_ID { - HANDLE UniqueProcess; - HANDLE UniqueThread; -} CLIENT_ID; -typedef CLIENT_ID *PCLIENT_ID; - -#define GDI_BATCH_BUFFER_SIZE 310 - -typedef struct _GDI_TEB_BATCH { - ULONG Offset; - ULONG_PTR HDC; - ULONG Buffer[GDI_BATCH_BUFFER_SIZE]; -} GDI_TEB_BATCH,*PGDI_TEB_BATCH; - -typedef struct _Wx86ThreadState { - PULONG CallBx86Eip; - PVOID DeallocationCpu; - BOOLEAN UseKnownWx86Dll; - char OleStubInvoked; -} WX86THREAD, *PWX86THREAD; - -#define STATIC_UNICODE_BUFFER_LENGTH 261 -#define WIN32_CLIENT_INFO_LENGTH 62 - -typedef struct _PEB* PPEB; - -typedef struct _TEB { - NT_TIB NtTib; - PVOID EnvironmentPointer; - CLIENT_ID ClientId; - PVOID ActiveRpcHandle; - PVOID ThreadLocalStoragePointer; -#if defined(PEBTEB_BITS) - PVOID ProcessEnvironmentBlock; -#else - PPEB ProcessEnvironmentBlock; #endif - ULONG LastErrorValue; - ULONG CountOfOwnedCriticalSections; - PVOID CsrClientThread; - PVOID Win32ThreadInfo; // PtiCurrent - ULONG User32Reserved[26]; // user32.dll items - ULONG UserReserved[5]; // Winsrv SwitchStack - PVOID WOW32Reserved; // used by WOW - LCID CurrentLocale; - ULONG FpSoftwareStatusRegister; // offset known by outsiders! - PVOID SystemReserved1[54]; // Used by FP emulator - NTSTATUS ExceptionCode; // for RaiseUserException - ACTIVATION_CONTEXT_STACK ActivationContextStack; // Fusion activation stack - // sizeof(PVOID) is a way to express processor-dependence, more generally than #ifdef HOST_64BIT - UCHAR SpareBytes1[48 - sizeof(PVOID) - sizeof(ACTIVATION_CONTEXT_STACK)]; - GDI_TEB_BATCH GdiTebBatch; // Gdi batching - CLIENT_ID RealClientId; - HANDLE GdiCachedProcessHandle; - ULONG GdiClientPID; - ULONG GdiClientTID; - PVOID GdiThreadLocalInfo; - ULONG_PTR Win32ClientInfo[WIN32_CLIENT_INFO_LENGTH]; // User32 Client Info - PVOID glDispatchTable[233]; // OpenGL - ULONG_PTR glReserved1[29]; // OpenGL - PVOID glReserved2; // OpenGL - PVOID glSectionInfo; // OpenGL - PVOID glSection; // OpenGL - PVOID glTable; // OpenGL - PVOID glCurrentRC; // OpenGL - PVOID glContext; // OpenGL - ULONG LastStatusValue; - UNICODE_STRING StaticUnicodeString; - WCHAR StaticUnicodeBuffer[STATIC_UNICODE_BUFFER_LENGTH]; - PVOID DeallocationStack; - PVOID TlsSlots[TLS_MINIMUM_AVAILABLE]; - LIST_ENTRY TlsLinks; - PVOID Vdm; - PVOID ReservedForNtRpc; - PVOID DbgSsReserved[2]; - ULONG HardErrorsAreDisabled; - PVOID Instrumentation[16]; - PVOID WinSockData; // WinSock - ULONG GdiBatchCount; - BOOLEAN InDbgPrint; - BOOLEAN FreeStackOnTermination; - BOOLEAN HasFiberData; - BOOLEAN IdealProcessor; - ULONG Spare3; - PVOID ReservedForPerf; - PVOID ReservedForOle; - ULONG WaitingOnLoaderLock; - WX86THREAD Wx86Thread; - PPVOID TlsExpansionSlots; - LCID ImpersonationLocale; // Current locale of impersonated user - ULONG IsImpersonating; // Thread impersonation status - PVOID NlsCache; // NLS thread cache - PVOID pShimData; // Per thread data used in the shim - ULONG HeapVirtualAffinity; - HANDLE CurrentTransactionHandle;// reserved for TxF transaction context - PTEB_ACTIVE_FRAME ActiveFrame; -} TEB; -typedef TEB *PTEB; - -typedef struct _CURDIR { - UNICODE_STRING DosPath; - HANDLE Handle; -} CURDIR, *PCURDIR; - -#define RTL_USER_PROC_CURDIR_CLOSE 0x00000002 -#define RTL_USER_PROC_CURDIR_INHERIT 0x00000003 - -typedef struct _RTL_DRIVE_LETTER_CURDIR { - USHORT Flags; - USHORT Length; - ULONG TimeStamp; - STRING DosPath; -} RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR; - - -#define RTL_MAX_DRIVE_LETTERS 32 -#define RTL_DRIVE_LETTER_VALID (USHORT)0x0001 - -typedef struct _RTL_USER_PROCESS_PARAMETERS { - ULONG MaximumLength; - ULONG Length; - - ULONG Flags; - ULONG DebugFlags; - - HANDLE ConsoleHandle; - ULONG ConsoleFlags; - HANDLE StandardInput; - HANDLE StandardOutput; - HANDLE StandardError; - - CURDIR CurrentDirectory; // ProcessParameters - UNICODE_STRING DllPath; // ProcessParameters - UNICODE_STRING ImagePathName; // ProcessParameters - UNICODE_STRING CommandLine; // ProcessParameters - PVOID Environment; // NtAllocateVirtualMemory - - ULONG StartingX; - ULONG StartingY; - ULONG CountX; - ULONG CountY; - ULONG CountCharsX; - ULONG CountCharsY; - ULONG FillAttribute; - - ULONG WindowFlags; - ULONG ShowWindowFlags; - UNICODE_STRING WindowTitle; // ProcessParameters - UNICODE_STRING DesktopInfo; // ProcessParameters - UNICODE_STRING ShellInfo; // ProcessParameters - UNICODE_STRING RuntimeData; // ProcessParameters - RTL_DRIVE_LETTER_CURDIR CurrentDirectores[ RTL_MAX_DRIVE_LETTERS ]; -} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS; - - -typedef enum _PROCESSINFOCLASS { - ProcessBasicInformation, - ProcessQuotaLimits, - ProcessIoCounters, - ProcessVmCounters, - ProcessTimes, - ProcessBasePriority, - ProcessRaisePriority, - ProcessDebugPort, - ProcessExceptionPort, - ProcessAccessToken, - ProcessLdtInformation, - ProcessLdtSize, - ProcessDefaultHardErrorMode, - ProcessIoPortHandlers, // Note: this is kernel mode only - ProcessPooledUsageAndLimits, - ProcessWorkingSetWatch, - ProcessUserModeIOPL, - ProcessEnableAlignmentFaultFixup, - ProcessPriorityClass, - ProcessWx86Information, - ProcessHandleCount, - ProcessAffinityMask, - ProcessPriorityBoost, - ProcessDeviceMap, - ProcessSessionInformation, - ProcessForegroundInformation, - ProcessWow64Information, - ProcessImageFileName, - ProcessLUIDDeviceMapsEnabled, - ProcessBreakOnTermination, - ProcessDebugObjectHandle, - ProcessDebugFlags, - ProcessHandleTracing, - MaxProcessInfoClass // MaxProcessInfoClass should always be the last enum - } PROCESSINFOCLASS; - - -typedef struct _VM_COUNTERS { - SIZE_T PeakVirtualSize; - SIZE_T VirtualSize; - ULONG PageFaultCount; - SIZE_T PeakWorkingSetSize; - SIZE_T WorkingSetSize; - SIZE_T QuotaPeakPagedPoolUsage; - SIZE_T QuotaPagedPoolUsage; - SIZE_T QuotaPeakNonPagedPoolUsage; - SIZE_T QuotaNonPagedPoolUsage; - SIZE_T PagefileUsage; - SIZE_T PeakPagefileUsage; -} VM_COUNTERS; -typedef VM_COUNTERS *PVM_COUNTERS; - -#undef TYPE3 - -#endif // !defined(HOST_UNIX) #if !defined(TARGET_X86) @@ -832,26 +177,30 @@ RtlVirtualUnwind_Unsafe( // #ifdef TARGET_X86 -#ifndef TARGET_UNIX +#ifndef HOST_UNIX // // x86 ABI does not define RUNTIME_FUNCTION. Define our own to allow unification between x86 and other platforms. // #ifdef HOST_X86 typedef struct _RUNTIME_FUNCTION { DWORD BeginAddress; + // NOTE: R2R doesn't include EndAddress (see docs/design/coreclr/botr/readytorun-format.md). + // NativeAOT does include the EndAddress because the Microsoft linker expects it. In NativeAOT + // the info is generated in the managed ObjectWriter, so the structures don't have to match. + // DWORD EndAddress; DWORD UnwindData; } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION; typedef struct _DISPATCHER_CONTEXT { _EXCEPTION_REGISTRATION_RECORD* RegistrationPointer; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; + #endif // HOST_X86 -#endif // !TARGET_UNIX +#endif // !HOST_UNIX #define RUNTIME_FUNCTION__BeginAddress(prf) (prf)->BeginAddress #define RUNTIME_FUNCTION__SetBeginAddress(prf,addr) ((prf)->BeginAddress = (addr)) -#ifdef FEATURE_EH_FUNCLETS #include "win64unwind.h" #include "daccess.h" @@ -862,7 +211,7 @@ RtlpGetFunctionEndAddress ( _In_ TADDR ImageBase ) { - PTR_UNWIND_INFO pUnwindInfo = (PTR_UNWIND_INFO)(ImageBase + FunctionEntry->UnwindData); + PUNWIND_INFO pUnwindInfo = (PUNWIND_INFO)(ImageBase + FunctionEntry->UnwindData); return FunctionEntry->BeginAddress + pUnwindInfo->FunctionLength; } @@ -873,10 +222,7 @@ RtlpGetFunctionEndAddress ( #define RUNTIME_FUNCTION__SetUnwindInfoAddress(prf, addr) do { (prf)->UnwindData = (addr); } while(0) #ifdef HOST_X86 -EXTERN_C -NTSYSAPI PEXCEPTION_ROUTINE -NTAPI RtlVirtualUnwind ( _In_ DWORD HandlerType, _In_ DWORD ImageBase, @@ -888,7 +234,6 @@ RtlVirtualUnwind ( __inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers ); #endif // HOST_X86 -#endif // FEATURE_EH_FUNCLETS #endif // TARGET_X86 @@ -976,9 +321,22 @@ RtlpGetFunctionEndAddress ( ULONG64 FunctionLength; FunctionLength = FunctionEntry->UnwindData; - if ((FunctionLength & 3) != 0) { - FunctionLength = (FunctionLength >> 2) & 0x7ff; - } else { + if ((FunctionLength & 3) != 0) + { + // Compact form pdata. + if ((FunctionLength & 7) == 3) + { + // Long branch pdata, by standard this is 3 so size is 12. + FunctionLength = 3; + } + else + { + FunctionLength = (FunctionLength >> 2) & 0x7ff; + } + } + else + { + // Get from the xdata record. FunctionLength = *(PTR_ULONG64)(ImageBase + FunctionLength) & 0x3ffff; } @@ -1011,23 +369,63 @@ RtlVirtualUnwind( IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL ); -#ifndef IMAGE_FILE_MACHINE_ARM64 -#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // ARM64 Little-Endian #endif -#ifndef IMAGE_REL_ARM64_BRANCH26 -#define IMAGE_REL_ARM64_BRANCH26 0x0003 // 26 bit offset << 2 & sign ext. for B & BL -#endif +#ifdef TARGET_LOONGARCH64 +#include "daccess.h" -#ifndef IMAGE_REL_ARM64_PAGEBASE_REL21 -#define IMAGE_REL_ARM64_PAGEBASE_REL21 0x0004 // ADRP 21 bit PC-relative page address -#endif +#define UNW_FLAG_NHANDLER 0x0 /* any handler */ +#define UNW_FLAG_EHANDLER 0x1 /* filter handler */ +#define UNW_FLAG_UHANDLER 0x2 /* unwind handler */ -#ifndef IMAGE_REL_ARM64_PAGEOFFSET_12A -#define IMAGE_REL_ARM64_PAGEOFFSET_12A 0x0006 // ADD 12 bit page offset -#endif +// This function returns the RVA of the end of the function (exclusive, so one byte after the actual end) +// using the unwind info on LOONGARCH64. (see ExternalAPIs\Win9CoreSystem\inc\winnt.h) +FORCEINLINE +ULONG64 +RtlpGetFunctionEndAddress ( + _In_ PT_RUNTIME_FUNCTION FunctionEntry, + _In_ ULONG64 ImageBase + ) +{ + ULONG64 FunctionLength; -#endif + FunctionLength = FunctionEntry->UnwindData; + if ((FunctionLength & 3) != 0) { + FunctionLength = (FunctionLength >> 2) & 0x7ff; + } else { + FunctionLength = *(PTR_ULONG64)(ImageBase + FunctionLength) & 0x3ffff; + } + + return FunctionEntry->BeginAddress + 4 * FunctionLength; +} + +#define RUNTIME_FUNCTION__BeginAddress(FunctionEntry) ((FunctionEntry)->BeginAddress) +#define RUNTIME_FUNCTION__SetBeginAddress(FunctionEntry,address) ((FunctionEntry)->BeginAddress = (address)) + +#define RUNTIME_FUNCTION__EndAddress(FunctionEntry, ImageBase) (RtlpGetFunctionEndAddress(FunctionEntry, (ULONG64)(ImageBase))) + +#define RUNTIME_FUNCTION__SetUnwindInfoAddress(prf,address) do { (prf)->UnwindData = (address); } while (0) + +typedef struct _UNWIND_INFO { + // dummy +} UNWIND_INFO, *PUNWIND_INFO; + +EXTERN_C +NTSYSAPI +PEXCEPTION_ROUTINE +NTAPI +RtlVirtualUnwind( + IN ULONG HandlerType, + IN ULONG64 ImageBase, + IN ULONG64 ControlPc, + IN PRUNTIME_FUNCTION FunctionEntry, + IN OUT PCONTEXT ContextRecord, + OUT PVOID *HandlerData, + OUT PULONG64 EstablisherFrame, + IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL + ); + +#endif // TARGET_LOONGARCH64 #ifdef TARGET_RISCV64 #include "daccess.h" @@ -1051,8 +449,7 @@ RtlpGetFunctionEndAddress ( if ((FunctionLength & 3) != 0) { FunctionLength = (FunctionLength >> 2) & 0x7ff; } else { - memcpy(&FunctionLength, (void*)(ImageBase + FunctionLength), sizeof(UINT32)); - FunctionLength &= 0x3ffff; + FunctionLength = *(PTR_ULONG64)(ImageBase + FunctionLength) & 0x3ffff; } return FunctionEntry->BeginAddress + 4 * FunctionLength; diff --git a/src/shared/inc/clrtypes.h b/src/shared/inc/clrtypes.h index 5e83573e7a..9094e4932a 100644 --- a/src/shared/inc/clrtypes.h +++ b/src/shared/inc/clrtypes.h @@ -338,6 +338,15 @@ inline UINT64 AlignUp(UINT64 value, UINT alignment) return (value+alignment-1)&~(UINT64)(alignment-1); } +#ifdef __APPLE__ +inline SIZE_T AlignUp(SIZE_T value, UINT alignment) +{ + STATIC_CONTRACT_LEAF; + STATIC_CONTRACT_SUPPORTS_DAC; + return (value+alignment-1)&~(SIZE_T)(alignment-1); +} +#endif // __APPLE__ + inline UINT AlignDown(UINT value, UINT alignment) { STATIC_CONTRACT_LEAF; @@ -361,6 +370,15 @@ inline UINT64 AlignDown(UINT64 value, UINT alignment) return (value&~(UINT64)(alignment-1)); } +#ifdef __APPLE__ +inline SIZE_T AlignDown(SIZE_T value, UINT alignment) +{ + STATIC_CONTRACT_LEAF; + STATIC_CONTRACT_SUPPORTS_DAC; + return (value&~(SIZE_T)(alignment-1)); +} +#endif // __APPLE__ + inline UINT AlignmentPad(UINT value, UINT alignment) { STATIC_CONTRACT_WRAPPER; @@ -381,6 +399,14 @@ inline UINT AlignmentPad(UINT64 value, UINT alignment) return (UINT) (AlignUp(value, alignment) - value); } +#ifdef __APPLE__ +inline UINT AlignmentPad(SIZE_T value, UINT alignment) +{ + STATIC_CONTRACT_WRAPPER; + return (UINT) (AlignUp(value, alignment) - value); +} +#endif // __APPLE__ + inline UINT AlignmentTrim(UINT value, UINT alignment) { STATIC_CONTRACT_LEAF; @@ -406,4 +432,13 @@ inline UINT AlignmentTrim(UINT64 value, UINT alignment) return ((UINT)value)&(alignment-1); } +#ifdef __APPLE__ +inline UINT AlignmentTrim(SIZE_T value, UINT alignment) +{ + STATIC_CONTRACT_LEAF; + STATIC_CONTRACT_SUPPORTS_DAC; + return ((UINT)value)&(alignment-1); +} +#endif // __APPLE__ + #endif // CLRTYPES_H_ diff --git a/src/shared/inc/contract.h b/src/shared/inc/contract.h index a880d77c29..a8f3f6f47c 100644 --- a/src/shared/inc/contract.h +++ b/src/shared/inc/contract.h @@ -140,7 +140,6 @@ // ModeViolation // FaultViolation // FaultNotFatal -// HostViolation // LoadsTypeViolation // TakesLockViolation // @@ -174,7 +173,7 @@ // A do-nothing contract used by functions that trivially wrap another. // // -// "LEGACY" stuff - these features have been mostly superceded by better solutions +// "LEGACY" stuff - these features have been mostly superseded by better solutions // so their use should be discouraged. // // @@ -226,14 +225,13 @@ #define ENABLE_CONTRACTS #endif -// Finally, only define the implementaiton parts of contracts if this isn't a DAC build. +// Finally, only define the implementation parts of contracts if this isn't a DAC build. #if defined(_DEBUG_IMPL) && defined(ENABLE_CONTRACTS) #define ENABLE_CONTRACTS_IMPL #endif #include "specstrings.h" #include "clrtypes.h" -#include "malloc.h" #include "check.h" #include "debugreturn.h" #include "staticcontract.h" @@ -378,7 +376,7 @@ struct DbgStateLockState #define CONTRACT_BITMASK_OK_TO_THROW 0x1 << 0 #define CONTRACT_BITMASK_FAULT_FORBID 0x1 << 1 -#define CONTRACT_BITMASK_HOSTCALLS 0x1 << 2 +// Unused 0x1 << 2 #define CONTRACT_BITMASK_SOTOLERANT 0x1 << 3 #define CONTRACT_BITMASK_DEBUGONLY 0x1 << 4 #define CONTRACT_BITMASK_SONOTMAINLINE 0x1 << 5 @@ -418,11 +416,10 @@ struct ClrDebugState // We start out in SO-tolerant mode and must probe before entering SO-intolerant // any global state updates. // Initial mode is non-debug until we say otherwise - // Everthing defaults to mainline + // Everything defaults to mainline // By default, GetThread() is perfectly fine to call // By default, it's ok to take a lock (or call someone who does) m_flags = CONTRACT_BITMASK_OK_TO_THROW| - CONTRACT_BITMASK_HOSTCALLS| CONTRACT_BITMASK_SOTOLERANT| CONTRACT_BITMASK_OK_TO_LOCK| CONTRACT_BITMASK_OK_TO_RETAKE_LOCK; @@ -512,30 +509,6 @@ struct ClrDebugState CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_FAULT_FORBID); } - //--// - BOOL IsHostCaller() - { - return CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_HOSTCALLS); - } - - void SetHostCaller() - { - CONTRACT_BITMASK_SET(CONTRACT_BITMASK_HOSTCALLS); - } - - - BOOL SetHostCaller(BOOL value) - { - BOOL prevState = CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_HOSTCALLS); - CONTRACT_BITMASK_UPDATE(CONTRACT_BITMASK_HOSTCALLS,value); - return prevState; - } - - void ResetHostCaller() - { - CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_HOSTCALLS); - } - //--// BOOL IsDebugOnly() { @@ -896,11 +869,8 @@ class BaseContract SO_MAINLINE_No = 0x00000800, // code is not part of our mainline SO scenario - // Any place where we can't safely call into the host should have a HOST_NoCalls contract - HOST_Mask = 0x00003000, - HOST_Calls = 0x00002000, - HOST_NoCalls = 0x00001000, - HOST_Disabled = 0x00000000, // the default + // Unused = 0x00002000, + // Unused = 0x00001000, // These enforce the CAN_TAKE_LOCK / CANNOT_TAKE_LOCK contracts CAN_TAKE_LOCK_Mask = 0x00060000, @@ -920,7 +890,7 @@ class BaseContract LOADS_TYPE_Disabled = 0x00000000, // the default ALL_Disabled = THROWS_Disabled|GC_Disabled|FAULT_Disabled|MODE_Disabled|LOADS_TYPE_Disabled| - HOST_Disabled|CAN_TAKE_LOCK_Disabled|CAN_RETAKE_LOCK_No_Disabled + CAN_TAKE_LOCK_Disabled|CAN_RETAKE_LOCK_No_Disabled }; @@ -998,7 +968,7 @@ class BaseContract } }; - // PseudoTemplate is a class which can be instantated with a template-like syntax, resulting + // PseudoTemplate is a class which can be instantiated with a template-like syntax, resulting // in an expression which simply boxes a following value in a Box template @@ -1124,7 +1094,6 @@ enum ContractViolationBits FaultNotFatal = 0x00000010, // suppress INJECT_FAULT but not fault injection by harness LoadsTypeViolation = 0x00000040, // suppress LOADS_TYPE tags in this scope TakesLockViolation = 0x00000080, // suppress CAN_TAKE_LOCK tags in this scope - HostViolation = 0x00000100, // suppress HOST_CALLS tags in this scope //These are not violation bits. We steal some bits out of the violation mask to serve as // general flag bits. @@ -1667,7 +1636,7 @@ class ContractViolationHolder FORCEINLINE void EnterInternal(UINT_PTR violationMask) { _ASSERTE(0 == (violationMask & ~(ThrowsViolation | GCViolation | ModeViolation | FaultViolation | - FaultNotFatal | HostViolation | + FaultNotFatal | TakesLockViolation | LoadsTypeViolation)) || violationMask == AllViolation); @@ -1738,9 +1707,6 @@ enum PermanentContractViolationReason ReasonIBC, // Code runs in IBC scenarios only and the violation is safe. ReasonNGEN, // Code runs in NGEN scenarios only and the violation is safe. ReasonProfilerCallout, // Profiler implementers are guaranteed not to throw. - ReasonUnsupportedForSQLF1Profiling, // This code path violates HOST_NOCALLS, but that's ok b/c SQL will never - // invoke it, and thus SQL/F1 profiling (the primary reason to enforce - // HOST_NOCALLS) is not in danger. ReasonRuntimeReentrancy, // e.g. SafeQueryInterface ReasonShutdownOnly, // Code path only runs as part of Shutdown and the violation is safe. ReasonSOTolerance, // We would like to redesign SO contracts anyways @@ -2006,54 +1972,6 @@ inline ClrDebugState *GetClrDebugState(BOOL fAlloc) return NULL; } -#endif // ENABLE_CONTRACTS_IMPL - -#ifdef ENABLE_CONTRACTS_IMPL - -class HostNoCallHolder -{ - public: - DEBUG_NOINLINE HostNoCallHolder() - { - SCAN_SCOPE_BEGIN; - STATIC_CONTRACT_HOST_NOCALLS; - - m_clrDebugState = GetClrDebugState(); - m_previousState = m_clrDebugState->SetHostCaller(FALSE); - } - - DEBUG_NOINLINE ~HostNoCallHolder() - { - SCAN_SCOPE_END; - - m_clrDebugState->SetHostCaller(m_previousState); - } - - private: - BOOL m_previousState; - ClrDebugState* m_clrDebugState; - -}; - -#define BEGIN_HOST_NOCALL_CODE \ - { \ - HostNoCallHolder __hostNoCallHolder; \ - CantAllocHolder __cantAlloc; - -#define END_HOST_NOCALL_CODE \ - } - -#else // ENABLE_CONTRACTS_IMPL -#define BEGIN_HOST_NOCALL_CODE \ - { \ - CantAllocHolder __cantAlloc; \ - -#define END_HOST_NOCALL_CODE \ - } -#endif - - -#if defined(ENABLE_CONTRACTS_IMPL) // Macros to indicate we're taking or releasing locks @@ -2063,21 +1981,6 @@ class HostNoCallHolder #define LOCK_RELEASED_MULTIPLE(dbgStateLockType, cExits, pvLock) \ ::GetClrDebugState()->LockReleased((dbgStateLockType), (cExits), (void*) (pvLock)) -// Use these only if you need to force multiple entrances or exits in a single -// line (e.g., to restore the lock to a previous state). CRWLock in vm\rwlock.cpp does this -#define EE_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock) \ - LOCK_TAKEN_MULTIPLE(kDbgStateLockType_EE, cEntrances, pvLock) -#define EE_LOCK_RELEASED_MULTIPLE(cExits, pvLock) \ - LOCK_RELEASED_MULTIPLE(kDbgStateLockType_EE, cExits, pvLock) -#define HOST_BREAKABLE_CRST_TAKEN_MULTIPLE(cEntrances, pvLock) \ - LOCK_TAKEN_MULTIPLE(kDbgStateLockType_HostBreakableCrst, cEntrances, pvLock) -#define HOST_BREAKABLE_CRST_RELEASED_MULTIPLE(cExits, pvLock) \ - LOCK_RELEASED_MULTIPLE(kDbgStateLockType_HostBreakableCrst, cExits, pvLock) -#define USER_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock) \ - LOCK_TAKEN_MULTIPLE(kDbgStateLockType_User, cEntrances, pvLock) -#define USER_LOCK_RELEASED_MULTIPLE(cExits, pvLock) \ - LOCK_RELEASED_MULTIPLE(kDbgStateLockType_User, cExits, pvLock) - // These are most typically used #define EE_LOCK_TAKEN(pvLock) \ LOCK_TAKEN_MULTIPLE(kDbgStateLockType_EE, 1, pvLock) @@ -2096,12 +1999,6 @@ class HostNoCallHolder #define LOCK_TAKEN_MULTIPLE(dbgStateLockType, cEntrances, pvLock) #define LOCK_RELEASED_MULTIPLE(dbgStateLockType, cExits, pvLock) -#define EE_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock) -#define EE_LOCK_RELEASED_MULTIPLE(cExits, pvLock) -#define HOST_BREAKABLE_CRST_TAKEN_MULTIPLE(cEntrances, pvLock) -#define HOST_BREAKABLE_CRST_RELEASED_MULTIPLE(cExits, pvLock) -#define USER_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock) -#define USER_LOCK_RELEASED_MULTIPLE(cExits, pvLock) #define EE_LOCK_TAKEN(pvLock) #define EE_LOCK_RELEASED(pvLock) #define HOST_BREAKABLE_CRST_TAKEN(pvLock) @@ -2142,7 +2039,7 @@ class HostNoCallHolder // Eventually, all those bugs should be fixed this holder can be completely removed. // // It is also the case that we disallow allocations when any thread is OS suspended -// This happens for a short time when we are suspending the EE. We supress both +// This happens for a short time when we are suspending the EE. We suppress both // of these. // // @todo- ideally this would be rolled into the ContractViolation. diff --git a/src/shared/inc/contract.inl b/src/shared/inc/contract.inl index 06ee1ef06d..211b6b5a1d 100644 --- a/src/shared/inc/contract.inl +++ b/src/shared/inc/contract.inl @@ -352,7 +352,7 @@ inline void DbgStateLockData::LockTaken(DbgStateLockType dbgStateLockType, // Remember as many of these new entrances in m_rgTakenLockInfos as we can for (UINT i = cCombinedLocks; - i < min (ARRAY_SIZE(m_rgTakenLockInfos), cCombinedLocks + cTakes); + i < std::min (ARRAY_SIZE(m_rgTakenLockInfos), (size_t)(cCombinedLocks + cTakes)); i++) { m_rgTakenLockInfos[i].m_pvLock = pvLock; @@ -377,7 +377,7 @@ inline void DbgStateLockData::LockReleased(DbgStateLockType dbgStateLockType, UI // If lock count is within range of our m_rgTakenLockInfos buffer size, then // make sure we're releasing locks in reverse order of how we took them for (UINT i = cCombinedLocks - cReleases; - i < min (ARRAY_SIZE(m_rgTakenLockInfos), cCombinedLocks); + i < std::min (ARRAY_SIZE(m_rgTakenLockInfos), (size_t)cCombinedLocks); i++) { if (m_rgTakenLockInfos[i].m_pvLock != pvLock) @@ -443,7 +443,7 @@ inline BOOL DbgStateLockState::IsLockRetaken(void * pvLock) // m_cLocksEnteringCannotRetakeLock records the number of locks that were taken // when CANNOT_RETAKE_LOCK contract was constructed. for (UINT i = 0; - i < min(ARRAY_SIZE(m_pLockData->m_rgTakenLockInfos), m_cLocksEnteringCannotRetakeLock); + i < std::min(ARRAY_SIZE(m_pLockData->m_rgTakenLockInfos), (size_t)m_cLocksEnteringCannotRetakeLock); ++i) { if (m_pLockData->m_rgTakenLockInfos[i].m_pvLock == pvLock) @@ -493,7 +493,7 @@ void CONTRACT_ASSERT(const char *szElaboration, { char Buf[512*20 + 2048 + 1024]; - sprintf_s(Buf,ARRAY_SIZE(Buf), "CONTRACT VIOLATION by %s at \"%s\" @ %d\n\n%s\n", szFunction, szFile, lineNum, szElaboration); + sprintf_s(Buf,ARRAY_SIZE(Buf), "CONTRACT VIOLATION by %s at \"%s\":%d\n\n%s\n", szFunction, szFile, lineNum, szElaboration); int count = 20; ContractStackRecord *pRec = CheckClrDebugState() ? CheckClrDebugState()->GetContractStackTrace() : NULL; @@ -530,7 +530,7 @@ void CONTRACT_ASSERT(const char *szElaboration, } sprintf_s(tmpbuf,ARRAY_SIZE(tmpbuf), - "\n%s %s in %s at \"%s\" @ %d", + "\n%s %s in %s at \"%s\":%d", fshowconflict ? "VIOLATED-->" : " ", pRec->m_construct, pRec->m_szFunction, diff --git a/src/shared/inc/cor.h b/src/shared/inc/cor.h index 8ccc151cc0..d6f31caeff 100644 --- a/src/shared/inc/cor.h +++ b/src/shared/inc/cor.h @@ -23,35 +23,6 @@ extern "C" { #endif -// {BED7F4EA-1A96-11d2-8F08-00A0C9A6186D} -EXTERN_GUID(LIBID_ComPlusRuntime, 0xbed7f4ea, 0x1a96, 0x11d2, 0x8f, 0x8, 0x0, 0xa0, 0xc9, 0xa6, 0x18, 0x6d); - -// {90883F05-3D28-11D2-8F17-00A0C9A6186D} -EXTERN_GUID(GUID_ExportedFromComPlus, 0x90883f05, 0x3d28, 0x11d2, 0x8f, 0x17, 0x0, 0xa0, 0xc9, 0xa6, 0x18, 0x6d); - -// {0F21F359-AB84-41e8-9A78-36D110E6D2F9} -EXTERN_GUID(GUID_ManagedName, 0xf21f359, 0xab84, 0x41e8, 0x9a, 0x78, 0x36, 0xd1, 0x10, 0xe6, 0xd2, 0xf9); - -// {54FC8F55-38DE-4703-9C4E-250351302B1C} -EXTERN_GUID(GUID_Function2Getter, 0x54fc8f55, 0x38de, 0x4703, 0x9c, 0x4e, 0x25, 0x3, 0x51, 0x30, 0x2b, 0x1c); - -// CLSID_CorMetaDataDispenserRuntime: {1EC2DE53-75CC-11d2-9775-00A0C9B4D50C} -// Dispenser coclass for version 1.5 and 2.0 meta data. To get the "latest" bind -// to CLSID_MetaDataDispenser. -EXTERN_GUID(CLSID_CorMetaDataDispenserRuntime, 0x1ec2de53, 0x75cc, 0x11d2, 0x97, 0x75, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc); - -// {CD2BC5C9-F452-4326-B714-F9C539D4DA58} -EXTERN_GUID(GUID_DispIdOverride, 0xcd2bc5c9, 0xf452, 0x4326, 0xb7, 0x14, 0xf9, 0xc5, 0x39, 0xd4, 0xda, 0x58); - -// {B64784EB-D8D4-4d9b-9ACD-0E30806426F7} -EXTERN_GUID(GUID_ForceIEnumerable, 0xb64784eb, 0xd8d4, 0x4d9b, 0x9a, 0xcd, 0x0e, 0x30, 0x80, 0x64, 0x26, 0xf7); - -// {2941FF83-88D8-4F73-B6A9-BDF8712D000D} -EXTERN_GUID(GUID_PropGetCA, 0x2941ff83, 0x88d8, 0x4f73, 0xb6, 0xa9, 0xbd, 0xf8, 0x71, 0x2d, 0x00, 0x0d); - -// {29533527-3683-4364-ABC0-DB1ADD822FA2} -EXTERN_GUID(GUID_PropPutCA, 0x29533527, 0x3683, 0x4364, 0xab, 0xc0, 0xdb, 0x1a, 0xdd, 0x82, 0x2f, 0xa2); - // CLSID_CLR_v1_MetaData: {005023CA-72B1-11D3-9FC4-00C04F79A0A3} // Used to generate v1 metadata (for v1.0 and v1.1 CLR compatibility). EXTERN_GUID(CLSID_CLR_v1_MetaData, 0x005023ca, 0x72b1, 0x11d3, 0x9f, 0xc4, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3); @@ -166,18 +137,6 @@ EXTERN_GUID(CLSID_Cor, 0xbee00010, 0xee77, 0x11d0, 0xa0, 0x15, 0x00, 0xc0, 0x4f, // dispenser on the machine. EXTERN_GUID(CLSID_CorMetaDataDispenser, 0xe5cb7a31, 0x7512, 0x11d2, 0x89, 0xce, 0x0, 0x80, 0xc7, 0x92, 0xe5, 0xd8); - -// CLSID_CorMetaDataDispenserReg: {435755FF-7397-11d2-9771-00A0C9B4D50C} -// Dispenser coclass for version 1.0 meta data. To get the "latest" bind -// to CLSID_CorMetaDataDispenser. -EXTERN_GUID(CLSID_CorMetaDataDispenserReg, 0x435755ff, 0x7397, 0x11d2, 0x97, 0x71, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc); - - -// CLSID_CorMetaDataReg: {87F3A1F5-7397-11d2-9771-00A0C9B4D50C} -// For COM+ Meta Data, Data Driven Registration -EXTERN_GUID(CLSID_CorMetaDataReg, 0x87f3a1f5, 0x7397, 0x11d2, 0x97, 0x71, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc); - - interface IMetaDataDispenser; //------------------------------------- @@ -1441,7 +1400,7 @@ DECLARE_INTERFACE_(IMetaDataDispenserEx, IMetaDataDispenser) LPCWSTR szAssemblyName, // [IN] required - this is the assembly you are requesting LPCWSTR szName, // [OUT] buffer - to hold name ULONG cchName, // [IN] the name buffer's size - ULONG *pcName) PURE; // [OUT] the number of characters returend in the buffer + ULONG *pcName) PURE; // [OUT] the number of characters returned in the buffer STDMETHOD(FindAssemblyModule)( // S_OK or error LPCWSTR szAppBase, // [IN] optional - can be NULL @@ -1452,7 +1411,7 @@ DECLARE_INTERFACE_(IMetaDataDispenserEx, IMetaDataDispenser) _Out_writes_to_opt_(cchName, *pcName) LPWSTR szName, // [OUT] buffer - to hold name ULONG cchName, // [IN] the name buffer's size - ULONG *pcName) PURE; // [OUT] the number of characters returend in the buffer + ULONG *pcName) PURE; // [OUT] the number of characters returned in the buffer }; @@ -2211,7 +2170,7 @@ inline ULONG CorSigCompressSignedInt( // return number of bytes that compresse *(pBytes + 3) = BYTE(iData & 0xff); return 4; } - // Out of compressable range + // Out of compressible range return (ULONG)-1; } // CorSigCompressSignedInt diff --git a/src/shared/inc/cordebug.idl b/src/shared/inc/cordebug.idl index 97e53150b0..077d811cd4 100644 --- a/src/shared/inc/cordebug.idl +++ b/src/shared/inc/cordebug.idl @@ -285,7 +285,9 @@ interface ICorDebugDataTarget : IUnknown CORDB_PLATFORM_POSIX_AMD64, // Posix supporting OS on Intel x64 CORDB_PLATFORM_POSIX_X86, // Posix supporting OS on Intel x86 CORDB_PLATFORM_POSIX_ARM, // Posix supporting OS on ARM32 - CORDB_PLATFORM_POSIX_ARM64 // Posix supporting OS on ARM64 + CORDB_PLATFORM_POSIX_ARM64, // Posix supporting OS on ARM64 + CORDB_PLATFORM_POSIX_LOONGARCH64, // Posix supporting OS on LoongArch64 + CORDB_PLATFORM_POSIX_RISCV64 // Posix supporting OS on RISC64 } CorDebugPlatform; HRESULT GetPlatform([out] CorDebugPlatform * pTargetPlatform); @@ -653,7 +655,7 @@ interface ICorDebugSymbolProvider2 : IUnknown * * The format for each instantiation info in heap is as follows: * - Length of this instantiation info (in bytes, not including this length information) in compressed ECMA metadata format. - * - Number of instantatiation types (T, in compressed ECMA metadata format) + * - Number of instantiation types (T, in compressed ECMA metadata format) * - T types, each expressed in ECMA type signature format * * The inclusion of the length for each heap element enables simple sorting of the directory section without affecting the heap. @@ -996,7 +998,7 @@ interface ICorDebugManagedCallback : IUnknown { /* * All callbacks are called with the process in the synchronized state - * All callbacks are serialized, and are called in in the same thread. + * All callbacks are serialized, and are called in the same thread. * Each callback implementor must call Continue in a callback to * resume execution. * If Continue is not called before returning, the process will @@ -2363,7 +2365,7 @@ interface ICorDebugAppDomain4 : IUnknown /* ------------------------------------------------------------------------- * * Assembly interface - * An ICorDebugAssembly instance corresponds to a a managed assembly loaded + * An ICorDebugAssembly instance corresponds to a managed assembly loaded * into a specific AppDomain in the CLR. For assemblies shared between multiple * AppDomains (eg. CoreLib), there will be a separate ICorDebugAssembly instance * per AppDomain in which it is used. @@ -2511,6 +2513,7 @@ typedef enum CorDebugGenerationTypes CorDebug_Gen2 = 2, CorDebug_LOH = 3, CorDebug_POH = 4, + CorDebug_NonGC = 0x7FFFFFFF, } CorDebugGenerationTypes; typedef struct _COR_SEGMENT @@ -2796,7 +2799,7 @@ interface ICorDebugProcess : ICorDebugController * Any managed breakpoints will be automatically stripped from the returned buffer. * No adjustments will be made for Native breakpoints set by ICorDebugProcess2::SetUnmanagedBreakpoint * - * No caching of process memory is peformed. + * No caching of process memory is performed. * These parameters have the same semantics as kernel32!ReadProcessMemory. * The entire range must be read for the function to return success. */ @@ -3211,11 +3214,11 @@ interface ICorDebugProcess6 : IUnknown // Note: If any container assembly is missing symbols, none of its // sub-assemblies will be enumerated. If any regular assembly is // missing symbols it may or may not be enumerated. - // ICorDebugCode.GetCode (when refering to IL code only) + // ICorDebugCode.GetCode (when referring to IL code only) // Disabled - Returns the IL in the post-merge assembly image. // Enabled - Returns IL that would be valid in a pre-merge assembly image. Specifically // any inline metadata tokens will correctly be TypeRef or MemberRef tokens - // when the types being refered to are not defined in the virtual module + // when the types being referred to are not defined in the virtual module // containing the IL. These TypeRefs/MemberRefs can be looked up in the // IMetaDataImport for the corresponding virtual ICorDebugModule. // @@ -3231,7 +3234,7 @@ interface ICorDebugProcess6 : IUnknown // returns true. // // Returns - // S_OK - debuggee is succesfully updated + // S_OK - debuggee is successfully updated // CORDBG_E_MODULE_NOT_LOADED - assembly containing System.Debugger.IsAttached API is not loaded // or some other error is preventing it from being recognized such as missing metadata. This error // is common and benign - it is recommended to try the call again when future assemblies load. @@ -3512,7 +3515,7 @@ interface ICorDebugValueBreakpoint : ICorDebugBreakpoint * Also, a stepper may migrate between threads if a cross-thread * marshalled call is made by the EE. * - * This object serves several purposes. Its serves as an identifer between a + * This object serves several purposes. Its serves as an identifier between a * step command issued and the completion of that command. It also * provides a central interface to encapsulate all of the stepping * that can be performed. Finally it provides a way to prematurely @@ -3586,7 +3589,7 @@ interface ICorDebugStepper : IUnknown * * It should be noted that if one doesn't use a stepper to enter a * method (for example, the main() method of C++), then one - * won't neccessarily step over prologs,etc. + * won't necessarily step over prologs,etc. * * By default, STOP_OTHER_UNMAPPED will be used. * @@ -3917,6 +3920,138 @@ interface ICorDebugRegisterSet : IUnknown REGISTER_ARM64_V30, REGISTER_ARM64_V31, + // LoongArch64 registers + REGISTER_LOONGARCH64_PC = 0, + REGISTER_LOONGARCH64_SP, + REGISTER_LOONGARCH64_FP, + REGISTER_LOONGARCH64_RA, + REGISTER_LOONGARCH64_TP, + REGISTER_LOONGARCH64_A0, + REGISTER_LOONGARCH64_A1, + REGISTER_LOONGARCH64_A2, + REGISTER_LOONGARCH64_A3, + REGISTER_LOONGARCH64_A4, + REGISTER_LOONGARCH64_A5, + REGISTER_LOONGARCH64_A6, + REGISTER_LOONGARCH64_A7, + REGISTER_LOONGARCH64_T0, + REGISTER_LOONGARCH64_T1, + REGISTER_LOONGARCH64_T2, + REGISTER_LOONGARCH64_T3, + REGISTER_LOONGARCH64_T4, + REGISTER_LOONGARCH64_T5, + REGISTER_LOONGARCH64_T6, + REGISTER_LOONGARCH64_T7, + REGISTER_LOONGARCH64_T8, + REGISTER_LOONGARCH64_X0, + REGISTER_LOONGARCH64_S0, + REGISTER_LOONGARCH64_S1, + REGISTER_LOONGARCH64_S2, + REGISTER_LOONGARCH64_S3, + REGISTER_LOONGARCH64_S4, + REGISTER_LOONGARCH64_S5, + REGISTER_LOONGARCH64_S6, + REGISTER_LOONGARCH64_S7, + REGISTER_LOONGARCH64_S8, + + REGISTER_LOONGARCH64_F0, + REGISTER_LOONGARCH64_F1, + REGISTER_LOONGARCH64_F2, + REGISTER_LOONGARCH64_F3, + REGISTER_LOONGARCH64_F4, + REGISTER_LOONGARCH64_F5, + REGISTER_LOONGARCH64_F6, + REGISTER_LOONGARCH64_F7, + REGISTER_LOONGARCH64_F8, + REGISTER_LOONGARCH64_F9, + REGISTER_LOONGARCH64_F10, + REGISTER_LOONGARCH64_F11, + REGISTER_LOONGARCH64_F12, + REGISTER_LOONGARCH64_F13, + REGISTER_LOONGARCH64_F14, + REGISTER_LOONGARCH64_F15, + REGISTER_LOONGARCH64_F16, + REGISTER_LOONGARCH64_F17, + REGISTER_LOONGARCH64_F18, + REGISTER_LOONGARCH64_F19, + REGISTER_LOONGARCH64_F20, + REGISTER_LOONGARCH64_F21, + REGISTER_LOONGARCH64_F22, + REGISTER_LOONGARCH64_F23, + REGISTER_LOONGARCH64_F24, + REGISTER_LOONGARCH64_F25, + REGISTER_LOONGARCH64_F26, + REGISTER_LOONGARCH64_F27, + REGISTER_LOONGARCH64_F28, + REGISTER_LOONGARCH64_F29, + REGISTER_LOONGARCH64_F30, + REGISTER_LOONGARCH64_F31, + + REGISTER_RISCV64_PC = 0, + REGISTER_RISCV64_SP, + REGISTER_RISCV64_FP, + REGISTER_RISCV64_RA, + REGISTER_RISCV64_GP, + REGISTER_RISCV64_TP, + REGISTER_RISCV64_T0, + REGISTER_RISCV64_T1, + REGISTER_RISCV64_T2, + REGISTER_RISCV64_S1, + REGISTER_RISCV64_A0, + REGISTER_RISCV64_A1, + REGISTER_RISCV64_A2, + REGISTER_RISCV64_A3, + REGISTER_RISCV64_A4, + REGISTER_RISCV64_A5, + REGISTER_RISCV64_A6, + REGISTER_RISCV64_A7, + REGISTER_RISCV64_S2, + REGISTER_RISCV64_S3, + REGISTER_RISCV64_S4, + REGISTER_RISCV64_S5, + REGISTER_RISCV64_S6, + REGISTER_RISCV64_S7, + REGISTER_RISCV64_S8, + REGISTER_RISCV64_S9, + REGISTER_RISCV64_S10, + REGISTER_RISCV64_S11, + REGISTER_RISCV64_T3, + REGISTER_RISCV64_T4, + REGISTER_RISCV64_T5, + REGISTER_RISCV64_T6, + REGISTER_RISCV64_F0, + REGISTER_RISCV64_F1, + REGISTER_RISCV64_F2, + REGISTER_RISCV64_F3, + REGISTER_RISCV64_F4, + REGISTER_RISCV64_F5, + REGISTER_RISCV64_F6, + REGISTER_RISCV64_F7, + REGISTER_RISCV64_F8, + REGISTER_RISCV64_F9, + REGISTER_RISCV64_F10, + REGISTER_RISCV64_F11, + REGISTER_RISCV64_F12, + REGISTER_RISCV64_F13, + REGISTER_RISCV64_F14, + REGISTER_RISCV64_F15, + REGISTER_RISCV64_F16, + REGISTER_RISCV64_F17, + REGISTER_RISCV64_F18, + REGISTER_RISCV64_F19, + REGISTER_RISCV64_F20, + REGISTER_RISCV64_F21, + REGISTER_RISCV64_F22, + REGISTER_RISCV64_F23, + REGISTER_RISCV64_F24, + REGISTER_RISCV64_F25, + REGISTER_RISCV64_F26, + REGISTER_RISCV64_F27, + REGISTER_RISCV64_F28, + REGISTER_RISCV64_F29, + REGISTER_RISCV64_F30, + REGISTER_RISCV64_F31 + // other architectures here } CorDebugRegister; @@ -4096,11 +4231,11 @@ interface ICorDebugThread : IUnknown * The normal value for this is THREAD_RUNNING. Only the debugger * can affect the debug state of a thread. Debug states do * last across continues, so if you want to keep a thread - * THREAD_SUSPENDed over mulitple continues, you can set it once + * THREAD_SUSPENDed over multiple continues, you can set it once * and thereafter not have to worry about it. * * Suspending threads and resuming the process can cause deadlocks, though it's - * usually unlikely. This is an intrinisc quality of threads and processes and is by-design. + * usually unlikely. This is an intrinsic quality of threads and processes and is by-design. * A debugger can async break and resume the threads to break the deadlock. * * If the thread's user state includes USER_UNSAFE_POINT, then the thread may block a GC. @@ -5638,6 +5773,29 @@ interface ICorDebugFunction4 : IUnknown HRESULT CreateNativeBreakpoint(ICorDebugFunctionBreakpoint **ppBreakpoint); }; +/* +ICorDebugFunction5 is a logical extension to ICorDebugFunction. +*/ +[ + object, + local, + uuid(9D4DAB7B-3401-4F37-BD08-CA09F3FDF10F), + pointer_default(unique) +] +interface ICorDebugFunction5 : IUnknown +{ + /* + * Triggers a new JIT so the next time the function is called, it will be unoptimized. Will + * trigger a JIT even for R2R code. + */ + HRESULT DisableOptimizations(); + + /* + * Indicates whether this method had optimizations disabled already. + */ + HRESULT AreOptimizationsDisabled(BOOL *pOptimizationsDisabled); +}; + /* ICorDebugCode represents an IL or native code blob. @@ -5991,7 +6149,7 @@ interface ICorDebugClass2 : IUnknown * A JMC stepper will skip non-user code. * User code must be a subset of debuggable code. * - * Returns S_OK if all methods are set succesfully. + * Returns S_OK if all methods are set successfully. * Return failure if any are not set. * On failure, some may still be set. */ @@ -6208,7 +6366,7 @@ interface ICorDebugEval2 : IUnknown [in, size_is(nTypeArgs)] ICorDebugType *ppTypeArgs[]); /* - * NewParamaterizedArray allocates a new array whose elements may be instances + * NewParameterizedArray allocates a new array whose elements may be instances * of a generic type. The array is always created in the AppDomain the thread is * currently in. */ @@ -6383,7 +6541,7 @@ interface ICorDebugGenericValue : ICorDebugValue * An ICorDebugReference will either cooperate with GCs such that its information is updated * after the GC, or it will be implicitly neutered before the GC. * - * The ICorDebugReferenceValue inteface may be implicitly neutered after the debuggee + * The ICorDebugReferenceValue interface may be implicitly neutered after the debuggee * has been continued. The derived ICorDebugHandleValue is not neutered until explicitly * released or exposed. * @@ -6569,7 +6727,7 @@ interface ICorDebugObjectValue : ICorDebugValue HRESULT GetContext([out] ICorDebugContext **ppContext); /* - * IsValueClass returns true if the the class of this object is + * IsValueClass returns true if the class of this object is * a value class. */ @@ -6737,7 +6895,7 @@ interface ICorDebugArrayValue : ICorDebugHeapValue length_is(cdim)] ULONG32 dims[]); /* - * HasBaseIndicies returns whether or not the array has base indicies. + * HasBaseIndicies returns whether or not the array has base indices. * If the answer is no, then all dimensions have a base index of 0. */ @@ -6750,7 +6908,7 @@ interface ICorDebugArrayValue : ICorDebugHeapValue HRESULT GetBaseIndicies([in] ULONG32 cdim, [out, size_is(cdim), - length_is(cdim)] ULONG32 indicies[]); + length_is(cdim)] ULONG32 indices[]); /* * GetElement returns a value representing the given element in the array. @@ -6850,7 +7008,7 @@ interface ICorDebugVariableHome : IUnknown * A normal ICorDebugReference becomes neutered after the debuggee has been * continued. A ICorDebugHandleValue will survive across continues and can be - * dereferenced until the client explcitly disposes the handle. + * dereferenced until the client explicitly disposes the handle. * * * ICorDebugHeapValu2::CreateHandle will create ICorDebugHandleValue @@ -7286,11 +7444,11 @@ interface ICorDebugType : IUnknown * class MyStringDict : Dict * then the base type of "MyStringDict" will be "Dict". * - * This is a helper function - you could compute this from EnumerateTypeParemeters, + * This is a helper function - you could compute this from EnumerateTypeParameters, * GetClass and the relevant metadata, but it is relatively painful: you would * have to lookup the class, then the metadata of that class * to find the "generic" base type, then instantiate this generic base type by - * looking up the type paramaters to the initial type, + * looking up the type parameters to the initial type, * and then perform the appropriate instantiation in the case where the class * happens to be either a generic class or a normal class with a constructed type * as its parent. Looking up the base types is useful to implement common @@ -7623,6 +7781,17 @@ interface ICorDebugExceptionObjectValue : IUnknown HRESULT EnumerateExceptionCallStack([out] ICorDebugExceptionObjectCallStackEnum** ppCallStackEnum); }; +[ + object, + local, + uuid(e3b2f332-cc46-4f1e-ab4e-5400e332195e), + pointer_default(unique) +] +interface ICorDebugExceptionObjectValue2 : IUnknown +{ + HRESULT ForceCatchHandlerFoundEvents([in] BOOL enableEvents); +}; + /* ------------------------------------------------------------------------- * * Library definition * ------------------------------------------------------------------------- */ diff --git a/src/shared/inc/corhdr.h b/src/shared/inc/corhdr.h index b4ea57f811..c12c1cfdd4 100644 --- a/src/shared/inc/corhdr.h +++ b/src/shared/inc/corhdr.h @@ -439,9 +439,9 @@ typedef enum CorMethodAttr #define IsMdRTSpecialName(x) ((x) & mdRTSpecialName) #define IsMdInstanceInitializer(x, str) (((x) & mdRTSpecialName) && !strcmp((str), COR_CTOR_METHOD_NAME)) -#define IsMdInstanceInitializerW(x, str) (((x) & mdRTSpecialName) && !wcscmp((str), COR_CTOR_METHOD_NAME_W)) +#define IsMdInstanceInitializerW(x, str) (((x) & mdRTSpecialName) && !u16_strcmp((str), COR_CTOR_METHOD_NAME_W)) #define IsMdClassConstructor(x, str) (((x) & mdRTSpecialName) && !strcmp((str), COR_CCTOR_METHOD_NAME)) -#define IsMdClassConstructorW(x, str) (((x) & mdRTSpecialName) && !wcscmp((str), COR_CCTOR_METHOD_NAME_W)) +#define IsMdClassConstructorW(x, str) (((x) & mdRTSpecialName) && !u16_strcmp((str), COR_CCTOR_METHOD_NAME_W)) #define IsMdHasSecurity(x) ((x) & mdHasSecurity) #define IsMdRequireSecObject(x) ((x) & mdRequireSecObject) @@ -842,11 +842,12 @@ typedef enum CorGenericParamAttr gpContravariant = 0x0002, // Special constraints, applicable to any type parameters - gpSpecialConstraintMask = 0x001C, + gpSpecialConstraintMask = 0x003C, gpNoSpecialConstraint = 0x0000, gpReferenceTypeConstraint = 0x0004, // type argument must be a reference type gpNotNullableValueTypeConstraint = 0x0008, // type argument must be a value type but not Nullable gpDefaultConstructorConstraint = 0x0010, // type argument must have a public default constructor + gpAllowByRefLike = 0x0020, // type argument can be ByRefLike } CorGenericParamAttr; // structures and enums moved from COR.H @@ -1235,7 +1236,7 @@ typedef struct IMAGE_COR_ILMETHOD_TINY } IMAGE_COR_ILMETHOD_TINY; /************************************/ -// This strucuture is the 'fat' layout, where no compression is attempted. +// This structure is the 'fat' layout, where no compression is attempted. // Note that this structure can be added on at the end, thus making it extensible typedef struct IMAGE_COR_ILMETHOD_FAT { @@ -1714,6 +1715,7 @@ typedef enum LoadHintEnum #define CMOD_CALLCONV_NAME_STDCALL "CallConvStdcall" #define CMOD_CALLCONV_NAME_THISCALL "CallConvThiscall" #define CMOD_CALLCONV_NAME_FASTCALL "CallConvFastcall" +#define CMOD_CALLCONV_NAME_SWIFT "CallConvSwift" #define CMOD_CALLCONV_NAME_SUPPRESSGCTRANSITION "CallConvSuppressGCTransition" #define CMOD_CALLCONV_NAME_MEMBERFUNCTION "CallConvMemberFunction" diff --git a/src/shared/inc/corhlpr.cpp b/src/shared/inc/corhlpr.cpp index f9559cec6a..61dc050ce5 100644 --- a/src/shared/inc/corhlpr.cpp +++ b/src/shared/inc/corhlpr.cpp @@ -8,9 +8,7 @@ ****************************************************************************/ #ifndef SOS_INCLUDE -#ifdef _BLD_CLR #include "utilcode.h" -#endif #include "corhlpr.h" #include @@ -26,15 +24,15 @@ extern "C" { /***************************************************************************/ -/* Note that this construtor does not set the LocalSig, but has the - advantage that it does not have any dependancy on EE structures. +/* Note that this constructor does not set the LocalSig, but has the + advantage that it does not have any dependency on EE structures. inside the EE use the FunctionDesc constructor */ void __stdcall DecoderInit(void *pThis, COR_ILMETHOD *header) { + memset(pThis, 0, sizeof(COR_ILMETHOD_DECODER)); COR_ILMETHOD_DECODER *decoder = (COR_ILMETHOD_DECODER *)pThis; - memset(decoder, 0, sizeof(COR_ILMETHOD_DECODER)); if (header->Tiny.IsTiny()) { decoder->SetMaxStack(header->Tiny.GetMaxStack()); @@ -48,7 +46,7 @@ void __stdcall DecoderInit(void *pThis, COR_ILMETHOD *header) #ifdef HOST_64BIT if((((size_t) header) & 3) == 0) // header is aligned #else - _ASSERTE((((size_t) header) & 3) == 0); // header is aligned + assert((((size_t) header) & 3) == 0); // header is aligned #endif { *((COR_ILMETHOD_FAT *)decoder) = header->Fat; @@ -129,18 +127,20 @@ unsigned __stdcall IlmethodEmit(unsigned size, COR_ILMETHOD_FAT* header, } else { // Fat format - _ASSERTE((((size_t) outBuff) & 3) == 0); // header is dword aligned + assert((((size_t) outBuff) & 3) == 0); // header is dword aligned COR_ILMETHOD_FAT* fatHeader = (COR_ILMETHOD_FAT*) outBuff; outBuff += sizeof(COR_ILMETHOD_FAT); *fatHeader = *header; fatHeader->SetFlags(fatHeader->GetFlags() | CorILMethod_FatFormat); - _ASSERTE((fatHeader->GetFlags() & CorILMethod_FormatMask) == CorILMethod_FatFormat); + assert((fatHeader->GetFlags() & CorILMethod_FormatMask) == CorILMethod_FatFormat); if (moreSections) fatHeader->SetFlags(fatHeader->GetFlags() | CorILMethod_MoreSects); fatHeader->SetSize(sizeof(COR_ILMETHOD_FAT) / 4); } #ifndef SOS_INCLUDE - _ASSERTE(&origBuff[size] == outBuff); +#ifdef _DEBUG + assert(&origBuff[size] == outBuff); +#endif #endif // !SOS_INCLUDE return(size); } @@ -211,7 +211,7 @@ unsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount, if (size == 0) return(0); - _ASSERTE((((size_t) outBuff) & 3) == 0); // header is dword aligned + assert((((size_t) outBuff) & 3) == 0); // header is dword aligned BYTE* origBuff = outBuff; if (ehCount <= 0) return 0; @@ -234,11 +234,11 @@ unsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount, fatClause->GetHandlerLength() > 0xFF) { break; // fall through and generate as FAT } - _ASSERTE((fatClause->GetFlags() & ~0xFFFF) == 0); - _ASSERTE((fatClause->GetTryOffset() & ~0xFFFF) == 0); - _ASSERTE((fatClause->GetTryLength() & ~0xFF) == 0); - _ASSERTE((fatClause->GetHandlerOffset() & ~0xFFFF) == 0); - _ASSERTE((fatClause->GetHandlerLength() & ~0xFF) == 0); + assert((fatClause->GetFlags() & ~0xFFFF) == 0); + assert((fatClause->GetTryOffset() & ~0xFFFF) == 0); + assert((fatClause->GetTryLength() & ~0xFF) == 0); + assert((fatClause->GetHandlerOffset() & ~0xFFFF) == 0); + assert((fatClause->GetHandlerLength() & ~0xFF) == 0); COR_ILMETHOD_SECT_EH_CLAUSE_SMALL* smallClause = (COR_ILMETHOD_SECT_EH_CLAUSE_SMALL*)&EHSect->Clauses[i]; smallClause->SetFlags((CorExceptionFlag) fatClause->GetFlags()); @@ -253,13 +253,9 @@ unsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount, EHSect->Kind = CorILMethod_Sect_EHTable; if (moreSections) EHSect->Kind |= CorILMethod_Sect_MoreSects; -#ifndef SOS_INCLUDE - EHSect->DataSize = EHSect->Size(ehCount); -#else EHSect->DataSize = (BYTE) EHSect->Size(ehCount); -#endif // !SOS_INCLUDE EHSect->Reserved = 0; - _ASSERTE(EHSect->DataSize == EHSect->Size(ehCount)); // make sure didn't overflow + assert(EHSect->DataSize == EHSect->Size(ehCount)); // make sure didn't overflow outBuff = (BYTE*) &EHSect->Clauses[ehCount]; // Set the offsets for the exception type tokens. if (ehTypeOffsets) @@ -268,7 +264,7 @@ unsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount, COR_ILMETHOD_SECT_EH_CLAUSE_SMALL* smallClause = (COR_ILMETHOD_SECT_EH_CLAUSE_SMALL*)&EHSect->Clauses[i]; if (smallClause->GetFlags() == COR_ILEXCEPTION_CLAUSE_NONE) { - _ASSERTE(! IsNilToken(smallClause->GetClassToken())); + assert(! IsNilToken(smallClause->GetClassToken())); ehTypeOffsets[i] = (ULONG)((BYTE *)&smallClause->ClassToken - origBuff); } } @@ -285,7 +281,7 @@ unsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount, EHSect->SetDataSize(EHSect->Size(ehCount)); memcpy(EHSect->Clauses, clauses, ehCount * sizeof(COR_ILMETHOD_SECT_EH_CLAUSE_FAT)); outBuff = (BYTE*) &EHSect->Clauses[ehCount]; - _ASSERTE(&origBuff[size] == outBuff); + assert(&origBuff[size] == outBuff); // Set the offsets for the exception type tokens. if (ehTypeOffsets) { @@ -293,7 +289,7 @@ unsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount, COR_ILMETHOD_SECT_EH_CLAUSE_FAT* fatClause = (COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)&EHSect->Clauses[i]; if (fatClause->GetFlags() == COR_ILEXCEPTION_CLAUSE_NONE) { - _ASSERTE(! IsNilToken(fatClause->GetClassToken())); + assert(! IsNilToken(fatClause->GetClassToken())); ehTypeOffsets[i] = (ULONG)((BYTE *)&fatClause->ClassToken - origBuff); } } diff --git a/src/shared/inc/corhlpr.h b/src/shared/inc/corhlpr.h index a4021921dd..0bd3b1e1df 100644 --- a/src/shared/inc/corhlpr.h +++ b/src/shared/inc/corhlpr.h @@ -17,18 +17,14 @@ #define CORHLPR_TURNED_FPO_ON 1 #endif +#include #include "cor.h" #include "corhdr.h" #include "corerror.h" #include "unreachable.h" +#include -// This header is consumed both within the runtime and externally. In the former -// case we need to wrap memory allocations, in the latter there is no -// infrastructure to support this. Detect which way we're building and provide a -// very simple abstraction layer (handles allocating bytes only). -#ifdef _BLD_CLR -#include "new.hpp" - +using std::nothrow; #define NEW_NOTHROW(_bytes) new (nothrow) BYTE[_bytes] #define NEW_THROWS(_bytes) new BYTE[_bytes] @@ -37,27 +33,6 @@ inline void DECLSPEC_NORETURN THROW_OUT_OF_MEMORY() { ThrowOutOfMemory(); } -#else -#define NEW_NOTHROW(_bytes) new BYTE[_bytes] -#define NEW_THROWS(_bytes) __CorHlprNewThrows(_bytes) -static inline void DECLSPEC_NORETURN __CorHlprThrowOOM() -{ - RaiseException(STATUS_NO_MEMORY, 0, 0, NULL); - __UNREACHABLE(); -} -static inline BYTE *__CorHlprNewThrows(size_t bytes) -{ - BYTE *pbMemory = new BYTE[bytes]; - if (pbMemory == NULL) - __CorHlprThrowOOM(); - return pbMemory; -} -inline void DECLSPEC_NORETURN THROW_OUT_OF_MEMORY() -{ - __CorHlprThrowOOM(); -} -#endif - //***************************************************************************** // There are a set of macros commonly used in the helpers which you will want @@ -82,10 +57,6 @@ do { hr = (EXPR); if(FAILED(hr)) { goto LABEL; } } while (0) #endif -#ifndef _ASSERTE -#define _ASSERTE(expr) -#endif - #if !BIGENDIAN #define VAL16(x) x #define VAL32(x) x @@ -259,7 +230,7 @@ typedef struct tagCOR_ILMETHOD_SECT_EH_CLAUSE_SMALL : public IMAGE_COR_ILMETHOD_ return VAL16(TryOffset); } void SetTryOffset(DWORD Offset) { - _ASSERTE((Offset & ~0xffff) == 0); + assert((Offset & ~0xffff) == 0); TryOffset = VAL16(Offset); } @@ -267,7 +238,7 @@ typedef struct tagCOR_ILMETHOD_SECT_EH_CLAUSE_SMALL : public IMAGE_COR_ILMETHOD_ return TryLength; } void SetTryLength(DWORD Length) { - _ASSERTE((Length & ~0xff) == 0); + assert((Length & ~0xff) == 0); TryLength = Length; } @@ -275,7 +246,7 @@ typedef struct tagCOR_ILMETHOD_SECT_EH_CLAUSE_SMALL : public IMAGE_COR_ILMETHOD_ return VAL16(HandlerOffset); } void SetHandlerOffset(DWORD Offset) { - _ASSERTE((Offset & ~0xffff) == 0); + assert((Offset & ~0xffff) == 0); HandlerOffset = VAL16(Offset); } @@ -283,7 +254,7 @@ typedef struct tagCOR_ILMETHOD_SECT_EH_CLAUSE_SMALL : public IMAGE_COR_ILMETHOD_ return HandlerLength; } void SetHandlerLength(DWORD Length) { - _ASSERTE((Length & ~0xff) == 0); + assert((Length & ~0xff) == 0); HandlerLength = Length; } @@ -501,7 +472,7 @@ typedef struct tagCOR_ILMETHOD_TINY : IMAGE_COR_ILMETHOD_TINY /************************************/ -// This strucuture is the 'fat' layout, where no compression is attempted. +// This structure is the 'fat' layout, where no compression is attempted. // Note that this structure can be added on at the end, thus making it extensible typedef struct tagCOR_ILMETHOD_FAT : IMAGE_COR_ILMETHOD_FAT { @@ -619,7 +590,7 @@ struct COR_ILMETHOD extern "C" { /***************************************************************************/ /* COR_ILMETHOD_DECODER is the only way functions internal to the EE should - fetch data from a COR_ILMETHOD. This way any dependancy on the file format + fetch data from a COR_ILMETHOD. This way any dependency on the file format (and the multiple ways of encoding the header) is centralized to the COR_ILMETHOD_DECODER constructor) */ void __stdcall DecoderInit(void * pThis, COR_ILMETHOD* header); @@ -629,9 +600,7 @@ extern "C" { class COR_ILMETHOD_DECODER : public COR_ILMETHOD_FAT { public: - // This returns an uninitialized decoder, suitable for placement new but nothing - // else. Use with caution. - COR_ILMETHOD_DECODER() {} + COR_ILMETHOD_DECODER() = default; // Typically the ONLY way you should access COR_ILMETHOD is through // this constructor so format changes are easier. diff --git a/src/shared/inc/corhlprpriv.h b/src/shared/inc/corhlprpriv.h index 38faa6f6ef..9cbdaa4a3e 100644 --- a/src/shared/inc/corhlprpriv.h +++ b/src/shared/inc/corhlprpriv.h @@ -81,7 +81,7 @@ class CQuickMemoryBase template void *_Alloc(SIZE_T iItems) { -#if defined(_BLD_CLR) && defined(_DEBUG) +#if defined(_DEBUG) { // Exercise heap for OOM-fault injection purposes BYTE * pb = NSQuickBytesHelper::_AllocBytes::Invoke(iItems); _ASSERTE(!bThrow || pb != NULL); // _AllocBytes would have thrown if bThrow == TRUE @@ -294,15 +294,12 @@ class CQuickMemoryBase } // Copy single byte string and hold it - const char * SetStringNoThrow(const char * pStr, SIZE_T len) + const char * SetString(const char * pStr, SIZE_T len) { - LPSTR buffer = (LPSTR) AllocNoThrow(len + 1); + LPSTR buffer = (LPSTR) AllocThrows(len + 1); - if (buffer != NULL) - { - memcpy(buffer, pStr, len); - buffer[len] = 0; - } + memcpy(buffer, pStr, len); + buffer[len] = 0; return buffer; } @@ -477,12 +474,12 @@ template class CQuickArrayBase : public CQuickBytesBase template class CQuickArray : public CQuickArrayBase { public: - CQuickArray() + CQuickArray() { this->Init(); } - ~CQuickArray() + ~CQuickArray() { this->Destroy(); } @@ -605,7 +602,7 @@ class RidBitmap HRESULT hr = S_OK; mdToken rid = RidFromToken(token); SIZE_T index = rid / 8; - BYTE bit = (1 << (rid % 8)); + BYTE bit = (BYTE)(1 << (rid % 8)); if (index >= buffer.Size()) { @@ -623,7 +620,7 @@ class RidBitmap { mdToken rid = RidFromToken(token); SIZE_T index = rid / 8; - BYTE bit = (1 << (rid % 8)); + BYTE bit = (BYTE)(1 << (rid % 8)); return ((index < buffer.Size()) && (buffer[index] & bit)); } @@ -743,7 +740,7 @@ CorSigUncompressPointer_EndPtr( // make it easier to catch invalid signatures in trusted code (e.g. IL stubs, NGEN images, etc.) if (pData + sizeof(void *) > pDataEnd) { // Not enough data in the buffer - _ASSERTE(!"This signature is invalid. Note that caller should check that it is not comming from untrusted source!"); + _ASSERTE(!"This signature is invalid. Note that caller should check that it is not coming from untrusted source!"); return META_E_BAD_SIGNATURE; } *ppvPointerOut = *(void * UNALIGNED *)pData; diff --git a/src/shared/inc/corjitflags.h b/src/shared/inc/corjitflags.h index c749e876d2..dce9a9f00b 100644 --- a/src/shared/inc/corjitflags.h +++ b/src/shared/inc/corjitflags.h @@ -22,107 +22,52 @@ class CORJIT_FLAGS { public: + // Note: these flags can be #ifdef'ed, but no number should be re-used between different #ifdef conditions, + // so platform-independent code can know uniquely which number corresponds to which flag. enum CorJitFlag { CORJIT_FLAG_CALL_GETJITFLAGS = 0xffffffff, // Indicates that the JIT should retrieve flags in the form of a // pointer to a CORJIT_FLAGS value via ICorJitInfo::getJitFlags(). - CORJIT_FLAG_SPEED_OPT = 0, - CORJIT_FLAG_SIZE_OPT = 1, + + CORJIT_FLAG_SPEED_OPT = 0, // optimize for speed + CORJIT_FLAG_SIZE_OPT = 1, // optimize for code size CORJIT_FLAG_DEBUG_CODE = 2, // generate "debuggable" code (no code-mangling optimizations) CORJIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode CORJIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info - CORJIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necesarily debuggable code) - CORJIT_FLAG_UNUSED1 = 6, - CORJIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete - - #if defined(TARGET_X86) - - CORJIT_FLAG_PINVOKE_RESTORE_ESP = 8, // Restore ESP after returning from inlined PInvoke - CORJIT_FLAG_TARGET_P4 = 9, - CORJIT_FLAG_USE_FCOMI = 10, // Generated code may use fcomi(p) instruction - CORJIT_FLAG_USE_CMOV = 11, // Generated code may use cmov instruction - - #else // !defined(TARGET_X86) - - CORJIT_FLAG_UNUSED2 = 8, - CORJIT_FLAG_UNUSED3 = 9, - CORJIT_FLAG_UNUSED4 = 10, - CORJIT_FLAG_UNUSED5 = 11, - CORJIT_FLAG_UNUSED6 = 12, - - #endif // !defined(TARGET_X86) - - CORJIT_FLAG_OSR = 13, // Generate alternate method for On Stack Replacement - - CORJIT_FLAG_ALT_JIT = 14, // JIT should consider itself an ALT_JIT - CORJIT_FLAG_UNUSED8 = 15, - CORJIT_FLAG_UNUSED9 = 16, - - - #if defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64) - CORJIT_FLAG_FEATURE_SIMD = 17, - #else - CORJIT_FLAG_UNUSED10 = 17, - #endif // !(defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64)) - - CORJIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter. - CORJIT_FLAG_READYTORUN = 19, // Use version-resilient code generation - CORJIT_FLAG_PROF_ENTERLEAVE = 20, // Instrument prologues/epilogues - CORJIT_FLAG_UNUSED11 = 21, - CORJIT_FLAG_PROF_NO_PINVOKE_INLINE = 22, // Disables PInvoke inlining - CORJIT_FLAG_SKIP_VERIFICATION = 23, // (lazy) skip verification - determined without doing a full resolve. See comment below - CORJIT_FLAG_PREJIT = 24, // jit or prejit is the execution engine. - CORJIT_FLAG_RELOC = 25, // Generate relocatable code - CORJIT_FLAG_IMPORT_ONLY = 26, // Only import the function - CORJIT_FLAG_IL_STUB = 27, // method is an IL stub - CORJIT_FLAG_PROCSPLIT = 28, // JIT should separate code into hot and cold sections - CORJIT_FLAG_BBINSTR = 29, // Collect basic block profile information - CORJIT_FLAG_BBOPT = 30, // Optimize method based on profile information - CORJIT_FLAG_FRAMED = 31, // All methods have an EBP frame - CORJIT_FLAG_UNUSED12 = 32, - CORJIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - CORJIT_FLAG_UNUSED13 = 34, - CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background - CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions - CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - CORJIT_FLAG_TRACK_TRANSITIONS = 38, // The JIT should insert the REVERSE_PINVOKE helper variants that track transitions. - CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible - CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code + CORJIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necessarily debuggable code) + CORJIT_FLAG_ENABLE_CFG = 6, // generate CFG enabled code + CORJIT_FLAG_OSR = 7, // Generate alternate version for On Stack Replacement + CORJIT_FLAG_ALT_JIT = 8, // JIT should consider itself an ALT_JIT + CORJIT_FLAG_FROZEN_ALLOC_ALLOWED = 9, // JIT is allowed to use *_MAYBEFROZEN allocators + CORJIT_FLAG_MAKEFINALCODE = 10, // Use the final code generator, i.e., not the interpreter. + CORJIT_FLAG_READYTORUN = 11, // Use version-resilient code generation + CORJIT_FLAG_PROF_ENTERLEAVE = 12, // Instrument prologues/epilogues + CORJIT_FLAG_PROF_NO_PINVOKE_INLINE = 13, // Disables PInvoke inlining + CORJIT_FLAG_PREJIT = 14, // prejit is the execution engine. + CORJIT_FLAG_RELOC = 15, // Generate relocatable code + CORJIT_FLAG_IL_STUB = 16, // method is an IL stub + CORJIT_FLAG_PROCSPLIT = 17, // JIT should separate code into hot and cold sections + CORJIT_FLAG_BBINSTR = 18, // Collect basic block profile information + CORJIT_FLAG_BBINSTR_IF_LOOPS = 19, // JIT must instrument current method if it has loops + CORJIT_FLAG_BBOPT = 20, // Optimize method based on profile information + CORJIT_FLAG_FRAMED = 21, // All methods have an EBP frame + CORJIT_FLAG_PUBLISH_SECRET_PARAM = 22, // JIT must place stub secret param into local 0. (used by IL stubs) + CORJIT_FLAG_USE_PINVOKE_HELPERS = 23, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions + CORJIT_FLAG_REVERSE_PINVOKE = 24, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog + CORJIT_FLAG_TRACK_TRANSITIONS = 25, // The JIT should insert the helper variants that track transitions. + CORJIT_FLAG_TIER0 = 26, // This is the initial tier for tiered compilation which should generate code as quickly as possible + CORJIT_FLAG_TIER1 = 27, // This is the final tier (for now) for tiered compilation which should generate high quality code + CORJIT_FLAG_NO_INLINING = 28, // JIT should not inline any called method into this method #if defined(TARGET_ARM) - CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records -#else // !defined(TARGET_ARM) - CORJIT_FLAG_UNUSED15 = 41, -#endif // !defined(TARGET_ARM) + CORJIT_FLAG_RELATIVE_CODE_RELOCS = 29, // JIT should generate PC-relative address computations instead of EE relocation records + CORJIT_FLAG_SOFTFP_ABI = 30, // Enable armel calling convention +#endif - CORJIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method +#if defined(TARGET_X86) || defined(TARGET_AMD64) + CORJIT_FLAG_VECTOR512_THROTTLING = 31, // On x86/x64, 512-bit vector usage may incur CPU frequency throttling +#endif -#if defined(TARGET_ARM) - CORJIT_FLAG_SOFTFP_ABI = 43, // JIT should generate PC-relative address computations instead of EE relocation records -#else // !defined(TARGET_ARM) - CORJIT_FLAG_UNUSED16 = 43, -#endif // !defined(TARGET_ARM) - - CORJIT_FLAG_UNUSED17 = 44, - CORJIT_FLAG_UNUSED18 = 45, - CORJIT_FLAG_UNUSED19 = 46, - CORJIT_FLAG_UNUSED20 = 47, - CORJIT_FLAG_UNUSED21 = 48, - CORJIT_FLAG_UNUSED22 = 49, - CORJIT_FLAG_UNUSED23 = 50, - CORJIT_FLAG_UNUSED24 = 51, - CORJIT_FLAG_UNUSED25 = 52, - CORJIT_FLAG_UNUSED26 = 53, - CORJIT_FLAG_UNUSED27 = 54, - CORJIT_FLAG_UNUSED28 = 55, - CORJIT_FLAG_UNUSED29 = 56, - CORJIT_FLAG_UNUSED30 = 57, - CORJIT_FLAG_UNUSED31 = 58, - CORJIT_FLAG_UNUSED32 = 59, - CORJIT_FLAG_UNUSED33 = 60, - CORJIT_FLAG_UNUSED34 = 61, - CORJIT_FLAG_UNUSED35 = 62, - CORJIT_FLAG_UNUSED36 = 63 }; CORJIT_FLAGS() @@ -208,11 +153,21 @@ class CORJIT_FLAGS } // DO NOT USE THIS FUNCTION! (except in very restricted special cases) - uint64_t GetInstructionSetFlagsRaw() + uint64_t* GetInstructionSetFlagsRaw() { return instructionSetFlags.GetFlagsRaw(); } + CORINFO_InstructionSetFlags GetInstructionSetFlags() + { + return instructionSetFlags; + } + + const int GetInstructionFlagsFieldCount() + { + return instructionSetFlags.GetInstructionFlagsFieldCount(); + } + private: uint64_t corJitFlags; diff --git a/src/shared/inc/corprof.idl b/src/shared/inc/corprof.idl index 1ff60aa448..4e43edfdf1 100644 --- a/src/shared/inc/corprof.idl +++ b/src/shared/inc/corprof.idl @@ -13,9 +13,6 @@ #if !DEFINITIONS_FROM_NON_IMPORTABLE_PLACES -cpp_quote("#define CorDB_CONTROL_Profiling \"Cor_Enable_Profiling\"") -cpp_quote("#define CorDB_CONTROL_ProfilingL L\"Cor_Enable_Profiling\"") - cpp_quote("#if 0") @@ -839,6 +836,36 @@ typedef struct UINT32 reserved; } COR_PRF_EVENT_DATA; +typedef struct +{ + UINT64 Ptr; + UINT32 Size; + UINT32 Type; +} COR_PRF_FILTER_DATA; + +typedef STDMETHODCALLTYPE void EventPipeProviderCallback( + const UINT8 *source_id, + UINT32 is_enabled, + UINT8 level, + UINT64 match_any_keywords, + UINT64 match_all_keywords, + COR_PRF_FILTER_DATA *filter_data, + void *callback_data); + +typedef enum _COR_PRF_HANDLE_TYPE +{ + COR_PRF_HANDLE_TYPE_WEAK = 0x1, + COR_PRF_HANDLE_TYPE_STRONG = 0x2, + COR_PRF_HANDLE_TYPE_PINNED = 0x3, +} COR_PRF_HANDLE_TYPE; + +typedef void** ObjectHandleID; + +/* +* Callback for each object in the GC Heap +*/ +typedef BOOL STDMETHODCALLTYPE (* ObjectCallback)(ObjectID object, void* callbackState); + /* -------------------------------------------------------------------------- * * Forward declarations * -------------------------------------------------------------------------- */ @@ -1313,7 +1340,7 @@ interface ICorProfilerCallback : IUnknown /* * The CLR calls ThreadAssignedToOSThread to tell the profiler - * that a managed thread is being implemented via a particualr OS thread. + * that a managed thread is being implemented via a particular OS thread. * This callback exists so that the profiler can maintain an accurate * OS to Managed thread mapping across fibres. */ @@ -1356,7 +1383,7 @@ interface ICorProfilerCallback : IUnknown /* * The CLR calls RemotingClientSendingMessage to notify the profiler that - * a remoting call is requiring the the caller to send an invocation request through + * a remoting call is requiring the caller to send an invocation request through * a remoting channel. * * pCookie - if remoting GUID cookies are active, this value will correspond with the @@ -2029,6 +2056,17 @@ typedef struct COR_PRF_GC_GENERATION_RANGE } COR_PRF_GC_GENERATION_RANGE; +/* + * COR_PRF_NONGC_GENERATION_RANGE describes a range of memory in the GetNonGCHeapBounds function. + */ +typedef struct COR_PRF_NONGC_HEAP_RANGE +{ + ObjectID rangeStart; // the start of the range + UINT_PTR rangeLength; // the used length of the range + UINT_PTR rangeLengthReserved; // the amount of memory reserved for the range (including rangeLength) + +} COR_PRF_NONGC_HEAP_RANGE; + /* * COR_PRF_CLAUSE_TYPE defines the various clause codes for the EX clauses @@ -2510,7 +2548,7 @@ interface ICorProfilerCallback7 : ICorProfilerCallback6 // in-memory module is updated. Even when symbols are provided up-front in // a call to the managed API Assembly.Load(byte[], byte[], ...) the runtime // may not actually associate the symbolic data with the module until after - // the ModuleLoadFinished callback has occured. This event provides a later + // the ModuleLoadFinished callback has occurred. This event provides a later // opportunity to collect symbols for such modules. // // This event is controlled by the COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED @@ -2615,9 +2653,9 @@ typedef enum { COR_PRF_CODEGEN_DISABLE_INLINING = 0x0001, COR_PRF_CODEGEN_DISABLE_ALL_OPTIMIZATIONS = 0x0002, + COR_PRF_CODEGEN_DEBUG_INFO = 0x0003, } COR_PRF_CODEGEN_FLAGS; - /* * The CLR implements the ICorProfilerInfo interface. This interface is * used by a code profiler to communicate with the CLR to control event @@ -3389,7 +3427,7 @@ interface ICorProfilerInfo2 : ICorProfilerInfo * in generations 3 and 0. So by the time managed code starts executing, these * generations will already contain objects. Generations 1 and 2 will be normally * empty, except for dummy objects generated by the garbage collector (of size 12 - * bytes in 32-bit implementations of the CLR, larger in 64-bit implementaions). + * bytes in 32-bit implementations of the CLR, larger in 64-bit implementations). * You may also see generation 2 ranges that are inside modules generated by ngen. * These are "frozen objects" generated at ngen time rather than allocated by the * garbage collector. @@ -4049,7 +4087,7 @@ interface ICorProfilerInfo8 : ICorProfilerInfo7 [out] ReJITID * pReJitId); /* - * Retrieves informaiton about dynamic methods + * Retrieves information about dynamic methods * * Certain methods like IL Stubs or LCG do not have * associated metadata that can be retrieved using the IMetaDataImport APIs. @@ -4083,7 +4121,7 @@ interface ICorProfilerInfo9 : ICorProfilerInfo8 //Given the native code start address, return the native->IL mapping information for this jitted version of the code HRESULT GetILToNativeMapping3(UINT_PTR pNativeCodeStartAddress, ULONG32 cMap, ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[]); - //Given the native code start address, return the the blocks of virtual memory that store this code (method code is not necessarily stored in a single contiguous memory region) + //Given the native code start address, return the blocks of virtual memory that store this code (method code is not necessarily stored in a single contiguous memory region) HRESULT GetCodeInfo4(UINT_PTR pNativeCodeStartAddress, ULONG32 cCodeInfos, ULONG32* pcCodeInfos, COR_PRF_CODE_INFO codeInfos[]); }; @@ -4218,6 +4256,103 @@ interface ICorProfilerInfo12 : ICorProfilerInfo11 [in] LPCGUID pRelatedActivityId); } +[ + object, + uuid(6E6C7EE2-0701-4EC2-9D29-2E8733B66934), + pointer_default(unique), + local +] +interface ICorProfilerInfo13 : ICorProfilerInfo12 +{ + HRESULT CreateHandle( + [in] ObjectID object, + [in] COR_PRF_HANDLE_TYPE type, + [out] ObjectHandleID* pHandle); + + HRESULT DestroyHandle( + [in] ObjectHandleID handle); + + HRESULT GetObjectIDFromHandle( + [in] ObjectHandleID handle, + [out] ObjectID* pObject); +} + +[ + object, + uuid(F460E352-D76D-4FE9-835F-F6AF9D6E862D), + pointer_default(unique), + local +] +interface ICorProfilerInfo14 : ICorProfilerInfo13 +{ + HRESULT EnumerateNonGCObjects([out] ICorProfilerObjectEnum** ppEnum); + + HRESULT GetNonGCHeapBounds( + [in] ULONG cObjectRanges, + [out] ULONG *pcObjectRanges, + [out, size_is(cObjectRanges), length_is(*pcObjectRanges)] COR_PRF_NONGC_HEAP_RANGE ranges[]); + + + // EventPipeCreateProvider2 allows you to pass in a callback which will be called whenever a + // session enables your provider. The behavior of the callback matches the ETW behavior which + // can be counter intuitive. You will get a callback any time a session changes with the updated + // global keywords enabled for your session. The is_enabled parameter will be true if any + // session has your provider enabled. The source_id parameter will be a valid id if the callback + // was triggered due to a session enabling and it will be NULL if it was triggered due to a session + // disabling. + // + // Example: + // Session A enables your provider: callback with is_enabled == true, session_id == A, and keywords == Session A + // Session B enables your provider: callback with is_enabled == true, session_id == B, and keywords == Session A | Session B + // Session B disables your provider: callback with is_enabled == true, session_id == NULL, and keywords == Session A + // Session A disables your provider: callback with is_enabled == false, session_id == NULL, and keywords == 0 + HRESULT EventPipeCreateProvider2( + [in, string] const WCHAR *providerName, + [in] EventPipeProviderCallback *pCallback, + [out] EVENTPIPE_PROVIDER *pProvider); +} + +[ + object, + uuid(B446462D-BD22-41DD-872D-DC714C49EB56), + pointer_default(unique), + local +] +interface ICorProfilerInfo15 : ICorProfilerInfo14 +{ + /* + * EnumerateGCHeapObjects is a method that iterates over each object in the GC heap. + * For each object, it invokes the provided callback function which should return a bool + * indicating whether or not enumeration should continue. + * Enumerating the GC heap requires suspending the runtime. The profiler may accomplish this + * by starting from a state where the runtime is not suspended and by doing one of: + * + * From the same thread, + * Invoking ICorProfilerInfo10::SuspendRuntime() + * ... + * Invoking ICorProfilerInfo15::EnumerateGCHeapObjects() + * ... + * Invoking ICorProfilerInfo10::ResumeRuntime() + * + * or + * + * Invoke ICorProfilerInfo15::EnumerateGCHeapObjects() on its own, and leverage its + * built-in runtime suspension logic. + * + * Parameters: + * - callback: A function pointer to the callback function that will be invoked for each object in the GC heap. + * The callback function should accept an ObjectID and a void pointer as parameters and return a BOOL. + * - callbackState: A void pointer that can be used to pass state information to the callback function. + * + * Returns: + * - HRESULT: A code indicating the result of the operation. If the method succeeds, + * it returns S_OK. If it fails, it returns an error code. + */ + HRESULT EnumerateGCHeapObjects( + [in] ObjectCallback callback, + [in] void* callbackState); +} + /* * This interface lets you iterate over methods in the runtime. */ diff --git a/src/shared/inc/corpub.idl b/src/shared/inc/corpub.idl index c2563fd281..16d3e6359a 100644 --- a/src/shared/inc/corpub.idl +++ b/src/shared/inc/corpub.idl @@ -34,7 +34,7 @@ interface ICorPublishAppDomainEnum; #pragma warning(pop) /* ------------------------------------------------------------------------- * - * Library defintion + * Library definition * ------------------------------------------------------------------------- */ [ diff --git a/src/shared/inc/corsym.idl b/src/shared/inc/corsym.idl index 0afc1ea41e..6c8cf9eddf 100644 --- a/src/shared/inc/corsym.idl +++ b/src/shared/inc/corsym.idl @@ -160,7 +160,7 @@ typedef enum CorSymVarFlag { } CorSymVarFlag; /* ------------------------------------------------------------------------- * - * Library defintion + * Library definition * * Use the _SxS coclasses for tools designed to work with .NET Framework * 1.1 and above. On computers that only have version 1.0 installed, fall @@ -1253,7 +1253,7 @@ interface ISymUnmanagedWriter : IUnknown /* * Define a single variable not within a method. This is used for - * certian fields in classes, bitfields, etc. + * certain fields in classes, bitfields, etc. */ HRESULT DefineField([in] mdTypeDef parent, [in] const WCHAR *name, @@ -1403,7 +1403,7 @@ interface ISymUnmanagedWriter : IUnknown /* * Same as Initialize except that the final path name is the path string to - * name the final location of the pdb file. This is used in build enviroments in + * name the final location of the pdb file. This is used in build environments in * which the pdb is built in a temporary location and moved when the build is * complete. */ diff --git a/src/shared/inc/cortypeinfo.h b/src/shared/inc/cortypeinfo.h index e67fdddbef..87d960301b 100644 --- a/src/shared/inc/cortypeinfo.h +++ b/src/shared/inc/cortypeinfo.h @@ -4,8 +4,8 @@ // This describes information about the COM+ primitive types // -// Note: This file gets parsed by the Mono IL Linker (https://github.com/mono/linker/) which may throw an exception during parsing. -// Specifically, this (https://github.com/mono/linker/blob/master/corebuild/integration/ILLink.Tasks/CreateRuntimeRootDescriptorFile.cs) will try to +// Note: This file gets parsed by the IL Linker (https://github.com/dotnet/runtime/tree/main/src/tools/illink) which may throw an exception during parsing. +// Specifically, this (https://github.com/dotnet/runtime/blob/main/src/tools/illink/src/ILLink.Tasks/CreateRuntimeRootDescriptorFile.cs) will try to // parse this header, and it may throw an exception while doing that. If you edit this file and get a build failure on msbuild.exe D:\repos\coreclr\build.proj // you might want to check out the parser linked above. // diff --git a/src/shared/inc/crosscomp.h b/src/shared/inc/crosscomp.h index 01ec1ff928..10a196302f 100644 --- a/src/shared/inc/crosscomp.h +++ b/src/shared/inc/crosscomp.h @@ -282,7 +282,8 @@ typedef struct DECLSPEC_ALIGN(16) _T_CONTEXT { } T_CONTEXT, *PT_CONTEXT; // _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY (see ExternalAPIs\Win9CoreSystem\inc\winnt.h) -typedef struct _T_RUNTIME_FUNCTION { +#ifdef HOST_UNIX +typedef struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY { DWORD BeginAddress; union { DWORD UnwindData; @@ -294,12 +295,11 @@ typedef struct _T_RUNTIME_FUNCTION { DWORD H : 1; DWORD CR : 2; DWORD FrameSize : 9; - } PackedUnwindData; + }; }; -} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION; +} IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY, * PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY; -#ifdef HOST_UNIX typedef EXCEPTION_DISPOSITION @@ -310,6 +310,8 @@ EXCEPTION_DISPOSITION PVOID DispatcherContext ); #endif + +typedef IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY T_RUNTIME_FUNCTION, * PT_RUNTIME_FUNCTION; // // Define exception dispatch context structure. // @@ -382,6 +384,141 @@ enum #endif // TARGET_ARM64 && !HOST_ARM64 +#elif defined(HOST_AMD64) && defined(TARGET_LOONGARCH64) // Host amd64 managing LOONGARCH64 related code + +#ifndef CROSS_COMPILE +#define CROSS_COMPILE +#endif + +// +// Specify the number of breakpoints and watchpoints that the OS +// will track. Architecturally, LOONGARCH64 supports up to 16. In practice, +// however, almost no one implements more than 4 of each. +// + +#define LOONGARCH64_MAX_BREAKPOINTS 8 +#define LOONGARCH64_MAX_WATCHPOINTS 2 + +#define CONTEXT_UNWOUND_TO_CALL 0x20000000 + +typedef struct DECLSPEC_ALIGN(16) _T_CONTEXT { + + // + // Control flags. + // + + /* +0x000 */ DWORD ContextFlags; + + // + // Integer registers + // + DWORD64 R0; + DWORD64 Ra; + DWORD64 Tp; + DWORD64 Sp; + DWORD64 A0; + DWORD64 A1; + DWORD64 A2; + DWORD64 A3; + DWORD64 A4; + DWORD64 A5; + DWORD64 A6; + DWORD64 A7; + DWORD64 T0; + DWORD64 T1; + DWORD64 T2; + DWORD64 T3; + DWORD64 T4; + DWORD64 T5; + DWORD64 T6; + DWORD64 T7; + DWORD64 T8; + DWORD64 X0; + DWORD64 Fp; + DWORD64 S0; + DWORD64 S1; + DWORD64 S2; + DWORD64 S3; + DWORD64 S4; + DWORD64 S5; + DWORD64 S6; + DWORD64 S7; + DWORD64 S8; + DWORD64 Pc; + + // + // Floating Point Registers: FPR64/LSX/LASX. + // + ULONGLONG F[4*32]; + DWORD64 Fcc; + DWORD Fcsr; +} T_CONTEXT, *PT_CONTEXT; + +// _IMAGE_LOONGARCH64_RUNTIME_FUNCTION_ENTRY (see ExternalAPIs\Win9CoreSystem\inc\winnt.h) +typedef struct _T_RUNTIME_FUNCTION { + DWORD BeginAddress; + union { + DWORD UnwindData; + struct { + DWORD Flag : 2; + DWORD FunctionLength : 11; + DWORD RegF : 3; + DWORD RegI : 4; + DWORD H : 1; + DWORD CR : 2; + DWORD FrameSize : 9; + } PackedUnwindData; + }; +} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION; + +// +// Define exception dispatch context structure. +// + +typedef struct _T_DISPATCHER_CONTEXT { + DWORD64 ControlPc; + DWORD64 ImageBase; + PT_RUNTIME_FUNCTION FunctionEntry; + DWORD64 EstablisherFrame; + DWORD64 TargetPc; + PCONTEXT ContextRecord; + PEXCEPTION_ROUTINE LanguageHandler; + PVOID HandlerData; + PVOID HistoryTable; + DWORD ScopeIndex; + BOOLEAN ControlPcIsUnwound; + PBYTE NonVolatileRegisters; +} T_DISPATCHER_CONTEXT, *PT_DISPATCHER_CONTEXT; + +// +// Nonvolatile context pointer record. +// + +typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS { + + PDWORD64 S0; + PDWORD64 S1; + PDWORD64 S2; + PDWORD64 S3; + PDWORD64 S4; + PDWORD64 S5; + PDWORD64 S6; + PDWORD64 S7; + PDWORD64 S8; + PDWORD64 Fp; + PDWORD64 Tp; + PDWORD64 Ra; + + PDWORD64 F24; + PDWORD64 F25; + PDWORD64 F26; + PDWORD64 F27; + PDWORD64 F28; + PDWORD64 F29; + PDWORD64 F30; + PDWORD64 F31; +} T_KNONVOLATILE_CONTEXT_POINTERS, *PT_KNONVOLATILE_CONTEXT_POINTERS; + #elif defined(HOST_AMD64) && defined(TARGET_RISCV64) // Host amd64 managing RISCV64 related code #ifndef CROSS_COMPILE @@ -557,10 +694,14 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS { #define DAC_CS_NATIVE_DATA_SIZE 12 #elif defined(TARGET_FREEBSD) && defined(TARGET_AMD64) #define DAC_CS_NATIVE_DATA_SIZE 24 +#elif defined(TARGET_FREEBSD) && defined(TARGET_ARM64) +#define DAC_CS_NATIVE_DATA_SIZE 24 #elif defined(TARGET_LINUX) && defined(TARGET_ARM) #define DAC_CS_NATIVE_DATA_SIZE 80 #elif defined(TARGET_LINUX) && defined(TARGET_ARM64) -#define DAC_CS_NATIVE_DATA_SIZE 116 +#define DAC_CS_NATIVE_DATA_SIZE 104 +#elif defined(TARGET_LINUX) && defined(TARGET_LOONGARCH64) +#define DAC_CS_NATIVE_DATA_SIZE 96 #elif defined(TARGET_LINUX) && defined(TARGET_X86) #define DAC_CS_NATIVE_DATA_SIZE 76 #elif defined(TARGET_LINUX) && defined(TARGET_AMD64) @@ -569,6 +710,8 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS { #define DAC_CS_NATIVE_DATA_SIZE 96 #elif defined(TARGET_LINUX) && defined(TARGET_RISCV64) #define DAC_CS_NATIVE_DATA_SIZE 96 +#elif defined(TARGET_LINUX) && defined(TARGET_POWERPC64) +#define DAC_CS_NATIVE_DATA_SIZE 96 #elif defined(TARGET_NETBSD) && defined(TARGET_AMD64) #define DAC_CS_NATIVE_DATA_SIZE 96 #elif defined(TARGET_NETBSD) && defined(TARGET_ARM) diff --git a/src/shared/inc/crsttypes.h b/src/shared/inc/crsttypes_generated.h similarity index 63% rename from src/shared/inc/crsttypes.h rename to src/shared/inc/crsttypes_generated.h index d462cbd3c8..ccbb4070ea 100644 --- a/src/shared/inc/crsttypes.h +++ b/src/shared/inc/crsttypes_generated.h @@ -16,71 +16,71 @@ enum CrstType { CrstAppDomainCache = 0, - CrstAppDomainHandleTable = 1, - CrstArgBasedStubCache = 2, - CrstAssemblyList = 3, - CrstAssemblyLoader = 4, - CrstAvailableClass = 5, - CrstAvailableParamTypes = 6, - CrstBaseDomain = 7, - CrstCCompRC = 8, - CrstClassFactInfoHash = 9, - CrstClassInit = 10, - CrstClrNotification = 11, - CrstCodeFragmentHeap = 12, - CrstCodeVersioning = 13, - CrstCOMCallWrapper = 14, - CrstCOMWrapperCache = 15, - CrstDataTest1 = 16, - CrstDataTest2 = 17, - CrstDbgTransport = 18, - CrstDeadlockDetection = 19, - CrstDebuggerController = 20, - CrstDebuggerFavorLock = 21, - CrstDebuggerHeapExecMemLock = 22, - CrstDebuggerHeapLock = 23, - CrstDebuggerJitInfo = 24, - CrstDebuggerMutex = 25, - CrstDelegateToFPtrHash = 26, - CrstDomainLocalBlock = 27, - CrstDynamicIL = 28, - CrstDynamicMT = 29, - CrstEtwTypeLogHash = 30, - CrstEventPipe = 31, - CrstEventStore = 32, - CrstException = 33, - CrstExecutableAllocatorLock = 34, - CrstExecuteManRangeLock = 35, - CrstExternalObjectContextCache = 36, - CrstFCall = 37, - CrstFuncPtrStubs = 38, - CrstFusionAppCtx = 39, - CrstGCCover = 40, - CrstGlobalStrLiteralMap = 41, - CrstHandleTable = 42, - CrstIbcProfile = 43, - CrstIJWFixupData = 44, - CrstIJWHash = 45, - CrstILStubGen = 46, - CrstInlineTrackingMap = 47, - CrstInstMethodHashTable = 48, - CrstInterop = 49, - CrstInteropData = 50, - CrstIsJMCMethod = 51, - CrstISymUnmanagedReader = 52, - CrstJit = 53, - CrstJitGenericHandleCache = 54, - CrstJitInlineTrackingMap = 55, - CrstJitPatchpoint = 56, - CrstJitPerf = 57, - CrstJumpStubCache = 58, - CrstLeafLock = 59, - CrstListLock = 60, - CrstLoaderAllocator = 61, - CrstLoaderAllocatorReferences = 62, - CrstLoaderHeap = 63, - CrstManagedObjectWrapperMap = 64, - CrstMethodDescBackpatchInfoTracker = 65, + CrstArgBasedStubCache = 1, + CrstAssemblyList = 2, + CrstAssemblyLoader = 3, + CrstAvailableClass = 4, + CrstAvailableParamTypes = 5, + CrstBaseDomain = 6, + CrstCCompRC = 7, + CrstClassFactInfoHash = 8, + CrstClassInit = 9, + CrstClrNotification = 10, + CrstCodeFragmentHeap = 11, + CrstCodeVersioning = 12, + CrstCOMCallWrapper = 13, + CrstCOMWrapperCache = 14, + CrstDataTest1 = 15, + CrstDataTest2 = 16, + CrstDbgTransport = 17, + CrstDeadlockDetection = 18, + CrstDebuggerController = 19, + CrstDebuggerFavorLock = 20, + CrstDebuggerHeapExecMemLock = 21, + CrstDebuggerHeapLock = 22, + CrstDebuggerJitInfo = 23, + CrstDebuggerMutex = 24, + CrstDelegateToFPtrHash = 25, + CrstDynamicIL = 26, + CrstDynamicMT = 27, + CrstEtwTypeLogHash = 28, + CrstEventPipe = 29, + CrstEventStore = 30, + CrstException = 31, + CrstExecutableAllocatorLock = 32, + CrstExecuteManRangeLock = 33, + CrstFCall = 34, + CrstFrozenObjectHeap = 35, + CrstFuncPtrStubs = 36, + CrstFusionAppCtx = 37, + CrstGCCover = 38, + CrstGenericDictionaryExpansion = 39, + CrstGlobalStrLiteralMap = 40, + CrstHandleTable = 41, + CrstIbcProfile = 42, + CrstIJWFixupData = 43, + CrstIJWHash = 44, + CrstILStubGen = 45, + CrstInlineTrackingMap = 46, + CrstInstMethodHashTable = 47, + CrstInterop = 48, + CrstInteropData = 49, + CrstIsJMCMethod = 50, + CrstISymUnmanagedReader = 51, + CrstJit = 52, + CrstJitGenericHandleCache = 53, + CrstJitInlineTrackingMap = 54, + CrstJitPatchpoint = 55, + CrstJitPerf = 56, + CrstJumpStubCache = 57, + CrstLeafLock = 58, + CrstListLock = 59, + CrstLoaderAllocator = 60, + CrstLoaderAllocatorReferences = 61, + CrstLoaderHeap = 62, + CrstManagedObjectWrapperMap = 63, + CrstMethodDescBackpatchInfoTracker = 64, + CrstMethodTableExposedObject = 65, CrstModule = 66, CrstModuleFixup = 67, CrstModuleLookupTable = 68, @@ -93,48 +93,47 @@ enum CrstType CrstObjectList = 75, CrstPEImage = 76, CrstPendingTypeLoadEntry = 77, - CrstPgoData = 78, - CrstPinnedByrefValidation = 79, - CrstProfilerGCRefDataFreeList = 80, - CrstProfilingAPIStatus = 81, - CrstRCWCache = 82, - CrstRCWCleanupList = 83, - CrstReadyToRunEntryPointToMethodDescMap = 84, - CrstReflection = 85, - CrstReJITGlobalRequest = 86, - CrstRetThunkCache = 87, - CrstSavedExceptionInfo = 88, - CrstSaveModuleProfileData = 89, - CrstSecurityStackwalkCache = 90, - CrstSigConvert = 91, - CrstSingleUseLock = 92, - CrstSpecialStatics = 93, - CrstStackSampler = 94, - CrstStressLog = 95, - CrstStubCache = 96, - CrstStubDispatchCache = 97, - CrstStubUnwindInfoHeapSegments = 98, - CrstSyncBlockCache = 99, - CrstSyncHashLock = 100, - CrstSystemBaseDomain = 101, - CrstSystemDomain = 102, - CrstSystemDomainDelayedUnloadList = 103, - CrstThreadIdDispenser = 104, - CrstThreadpoolTimerQueue = 105, - CrstThreadpoolWaitThreads = 106, - CrstThreadpoolWorker = 107, - CrstThreadStore = 108, - CrstTieredCompilation = 109, - CrstTypeEquivalenceMap = 110, - CrstTypeIDMap = 111, - CrstUMEntryThunkCache = 112, - CrstUMEntryThunkFreeListLock = 113, - CrstUniqueStack = 114, - CrstUnresolvedClassLock = 115, - CrstUnwindInfoTableLock = 116, - CrstVSDIndirectionCellLock = 117, - CrstWrapperTemplate = 118, - kNumberOfCrstTypes = 119 + CrstPerfMap = 78, + CrstPgoData = 79, + CrstPinnedByrefValidation = 80, + CrstPinnedHeapHandleTable = 81, + CrstProfilerGCRefDataFreeList = 82, + CrstProfilingAPIStatus = 83, + CrstRCWCache = 84, + CrstRCWCleanupList = 85, + CrstReadyToRunEntryPointToMethodDescMap = 86, + CrstReflection = 87, + CrstReJITGlobalRequest = 88, + CrstRetThunkCache = 89, + CrstSavedExceptionInfo = 90, + CrstSaveModuleProfileData = 91, + CrstSigConvert = 92, + CrstSingleUseLock = 93, + CrstSpecialStatics = 94, + CrstStackSampler = 95, + CrstStressLog = 96, + CrstStubCache = 97, + CrstStubDispatchCache = 98, + CrstStubUnwindInfoHeapSegments = 99, + CrstSyncBlockCache = 100, + CrstSyncHashLock = 101, + CrstSystemBaseDomain = 102, + CrstSystemDomain = 103, + CrstSystemDomainDelayedUnloadList = 104, + CrstThreadIdDispenser = 105, + CrstThreadLocalStorageLock = 106, + CrstThreadStore = 107, + CrstTieredCompilation = 108, + CrstTypeEquivalenceMap = 109, + CrstTypeIDMap = 110, + CrstUMEntryThunkCache = 111, + CrstUMEntryThunkFreeListLock = 112, + CrstUniqueStack = 113, + CrstUnresolvedClassLock = 114, + CrstUnwindInfoTableLock = 115, + CrstVSDIndirectionCellLock = 116, + CrstWrapperTemplate = 117, + kNumberOfCrstTypes = 118 }; #endif // __CRST_TYPES_INCLUDED @@ -146,21 +145,20 @@ enum CrstType int g_rgCrstLevelMap[] = { 10, // CrstAppDomainCache - 14, // CrstAppDomainHandleTable 3, // CrstArgBasedStubCache - 0, // CrstAssemblyList - 12, // CrstAssemblyLoader + 3, // CrstAssemblyList + 14, // CrstAssemblyLoader 4, // CrstAvailableClass 5, // CrstAvailableParamTypes 7, // CrstBaseDomain -1, // CrstCCompRC - 13, // CrstClassFactInfoHash + 15, // CrstClassFactInfoHash 11, // CrstClassInit -1, // CrstClrNotification 6, // CrstCodeFragmentHeap 9, // CrstCodeVersioning - 0, // CrstCOMCallWrapper - 5, // CrstCOMWrapperCache + 3, // CrstCOMCallWrapper + 10, // CrstCOMWrapperCache 3, // CrstDataTest1 0, // CrstDataTest2 0, // CrstDbgTransport @@ -170,72 +168,74 @@ int g_rgCrstLevelMap[] = 0, // CrstDebuggerHeapExecMemLock 0, // CrstDebuggerHeapLock 4, // CrstDebuggerJitInfo - 10, // CrstDebuggerMutex + 13, // CrstDebuggerMutex 0, // CrstDelegateToFPtrHash - 16, // CrstDomainLocalBlock 0, // CrstDynamicIL - 3, // CrstDynamicMT + 10, // CrstDynamicMT 0, // CrstEtwTypeLogHash - 18, // CrstEventPipe + 20, // CrstEventPipe 0, // CrstEventStore 0, // CrstException 0, // CrstExecutableAllocatorLock 0, // CrstExecuteManRangeLock - 0, // CrstExternalObjectContextCache 4, // CrstFCall + -1, // CrstFrozenObjectHeap 7, // CrstFuncPtrStubs 10, // CrstFusionAppCtx 10, // CrstGCCover - 13, // CrstGlobalStrLiteralMap + 18, // CrstGenericDictionaryExpansion + 17, // CrstGlobalStrLiteralMap 1, // CrstHandleTable 0, // CrstIbcProfile 8, // CrstIJWFixupData 0, // CrstIJWHash 7, // CrstILStubGen 3, // CrstInlineTrackingMap - 17, // CrstInstMethodHashTable - 20, // CrstInterop - 5, // CrstInteropData + 19, // CrstInstMethodHashTable + 22, // CrstInterop + 10, // CrstInteropData 0, // CrstIsJMCMethod 7, // CrstISymUnmanagedReader 11, // CrstJit 0, // CrstJitGenericHandleCache - 16, // CrstJitInlineTrackingMap + 12, // CrstJitInlineTrackingMap 4, // CrstJitPatchpoint -1, // CrstJitPerf 6, // CrstJumpStubCache 0, // CrstLeafLock -1, // CrstListLock - 15, // CrstLoaderAllocator - 16, // CrstLoaderAllocatorReferences + 17, // CrstLoaderAllocator + 18, // CrstLoaderAllocatorReferences 3, // CrstLoaderHeap 3, // CrstManagedObjectWrapperMap - 14, // CrstMethodDescBackpatchInfoTracker + 10, // CrstMethodDescBackpatchInfoTracker + -1, // CrstMethodTableExposedObject 5, // CrstModule - 15, // CrstModuleFixup + 18, // CrstModuleFixup 4, // CrstModuleLookupTable 0, // CrstMulticoreJitHash - 13, // CrstMulticoreJitManager - 0, // CrstNativeImageEagerFixups + 15, // CrstMulticoreJitManager + 3, // CrstNativeImageEagerFixups 0, // CrstNativeImageLoad 0, // CrstNls 0, // CrstNotifyGdb 2, // CrstObjectList 5, // CrstPEImage - 19, // CrstPendingTypeLoadEntry + 21, // CrstPendingTypeLoadEntry + 0, // CrstPerfMap 4, // CrstPgoData 0, // CrstPinnedByrefValidation + 16, // CrstPinnedHeapHandleTable 0, // CrstProfilerGCRefDataFreeList - 13, // CrstProfilingAPIStatus + 15, // CrstProfilingAPIStatus 4, // CrstRCWCache 0, // CrstRCWCleanupList 10, // CrstReadyToRunEntryPointToMethodDescMap 8, // CrstReflection - 17, // CrstReJITGlobalRequest + 16, // CrstReJITGlobalRequest 4, // CrstRetThunkCache 3, // CrstSavedExceptionInfo 0, // CrstSaveModuleProfileData - 0, // CrstSecurityStackwalkCache 4, // CrstSigConvert 5, // CrstSingleUseLock 0, // CrstSpecialStatics @@ -247,13 +247,11 @@ int g_rgCrstLevelMap[] = 3, // CrstSyncBlockCache 0, // CrstSyncHashLock 5, // CrstSystemBaseDomain - 13, // CrstSystemDomain + 15, // CrstSystemDomain 0, // CrstSystemDomainDelayedUnloadList 0, // CrstThreadIdDispenser - 7, // CrstThreadpoolTimerQueue - 7, // CrstThreadpoolWaitThreads - 13, // CrstThreadpoolWorker - 12, // CrstThreadStore + 5, // CrstThreadLocalStorageLock + 14, // CrstThreadStore 8, // CrstTieredCompilation 4, // CrstTypeEquivalenceMap 10, // CrstTypeIDMap @@ -270,7 +268,6 @@ int g_rgCrstLevelMap[] = LPCSTR g_rgCrstNameMap[] = { "CrstAppDomainCache", - "CrstAppDomainHandleTable", "CrstArgBasedStubCache", "CrstAssemblyList", "CrstAssemblyLoader", @@ -296,7 +293,6 @@ LPCSTR g_rgCrstNameMap[] = "CrstDebuggerJitInfo", "CrstDebuggerMutex", "CrstDelegateToFPtrHash", - "CrstDomainLocalBlock", "CrstDynamicIL", "CrstDynamicMT", "CrstEtwTypeLogHash", @@ -305,11 +301,12 @@ LPCSTR g_rgCrstNameMap[] = "CrstException", "CrstExecutableAllocatorLock", "CrstExecuteManRangeLock", - "CrstExternalObjectContextCache", "CrstFCall", + "CrstFrozenObjectHeap", "CrstFuncPtrStubs", "CrstFusionAppCtx", "CrstGCCover", + "CrstGenericDictionaryExpansion", "CrstGlobalStrLiteralMap", "CrstHandleTable", "CrstIbcProfile", @@ -335,6 +332,7 @@ LPCSTR g_rgCrstNameMap[] = "CrstLoaderHeap", "CrstManagedObjectWrapperMap", "CrstMethodDescBackpatchInfoTracker", + "CrstMethodTableExposedObject", "CrstModule", "CrstModuleFixup", "CrstModuleLookupTable", @@ -347,8 +345,10 @@ LPCSTR g_rgCrstNameMap[] = "CrstObjectList", "CrstPEImage", "CrstPendingTypeLoadEntry", + "CrstPerfMap", "CrstPgoData", "CrstPinnedByrefValidation", + "CrstPinnedHeapHandleTable", "CrstProfilerGCRefDataFreeList", "CrstProfilingAPIStatus", "CrstRCWCache", @@ -359,7 +359,6 @@ LPCSTR g_rgCrstNameMap[] = "CrstRetThunkCache", "CrstSavedExceptionInfo", "CrstSaveModuleProfileData", - "CrstSecurityStackwalkCache", "CrstSigConvert", "CrstSingleUseLock", "CrstSpecialStatics", @@ -374,9 +373,7 @@ LPCSTR g_rgCrstNameMap[] = "CrstSystemDomain", "CrstSystemDomainDelayedUnloadList", "CrstThreadIdDispenser", - "CrstThreadpoolTimerQueue", - "CrstThreadpoolWaitThreads", - "CrstThreadpoolWorker", + "CrstThreadLocalStorageLock", "CrstThreadStore", "CrstTieredCompilation", "CrstTypeEquivalenceMap", diff --git a/src/shared/inc/crtwrap.h b/src/shared/inc/crtwrap.h index 3a54ccfb80..59b68d7d46 100644 --- a/src/shared/inc/crtwrap.h +++ b/src/shared/inc/crtwrap.h @@ -11,12 +11,11 @@ #define __CrtWrap_h__ #include +#include #include #include -#include #include "debugmacros.h" #include -#include #include #include diff --git a/src/shared/inc/daccess.h b/src/shared/inc/daccess.h index 5c41b9e06f..cc03c8e9d1 100644 --- a/src/shared/inc/daccess.h +++ b/src/shared/inc/daccess.h @@ -2,23 +2,606 @@ // The .NET Foundation licenses this file to you under the MIT license. //***************************************************************************** // File: daccess.h -// +// + +// +// Support for external access of runtime data structures. These +// macros and templates hide the details of pointer and data handling +// so that data structures and code can be compiled to work both +// in-process and through a special memory access layer. +// +// This code assumes the existence of two different pieces of code, +// the target, the runtime code that is going to be examined, and +// the host, the code that's doing the examining. Access to the +// target is abstracted so the target may be a live process on the +// same machine, a live process on a different machine, a dump file +// or whatever. No assumptions should be made about accessibility +// of the target. +// +// This code assumes that the data in the target is static. Any +// time the target's data changes the interfaces must be reset so +// that potentially stale data is discarded. +// +// This code is intended for read access and there is no +// way to write data back currently. +// +// DAC-ized code: +// - is read-only (non-invasive). So DACized codepaths can not trigger a GC. +// - has no Thread* object. In reality, DAC-ized codepaths are +// ReadProcessMemory calls from out-of-process. Conceptually, they +// are like a pure-native (preemptive) thread. +//// +// This means that in particular, you cannot DACize a GCTRIGGERS function. +// Neither can you DACize a function that throws if this will involve +// allocating a new exception object. There may be +// exceptions to these rules if you can guarantee that the DACized +// part of the code path cannot cause a garbage collection (see +// EditAndContinueModule::ResolveField for an example). +// If you need to DACize a function that may trigger +// a GC, it is probably best to refactor the function so that the DACized +// part of the code path is in a separate function. For instance, +// functions with GetOrCreate() semantics are hard to DAC-ize because +// they the Create portion is inherently invasive. Instead, consider refactoring +// into a GetOrFail() function that DAC can call; and then make GetOrCreate() +// a wrapper around that. + +// +// This code works by hiding the details of access to target memory. +// Access is divided into two types: +// 1. DPTR - access to a piece of data. +// 2. VPTR - access to a class with a vtable. The class can only have +// a single vtable pointer at the beginning of the class instance. +// Things only need to be declared as VPTRs when it is necessary to +// call virtual functions in the host. In that case the access layer +// must do extra work to provide a host vtable for the object when +// it is retrieved so that virtual functions can be called. +// +// When compiling with DACCESS_COMPILE the macros turn into templates +// which replace pointers with smart pointers that know how to fetch +// data from the target process and provide a host process version of it. +// Normal data structure access will transparently receive a host copy +// of the data and proceed, so code such as +// typedef DPTR(Class) PTR_Class; +// PTR_Class cls; +// int val = cls->m_Int; +// will work without modification. The appropriate operators are overloaded +// to provide transparent access, such as the -> operator in this case. +// Note that the convention is to create an appropriate typedef for +// each type that will be accessed. This hides the particular details +// of the type declaration and makes the usage look more like regular code. +// +// The ?PTR classes also have an implicit base type cast operator to +// produce a host-pointer instance of the given type. For example +// Class* cls = PTR_Class(addr); +// works by implicit conversion from the PTR_Class created by wrapping +// to a host-side Class instance. Again, this means that existing code +// can work without modification. +// +// Code Example: +// +// typedef struct _rangesection +// { +// PTR_IJitManager pjit; +// PTR_RangeSection pright; +// PTR_RangeSection pleft; +// ... Other fields omitted ... +// } RangeSection; +// +// RangeSection* pRS = m_RangeTree; +// +// while (pRS != NULL) +// { +// if (currentPC < pRS->LowAddress) +// pRS=pRS->pleft; +// else if (currentPC > pRS->HighAddress) +// pRS=pRS->pright; +// else +// { +// return pRS->_pjit; +// } +// } +// +// This code does not require any modifications. The global reference +// provided by m_RangeTree will be a host version of the RangeSection +// instantiated by conversion. The references to pRS->pleft and +// pRS->pright will refer to DPTRs due to the modified declaration. +// In the assignment statement the compiler will automatically use +// the implicit conversion from PTR_RangeSection to RangeSection*, +// causing a host instance to be created. Finally, if an appropriate +// section is found the use of pRS->_pjit will cause an implicit +// conversion from PTR_IJitManager to IJitManager. The VPTR code +// will look at target memory to determine the actual derived class +// for the JitManager and instantiate the right class in the host so +// that host virtual functions can be used just as they would in +// the target. +// +// There are situations where code modifications are required, though. +// +// 1. Any time the actual value of an address matters, such as using +// it as a search key in a tree, the target address must be used. +// +// An example of this is the RangeSection tree used to locate JIT +// managers. A portion of this code is shown above. Each +// RangeSection node in the tree describes a range of addresses +// managed by the JitMan. These addresses are just being used as +// values, not to dereference through, so there are not DPTRs. When +// searching the range tree for an address the address used in the +// search must be a target address as that's what values are kept in +// the RangeSections. In the code shown above, currentPC must be a +// target address as the RangeSections in the tree are all target +// addresses. Use dac_cast to retrieve the target address +// of a ?PTR, as well as to convert a host address to the +// target address used to retrieve that particular instance. Do not +// use dac_cast with any raw target pointer types (such as BYTE*). +// +// 2. Any time an address is modified, such as by address arithmetic, +// the arithmetic must be performed on the target address. +// +// When a host instance is created it is created for the type in use. +// There is no particular relation to any other instance, so address +// arithmetic cannot be used to get from one instance to any other +// part of memory. For example +// char* Func(Class* cls) +// { +// // String follows the basic Class data. +// return (char*)(cls + 1); +// } +// does not work with external access because the Class* used would +// have retrieved only a Class worth of data. There is no string +// following the host instance. Instead, this code should use +// dac_cast to get the target address of the Class +// instance, add sizeof(*cls) and then create a new ?PTR to access +// the desired data. Note that the newly retrieved data will not +// be contiguous with the Class instance, so address arithmetic +// will still not work. +// +// Previous Code: +// +// BOOL IsTarget(LPVOID ip) +// { +// StubCallInstrs* pStubCallInstrs = GetStubCallInstrs(); +// +// if (ip == (LPVOID) &(pStubCallInstrs->m_op)) +// { +// return TRUE; +// } +// +// Modified Code: +// +// BOOL IsTarget(LPVOID ip) +// { +// StubCallInstrs* pStubCallInstrs = GetStubCallInstrs(); +// +// if ((TADDR)ip == dac_cast(pStubCallInstrs) + +// (TADDR)offsetof(StubCallInstrs, m_op)) +// { +// return TRUE; +// } +// +// The parameter ip is a target address, so the host pStubCallInstrs +// cannot be used to derive an address from. The member & reference +// has to be replaced with a conversion from host to target address +// followed by explicit offsetting for the field. +// +// PTR_HOST_MEMBER_TADDR is a convenience macro that encapsulates +// these two operations, so the above code could also be: +// +// if ((TADDR)ip == +// PTR_HOST_MEMBER_TADDR(StubCallInstrs, pStubCallInstrs, m_op)) +// +// 3. Any time the amount of memory referenced through an address +// changes, such as by casting to a different type, a new ?PTR +// must be created. +// +// Host instances are created and stored based on both the target +// address and size of access. The access code has no way of knowing +// all possible ways that data will be retrieved for a given address +// so if code changes the way it accesses through an address a new +// ?PTR must be used, which may lead to a difference instance and +// different host address. This means that pointer identity does not hold +// across casts, so code like +// Class* cls = PTR_Class(addr); +// Class2* cls2 = PTR_Class2(addr); +// return cls == cls2; +// will fail because the host-side instances have no relation to each +// other. That isn't a problem, since by rule #1 you shouldn't be +// relying on specific host address values. +// +// Previous Code: +// +// return (ArrayClass *) m_pMethTab->GetClass(); +// +// Modified Code: +// +// return PTR_ArrayClass(m_pMethTab->GetClass()); +// +// The ?PTR templates have an implicit conversion from a host pointer +// to a target address, so the cast above constructs a new +// PTR_ArrayClass by implicitly converting the host pointer result +// from GetClass() to its target address and using that as the address +// of the new PTR_ArrayClass. As mentioned, the actual host-side +// pointer values may not be the same. +// +// Host pointer identity can be assumed as long as the type of access +// is the same. In the example above, if both accesses were of type +// Class then the host pointer will be the same, so it is safe to +// retrieve the target address of an instance and then later get +// a new host pointer for the target address using the same type as +// the host pointer in that case will be the same. This is enabled +// by caching all of the retrieved host instances. This cache is searched +// by the addr:size pair and when there's a match the existing instance +// is reused. This increases performance and also allows simple +// pointer identity to hold. It does mean that host memory grows +// in proportion to the amount of target memory being referenced, +// so retrieving extraneous data should be avoided. +// The host-side data cache grows until the Flush() method is called, +// at which point all host-side data is discarded. No host +// instance pointers should be held across a Flush(). +// +// Accessing into an object can lead to some unusual behavior. For +// example, the SList class relies on objects to contain an SLink +// instance that it uses for list maintenance. This SLink can be +// embedded anywhere in the larger object. The SList access is always +// purely to an SLink, so when using the access layer it will only +// retrieve an SLink's worth of data. The SList template will then +// do some address arithmetic to determine the start of the real +// object and cast the resulting pointer to the final object type. +// When using the access layer this results in a new ?PTR being +// created and used, so a new instance will result. The internal +// SLink instance will have no relation to the new object instance +// even though in target address terms one is embedded in the other. +// The assumption of data stability means that this won't cause +// a problem, but care must be taken with the address arithmetic, +// as laid out in rules #2 and #3. +// +// 4. Global address references cannot be used. Any reference to a +// global piece of code or data, such as a function address, global +// variable or class static variable, must be changed. +// +// The external access code may load at a different base address than +// the target process code. Global addresses are therefore not +// meaningful and must be replaced with something else. There isn't +// a single solution, so replacements must be done on a case-by-case +// basis. +// +// The simplest case is a global or class static variable. All +// declarations must be replaced with a special declaration that +// compiles into a modified accessor template value when compiled for +// external data access. Uses of the variable automatically are fixed +// up by the template instance. Note that assignment to the global +// must be independently ifdef'ed as the external access layer should +// not make any modifications. +// +// Macros allow for simple declaration of a class static and global +// values that compile into an appropriate templated value. +// +// Previous Code: +// +// static RangeSection* m_RangeTree; +// RangeSection* ExecutionManager::m_RangeTree; +// +// extern ThreadStore* g_pThreadStore; +// ThreadStore* g_pThreadStore = &StaticStore; +// class SystemDomain : public BaseDomain { +// ... +// ArrayListStatic m_appDomainIndexList; +// ... +// } +// +// SystemDomain::m_appDomainIndexList; +// +// extern DWORD gThreadTLSIndex; +// +// DWORD gThreadTLSIndex = TLS_OUT_OF_INDEXES; +// +// Modified Code: +// +// typedef DPTR(RangeSection) PTR_RangeSection; +// SPTR_DECL(RangeSection, m_RangeTree); +// SPTR_IMPL(RangeSection, ExecutionManager, m_RangeTree); +// +// typedef DPTR(ThreadStore) PTR_ThreadStore +// GPTR_DECL(ThreadStore, g_pThreadStore); +// GPTR_IMPL_INIT(ThreadStore, g_pThreadStore, &StaticStore); +// +// class SystemDomain : public BaseDomain { +// ... +// SVAL_DECL(ArrayListStatic; m_appDomainIndexList); +// ... +// } +// +// SVAL_IMPL(ArrayListStatic, SystemDomain, m_appDomainIndexList); +// +// GVAL_DECL(DWORD, gThreadTLSIndex); +// +// GVAL_IMPL_INIT(DWORD, gThreadTLSIndex, TLS_OUT_OF_INDEXES); +// +// When declaring the variable, the first argument declares the +// variable's type and the second argument declares the variable's +// name. When defining the variable the arguments are similar, with +// an extra class name parameter for the static class variable case. +// If an initializer is needed the IMPL_INIT macro should be used. +// +// Things get slightly more complicated when declaring an embedded +// array. In this case the data element is not a single element and +// therefore cannot be represented by a ?PTR. In the case of a global +// array, you should use the GARY_DECL and GARY_IMPL macros. +// We durrently have no support for declaring static array data members +// or initialized arrays. Array data members that are dynamically allocated +// need to be treated as pointer members. To reference individual elements +// you must use pointer arithmetic (see rule 2 above). An array declared +// as a local variable within a function does not need to be DACized. +// +// +// All uses of ?VAL_DECL must have a corresponding entry given in the +// DacGlobals structure in src\inc\dacvars.h. For SVAL_DECL the entry +// is class__name. For GVAL_DECL the entry is dac__name. You must add +// these entries in dacvars.h using the DEFINE_DACVAR macro. Note that +// these entries also are used for dumping memory in mini dumps and +// heap dumps. If it's not appropriate to dump a variable, (e.g., +// it's an array or some other value that is not important to have +// in a minidump) a second macro, DEFINE_DACVAR_NO_DUMP, will allow +// you to make the required entry in the DacGlobals structure without +// dumping its value. If the variable is implemented with one of the VOLATILE_* macros +// then the DEFINE_DACVAR_VOLATILE macro must be used. +// +// For convenience, here is a list of the various variable declaration and +// initialization macros: +// SVAL_DECL(type, name) static non-pointer data class MyClass +// member declared within { +// the class declaration // static int i; +// SVAL_DECL(int, i); +// } +// +// SVAL_IMPL(type, cls, name) static non-pointer data // int MyClass::i; +// member defined outside SVAL_IMPL(int, MyClass, i); +// the class declaration +// +// SVAL_IMPL_INIT(type, cls, static non-pointer data // int MyClass::i = 0; +// name, val) member defined and SVAL_IMPL_INIT(int, MyClass, i, 0); +// initialized outside the +// class declaration +// ------------------------------------------------------------------------------------------------ +// VOLATILE_SVAL_DECL(type, name) static volatile class MyClass +// non-pointer data { +// member declared // static Volatile i; +// within the class VOLATILE_SVAL_DECL(int, i); +// declaration } +// +// VOLATILE_SVAL_IMPL(type, cls, static volatile +// name) non-pointer data // Volatile MyClass::i; +// member defined VOLATILE_SVAL_IMPL(int, MyClass, i); +// outside the +// class declaration +// +// VOLATILE_SVAL_IMPL_INIT( static volatile +// type, cls, name) non-pointer data // Volatile MyClass::i = 0; +// member defined VOLATILE_SVAL_IMPL_INIT(int, MyClass, i, 0); +// and initialized +// outside the +// class declaration +// ------------------------------------------------------------------------------------------------ +// SPTR_DECL(type, name) static pointer data class MyClass +// member declared within { +// the class declaration // static int * pInt; +// SPTR_DECL(int, pInt); +// } +// +// SPTR_IMPL(type, cls, name) static pointer data // int * MyClass::pInt; +// member defined outside SPTR_IMPL(int, MyClass, pInt); +// the class declaration +// +// SPTR_IMPL_INIT(type, cls, static pointer data // int * MyClass::pInt = NULL; +// name, val) member defined and SPTR_IMPL_INIT(int, MyClass, pInt, NULL); +// initialized outside the +// class declaration +// ------------------------------------------------------------------------------------------------ +// VOLATILE_SPTR_DECL(type, name) static volatile class MyClass +// pointer data { +// member declared // static Volatile i; +// within the class VOLATILE_SPTR_DECL(int, i); +// declaration } +// +// VOLATILE_SPTR_IMPL(type, cls, static volatile +// name) pointer data // Volatile MyClass::i; +// member defined VOLATILE_SPTR_IMPL(int, MyClass, i); +// outside the +// class declaration +// +// VOLATILE_SPTR_IMPL_INIT( static volatile +// type, cls, name) pointer data // Volatile MyClass::i = 0; +// member defined VOLATILE_SPTR_IMPL_INIT(int, MyClass, i, 0); +// and initialized +// outside the +// class declaration +// ------------------------------------------------------------------------------------------------ +// GVAL_DECL(type, name) extern declaration of // extern int g_i +// global non-pointer GVAL_DECL(int, g_i); +// variable +// +// GVAL_IMPL(type, name) declaration of a // int g_i +// global non-pointer GVAL_IMPL(int, g_i); +// variable +// +// GVAL_IMPL_INIT (type, declaration and // int g_i = 0; +// name, initialization of a GVAL_IMPL_INIT(int, g_i, 0); +// val) global non-pointer +// variable +// ****Note**** +// If you use GVAL_? to declare a global variable of a structured type and you need to +// access a member of the type, you cannot use the dot operator. Instead, you must take the +// address of the variable and use the arrow operator. For example: +// struct +// { +// int x; +// char ch; +// } MyStruct; +// GVAL_IMPL(MyStruct, g_myStruct); +// int i = (&g_myStruct)->x; +// ------------------------------------------------------------------------------------------------ +// GPTR_DECL(type, name) extern declaration of // extern int * g_pInt +// global pointer GPTR_DECL(int, g_pInt); +// variable +// +// GPTR_IMPL(type, name) declaration of a // int * g_pInt +// global pointer GPTR_IMPL(int, g_pInt); +// variable +// +// GPTR_IMPL_INIT (type, declaration and // int * g_pInt = 0; +// name, initialization of a GPTR_IMPL_INIT(int, g_pInt, NULL); +// val) global pointer +// variable +// ------------------------------------------------------------------------------------------------ +// GARY_DECL(type, name) extern declaration of // extern int g_rgIntList[MAX_ELEMENTS]; +// a global array GPTR_DECL(int, g_rgIntList, MAX_ELEMENTS); +// variable +// +// GARY_IMPL(type, name) declaration of a // int g_rgIntList[MAX_ELEMENTS]; +// global pointer GPTR_IMPL(int, g_rgIntList, MAX_ELEMENTS); +// variable +// +// +// Certain pieces of code, such as the stack walker, rely on identifying +// an object from its vtable address. As the target vtable addresses +// do not necessarily correspond to the vtables used in the host, these +// references must be translated. The access layer maintains translation +// tables for all classes used with VPTR and can return the target +// vtable pointer for any host vtable in the known list of VPTR classes. +// +// ----- Errors: +// +// All errors in the access layer are reported via exceptions. The +// formal access layer methods catch all such exceptions and turn +// them into the appropriate error, so this generally isn't visible +// to users of the access layer. +// +// ----- DPTR Declaration: +// +// Create a typedef for the type with typedef DPTR(type) PTR_type; +// Replace type* with PTR_type. +// +// ----- VPTR Declaration: +// +// VPTR can only be used on classes that have a single vtable +// pointer at the beginning of the object. This should be true +// for a normal single-inheritance object. +// +// All of the classes that may be instantiated need to be identified +// and marked. In the base class declaration add either +// VPTR_BASE_VTABLE_CLASS if the class is abstract or +// VPTR_BASE_CONCRETE_VTABLE_CLASS if the class is concrete. In each +// derived class add VPTR_VTABLE_CLASS. If you end up with compile or +// link errors for an unresolved method called VPtrSize you missed a +// derived class declaration. +// +// +// All classes to be instantiated must be listed in src\inc\vptr_list.h. +// +// Create a typedef for the type with typedef VPTR(type) PTR_type; +// When using a VPTR, replace Class* with PTR_Class. +// +// ----- Specific Macros: +// +// PTR_TO_TADDR(ptr) +// Retrieves the raw target address for a ?PTR. +// See code:dac_cast for the preferred alternative +// +// PTR_HOST_TO_TADDR(host) +// Given a host address of an instance produced by a ?PTR reference, +// return the original target address. The host address must +// be an exact match for an instance. +// See code:dac_cast for the preferred alternative +// +// PTR_HOST_INT_TO_TADDR(host) +// Given a host address which resides somewhere within an instance +// produced by a ?PTR reference (a host interior pointer) return the +// corresponding target address. This is useful for evaluating +// relative pointers (e.g. RelativePointer) where calculating the +// target address requires knowledge of the target address of the +// relative pointer field itself. This lookup is slower than that for +// a non-interior host pointer so use it sparingly. +// +// VPTR_HOST_VTABLE_TO_TADDR(host) +// Given the host vtable pointer for a known VPTR class, return +// the target vtable pointer. +// +// PTR_HOST_MEMBER_TADDR(type, host, memb) +// Retrieves the target address of a host instance pointer and +// offsets it by the given member's offset within the type. +// +// PTR_HOST_INT_MEMBER_TADDR(type, host, memb) +// As above but will work for interior host pointers (see the +// description of PTR_HOST_INT_TO_TADDR for an explanation of host +// interior pointers). +// +// PTR_READ(addr, size) +// Reads a block of memory from the target and returns a host +// pointer for it. Useful for reading blocks of data from the target +// whose size is only known at runtime, such as raw code for a jitted +// method. If the data being read is actually an object, use SPTR +// instead to get better type semantics. +// +// DAC_EMPTY() +// DAC_EMPTY_ERR() +// DAC_EMPTY_RET(retVal) +// DAC_UNEXPECTED() +// Provides an empty method implementation when compiled +// for DACCESS_COMPILE. For example, use to stub out methods needed +// for vtable entries but otherwise unused. +// +// These macros are designed to turn into normal code when compiled +// without DACCESS_COMPILE. +// +//***************************************************************************** + #ifndef __daccess_h__ #define __daccess_h__ +#ifndef NATIVEAOT #include +#if !defined(HOST_WINDOWS) +#include +#endif + #include "switches.h" #include "safemath.h" #include "corerror.h" -#ifdef PAL_STDCPP_COMPAT +// Keep in sync with the definitions in dbgutil.cpp and createdump.h +#define DACCESS_TABLE_SYMBOL "g_dacTable" + #include -#else -#include "clr_std/type_traits" #include "crosscomp.h" -#endif + +#include + +// Information stored in the DAC table of interest to the DAC implementation +// Note that this information is shared between all instantiations of ClrDataAccess, so initialize +// it just once in code:ClrDataAccess.GetDacGlobals (rather than use fields in ClrDataAccess); +struct DacTableInfo +{ + // On Windows, the first DWORD is the 32-bit timestamp read out of the runtime dll's debug directory. + // The remaining 3 DWORDS must all be 0. + // On Mac, this is the 16-byte UUID of the runtime dll. + // It is used to validate that mscorwks is the same version as mscordacwks + DWORD dwID0; + DWORD dwID1; + DWORD dwID2; + DWORD dwID3; +}; + +// The header of the DAC table. This includes the number of globals, the number of vptrs, and +// the DacTableInfo structure. We need the DacTableInfo and DacTableHeader structs outside +// of a DACCESS_COMPILE since soshost walks the Dac table headers to find the UUID of CoreCLR +// in the target process. +struct DacTableHeader +{ + ULONG numGlobals; + ULONG numVptrs; + DacTableInfo info; +}; // // This version of things wraps pointer access in @@ -31,20 +614,18 @@ // Define TADDR as a non-pointer value so use of it as a pointer // will not work properly. Define it as unsigned so // pointer comparisons aren't affected by sign. -// This requires special casting to ULONG64 to sign-extend if necessary. -typedef ULONG_PTR TADDR; +typedef uintptr_t TADDR; -// TSIZE_T used for counts or ranges that need to span the size of a +// TSIZE_T used for counts or ranges that need to span the size of a // target pointer. For cross-plat, this may be different than SIZE_T // which reflects the host pointer size. typedef SIZE_T TSIZE_T; -#define VPTR_CLASS_METHODS(name) +#endif // !NATIVEAOT + // Used for base classes that can be instantiated directly. // The fake vfn is still used to force a vtable even when // all the normal vfns are ifdef'ed out. -#define VPTR_BASE_CONCRETE_VTABLE_CLASS(name) \ -public: name(TADDR addr, TADDR vtAddr) {} \ - VPTR_CLASS_METHODS(name) +#define VPTR_BASE_CONCRETE_VTABLE_CLASS(name) // // This version of the macros turns into normal pointers @@ -63,7 +644,7 @@ public: name(TADDR addr, TADDR vtAddr) {} \ // Declare TADDR as a non-pointer type so that arithmetic // can be done on it directly, as with the DACCESS_COMPILE definition. // This also helps expose pointer usage that may need to be changed. -typedef ULONG_PTR TADDR; +typedef uintptr_t TADDR; typedef void* PTR_VOID; typedef LPVOID* PTR_PTR_VOID; @@ -81,7 +662,6 @@ typedef const void* PTR_CVOID; static store_type var #define _SPTR_IMPL(acc_type, store_type, cls, var) \ store_type cls::var - #define GVAL_DECL(type, var) \ extern type var #define GVAL_IMPL(type, var) \ @@ -108,7 +688,7 @@ typedef const void* PTR_CVOID; // TADDR <- ?PTR(Src) - Get TADDR of PTR object (DPtr etc.) // TADDR <- Src * - Get TADDR of dac host object instance // -// Note that there is no direct convertion to other host-pointer types (because we don't +// Note that there is no direct conversion to other host-pointer types (because we don't // know if you want a DPTR or VPTR etc.). However, due to the implicit DAC conversions, // you can just use dac_cast and assign that to a Foo*. // @@ -134,7 +714,7 @@ typedef const void* PTR_CVOID; // dac_cast(pBD) // dac_cast(pAD) // -// Example comparsions of some old and new syntax, where +// Example comparisons of some old and new syntax, where // h is a host pointer, such as "Foo *h;" // p is a DPTR, such as "PTR_Foo p;" // @@ -165,10 +745,18 @@ inline Tgt dac_cast(Src src) // //---------------------------------------------------------------------------- -typedef ArrayDPTR(BYTE) PTR_BYTE; +typedef DPTR(size_t) PTR_size_t; typedef ArrayDPTR(uint8_t) PTR_uint8_t; +typedef DPTR(PTR_uint8_t) PTR_PTR_uint8_t; +typedef DPTR(int32_t) PTR_int32_t; +typedef DPTR(uint32_t) PTR_uint32_t; +typedef DPTR(uint64_t) PTR_uint64_t; +typedef DPTR(uintptr_t) PTR_uintptr_t; +typedef DPTR(TADDR) PTR_TADDR; + +#ifndef NATIVEAOT +typedef ArrayDPTR(BYTE) PTR_BYTE; typedef DPTR(PTR_BYTE) PTR_PTR_BYTE; -typedef DPTR(PTR_uint8_t) PTR_PTR_uint8_t; typedef DPTR(PTR_PTR_BYTE) PTR_PTR_PTR_BYTE; typedef ArrayDPTR(signed char) PTR_SBYTE; typedef ArrayDPTR(const BYTE) PTR_CBYTE; @@ -178,7 +766,6 @@ typedef DPTR(UINT16) PTR_UINT16; typedef DPTR(WORD) PTR_WORD; typedef DPTR(USHORT) PTR_USHORT; typedef DPTR(DWORD) PTR_DWORD; -typedef DPTR(uint32_t) PTR_uint32_t; typedef DPTR(LONG) PTR_LONG; typedef DPTR(ULONG) PTR_ULONG; typedef DPTR(INT32) PTR_INT32; @@ -187,8 +774,6 @@ typedef DPTR(ULONG64) PTR_ULONG64; typedef DPTR(INT64) PTR_INT64; typedef DPTR(UINT64) PTR_UINT64; typedef DPTR(SIZE_T) PTR_SIZE_T; -typedef DPTR(size_t) PTR_size_t; -typedef DPTR(TADDR) PTR_TADDR; typedef DPTR(int) PTR_int; typedef DPTR(BOOL) PTR_BOOL; typedef DPTR(unsigned) PTR_unsigned; @@ -217,6 +802,7 @@ typedef DPTR(IMAGE_NT_HEADERS64) PTR_IMAGE_NT_HEADERS64; typedef DPTR(IMAGE_SECTION_HEADER) PTR_IMAGE_SECTION_HEADER; typedef DPTR(IMAGE_EXPORT_DIRECTORY) PTR_IMAGE_EXPORT_DIRECTORY; typedef DPTR(IMAGE_TLS_DIRECTORY) PTR_IMAGE_TLS_DIRECTORY; +#endif //---------------------------------------------------------------------------- // @@ -227,14 +813,6 @@ typedef DPTR(IMAGE_TLS_DIRECTORY) PTR_IMAGE_TLS_DIRECTORY; typedef TADDR PCODE; typedef DPTR(PCODE) PTR_PCODE; typedef DPTR(PTR_PCODE) PTR_PTR_PCODE; - -// TARGET_CONSISTENCY_CHECK represents a condition that should not fail unless the DAC target is corrupt. -// This is in contrast to ASSERTs in DAC infrastructure code which shouldn't fail regardless of the memory -// read from the target. At the moment we treat these the same, but in the future we will want a mechanism -// for disabling just the target consistency checks (eg. for tests that intentionally use corrupted targets). -// @dbgtodo : Separating asserts and target consistency checks is tracked by DevDiv Bugs 31674 -#define TARGET_CONSISTENCY_CHECK(expr,msg) _ASSERTE_MSG(expr,msg) - // For cross compilation, controlling type layout is important // We add a simple macro here which defines DAC_ALIGNAS to the C++11 alignas operator // This helps force the alignment of the next member @@ -246,4 +824,5 @@ typedef DPTR(PTR_PCODE) PTR_PTR_PCODE; // The Windows compilers will align the first member to the alignment size of the // class. Linux will align the first member to its natural alignment #define DAC_ALIGNAS(a) alignas(a) + #endif // #ifndef __daccess_h__ diff --git a/src/shared/inc/dacprivate.h b/src/shared/inc/dacprivate.h index f568efe429..3050296344 100644 --- a/src/shared/inc/dacprivate.h +++ b/src/shared/inc/dacprivate.h @@ -230,7 +230,7 @@ struct MSLAYOUT DacpThreadLocalModuleData struct MSLAYOUT DacpModuleData { CLRDATA_ADDRESS Address = 0; - CLRDATA_ADDRESS PEAssembly = 0; // A PEAssembly addr + CLRDATA_ADDRESS PEAssembly = 0; // Actually the module address in .NET 9+ CLRDATA_ADDRESS ilBase = 0; CLRDATA_ADDRESS metadataStart = 0; ULONG64 metadataSize = 0; @@ -250,8 +250,8 @@ struct MSLAYOUT DacpModuleData CLRDATA_ADDRESS FileReferencesMap = 0; CLRDATA_ADDRESS ManifestModuleReferencesMap = 0; - CLRDATA_ADDRESS pLookupTableHeap = 0; - CLRDATA_ADDRESS pThunkHeap = 0; + CLRDATA_ADDRESS LoaderAllocator = 0; + CLRDATA_ADDRESS ThunkHeap = 0; ULONG64 dwModuleIndex = 0; @@ -274,11 +274,14 @@ struct MSLAYOUT DacpMethodTableData { BOOL bIsFree = FALSE; // everything else is NULL if this is true. CLRDATA_ADDRESS Module = 0; + // Note: DacpMethodTableData::Class is really a pointer to the canonical method table CLRDATA_ADDRESS Class = 0; CLRDATA_ADDRESS ParentMethodTable = 0; WORD wNumInterfaces = 0; WORD wNumMethods = 0; + // Note: Always 0, since .NET 9 WORD wNumVtableSlots = 0; + // Note: Always 0, since .NET 9 WORD wNumVirtuals = 0; DWORD BaseSize = 0; DWORD ComponentSize = 0; @@ -467,7 +470,7 @@ struct MSLAYOUT DacpAssemblyData HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr) { - return Request(sos, addr, (TADDR)0); + return Request(sos, addr, 0); } }; @@ -577,7 +580,7 @@ struct MSLAYOUT DacpMethodDescData { return sos->GetMethodDescData( addr, - (TADDR)0, // IP address + 0, // IP address this, 0, // cRejitData NULL, // rejitData[] @@ -611,7 +614,7 @@ struct MSLAYOUT DacpTieredVersionData OptimizationTier_ReadyToRun, OptimizationTier_OptimizedTier1OSR, OptimizationTier_QuickJittedInstrumented, - OptimizationTier_OptimizedTier1Instrumented + OptimizationTier_OptimizedTier1Instrumented, }; CLRDATA_ADDRESS NativeCodeAddr; @@ -619,22 +622,6 @@ struct MSLAYOUT DacpTieredVersionData CLRDATA_ADDRESS NativeCodeVersionNodePtr; }; -// 2.x version -struct MSLAYOUT DacpTieredVersionData_2x -{ - enum TieredState - { - NON_TIERED, - TIERED_0, - TIERED_1, - TIERED_UNKNOWN - }; - - CLRDATA_ADDRESS NativeCodeAddr; - TieredState TieredInfo; - CLRDATA_ADDRESS NativeCodeVersionNodePtr; -}; - // for JITType enum JITTypes {TYPE_UNKNOWN=0,TYPE_JIT,TYPE_PJIT}; @@ -743,7 +730,7 @@ struct MSLAYOUT DacpGenerationAllocData struct MSLAYOUT DacpGcHeapDetails { - CLRDATA_ADDRESS heapAddr = 0; // Only filled in in server mode, otherwise NULL + CLRDATA_ADDRESS heapAddr = 0; // Only filled in server mode, otherwise NULL CLRDATA_ADDRESS alloc_allocated = 0; CLRDATA_ADDRESS mark_array = 0; @@ -798,7 +785,7 @@ struct MSLAYOUT DacpHeapSegmentData CLRDATA_ADDRESS mem = 0; // pass this to request if non-null to get the next segments. CLRDATA_ADDRESS next = 0; - CLRDATA_ADDRESS gc_heap = 0; // only filled in in server mode, otherwise NULL + CLRDATA_ADDRESS gc_heap = 0; // only filled in server mode, otherwise NULL // computed field: if this is the ephemeral segment highMark includes the ephemeral generation CLRDATA_ADDRESS highAllocMark = 0; @@ -901,7 +888,7 @@ struct MSLAYOUT DacpGCInterestingInfoData struct MSLAYOUT DacpGcHeapAnalyzeData { - CLRDATA_ADDRESS heapAddr = 0; // Only filled in in server mode, otherwise NULL + CLRDATA_ADDRESS heapAddr = 0; // Only filled in server mode, otherwise NULL CLRDATA_ADDRESS internal_root_array = 0; ULONG64 internal_root_array_index = 0; @@ -1002,7 +989,7 @@ struct MSLAYOUT DacpGetModuleData BOOL IsDynamic = FALSE; BOOL IsInMemory = FALSE; BOOL IsFileLayout = FALSE; - CLRDATA_ADDRESS PEAssembly = 0; + CLRDATA_ADDRESS PEAssembly = 0; // Actually the module address in .NET 9+ CLRDATA_ADDRESS LoadedPEAddress = 0; ULONG64 LoadedPESize = 0; CLRDATA_ADDRESS InMemoryPdbAddress = 0; diff --git a/src/shared/inc/dbgenginemetrics.h b/src/shared/inc/dbgenginemetrics.h index ebb7fc1400..f1410b9195 100644 --- a/src/shared/inc/dbgenginemetrics.h +++ b/src/shared/inc/dbgenginemetrics.h @@ -3,7 +3,7 @@ // // DbgEngineMetrics.h // -// This file contains the defintion of CLR_ENGINE_METRICS. This struct is used for Silverlight debugging. +// This file contains the definition of CLR_ENGINE_METRICS. This struct is used for Silverlight debugging. // // ====================================================================================== diff --git a/src/shared/inc/debugmacros.h b/src/shared/inc/debugmacros.h index 99cfd60b1c..35592ea36b 100644 --- a/src/shared/inc/debugmacros.h +++ b/src/shared/inc/debugmacros.h @@ -10,6 +10,7 @@ #ifndef __DebugMacros_h__ #define __DebugMacros_h__ +#include "stacktrace.h" #include "debugmacrosext.h" #include "palclr.h" @@ -25,13 +26,10 @@ extern "C" { class SString; bool GetStackTraceAtContext(SString & s, struct _CONTEXT * pContext); -void _cdecl DbgWriteEx(LPCTSTR szFmt, ...); bool _DbgBreakCheck(LPCSTR szFile, int iLine, LPCSTR szExpr, BOOL fConstrained = FALSE); extern VOID ANALYZER_NORETURN DbgAssertDialog(const char *szFile, int iLine, const char *szExpr); -extern int _DbgBreakCount; - #define PRE_ASSERTE /* if you need to change modes before doing asserts override */ #define POST_ASSERTE /* put it back */ @@ -53,23 +51,14 @@ extern int _DbgBreakCount; #define VERIFY(stmt) _ASSERTE((stmt)) -#define _ASSERTE_ALL_BUILDS(file, expr) _ASSERTE((expr)) - -#define FreeBuildDebugBreak() DebugBreak() +#define _ASSERTE_ALL_BUILDS(expr) _ASSERTE((expr)) #else // !_DEBUG -#define _DbgBreakCount 0 - #define _ASSERTE(expr) ((void)0) #define _ASSERTE_MSG(expr, msg) ((void)0) #define VERIFY(stmt) (void)(stmt) -void __FreeBuildDebugBreak(); -void DECLSPEC_NORETURN __FreeBuildAssertFail(const char *szFile, int iLine, const char *szExpr); - -#define FreeBuildDebugBreak() __FreeBuildDebugBreak() - // At this point, EEPOLICY_HANDLE_FATAL_ERROR may or may not be defined. It will be defined // if we are building the VM folder, but outside VM, its not necessarily defined. // @@ -77,11 +66,11 @@ void DECLSPEC_NORETURN __FreeBuildAssertFail(const char *szFile, int iLine, cons // but if it is defined, we will use it. // // Failing here implies an error in the runtime - hence we use COR_E_EXECUTIONENGINE. - #ifdef EEPOLICY_HANDLE_FATAL_ERROR -#define _ASSERTE_ALL_BUILDS(file, expr) if (!(expr)) EEPOLICY_HANDLE_FATAL_ERROR(COR_E_EXECUTIONENGINE); +#define _ASSERTE_ALL_BUILDS(expr) if (!(expr)) EEPOLICY_HANDLE_FATAL_ERROR(COR_E_EXECUTIONENGINE); #else // !EEPOLICY_HANDLE_FATAL_ERROR -#define _ASSERTE_ALL_BUILDS(file, expr) if (!(expr)) __FreeBuildAssertFail(file, __LINE__, #expr); +void DECLSPEC_NORETURN __FreeBuildAssertFail(const char *szFile, int iLine, const char *szExpr); +#define _ASSERTE_ALL_BUILDS(expr) if (!(expr)) __FreeBuildAssertFail(__FILE__, __LINE__, #expr); #endif // EEPOLICY_HANDLE_FATAL_ERROR #endif @@ -99,9 +88,6 @@ void DECLSPEC_NORETURN __FreeBuildAssertFail(const char *szFile, int iLine, cons #ifdef _DEBUG_IMPL -// A macro to execute a statement only in _DEBUG_IMPL. -#define DEBUG_IMPL_STMT(stmt) stmt - #define _ASSERTE_IMPL(expr) _ASSERTE((expr)) #if defined(_M_IX86) @@ -116,7 +102,6 @@ void DECLSPEC_NORETURN __FreeBuildAssertFail(const char *szFile, int iLine, cons #define _DbgBreak() DebugBreak() #endif -extern VOID DebBreak(); extern VOID DebBreakHr(HRESULT hr); #ifndef IfFailGoto @@ -151,8 +136,6 @@ do { hr = (EXPR); if(hr != ERROR_SUCCESS) { hr = HRESULT_FROM_WIN32(hr); DebBrea #define _DbgBreak() {} -#define DEBUG_IMPL_STMT(stmt) - #define _ASSERTE_IMPL(expr) #define IfFailGoto(EXPR, LABEL) \ @@ -195,4 +178,4 @@ do { hr = (EXPR); if(hr != ERROR_SUCCESS) { hr = HRESULT_FROM_WIN32(hr); goto LA #undef _ASSERT #define _ASSERT _ASSERTE -#endif +#endif // __DebugMacros_h__ diff --git a/src/shared/inc/entrypoints.h b/src/shared/inc/entrypoints.h deleted file mode 100644 index dcd6cb5d06..0000000000 --- a/src/shared/inc/entrypoints.h +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//----------------------------------------------------------------------------- -// Entrypoint markers -// Used to identify all external entrypoints into the CLR (via COM, exports, etc) -// and perform various tasks on all of them -//----------------------------------------------------------------------------- - - -#ifndef __ENTRYPOINTS_h__ -#define __ENTRYPOINTS_h__ - -#define BEGIN_ENTRYPOINT_THROWS -#define END_ENTRYPOINT_THROWS -#define BEGIN_ENTRYPOINT_THROWS_WITH_THREAD(____thread) -#define END_ENTRYPOINT_THROWS_WITH_THREAD -#define BEGIN_ENTRYPOINT_NOTHROW_WITH_THREAD(___thread) -#define END_ENTRYPOINT_NOTHROW_WITH_THREAD -#define BEGIN_ENTRYPOINT_NOTHROW -#define END_ENTRYPOINT_NOTHROW -#define BEGIN_ENTRYPOINT_VOIDRET -#define END_ENTRYPOINT_VOIDRET -#define BEGIN_CLEANUP_ENTRYPOINT -#define END_CLEANUP_ENTRYPOINT - -#endif // __ENTRYPOINTS_h__ - - diff --git a/src/shared/inc/ex.h b/src/shared/inc/ex.h index 7fbc9278ee..fc319b3ef0 100644 --- a/src/shared/inc/ex.h +++ b/src/shared/inc/ex.h @@ -13,7 +13,6 @@ #include "corerror.h" #include "stresslog.h" #include "staticcontract.h" -#include "entrypoints.h" #if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE) #define _DEBUG_IMPL 1 @@ -177,11 +176,17 @@ class Exception public: Exception() {LIMITED_METHOD_DAC_CONTRACT; m_innerException = NULL;} virtual ~Exception() {LIMITED_METHOD_DAC_CONTRACT; if (m_innerException != NULL) Exception::Delete(m_innerException); } +#ifdef DACCESS_COMPILE + void * operator new(size_t size); + void operator delete(void* ptr); +#endif virtual BOOL IsDomainBound() {return m_innerException!=NULL && m_innerException->IsDomainBound();} ; virtual HRESULT GetHR() = 0; virtual void GetMessage(SString &s); +#ifdef FEATURE_COMINTEROP virtual IErrorInfo *GetErrorInfo() { LIMITED_METHOD_CONTRACT; return NULL; } virtual HRESULT SetErrorInfo() { LIMITED_METHOD_CONTRACT; return S_OK; } +#endif // FEATURE_COMINTEROP void SetInnerException(Exception * pInnerException) { LIMITED_METHOD_CONTRACT; m_innerException = pInnerException; } // Dynamic type query for catchers @@ -420,24 +425,32 @@ class COMException : public HRException { friend bool DebugIsEECxxExceptionPointer(void* pv); +#ifdef FEATURE_COMINTEROP private: IErrorInfo *m_pErrorInfo; +#endif // FEATURE_COMINTEROP public: COMException(); COMException(HRESULT hr) ; +#ifdef FEATURE_COMINTEROP COMException(HRESULT hr, IErrorInfo *pErrorInfo); ~COMException(); // Virtual overrides IErrorInfo *GetErrorInfo(); void GetMessage(SString &result); +#endif protected: virtual Exception *CloneHelper() { WRAPPER_NO_CONTRACT; +#ifdef FEATURE_COMINTEROP return new COMException(m_hr, m_pErrorInfo); +#else + return new COMException(m_hr); +#endif } }; @@ -470,7 +483,9 @@ class SEHException : public Exception // Virtual overrides HRESULT GetHR(); +#ifdef FEATURE_COMINTEROP IErrorInfo *GetErrorInfo(); +#endif // FEATURE_COMINTEROP void GetMessage(SString &result); protected: @@ -515,7 +530,9 @@ class DelegatingException : public Exception // Virtual overrides virtual BOOL IsDomainBound() {return Exception::IsDomainBound() ||(m_delegatedException!=NULL && m_delegatedException->IsDomainBound());} ; HRESULT GetHR(); +#ifdef FEATURE_COMINTEROP IErrorInfo *GetErrorInfo(); +#endif // FEATURE_COMINTEROP void GetMessage(SString &result); virtual Exception *Clone(); @@ -1247,25 +1264,31 @@ inline HRMsgException::HRMsgException(HRESULT hr, SString const &s) } inline COMException::COMException() - : HRException(), - m_pErrorInfo(NULL) + : HRException() +#ifdef FEATURE_COMINTEROP + , m_pErrorInfo(NULL) +#endif // FEATURE_COMINTEROP { WRAPPER_NO_CONTRACT; } inline COMException::COMException(HRESULT hr) - : HRException(hr), - m_pErrorInfo(NULL) + : HRException(hr) +#ifdef FEATURE_COMINTEROP + , m_pErrorInfo(NULL) +#endif // FEATURE_COMINTEROP { LIMITED_METHOD_CONTRACT; } +#ifdef FEATURE_COMINTEROP inline COMException::COMException(HRESULT hr, IErrorInfo *pErrorInfo) : HRException(hr), m_pErrorInfo(pErrorInfo) { LIMITED_METHOD_CONTRACT; } +#endif // FEATURE_COMINTEROP inline SEHException::SEHException() { @@ -1284,6 +1307,7 @@ inline SEHException::SEHException(EXCEPTION_RECORD *pointers, T_CONTEXT *pContex void DECLSPEC_NORETURN ThrowHR(HRESULT hr); void DECLSPEC_NORETURN ThrowHR(HRESULT hr, SString const &msg); +void DECLSPEC_NORETURN ThrowHR(HRESULT hr, UINT uText); void DECLSPEC_NORETURN ThrowWin32(DWORD err); void DECLSPEC_NORETURN ThrowLastError(); void DECLSPEC_NORETURN ThrowOutOfMemory(); diff --git a/src/shared/inc/gcdecoder.cpp b/src/shared/inc/gcdecoder.cpp index 73873acc25..d4a3c4c3a6 100644 --- a/src/shared/inc/gcdecoder.cpp +++ b/src/shared/inc/gcdecoder.cpp @@ -15,7 +15,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX // ****************************************************************************** // WARNING!!!: This code is also used by SOS in the diagnostics repo. Should be // updated in a backwards and forwards compatible way. -// See: https://github.com/dotnet/diagnostics/blob/master/src/inc/gcdecoder.cpp +// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcdecoder.cpp // ****************************************************************************** #ifdef TARGET_X86 diff --git a/src/shared/inc/gcdump.h b/src/shared/inc/gcdump.h index 131016d310..7c7f559a5a 100644 --- a/src/shared/inc/gcdump.h +++ b/src/shared/inc/gcdump.h @@ -11,11 +11,6 @@ * to the standard code-manager spec. */ -// ****************************************************************************** -// WARNING!!!: This header is also used by the runtime repo. -// See: https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/gcdump.h -// ****************************************************************************** - /*****************************************************************************/ #ifndef __GCDUMP_H__ #define __GCDUMP_H__ diff --git a/src/shared/inc/gcinfo.h b/src/shared/inc/gcinfo.h index 9a257a502b..d526405c9f 100644 --- a/src/shared/inc/gcinfo.h +++ b/src/shared/inc/gcinfo.h @@ -4,7 +4,7 @@ // ****************************************************************************** // WARNING!!!: These values are used by SOS in the diagnostics repo. Values should // added or removed in a backwards and forwards compatible way. -// See: https://github.com/dotnet/diagnostics/blob/master/src/inc/gcinfo.h +// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfo.h // ****************************************************************************** /*****************************************************************************/ @@ -13,9 +13,6 @@ /*****************************************************************************/ #include "daccess.h" -#include "windef.h" // For BYTE - -// Some declarations in this file are used on non-x86 platforms, but most are x86-specific. // Use the lower 2 bits of the offsets stored in the tables // to encode properties @@ -23,14 +20,15 @@ const unsigned OFFSET_MASK = 0x3; // mask to access the low 2 bits // -// Note for untracked locals the flags allowed are "pinned" and "byref" -// and for tracked locals the flags allowed are "this" and "byref" // Note that these definitions should also match the definitions of // GC_CALL_INTERIOR and GC_CALL_PINNED in VM/gc.h // const unsigned byref_OFFSET_FLAG = 0x1; // the offset is an interior ptr const unsigned pinned_OFFSET_FLAG = 0x2; // the offset is a pinned ptr -#if !defined(TARGET_X86) || !defined(FEATURE_EH_FUNCLETS) +#if defined(TARGET_X86) +// JIT32_ENCODER has additional restriction on x86 without funclets: +// - for untracked locals the flags allowed are "pinned" and "byref" +// - for tracked locals the flags allowed are "this" and "byref" const unsigned this_OFFSET_FLAG = 0x2; // the offset is "this" #endif @@ -38,7 +36,7 @@ const unsigned this_OFFSET_FLAG = 0x2; // the offset is "this" // The current GCInfo Version //----------------------------------------------------------------------------- -#define GCINFO_VERSION 2 +#define GCINFO_VERSION 3 //----------------------------------------------------------------------------- // GCInfoToken: A wrapper that contains the GcInfo data and version number. @@ -57,11 +55,26 @@ const unsigned this_OFFSET_FLAG = 0x2; // the offset is "this" struct GCInfoToken { PTR_VOID Info; - UINT32 Version; + uint32_t Version; + +#ifdef FEATURE_NATIVEAOT + GCInfoToken(PTR_VOID info) + { + Info = info; + Version = GCINFO_VERSION; + } +#endif - static UINT32 ReadyToRunVersionToGcInfoVersion(UINT32 readyToRunMajorVersion) + static uint32_t ReadyToRunVersionToGcInfoVersion(uint32_t readyToRunMajorVersion, uint32_t readyToRunMinorVersion) { - // GcInfo version is current from ReadyToRun version 2.0 + // Once MINIMUM_READYTORUN_MAJOR_VERSION is bumped to 10+ + // delete the following and just return GCINFO_VERSION + // + // R2R 9.0 and 9.1 use GCInfo v2 + // R2R 9.2 uses GCInfo v3 + if (readyToRunMajorVersion == 9 && readyToRunMinorVersion < 2) + return 2; + return GCINFO_VERSION; } }; diff --git a/src/shared/inc/gcinfodecoder.h b/src/shared/inc/gcinfodecoder.h index 2b18fd0dd2..6f62a3f874 100644 --- a/src/shared/inc/gcinfodecoder.h +++ b/src/shared/inc/gcinfodecoder.h @@ -10,7 +10,7 @@ // ****************************************************************************** // WARNING!!!: These values are used by SOS in the diagnostics repo. Values should // added or removed in a backwards and forwards compatible way. -// See: https://github.com/dotnet/diagnostics/blob/master/src/inc/gcinfodecoder.h +// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfodecoder.h // ****************************************************************************** #ifndef _GC_INFO_DECODER_ @@ -29,9 +29,19 @@ #else -#ifdef FEATURE_REDHAWK +#ifdef FEATURE_NATIVEAOT + +#include "gcinfo.h" typedef ArrayDPTR(const uint8_t) PTR_CBYTE; +#ifdef TARGET_X86 +// Bridge few additional pointer types used in x86 unwinding code +typedef DPTR(DWORD) PTR_DWORD; +typedef DPTR(WORD) PTR_WORD; +typedef DPTR(BYTE) PTR_BYTE; +typedef DPTR(signed char) PTR_SBYTE; +typedef DPTR(INT32) PTR_INT32; +#endif #define LIMITED_METHOD_CONTRACT #define SUPPORTS_DAC @@ -50,23 +60,13 @@ typedef ArrayDPTR(const uint8_t) PTR_CBYTE; #define SSIZE_T intptr_t #define LPVOID void* +#define CHECK_APP_DOMAIN 0 + typedef void * OBJECTREF; #define GET_CALLER_SP(pREGDISPLAY) ((TADDR)0) -struct GCInfoToken -{ - PTR_VOID Info; - UINT32 Version; - - GCInfoToken(PTR_VOID info) - { - Info = info; - Version = 2; - } -}; - -#else // FEATURE_REDHAWK +#else // FEATURE_NATIVEAOT // Stuff from cgencpu.h: @@ -85,6 +85,8 @@ inline TADDR GetSP(T_CONTEXT* context) return (TADDR)context->Sp; #elif defined(TARGET_ARM64) return (TADDR)context->Sp; +#elif defined(TARGET_LOONGARCH64) + return (TADDR)context->Sp; #elif defined(TARGET_RISCV64) return (TADDR)context->Sp; #else @@ -100,6 +102,8 @@ inline PCODE GetIP(T_CONTEXT* context) return (PCODE)context->Pc; #elif defined(TARGET_ARM64) return (PCODE)context->Pc; +#elif defined(TARGET_LOONGARCH64) + return (PCODE)context->Pc; #elif defined(TARGET_RISCV64) return (PCODE)context->Pc; #else @@ -157,7 +161,7 @@ inline BOOL IS_ALIGNED( void* val, size_t alignment ) typedef void (*GCEnumCallback)( void * hCallback, // callback data - OBJECTREF* pObject, // address of obect-reference we are reporting + OBJECTREF* pObject, // address of object-reference we are reporting uint32_t flags // is this a pinned and/or interior pointer ); @@ -165,7 +169,7 @@ typedef void (*GCEnumCallback)( #include "regdisp.h" -#endif // FEATURE_REDHAWK +#endif // FEATURE_NATIVEAOT #ifndef _strike_h @@ -181,6 +185,9 @@ enum ICodeManagerFlags NoReportUntracked = 0x0080, // EnumGCRefs/EnumerateLiveSlots should *not* include // any untracked slots + ReportFPBasedSlotsOnly + = 0x0200, // EnumGCRefs/EnumerateLiveSlots should only include + // slots that are based on the frame pointer }; #endif // !_strike_h @@ -216,15 +223,15 @@ enum GcInfoDecoderFlags DECODE_EDIT_AND_CONTINUE = 0x800, DECODE_REVERSE_PINVOKE_VAR = 0x1000, DECODE_RETURN_KIND = 0x2000, -#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) DECODE_HAS_TAILCALLS = 0x4000, -#endif // TARGET_ARM || TARGET_ARM64 || TARGET_RISCV64 +#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64 }; enum GcInfoHeaderFlags { GC_INFO_IS_VARARG = 0x1, - GC_INFO_HAS_SECURITY_OBJECT = 0x2, + // unused = 0x2, // was GC_INFO_HAS_SECURITY_OBJECT GC_INFO_HAS_GS_COOKIE = 0x4, GC_INFO_HAS_PSP_SYM = 0x8, GC_INFO_HAS_GENERICS_INST_CONTEXT_MASK = 0x30, @@ -235,10 +242,10 @@ enum GcInfoHeaderFlags GC_INFO_HAS_STACK_BASE_REGISTER = 0x40, #ifdef TARGET_AMD64 GC_INFO_WANTS_REPORT_ONLY_LEAF = 0x80, -#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) GC_INFO_HAS_TAILCALLS = 0x80, #endif // TARGET_AMD64 - GC_INFO_HAS_EDIT_AND_CONTINUE_PRESERVED_SLOTS = 0x100, + GC_INFO_HAS_EDIT_AND_CONTINUE_INFO = 0x100, GC_INFO_REVERSE_PINVOKE_FRAME = 0x200, GC_INFO_FLAGS_BIT_SIZE_VERSION_1 = 9, @@ -261,6 +268,9 @@ class BitStreamReader m_pCurrent = m_pBuffer = dac_cast((size_t)dac_cast(pBuffer) & ~((size_t)sizeof(size_t)-1)); m_RelPos = m_InitialRelPos = (int)((size_t)dac_cast(pBuffer) % sizeof(size_t)) * 8/*BITS_PER_BYTE*/; + // There are always some bits in the GC info, at least the header. + // It is ok to prefetch. + m_current = *m_pCurrent >> m_RelPos; } BitStreamReader(const BitStreamReader& other) @@ -271,6 +281,7 @@ class BitStreamReader m_InitialRelPos = other.m_InitialRelPos; m_pCurrent = other.m_pCurrent; m_RelPos = other.m_RelPos; + m_current = other.m_current; } const BitStreamReader& operator=(const BitStreamReader& other) @@ -281,6 +292,7 @@ class BitStreamReader m_InitialRelPos = other.m_InitialRelPos; m_pCurrent = other.m_pCurrent; m_RelPos = other.m_RelPos; + m_current = other.m_current; return *this; } @@ -291,35 +303,42 @@ class BitStreamReader _ASSERTE(numBits > 0 && numBits <= BITS_PER_SIZE_T); - size_t result = (*m_pCurrent) >> m_RelPos; + size_t result = m_current; + m_current >>= numBits; int newRelPos = m_RelPos + numBits; - if(newRelPos >= BITS_PER_SIZE_T) + if(newRelPos > BITS_PER_SIZE_T) { m_pCurrent++; + m_current = *m_pCurrent; newRelPos -= BITS_PER_SIZE_T; - if(newRelPos > 0) - { - size_t extraBits = (*m_pCurrent) << (numBits - newRelPos); - result ^= extraBits; - } + size_t extraBits = m_current << (numBits - newRelPos); + result |= extraBits; + m_current >>= newRelPos; } m_RelPos = newRelPos; - result &= SAFE_SHIFT_LEFT(1, numBits) - 1; + result &= ((size_t)-1 >> (BITS_PER_SIZE_T - numBits)); return result; } - // This version reads one bit, returning zero/non-zero (not 0/1) + // This version reads one bit // NOTE: This routine is perf-critical __forceinline size_t ReadOneFast() { SUPPORTS_DAC; - size_t result = (*m_pCurrent) & (((size_t)1) << m_RelPos); - if(++m_RelPos == BITS_PER_SIZE_T) + // "m_RelPos == BITS_PER_SIZE_T" means that m_current + // is not yet fetched. Do that now. + if(m_RelPos == BITS_PER_SIZE_T) { m_pCurrent++; + m_current = *m_pCurrent; m_RelPos = 0; } + + m_RelPos++; + size_t result = m_current & 1; + m_current >>= 1; + return result; } @@ -335,6 +354,10 @@ class BitStreamReader size_t adjPos = pos + m_InitialRelPos; m_pCurrent = m_pBuffer + adjPos / BITS_PER_SIZE_T; m_RelPos = (int)(adjPos % BITS_PER_SIZE_T); + + // we always call SetCurrentPos just before reading. + // It is ok to prefetch. + m_current = *m_pCurrent >> m_RelPos; _ASSERTE(GetCurrentPos() == pos); } @@ -342,28 +365,27 @@ class BitStreamReader { SUPPORTS_DAC; - SetCurrentPos(GetCurrentPos() + numBitsToSkip); - } + size_t pos = GetCurrentPos() + numBitsToSkip; + size_t adjPos = pos + m_InitialRelPos; + m_pCurrent = m_pBuffer + adjPos / BITS_PER_SIZE_T; + m_RelPos = (int)(adjPos % BITS_PER_SIZE_T); - __forceinline void AlignUpToByte() - { - if(m_RelPos <= BITS_PER_SIZE_T - 8) + // Skipping ahead may go to a position at the edge-exclusive + // end of the stream. The location may have no more data. + // We will not prefetch on word boundary - in case + // the next word in in an unreadable page. + if (m_RelPos == 0) { - m_RelPos = (m_RelPos + 7) & ~7; + m_pCurrent--; + m_RelPos = BITS_PER_SIZE_T; + m_current = 0; } else { - m_RelPos = 0; - m_pCurrent++; + m_current = *m_pCurrent >> m_RelPos; } - } - __forceinline size_t ReadBitAtPos( size_t pos ) - { - size_t adjPos = pos + m_InitialRelPos; - size_t* ptr = m_pBuffer + adjPos / BITS_PER_SIZE_T; - int relPos = (int)(adjPos % BITS_PER_SIZE_T); - return (*ptr) & (((size_t)1) << relPos); + _ASSERTE(GetCurrentPos() == pos); } @@ -372,17 +394,17 @@ class BitStreamReader // See the corresponding methods on BitStreamWriter for more information on the format //-------------------------------------------------------------------------- - inline size_t DecodeVarLengthUnsigned( int base ) + size_t DecodeVarLengthUnsignedMore ( int base ) { _ASSERTE((base > 0) && (base < (int)BITS_PER_SIZE_T)); size_t numEncodings = size_t{ 1 } << base; - size_t result = 0; - for(int shift=0; ; shift+=base) + size_t result = numEncodings; + for(int shift=base; ; shift+=base) { _ASSERTE(shift+base <= (int)BITS_PER_SIZE_T); size_t currentChunk = Read(base+1); - result |= (currentChunk & (numEncodings-1)) << shift; + result ^= (currentChunk & (numEncodings-1)) << shift; if(!(currentChunk & numEncodings)) { // Extension bit is not set, we're done. @@ -391,6 +413,19 @@ class BitStreamReader } } + __forceinline size_t DecodeVarLengthUnsigned(int base) + { + _ASSERTE((base > 0) && (base < (int)BITS_PER_SIZE_T)); + + size_t result = Read(base + 1); + if (result & ((size_t)1 << base)) + { + result ^= DecodeVarLengthUnsignedMore(base); + } + + return result; + } + inline SSIZE_T DecodeVarLengthSigned( int base ) { _ASSERTE((base > 0) && (base < (int)BITS_PER_SIZE_T)); @@ -418,6 +453,7 @@ class BitStreamReader int m_InitialRelPos; PTR_size_t m_pCurrent; int m_RelPos; + size_t m_current; }; struct GcSlotDesc @@ -488,12 +524,18 @@ class GcInfoDecoder //------------------------------------------------------------------------ bool IsInterruptible(); + bool HasInterruptibleRanges(); #ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED + bool IsSafePoint(); + bool AreSafePointsInterruptible(); + bool IsInterruptibleSafePoint(); + bool CouldBeInterruptibleSafePoint(); + // This is used for gccoverage bool IsSafePoint(UINT32 codeOffset); - typedef void EnumerateSafePointsCallback (UINT32 offset, void * hCallback); + typedef void EnumerateSafePointsCallback (GcInfoDecoder* decoder, UINT32 offset, void * hCallback); void EnumerateSafePoints(EnumerateSafePointsCallback * pCallback, void * hCallback); #endif @@ -528,7 +570,6 @@ class GcInfoDecoder // Miscellaneous method information //------------------------------------------------------------------------ - INT32 GetSecurityObjectStackSlot(); INT32 GetGSCookieStackSlot(); UINT32 GetGSCookieValidRangeStart(); UINT32 GetGSCookieValidRangeEnd(); @@ -540,13 +581,16 @@ class GcInfoDecoder bool HasMethodTableGenericsInstContext(); bool GetIsVarArg(); bool WantsReportOnlyLeaf(); -#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) bool HasTailCalls(); -#endif // TARGET_ARM || TARGET_ARM64 || TARGET_RISCV64 +#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64 || defined(TARGET_RISCV64) ReturnKind GetReturnKind(); UINT32 GetCodeLength(); UINT32 GetStackBaseRegister(); UINT32 GetSizeOfEditAndContinuePreservedArea(); +#ifdef TARGET_ARM64 + UINT32 GetSizeOfEditAndContinueFixedStackFrame(); +#endif size_t GetNumBytesRead(); #ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA @@ -559,16 +603,8 @@ class GcInfoDecoder UINT32 m_InstructionOffset; // Pre-decoded information + GcInfoHeaderFlags m_headerFlags; bool m_IsInterruptible; - bool m_IsVarArg; - bool m_GenericSecretParamIsMD; - bool m_GenericSecretParamIsMT; -#ifdef TARGET_AMD64 - bool m_WantsReportOnlyLeaf; -#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) - bool m_HasTailCalls; -#endif // TARGET_AMD64 - INT32 m_SecurityObjectStackSlot; INT32 m_GSCookieStackSlot; INT32 m_ReversePInvokeFrameStackSlot; UINT32 m_ValidRangeStart; @@ -578,11 +614,15 @@ class GcInfoDecoder UINT32 m_CodeLength; UINT32 m_StackBaseRegister; UINT32 m_SizeOfEditAndContinuePreservedArea; +#ifdef TARGET_ARM64 + UINT32 m_SizeOfEditAndContinueFixedStackFrame; +#endif ReturnKind m_ReturnKind; #ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED UINT32 m_NumSafePoints; UINT32 m_SafePointIndex; - UINT32 FindSafePoint(UINT32 codeOffset); + UINT32 NarrowSafePointSearch(size_t savedPos, UINT32 breakOffset, UINT32* searchEnd); + UINT32 FindSafePoint(UINT32 codeOffset); #endif UINT32 m_NumInterruptibleRanges; @@ -596,6 +636,8 @@ class GcInfoDecoder #endif UINT32 m_Version; + bool PredecodeFatHeader(int remainingFlags); + static bool SetIsInterruptibleCB (UINT32 startOffset, UINT32 stopOffset, void * hCallback); OBJECTREF* GetRegisterSlot( @@ -663,11 +705,12 @@ class GcInfoDecoder { _ASSERTE(slotIndex < slotDecoder.GetNumSlots()); const GcSlotDesc* pSlot = slotDecoder.GetSlotDesc(slotIndex); + bool reportFpBasedSlotsOnly = (inputFlags & ReportFPBasedSlotsOnly); if(slotIndex < slotDecoder.GetNumRegisters()) { UINT32 regNum = pSlot->Slot.RegisterNumber; - if( reportScratchSlots || !IsScratchRegister( regNum, pRD ) ) + if( ( reportScratchSlots || !IsScratchRegister( regNum, pRD ) ) && !reportFpBasedSlotsOnly ) { ReportRegisterToGC( regNum, @@ -687,7 +730,9 @@ class GcInfoDecoder { INT32 spOffset = pSlot->Slot.Stack.SpOffset; GcStackSlotBase spBase = pSlot->Slot.Stack.Base; - if( reportScratchSlots || !IsScratchStackSlot(spOffset, spBase, pRD) ) + + if( ( reportScratchSlots || !IsScratchStackSlot(spOffset, spBase, pRD) ) && + ( !reportFpBasedSlotsOnly || (GC_FRAMEREG_REL == spBase ) ) ) { ReportStackSlotToGC( spOffset, diff --git a/src/shared/inc/gcinfodumper.h b/src/shared/inc/gcinfodumper.h index 9d27752cec..7802ccc374 100644 --- a/src/shared/inc/gcinfodumper.h +++ b/src/shared/inc/gcinfodumper.h @@ -7,10 +7,12 @@ #include "gcinfotypes.h" #include "gcinfodecoder.h" -// ****************************************************************************** -// WARNING!!!: This header is also used by the runtime repo. -// See: https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/gcinfodumper.h -// ****************************************************************************** +// ***************************************************************************** +// WARNING!!!: These values and code are used in the runtime repo and SOS in the +// diagnostics repo. Should updated in a backwards and forwards compatible way. +// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfodumper.h +// https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/gcinfodumper.h +// ***************************************************************************** // // This class dumps the contents of the gc encodings, providing outputs @@ -95,7 +97,7 @@ class GcInfoDumper static void LivePointerCallback ( LPVOID hCallback, // callback data - OBJECTREF* pObject, // address of obect-reference we are reporting + OBJECTREF* pObject, // address of object-reference we are reporting uint32_t flags // is this a pinned and/or interior pointer DAC_ARG(DacSlotLocation loc)); // the location the pointer came from diff --git a/src/shared/inc/gcinfotypes.h b/src/shared/inc/gcinfotypes.h index fc409d3700..b770bb1bbc 100644 --- a/src/shared/inc/gcinfotypes.h +++ b/src/shared/inc/gcinfotypes.h @@ -5,14 +5,20 @@ #ifndef __GCINFOTYPES_H__ #define __GCINFOTYPES_H__ -#ifndef FEATURE_REDHAWK +#ifndef FEATURE_NATIVEAOT #include "gcinfo.h" #endif -// ****************************************************************************** -// WARNING!!!: This header is also used by the runtime repo. -// See: https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/gcinfotypes.h -// ****************************************************************************** +#ifdef _MSC_VER +#include +#endif // _MSC_VER + +// ***************************************************************************** +// WARNING!!!: These values and code are used in the runtime repo and SOS in the +// diagnostics repo. Should updated in a backwards and forwards compatible way. +// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfotypes.h +// https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/gcinfotypes.h +// ***************************************************************************** #define PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED @@ -21,35 +27,33 @@ #define BITS_PER_SIZE_T ((int)sizeof(size_t)*8) - -//-------------------------------------------------------------------------------- -// It turns out, that ((size_t)x) << y == x, when y is not a literal -// and its value is BITS_PER_SIZE_T -// I guess the processor only shifts of the right operand modulo BITS_PER_SIZE_T -// In many cases, we want the above operation to yield 0, -// hence the following macros -//-------------------------------------------------------------------------------- -__forceinline size_t SAFE_SHIFT_LEFT(size_t x, size_t count) -{ - _ASSERTE(count <= BITS_PER_SIZE_T); - return (x << 1) << (count - 1); -} -__forceinline size_t SAFE_SHIFT_RIGHT(size_t x, size_t count) -{ - _ASSERTE(count <= BITS_PER_SIZE_T); - return (x >> 1) >> (count - 1); -} - inline UINT32 CeilOfLog2(size_t x) { + // it is ok to use bsr or clz unconditionally _ASSERTE(x > 0); - UINT32 result = (x & (x - 1)) ? 1 : 0; - while (x != 1) - { - result++; - x >>= 1; - } - return result; + + x = (x << 1) - 1; + +#ifdef TARGET_64BIT +#ifdef _MSC_VER + DWORD result; + _BitScanReverse64(&result, (unsigned long)x); + return (UINT32)result; +#else // _MSC_VER + // LZCNT returns index starting from MSB, whereas BSR gives the index from LSB. + // 63 ^ LZCNT here is equivalent to 63 - LZCNT since the LZCNT result is always between 0 and 63. + // This saves an instruction, as subtraction from constant requires either MOV/SUB or NEG/ADD. + return (UINT32)63 ^ (UINT32)__builtin_clzl((unsigned long)x); +#endif // _MSC_VER +#else // TARGET_64BIT +#ifdef _MSC_VER + DWORD result; + _BitScanReverse(&result, (unsigned int)x); + return (UINT32)result; +#else // _MSC_VER + return (UINT32)31 ^ (UINT32)__builtin_clz((unsigned int)x); +#endif // _MSC_VER +#endif } enum GcSlotFlags @@ -155,7 +159,7 @@ struct GcStackSlot // 10 RT_ByRef // 11 RT_Unset -#elif defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#elif defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) // Slim Header: @@ -595,7 +599,6 @@ void FASTCALL decodeCallPattern(int pattern, // Stack offsets must be 8-byte aligned, so we use this unaligned // offset to represent that the method doesn't have a security object -#define NO_SECURITY_OBJECT (-1) #define NO_GS_COOKIE (-1) #define NO_STACK_BASE_REGISTER (0xffffffff) #define NO_SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA (0xffffffff) @@ -752,6 +755,62 @@ void FASTCALL decodeCallPattern(int pattern, #define STACK_BASE_REGISTER_ENCBASE 2 // FP encoded as 0, SP as 2. #define SIZE_OF_STACK_AREA_ENCBASE 3 #define SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE 4 +#define SIZE_OF_EDIT_AND_CONTINUE_FIXED_STACK_FRAME_ENCBASE 4 +#define REVERSE_PINVOKE_FRAME_ENCBASE 6 +#define NUM_REGISTERS_ENCBASE 3 +#define NUM_STACK_SLOTS_ENCBASE 2 +#define NUM_UNTRACKED_SLOTS_ENCBASE 1 +#define NORM_PROLOG_SIZE_ENCBASE 5 +#define NORM_EPILOG_SIZE_ENCBASE 3 +#define NORM_CODE_OFFSET_DELTA_ENCBASE 3 +#define INTERRUPTIBLE_RANGE_DELTA1_ENCBASE 6 +#define INTERRUPTIBLE_RANGE_DELTA2_ENCBASE 6 +#define REGISTER_ENCBASE 3 +#define REGISTER_DELTA_ENCBASE 2 +#define STACK_SLOT_ENCBASE 6 +#define STACK_SLOT_DELTA_ENCBASE 4 +#define NUM_SAFE_POINTS_ENCBASE 3 +#define NUM_INTERRUPTIBLE_RANGES_ENCBASE 1 +#define NUM_EH_CLAUSES_ENCBASE 2 +#define POINTER_SIZE_ENCBASE 3 +#define LIVESTATE_RLE_RUN_ENCBASE 2 +#define LIVESTATE_RLE_SKIP_ENCBASE 4 + +#elif defined(TARGET_LOONGARCH64) +#ifndef TARGET_POINTER_SIZE +#define TARGET_POINTER_SIZE 8 // equal to sizeof(void*) and the managed pointer size in bytes for this target +#endif +#define NUM_NORM_CODE_OFFSETS_PER_CHUNK (64) +#define NUM_NORM_CODE_OFFSETS_PER_CHUNK_LOG2 (6) +#define NORMALIZE_STACK_SLOT(x) ((x)>>3) // GC Pointers are 8-bytes aligned +#define DENORMALIZE_STACK_SLOT(x) ((x)<<3) +#define NORMALIZE_CODE_LENGTH(x) ((x)>>2) // All Instructions are 4 bytes long +#define DENORMALIZE_CODE_LENGTH(x) ((x)<<2) +#define NORMALIZE_STACK_BASE_REGISTER(x) ((x) == 22 ? 0 : 1) // Encode Frame pointer fp=$22 as zero +#define DENORMALIZE_STACK_BASE_REGISTER(x) ((x) == 0 ? 22 : 3) +#define NORMALIZE_SIZE_OF_STACK_AREA(x) ((x)>>3) +#define DENORMALIZE_SIZE_OF_STACK_AREA(x) ((x)<<3) +#define CODE_OFFSETS_NEED_NORMALIZATION 0 +#define NORMALIZE_CODE_OFFSET(x) (x) // Instructions are 4 bytes long, but the safe-point +#define DENORMALIZE_CODE_OFFSET(x) (x) // offsets are encoded with a -1 adjustment. +#define NORMALIZE_REGISTER(x) (x) +#define DENORMALIZE_REGISTER(x) (x) +#define NORMALIZE_NUM_SAFE_POINTS(x) (x) +#define DENORMALIZE_NUM_SAFE_POINTS(x) (x) +#define NORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x) +#define DENORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x) + +#define PSP_SYM_STACK_SLOT_ENCBASE 6 +#define GENERICS_INST_CONTEXT_STACK_SLOT_ENCBASE 6 +#define SECURITY_OBJECT_STACK_SLOT_ENCBASE 6 +#define GS_COOKIE_STACK_SLOT_ENCBASE 6 +#define CODE_LENGTH_ENCBASE 8 +#define SIZE_OF_RETURN_KIND_IN_SLIM_HEADER 2 +#define SIZE_OF_RETURN_KIND_IN_FAT_HEADER 4 +// FP/SP encoded as 0 or 1. +#define STACK_BASE_REGISTER_ENCBASE 2 +#define SIZE_OF_STACK_AREA_ENCBASE 3 +#define SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE 4 #define REVERSE_PINVOKE_FRAME_ENCBASE 6 #define NUM_REGISTERS_ENCBASE 3 #define NUM_STACK_SLOTS_ENCBASE 2 @@ -782,8 +841,8 @@ void FASTCALL decodeCallPattern(int pattern, #define DENORMALIZE_STACK_SLOT(x) ((x)<<3) #define NORMALIZE_CODE_LENGTH(x) ((x)>>2) // All Instructions are 4 bytes long #define DENORMALIZE_CODE_LENGTH(x) ((x)<<2) -#define NORMALIZE_STACK_BASE_REGISTER(x) ((x)^8) // Encode Frame pointer X8 as zero -#define DENORMALIZE_STACK_BASE_REGISTER(x) ((x)^8) +#define NORMALIZE_STACK_BASE_REGISTER(x) ((x) == 8 ? 0 : 1) // Encode Frame pointer X8 as zero, sp/x2 as 1 +#define DENORMALIZE_STACK_BASE_REGISTER(x) ((x) == 0 ? 8 : 2) #define NORMALIZE_SIZE_OF_STACK_AREA(x) ((x)>>3) #define DENORMALIZE_SIZE_OF_STACK_AREA(x) ((x)<<3) #define CODE_OFFSETS_NEED_NORMALIZATION 0 @@ -804,7 +863,7 @@ void FASTCALL decodeCallPattern(int pattern, #define SIZE_OF_RETURN_KIND_IN_SLIM_HEADER 2 #define SIZE_OF_RETURN_KIND_IN_FAT_HEADER 4 #define STACK_BASE_REGISTER_ENCBASE 2 -// FP encoded as 0, SP as 2?? +// FP encoded as 0, SP as 1 #define SIZE_OF_STACK_AREA_ENCBASE 3 #define SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE 4 #define SIZE_OF_EDIT_AND_CONTINUE_FIXED_STACK_FRAME_ENCBASE 4 @@ -828,6 +887,7 @@ void FASTCALL decodeCallPattern(int pattern, #define LIVESTATE_RLE_RUN_ENCBASE 2 #define LIVESTATE_RLE_SKIP_ENCBASE 4 + #else #ifndef TARGET_X86 diff --git a/src/shared/inc/gcmsg.inl b/src/shared/inc/gcmsg.inl index f6e1f7227a..d2461a3cdb 100644 --- a/src/shared/inc/gcmsg.inl +++ b/src/shared/inc/gcmsg.inl @@ -44,13 +44,13 @@ static const char* gcDetailedStartMsg() { STATIC_CONTRACT_LEAF; - return "*GC* %d(gen0:%d)(%d)(alloc: %Id)(%s)(%d)"; + return "*GC* %d(gen0:%d)(%d)(alloced for %.3fms, g0 %zd (b: %zd, %zd/h) (%.3fmb/ms), g3 %zd (%.3fmb/ms), g4 %zd (%.3fmb/ms))(%s)(%d)(%d)(heap size: %.3fmb max: %.3fmb)"; } static const char* gcDetailedEndMsg() { STATIC_CONTRACT_LEAF; - return "*EGC* %Id(gen0:%Id)(%Id)(%d)(%s)(%s)(%s)(ml: %d->%d)"; + return "*EGC* %zd(gen0:%zd)(heap size: %.3fmb)(%d)(%s)(%s)(%s)(ml: %d->%d)\n"; } static const char* gcStartMarkMsg() @@ -80,7 +80,7 @@ static const char* gcStartCompactMsg() { STATIC_CONTRACT_LEAF; - return "---- Compact Phase on heap %d: %Ix(%Ix)----"; + return "---- Compact Phase on heap %d: %zx(%zx)----"; } static const char* gcEndCompactMsg() @@ -92,31 +92,31 @@ static const char* gcMemCopyMsg() { STATIC_CONTRACT_LEAF; - return " mc: [%Ix->%Ix, %Ix->%Ix["; + return " mc: [%zx->%zx, %zx->%zx["; } static const char* gcPlanPlugMsg() { STATIC_CONTRACT_LEAF; - return "(%Ix)[%Ix->%Ix, NA: [%Ix(%Id), %Ix[: %Ix(%d), x: %Ix (%s)"; + return "(%zx)[%zx->%zx, NA: [%zx(%zd), %zx[: %zx(%d), x: %zx (%s)"; } static const char* gcPlanPinnedPlugMsg() { STATIC_CONTRACT_LEAF; - return "(%Ix)PP: [%Ix, %Ix[%Ix](m:%d)"; + return "(%zx)PP: [%zx, %zx[%zx](m:%d)"; } static const char* gcDesiredNewAllocationMsg() { STATIC_CONTRACT_LEAF; - return "h%d g%d surv: %Id current: %Id alloc: %Id (%d%%) f: %d%% new-size: %Id new-alloc: %Id"; + return "h%d g%d surv: %zd current: %zd alloc: %zd (%d%%) f: %d%% new-size: %zd new-alloc: %zd"; } static const char* gcMakeUnusedArrayMsg() { STATIC_CONTRACT_LEAF; - return "Making unused array [%Ix, %Ix["; + return "Making unused array [%zx, %zx["; } static const char* gcStartBgcThread() @@ -130,3 +130,9 @@ STATIC_CONTRACT_LEAF; return "Relocating reference *(%p) from %p to %p"; } + + static const char* gcLoggingIsOffMsg() + { + STATIC_CONTRACT_LEAF; + return "TraceGC is not turned on"; + } diff --git a/src/shared/inc/holder.h b/src/shared/inc/holder.h index 4ec7b106cc..353d7f39d5 100644 --- a/src/shared/inc/holder.h +++ b/src/shared/inc/holder.h @@ -11,13 +11,8 @@ #include "volatile.h" #include "palclr.h" -#ifdef PAL_STDCPP_COMPAT #include #include -#else -#include "clr_std/utility" -#include "clr_std/type_traits" -#endif #if defined(FEATURE_COMINTEROP) && !defined(STRIKE) #include @@ -91,7 +86,7 @@ struct AutoExpVisibleValue //----------------------------------------------------------------------------- // Holder is the base class of all holder objects. Any backout object should derive from it. -// (Eventually some additional bookeeping and exception handling code will be placed in this +// (Eventually some additional bookkeeping and exception handling code will be placed in this // base class.) // // There are several ways to use this class: @@ -130,12 +125,12 @@ class HolderBase void DoAcquire() { - // Insert any global or thread bookeeping here + // Insert any global or thread bookkeeping here } void DoRelease() { - // Insert any global or thread bookeeping here + // Insert any global or thread bookkeeping here } #ifdef _DEBUG @@ -347,7 +342,7 @@ class StateHolder FORCEINLINE void Acquire() { STATIC_CONTRACT_WRAPPER; - // Insert any global or thread bookeeping here + // Insert any global or thread bookkeeping here _ASSERTE(!m_acquired); @@ -357,7 +352,7 @@ class StateHolder FORCEINLINE void Release() { STATIC_CONTRACT_WRAPPER; - // Insert any global or thread bookeeping here + // Insert any global or thread bookkeeping here if (m_acquired) { @@ -408,7 +403,7 @@ class ConditionalStateHolder FORCEINLINE BOOL Acquire() { STATIC_CONTRACT_WRAPPER; - // Insert any global or thread bookeeping here + // Insert any global or thread bookkeeping here _ASSERTE(!m_acquired); @@ -419,7 +414,7 @@ class ConditionalStateHolder FORCEINLINE void Release() { STATIC_CONTRACT_WRAPPER; - // Insert any global or thread bookeeping here + // Insert any global or thread bookkeeping here if (m_acquired) { @@ -822,9 +817,9 @@ class Wrapper : public BaseWrapper, #endif template -class SpecializedWrapper : public Wrapper<_TYPE*, DoNothing<_TYPE*>, _RELEASEF, NULL> +class SpecializedWrapper : public Wrapper<_TYPE*, DoNothing<_TYPE*>, _RELEASEF, 0> { - using BaseT = Wrapper<_TYPE*, DoNothing<_TYPE*>, _RELEASEF, NULL>; + using BaseT = Wrapper<_TYPE*, DoNothing<_TYPE*>, _RELEASEF, 0>; public: FORCEINLINE SpecializedWrapper() : BaseT(NULL, FALSE) { @@ -914,8 +909,10 @@ FORCEINLINE void DoTheRelease(TYPE *value) template using DoNothingHolder = SpecializedWrapper<_TYPE, DoNothing<_TYPE*>>; +#ifndef SOS_INCLUDE template using ReleaseHolder = SpecializedWrapper<_TYPE, DoTheRelease<_TYPE>>; +#endif // SOS_INCLUDE template using NonVMComHolder = SpecializedWrapper<_TYPE, DoTheRelease<_TYPE>>; @@ -934,15 +931,25 @@ using NonVMComHolder = SpecializedWrapper<_TYPE, DoTheRelease<_TYPE>>; // } // foo->DecRef() on out of scope // //----------------------------------------------------------------------------- + template -class ExecutableWriterHolder; +class ExecutableWriterHolderNoLog; -template +class ExecutableAllocator; + +template FORCEINLINE void StubRelease(TYPE* value) { if (value) { - ExecutableWriterHolder stubWriterHolder(value, sizeof(TYPE)); +#ifdef LOG_EXECUTABLE_ALLOCATOR_STATISTICS +#ifdef HOST_UNIX + LOGGER::LogUsage(__FILE__, __LINE__, __PRETTY_FUNCTION__); +#else + LOGGER::LogUsage(__FILE__, __LINE__, __FUNCTION__); +#endif +#endif // LOG_EXECUTABLE_ALLOCATOR_STATISTICS + ExecutableWriterHolderNoLog stubWriterHolder(value, sizeof(TYPE)); stubWriterHolder.GetRW()->DecRef(); } } @@ -992,19 +999,6 @@ FORCEINLINE void Delete(TYPE *value) template using NewHolder = SpecializedWrapper<_TYPE, Delete<_TYPE>>; - //----------------------------------------------------------------------------- -// NewExecutableHolder : New'ed memory holder for executable memory. -// -// { -// NewExecutableHolder foo = (Foo*) new (executable) Byte[num]; -// } // delete foo on out of scope -//----------------------------------------------------------------------------- -// IJW -template void DeleteExecutable(T *p); - -template -using NewExecutableHolder = SpecializedWrapper<_TYPE, DeleteExecutable<_TYPE>>; - //----------------------------------------------------------------------------- // NewArrayHolder : New []'ed pointer holder // { @@ -1134,14 +1128,6 @@ typedef Wrapper, VoidFindClose, (UINT_PTR) -1> FindHan typedef Wrapper MapViewHolder; -#ifdef WszDeleteFile -// Deletes a file with the specified path. Do not use if you care about failures -// deleting the file, as failures are ignored by VoidDeleteFile. -FORCEINLINE void VoidDeleteFile(LPCWSTR wszFilePath) { WszDeleteFile(wszFilePath); } -typedef Wrapper, VoidDeleteFile, NULL> DeleteFileHolder; -#endif // WszDeleteFile - - //----------------------------------------------------------------------------- // Misc holders //----------------------------------------------------------------------------- @@ -1149,7 +1135,7 @@ typedef Wrapper, VoidDeleteFile, NULL> DeleteFileHol // A holder for HMODULE. FORCEINLINE void HolderFreeLibrary(HMODULE h) { FreeLibrary(h); } -typedef Wrapper, HolderFreeLibrary, NULL> HModuleHolder; +typedef Wrapper, HolderFreeLibrary, 0> HModuleHolder; template FORCEINLINE void DoLocalFree(T* pMem) @@ -1185,13 +1171,24 @@ FORCEINLINE void RegKeyRelease(HKEY k) {RegCloseKey(k);}; typedef Wrapper RegKeyHolder; #endif // HOST_WINDOWS -class ErrorModeHolder +class ErrorModeHolder final { - UINT m_oldMode; +#ifdef HOST_WINDOWS + BOOL m_revert; + DWORD m_oldMode; public: - ErrorModeHolder(UINT newMode){m_oldMode=SetErrorMode(newMode);}; - ~ErrorModeHolder(){SetErrorMode(m_oldMode);}; - UINT OldMode() {return m_oldMode;}; + ErrorModeHolder() + : m_revert{ FALSE } + { + DWORD newMode = SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS; + m_revert = ::SetThreadErrorMode(newMode, &m_oldMode); + } + ~ErrorModeHolder() noexcept + { + if (m_revert != FALSE) + (void)::SetThreadErrorMode(m_oldMode, NULL); + } +#endif // HOST_WINDOWS }; #ifdef HOST_WINDOWS @@ -1200,7 +1197,7 @@ class ErrorModeHolder // // { // HKEYHolder hFoo = NULL; -// WszRegOpenKeyEx(HKEY_CLASSES_ROOT, L"Interface",0, KEY_READ, hFoo); +// RegOpenKeyEx(HKEY_CLASSES_ROOT, L"Interface",0, KEY_READ, hFoo); // // } // close key on out of scope via RegCloseKey. //----------------------------------------------------------------------------- @@ -1321,7 +1318,7 @@ class DacHolder } FORCEINLINE void Release() { - // Insert any global or thread bookeeping here + // Insert any global or thread bookkeeping here if (m_acquired) { diff --git a/src/shared/inc/iallocator.h b/src/shared/inc/iallocator.h index a5b467a990..f8e0978c6f 100644 --- a/src/shared/inc/iallocator.h +++ b/src/shared/inc/iallocator.h @@ -29,48 +29,4 @@ class IAllocator virtual void Free(void* p) = 0; }; -// This class wraps an allocator that does not allow zero-length allocations, -// producing one that does (every zero-length allocation produces a pointer to the same -// statically-allocated memory, and freeing that pointer is a no-op). -class AllowZeroAllocator: public IAllocator -{ - int m_zeroLenAllocTarg; - IAllocator* m_alloc; - -public: - AllowZeroAllocator(IAllocator* alloc) : m_alloc(alloc) {} - - void* Alloc(size_t sz) - { - if (sz == 0) - { - return (void*)(&m_zeroLenAllocTarg); - } - else - { - return m_alloc->Alloc(sz); - } - } - - void* ArrayAlloc(size_t elemSize, size_t numElems) - { - if (elemSize == 0 || numElems == 0) - { - return (void*)(&m_zeroLenAllocTarg); - } - else - { - return m_alloc->ArrayAlloc(elemSize, numElems); - } - } - - virtual void Free(void * p) - { - if (p != (void*)(&m_zeroLenAllocTarg)) - { - m_alloc->Free(p); - } - } -}; - #endif // _IALLOCATOR_DEFINED_ diff --git a/src/shared/inc/iterator.h b/src/shared/inc/iterator.h index b7bb142665..887544c6bc 100644 --- a/src/shared/inc/iterator.h +++ b/src/shared/inc/iterator.h @@ -201,33 +201,33 @@ class IndexerBasePrototype SCOUNT_T Subtract(const IndexerBasePrototype &i) const; CHECK DoCheck(SCOUNT_T delta) const; }; - }; - template class CheckedIteratorBase { + DEFINE_MEMBER_EXISTENCE_CHECK(m_revision); protected: #if defined(_DEBUG) const CONTAINER *m_container; int m_revision; #endif - CHECK CheckRevision() const + template + typename std::enable_if::value, CHECK>::type CheckRevision() const { LIMITED_METHOD_CONTRACT; SUPPORTS_DAC; -#if defined(_DEBUG) && (defined(_MSC_VER) || defined(__llvm__)) - __if_exists(CONTAINER::m_revision) - { - CHECK_MSG(m_revision == m_container->m_revision, - "Use of Iterator after container has been modified"); - } +#if defined(_DEBUG) + CHECK_MSG(m_revision == m_container->m_revision, + "Use of Iterator after container has been modified"); #endif CHECK_OK; } + template + typename std::enable_if::value, CHECK>::type CheckRevision() const { CHECK_OK; } + CheckedIteratorBase() { LIMITED_METHOD_DAC_CONTRACT; @@ -238,30 +238,34 @@ class CheckedIteratorBase CheckedIteratorBase(const CONTAINER *container) { - LIMITED_METHOD_CONTRACT; #if defined(_DEBUG) m_container = container; -#if defined(_MSC_VER) || defined(__llvm__) - __if_exists(CONTAINER::m_revision) - { - m_revision = m_container->m_revision; - } + Init(container, has_m_revision()); #endif + } + + void Init(const CONTAINER *container, std::true_type) + { +#if defined(_DEBUG) + m_revision = container->m_revision; #endif } - void Resync(const CONTAINER *container) + void Init(const CONTAINER *container, std::false_type) { /* No-op */ } + + template + typename std::enable_if::value, void>::type Resync(const CONTAINER *container) { LIMITED_METHOD_DAC_CONTRACT; -#if defined(_DEBUG) && (defined(_MSC_VER) || defined(__llvm__)) - __if_exists(CONTAINER::m_revision) - { - m_revision = m_container->m_revision; - } +#if defined(_DEBUG) + m_revision = m_container->m_revision; #endif } + template + typename std::enable_if::value, void>::type Resync(const CONTAINER *container) { /* No-op */ } + #if defined(_DEBUG) const CONTAINER *GetContainerDebug() const { diff --git a/src/shared/inc/llvm/ELF.h b/src/shared/inc/llvm/ELF.h index d820a28265..b42a9c7da9 100644 --- a/src/shared/inc/llvm/ELF.h +++ b/src/shared/inc/llvm/ELF.h @@ -343,6 +343,8 @@ enum { EM_NORC = 218, // Nanoradio Optimized RISC EM_CSR_KALIMBA = 219, // CSR Kalimba architecture family EM_AMDGPU = 224, // AMD GPU architecture + EM_RISCV = 243, + EM_LOONGARCH = 258, // LoongArch processor // A request has been made to the maintainer of the official registry for // such numbers for an official value for WebAssembly. As soon as one is @@ -547,6 +549,14 @@ enum { ODK_PAGESIZE = 11 // Page size information }; +// LoongArch Specific e_flags +enum : unsigned { + EF_LARCH_ABI = 0x0003, + EF_LARCH_ABI_LP32 = 0x0001, + EF_LARCH_ABI_XLP32 = 0x0002, + EF_LARCH_ABI_LP64 = 0x0003, +}; + // Hexagon-specific e_flags enum { // Object processor version flags, bits[11:0] @@ -666,6 +676,11 @@ enum : unsigned { SHT_MIPS_OPTIONS = 0x7000000d, // General options SHT_MIPS_ABIFLAGS = 0x7000002a, // ABI information. + SHT_LOONGARCH_REGINFO = 0x70000006, // Register usage information + SHT_LOONGARCH_OPTIONS = 0x7000000d, // General options + SHT_LOONGARCH_DWARF = 0x7000001e, // DWARF debugging section. + SHT_LOONGARCH_ABIFLAGS = 0x7000002a, // ABI information. + SHT_HIPROC = 0x7fffffff, // Highest processor arch-specific type. SHT_LOUSER = 0x80000000, // Lowest type reserved for applications. SHT_HIUSER = 0xffffffff // Highest type reserved for applications. @@ -762,6 +777,30 @@ enum : unsigned { // Section data is string data by default. SHF_MIPS_STRING = 0x80000000, + // Linker must retain only one copy. + SHF_LOONGARCH_NODUPES = 0x01000000, + + // Linker must generate implicit hidden weak names. + SHF_LOONGARCH_NAMES = 0x02000000, + + // Section data local to process. + SHF_LOONGARCH_LOCAL = 0x04000000, + + // Do not strip this section. + SHF_LOONGARCH_NOSTRIP = 0x08000000, + + // Section must be part of global data area. + SHF_LOONGARCH_GPREL = 0x10000000, + + // This section should be merged. + SHF_LOONGARCH_MERGE = 0x20000000, + + // Address size to be inferred from section entry size. + SHF_LOONGARCH_ADDR = 0x40000000, + + // Section data is string data by default. + SHF_LOONGARCH_STRING = 0x80000000, + SHF_AMDGPU_HSA_GLOBAL = 0x00100000, SHF_AMDGPU_HSA_READONLY = 0x00200000, SHF_AMDGPU_HSA_CODE = 0x00400000, @@ -791,7 +830,7 @@ struct Elf32_Sym { void setBinding(unsigned char b) { setBindingAndType(b, getType()); } void setType(unsigned char t) { setBindingAndType(getBinding(), t); } void setBindingAndType(unsigned char b, unsigned char t) { - st_info = (b << 4) + (t & 0x0f); + st_info = (unsigned char)((b << 4) + (t & 0x0f)); } }; @@ -811,7 +850,7 @@ struct Elf64_Sym { void setBinding(unsigned char b) { setBindingAndType(b, getType()); } void setType(unsigned char t) { setBindingAndType(getBinding(), t); } void setBindingAndType(unsigned char b, unsigned char t) { - st_info = (b << 4) + (t & 0x0f); + st_info = (unsigned char)((b << 4) + (t & 0x0f)); } }; @@ -1004,6 +1043,12 @@ enum { PT_MIPS_OPTIONS = 0x70000002, // Options segment. PT_MIPS_ABIFLAGS = 0x70000003, // Abiflags segment. + // LOONGARCH program header types. + PT_LOONGARCH_REGINFO = 0x70000000, // Register usage information. + PT_LOONGARCH_RTPROC = 0x70000001, // Runtime procedure table. + PT_LOONGARCH_OPTIONS = 0x70000002, // Options segment. + PT_LOONGARCH_ABIFLAGS = 0x70000003, // Abiflags segment. + // AMDGPU program header types. PT_AMDGPU_HSA_LOAD_GLOBAL_PROGRAM = 0x60000000, PT_AMDGPU_HSA_LOAD_GLOBAL_AGENT = 0x60000001, diff --git a/src/shared/inc/log.h b/src/shared/inc/log.h index 57d716b5c8..3f608cee9e 100644 --- a/src/shared/inc/log.h +++ b/src/shared/inc/log.h @@ -26,12 +26,12 @@ enum { #define LL_EVERYTHING 10 -#define LL_INFO1000000 9 // can be expected to generate 1,000,000 logs per small but not trival run -#define LL_INFO100000 8 // can be expected to generate 100,000 logs per small but not trival run -#define LL_INFO10000 7 // can be expected to generate 10,000 logs per small but not trival run -#define LL_INFO1000 6 // can be expected to generate 1,000 logs per small but not trival run -#define LL_INFO100 5 // can be expected to generate 100 logs per small but not trival run -#define LL_INFO10 4 // can be expected to generate 10 logs per small but not trival run +#define LL_INFO1000000 9 // can be expected to generate 1,000,000 logs per small but not trivial run +#define LL_INFO100000 8 // can be expected to generate 100,000 logs per small but not trivial run +#define LL_INFO10000 7 // can be expected to generate 10,000 logs per small but not trivial run +#define LL_INFO1000 6 // can be expected to generate 1,000 logs per small but not trivial run +#define LL_INFO100 5 // can be expected to generate 100 logs per small but not trivial run +#define LL_INFO10 4 // can be expected to generate 10 logs per small but not trivial run #define LL_WARNING 3 #define LL_ERROR 2 #define LL_FATALERROR 1 @@ -47,6 +47,10 @@ enum { #define ERROR 0 #define FATALERROR 0 +#ifdef _DEBUG +#define _LOGALLOC +#endif + #ifndef LOGGING #define LOG(x) @@ -86,11 +90,36 @@ bool LoggingEnabled(); bool LoggingOn(DWORD facility, DWORD level); bool Logging2On(DWORD facility, DWORD level); -#define LOG(x) do { if (LoggingEnabled()) { LogSpew x; } } while (0) +#ifdef DACCESS_COMPILE + +/* + * + * Logging for the DAC is an incomplete feature, see more in + * https://github.com/dotnet/runtime/issues/77922 + * + * As of now, logging need to be opt-in. Any logging done through + * DAC_LOG (or it variants) will be available in the log for both the runtime and the DAC build + * And the normal LOG macro will be available only for the runtime. + * + */ + +#define LOG(x) do { } while (0) +#define LOG2(x) do { } while (0) +#define LOGALWAYS(x) do { } while (0) +#define DAC_LOG(x) do { if (LoggingEnabled()) { LogSpew x; } } while (0) +#define DAC_LOG2(x) do { if (LoggingEnabled()) { LogSpew2 x; } } while (0) +#define DAC_LOGALWAYS(x) LogSpewAlways x + +#else + +#define LOG(x) do { if (LoggingEnabled()) { LogSpew x; } } while (0) +#define LOG2(x) do { if (LoggingEnabled()) { LogSpew2 x; } } while (0) +#define LOGALWAYS(x) LogSpewAlways x +#define DAC_LOG(x) LOG(x) +#define DAC_LOG2(x) LOG2(x) +#define DAC_LOGALWAYS(x) LOGALWAYS(x) -#define LOG2(x) do { if (LoggingEnabled()) { LogSpew2 x; } } while (0) - -#define LOGALWAYS(x) LogSpewAlways x +#endif #endif diff --git a/src/shared/inc/longfilepathwrappers.h b/src/shared/inc/longfilepathwrappers.h index 149cdcf444..6407680900 100644 --- a/src/shared/inc/longfilepathwrappers.h +++ b/src/shared/inc/longfilepathwrappers.h @@ -5,6 +5,8 @@ #define _WIN_PATH_APIS_WRAPPER_ class SString; +#ifdef HOST_WINDOWS + HMODULE LoadLibraryExWrapper( _In_ LPCWSTR lpLibFileName, @@ -34,22 +36,7 @@ GetFileAttributesExWrapper( _In_ GET_FILEEX_INFO_LEVELS fInfoLevelId, _Out_writes_bytes_(sizeof(WIN32_FILE_ATTRIBUTE_DATA)) LPVOID lpFileInformation ); -BOOL -DeleteFileWrapper( - _In_ LPCWSTR lpFileName - ); -HANDLE -FindFirstFileExWrapper( - _In_ LPCWSTR lpFileName, - _In_ FINDEX_INFO_LEVELS fInfoLevelId, - _Out_writes_bytes_(sizeof(WIN32_FIND_DATAW)) LPVOID lpFindFileData, - _In_ FINDEX_SEARCH_OPS fSearchOp, - _Reserved_ LPVOID lpSearchFilter, - _In_ DWORD dwAdditionalFlags - ); - -#ifndef HOST_UNIX BOOL CopyFileExWrapper( _In_ LPCWSTR lpExistingFileName, @@ -60,14 +47,7 @@ CopyFileExWrapper( _Inout_opt_ LPBOOL pbCancel, _In_ DWORD dwCopyFlags ); -#endif //HOST_UNIX - -BOOL -MoveFileExWrapper( - _In_ LPCWSTR lpExistingFileName, - _In_opt_ LPCWSTR lpNewFileName, - _In_ DWORD dwFlags - ); +#endif //HOST_WINDOWS DWORD SearchPathWrapper( @@ -79,22 +59,6 @@ SearchPathWrapper( _Out_opt_ LPWSTR * lpFilePart ); - -UINT WINAPI GetTempFileNameWrapper( - _In_ LPCTSTR lpPathName, - _In_ LPCTSTR lpPrefixString, - _In_ UINT uUnique, - SString& lpTempFileName - ); - -DWORD WINAPI GetTempPathWrapper( - SString& lpBuffer - ); - -DWORD WINAPI GetCurrentDirectoryWrapper( - SString& lpBuffer - ); - DWORD GetModuleFileNameWrapper( _In_opt_ HMODULE hModule, diff --git a/src/shared/inc/mdcommon.h b/src/shared/inc/mdcommon.h index eeeb32fc72..dc76c5cb9c 100644 --- a/src/shared/inc/mdcommon.h +++ b/src/shared/inc/mdcommon.h @@ -13,12 +13,9 @@ // File types for the database. enum FILETYPE { - FILETYPE_UNKNOWN, // Unknown or undefined type. - FILETYPE_CLB, // Native .clb file format. - FILETYPE_CLX, // An obsolete file format. - FILETYPE_NTPE, // Windows PE executable. - FILETYPE_NTOBJ, // .obj file format (with .clb embedded). - FILETYPE_TLB // Typelib format. + FILETYPE_UNKNOWN, // Unknown or undefined type. + FILETYPE_CLB, // Native .clb file format. + FILETYPE_NTPE, // Windows PE executable. }; enum MAPPINGTYPE @@ -37,7 +34,6 @@ enum MAPPINGTYPE #define COMPRESSED_MODEL_STREAM_A "#~" #define ENC_MODEL_STREAM_A "#-" #define MINIMAL_MD_STREAM_A "#JTD" -#define HOT_MODEL_STREAM_A "#!" #ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB #define PDB_STREAM_A "#Pdb" #endif // FEATURE_METADATA_EMIT_PORTABLE_PDB @@ -50,7 +46,6 @@ enum MAPPINGTYPE #define COMPRESSED_MODEL_STREAM W("#~") #define ENC_MODEL_STREAM W("#-") #define MINIMAL_MD_STREAM W("#JTD") -#define HOT_MODEL_STREAM W("#!") #ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB #define PDB_STREAM W("#Pdb") #endif // FEATURE_METADATA_EMIT_PORTABLE_PDB diff --git a/src/shared/inc/metadata.h b/src/shared/inc/metadata.h deleted file mode 100644 index cf69f3a909..0000000000 --- a/src/shared/inc/metadata.h +++ /dev/null @@ -1,1531 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//**************************************************************************** -// File: metadata.h -// - -// -// Notes: -// Common includes for EE & metadata internal. This file contains -// definition of CorMetaDataScope -//**************************************************************************** - -#ifndef _METADATA_H_ -#define _METADATA_H_ - -#include "ex.h" - -class CorProfileData; -class IMetaModelCommon; -class MDInternalRW; -class UTSemReadWrite; - -inline int IsGlobalMethodParentTk(mdTypeDef td) -{ - LIMITED_METHOD_CONTRACT; - - return (td == mdTypeDefNil || td == mdTokenNil); -} - -typedef enum CorInternalStates -{ - tdNoTypes = 0x00000000, - tdAllAssemblies = 0x00000001, - tdAllTypes = 0xffffffff, -} CorInternalStates; - -// -// MetaData custom value names. -// -enum CorIfaceAttr -{ - ifDual = 0, // Interface derives from IDispatch. - ifVtable = 1, // Interface derives from IUnknown. - ifDispatch = 2, // Interface is a dispinterface. - ifInspectable = 3, // Interface derives from IInspectable. - ifLast = 4, // The last member of the enum. -}; - -inline BOOL IsDispatchBasedItf(CorIfaceAttr ifaceAttr) -{ - return (ifaceAttr == ifDual || ifaceAttr == ifDispatch); -} - -enum CorClassIfaceAttr -{ - clsIfNone = 0, // No class interface is generated. - clsIfAutoDisp = 1, // A dispatch only class interface is generated. - clsIfAutoDual = 2, // A dual class interface is generated. - clsIfLast = 3, // The last member of the enum. -}; - -// -// The default values for the COM interface and class interface types. -// -#define DEFAULT_COM_INTERFACE_TYPE ifDual -#define DEFAULT_CLASS_INTERFACE_TYPE clsIfAutoDisp - -#define HANDLE_UNCOMPRESSED(func) (E_FAIL) -#define HANDLE_UNCOMPRESSED_BOOL(func) (false) - -class TOKENLIST : public CDynArray -{ -}; - - -typedef enum tagEnumType -{ - MDSimpleEnum = 0x0, // simple enumerator that doesn't allocate memory - - // You could get this kind of enum if you perform a non-simple query (such as EnumMethodWithName). - // - MDDynamicArrayEnum = 0x2, // dynamic array that holds tokens -} EnumType; - -//***************************************** -// Enumerator used by MetaDataInternal -//***************************************** -struct HENUMInternal -{ - DWORD m_tkKind; // kind of tables that the enum is holding the result - uint32_t m_ulCount; // count of total entries holding by the enumerator - - EnumType m_EnumType; - - struct { - uint32_t m_ulStart; - uint32_t m_ulEnd; - uint32_t m_ulCur; - } u; - - // m_cursor will go away when we no longer support running EE with uncompressed - // format. WHEN WE REMOVE THIS, REMOVE ITS VESTIAGES FROM ZeroEnum as well - // - union { - void* m_alignpad; // The first item is m_cursor[] is a pointer - char m_cursor[32]; // cursor holding query result for read/write mode - }; - - // TOKENLIST daTKList; // dynamic arrays of token list - HENUMInternal() : m_EnumType(MDSimpleEnum) { LIMITED_METHOD_DAC_CONTRACT; } - - // in-place initialization - static void InitDynamicArrayEnum( - HENUMInternal *pEnum); // HENUMInternal to be initialized - - static void InitSimpleEnum( - DWORD tkKind, // kind of token that we are iterating - ULONG ridStart, // starting rid - ULONG ridEnd, // end rid - HENUMInternal *pEnum); // HENUMInternal to be initialized - - // Specialized helper which should be better than always calling memset - inline - static void ZeroEnum( - HENUMInternal *pEnum) - { - // we use this to avoid the memset that will happen otherwise. - // this should be inlined in its caller. we are seeing a large - // number of calls to memset from MDInternalRO::EnumPermissionSetsInit - // on x64 which we can eliminate with this code. - pEnum->m_tkKind = 0; - pEnum->m_ulCount = 0; - pEnum->m_EnumType = MDSimpleEnum; - pEnum->u.m_ulStart = 0; - pEnum->u.m_ulEnd = 0; - pEnum->u.m_ulCur = 0; - - // TODO: remove this when we remove m_cursor from the HENUMInternal structure - _ASSERTE(IS_ALIGNED(pEnum->m_cursor, sizeof(DWORD))); - _ASSERTE((sizeof(HENUMInternal) - offsetof(HENUMInternal, m_cursor)) == (8 * sizeof(DWORD))); - - DWORD* pBuffer = (DWORD*)pEnum->m_cursor; - pBuffer[0] = 0; - pBuffer[1] = 0; - pBuffer[2] = 0; - pBuffer[3] = 0; - pBuffer[4] = 0; - pBuffer[5] = 0; - pBuffer[6] = 0; - pBuffer[7] = 0; - } - - // This will only clear the content of enum and will not free the memory of enum - static void ClearEnum( - HENUMInternal *pmdEnum); - - // create a HENUMInternal. This will allocate the memory - __checkReturn - static HRESULT CreateSimpleEnum( - DWORD tkKind, // kind of token that we are iterating - ULONG ridStart, // starting rid - ULONG ridEnd, // end rid - HENUMInternal **ppEnum); // return the created HENUMInternal - - __checkReturn - static HRESULT CreateDynamicArrayEnum( - DWORD tkKind, // kind of token that we are iterating - HENUMInternal **ppEnum); // return the created HENUMInternal - - // Destory Enum. This will free the memory - static void DestroyEnum( - HENUMInternal *pmdEnum); - - static void DestroyEnumIfEmpty( - HENUMInternal **ppEnum); // reset the enumerator pointer to NULL if empty - - __checkReturn - static HRESULT EnumWithCount( - HENUMInternal *pEnum, // enumerator - ULONG cMax, // max tokens that caller wants - mdToken rTokens[], // output buffer to fill the tokens - ULONG *pcTokens); // number of tokens fill to the buffer upon return - - __checkReturn - static HRESULT EnumWithCount( - HENUMInternal *pEnum, // enumerator - ULONG cMax, // max tokens that caller wants - mdToken rTokens1[], // first output buffer to fill the tokens - mdToken rTokens2[], // second output buffer to fill the tokens - ULONG *pcTokens); // number of tokens fill to the buffer upon return - - __checkReturn - static HRESULT AddElementToEnum( - HENUMInternal *pEnum, // return the created HENUMInternal - mdToken tk); // token to fill - - //***************************************** - // Get next value contained in the enumerator - //***************************************** - static bool EnumNext( - HENUMInternal *phEnum, // [IN] the enumerator to retrieve information - mdToken *ptk); // [OUT] token to scope the search - - __checkReturn - static HRESULT GetCount( - HENUMInternal *phEnum, // [IN] the enumerator to retrieve information - ULONG *pCount); // ]OUT] the index of the desired item - - __checkReturn - static HRESULT GetElement( - HENUMInternal *phEnum, // [IN] the enumerator to retrieve information - ULONG ix, // ]IN] the index of the desired item - mdToken *ptk); // [OUT] token to fill - -}; - - - -//***************************************** -// Default Value for field, param or property. Returned by GetDefaultValue -//***************************************** -typedef struct _MDDefaultValue -{ -#if BIGENDIAN - _MDDefaultValue(void) - { - m_bType = ELEMENT_TYPE_END; - } - ~_MDDefaultValue(void) - { - if (m_bType == ELEMENT_TYPE_STRING) - { - delete[] m_wzValue; - } - } -#endif - - // type of default value - BYTE m_bType; // CorElementType for the default value - - // the default value - union - { - BOOL m_bValue; // ELEMENT_TYPE_BOOLEAN - CHAR m_cValue; // ELEMENT_TYPE_I1 - BYTE m_byteValue; // ELEMENT_TYPE_UI1 - SHORT m_sValue; // ELEMENT_TYPE_I2 - USHORT m_usValue; // ELEMENT_TYPE_UI2 - LONG m_lValue; // ELEMENT_TYPE_I4 - ULONG m_ulValue; // ELEMENT_TYPE_UI4 - LONGLONG m_llValue; // ELEMENT_TYPE_I8 - ULONGLONG m_ullValue; // ELEMENT_TYPE_UI8 - FLOAT m_fltValue; // ELEMENT_TYPE_R4 - DOUBLE m_dblValue; // ELEMENT_TYPE_R8 - LPCWSTR m_wzValue; // ELEMENT_TYPE_STRING - IUnknown *m_unkValue; // ELEMENT_TYPE_CLASS - }; - ULONG m_cbSize; // default value size (for blob) - -} MDDefaultValue; - - - -//***************************************** -// structure use to in GetAllEventAssociates and GetAllPropertyAssociates -//***************************************** -typedef struct -{ - mdMethodDef m_memberdef; - DWORD m_dwSemantics; -} ASSOCIATE_RECORD; - - -// -// structure use to retrieve class layout informaiton -// -typedef struct -{ - RID m_ridFieldCur; // indexing to the field table - RID m_ridFieldEnd; // end index to field table -} MD_CLASS_LAYOUT; - - -// Structure for describing the Assembly MetaData. -typedef struct -{ - USHORT usMajorVersion; // Major Version. - USHORT usMinorVersion; // Minor Version. - USHORT usBuildNumber; // Build Number. - USHORT usRevisionNumber; // Revision Number. - LPCSTR szLocale; // Locale. -} AssemblyMetaDataInternal; - - - -// Callback definition for comparing signatures. -// (*PSIGCOMPARE) (BYTE ScopeSignature[], DWORD ScopeSignatureLength, -// BYTE ExternalSignature[], DWORD ExternalSignatureLength, -// void* SignatureData); -typedef BOOL (*PSIGCOMPARE)(PCCOR_SIGNATURE, DWORD, PCCOR_SIGNATURE, DWORD, void*); - - -// {1B119F60-C507-4024-BB39-F8223FB3E1FD} -EXTERN_GUID(IID_IMDInternalImport, 0x1b119f60, 0xc507, 0x4024, 0xbb, 0x39, 0xf8, 0x22, 0x3f, 0xb3, 0xe1, 0xfd); - -#undef INTERFACE -#define INTERFACE IMDInternalImport -DECLARE_INTERFACE_(IMDInternalImport, IUnknown) -{ - //***************************************************************************** - // return the count of entries of a given kind in a scope - // For example, pass in mdtMethodDef will tell you how many MethodDef - // contained in a scope - //***************************************************************************** - STDMETHOD_(ULONG, GetCountWithTokenKind)(// return hresult - DWORD tkKind) PURE; // [IN] pass in the kind of token. - - //***************************************************************************** - // enumerator for typedef - //***************************************************************************** - __checkReturn - STDMETHOD(EnumTypeDefInit)( // return hresult - HENUMInternal *phEnum) PURE; // [OUT] buffer to fill for enumerator data - - //***************************************************************************** - // enumerator for MethodImpl - //***************************************************************************** - __checkReturn - STDMETHOD(EnumMethodImplInit)( // return hresult - mdTypeDef td, // [IN] TypeDef over which to scope the enumeration. - HENUMInternal *phEnumBody, // [OUT] buffer to fill for enumerator data for MethodBody tokens. - HENUMInternal *phEnumDecl) PURE; // [OUT] buffer to fill for enumerator data for MethodDecl tokens. - - ULONG EnumMethodImplGetCount( - HENUMInternal *phEnumBody, // [IN] MethodBody enumerator. - HENUMInternal *phEnumDecl) // [IN] MethodDecl enumerator. - { - return phEnumBody->m_ulCount; - } - - STDMETHOD_(void, EnumMethodImplReset)( - HENUMInternal *phEnumBody, // [IN] MethodBody enumerator. - HENUMInternal *phEnumDecl) PURE; // [IN] MethodDecl enumerator. - - __checkReturn - STDMETHOD(EnumMethodImplNext)( // return hresult (S_OK = TRUE, S_FALSE = FALSE or error code) - HENUMInternal *phEnumBody, // [IN] input enum for MethodBody - HENUMInternal *phEnumDecl, // [IN] input enum for MethodDecl - mdToken *ptkBody, // [OUT] return token for MethodBody - mdToken *ptkDecl) PURE; // [OUT] return token for MethodDecl - - STDMETHOD_(void, EnumMethodImplClose)( - HENUMInternal *phEnumBody, // [IN] MethodBody enumerator. - HENUMInternal *phEnumDecl) PURE; // [IN] MethodDecl enumerator. - - //***************************************** - // Enumerator helpers for memberdef, memberref, interfaceimp, - // event, property, exception, param - //***************************************** - - __checkReturn - STDMETHOD(EnumGlobalFunctionsInit)( // return hresult - HENUMInternal *phEnum) PURE; // [OUT] buffer to fill for enumerator data - - __checkReturn - STDMETHOD(EnumGlobalFieldsInit)( // return hresult - HENUMInternal *phEnum) PURE; // [OUT] buffer to fill for enumerator data - - __checkReturn - STDMETHOD(EnumInit)( // return S_FALSE if record not found - DWORD tkKind, // [IN] which table to work on - mdToken tkParent, // [IN] token to scope the search - HENUMInternal *phEnum) PURE; // [OUT] the enumerator to fill - - __checkReturn - STDMETHOD(EnumAllInit)( // return S_FALSE if record not found - DWORD tkKind, // [IN] which table to work on - HENUMInternal *phEnum) PURE; // [OUT] the enumerator to fill - - bool EnumNext( - HENUMInternal *phEnum, // [IN] the enumerator to retrieve information - mdToken *ptk) // [OUT] token to scope the search - { - _ASSERTE(phEnum && ptk); - if (phEnum->u.m_ulCur >= phEnum->u.m_ulEnd) - return false; - - if ( phEnum->m_EnumType == MDSimpleEnum ) - { - *ptk = phEnum->u.m_ulCur | phEnum->m_tkKind; - phEnum->u.m_ulCur++; - } - else - { - TOKENLIST *pdalist = (TOKENLIST *)&(phEnum->m_cursor); - - _ASSERTE( phEnum->m_EnumType == MDDynamicArrayEnum ); - *ptk = *( pdalist->Get(phEnum->u.m_ulCur++) ); - } - return true; - } - - ULONG EnumGetCount( - HENUMInternal *phEnum) // [IN] the enumerator to retrieve information - { - _ASSERTE(phEnum); - return phEnum->m_ulCount; - } - - void EnumReset( - HENUMInternal *phEnum) // [IN] the enumerator to be reset - { - _ASSERTE(phEnum); - _ASSERTE( phEnum->m_EnumType == MDSimpleEnum || phEnum->m_EnumType == MDDynamicArrayEnum); - - phEnum->u.m_ulCur = phEnum->u.m_ulStart; - } // MDInternalRW::EnumReset - - void EnumClose( - HENUMInternal *phEnum) // [IN] the enumerator to be closed - { - _ASSERTE( phEnum->m_EnumType == MDSimpleEnum || - phEnum->m_EnumType == MDDynamicArrayEnum); - if (phEnum->m_EnumType == MDDynamicArrayEnum) - HENUMInternal::ClearEnum(phEnum); - } - - //***************************************** - // Enumerator helpers for CustomAttribute - //***************************************** - __checkReturn - STDMETHOD(EnumCustomAttributeByNameInit)(// return S_FALSE if record not found - mdToken tkParent, // [IN] token to scope the search - LPCSTR szName, // [IN] CustomAttribute's name to scope the search - HENUMInternal *phEnum) PURE; // [OUT] the enumerator to fill - - //***************************************** - // Nagivator helper to navigate back to the parent token given a token. - // For example, given a memberdef token, it will return the containing typedef. - // - // the mapping is as following: - // ---given child type---------parent type - // mdMethodDef mdTypeDef - // mdFieldDef mdTypeDef - // mdInterfaceImpl mdTypeDef - // mdParam mdMethodDef - // mdProperty mdTypeDef - // mdEvent mdTypeDef - // - //***************************************** - __checkReturn - STDMETHOD(GetParentToken)( - mdToken tkChild, // [IN] given child token - mdToken *ptkParent) PURE; // [OUT] returning parent - - //***************************************** - // Custom value helpers - //***************************************** - __checkReturn - STDMETHOD(GetCustomAttributeProps)( // S_OK or error. - mdCustomAttribute at, // [IN] The attribute. - mdToken *ptkType) PURE; // [OUT] Put attribute type here. - - __checkReturn - STDMETHOD(GetCustomAttributeAsBlob)( - mdCustomAttribute cv, // [IN] given custom value token - void const **ppBlob, // [OUT] return the pointer to internal blob - ULONG *pcbSize) PURE; // [OUT] return the size of the blob - - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD (GetScopeProps)( - LPCSTR *pszName, // [OUT] scope name - GUID *pmvid) PURE; // [OUT] version id - - // finding a particular method - __checkReturn - STDMETHOD(FindMethodDef)( - mdTypeDef classdef, // [IN] given typedef - LPCSTR szName, // [IN] member name - PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature - ULONG cbSigBlob, // [IN] count of bytes in the signature blob - mdMethodDef *pmd) PURE; // [OUT] matching memberdef - - // return a iSeq's param given a MethodDef - __checkReturn - STDMETHOD(FindParamOfMethod)( // S_OK or error. - mdMethodDef md, // [IN] The owning method of the param. - ULONG iSeq, // [IN] The sequence # of the param. - mdParamDef *pparamdef) PURE; // [OUT] Put ParamDef token here. - - //***************************************** - // - // GetName* functions - // - //***************************************** - - // return the name and namespace of typedef - __checkReturn - STDMETHOD(GetNameOfTypeDef)( - mdTypeDef classdef, // given classdef - LPCSTR *pszname, // return class name(unqualified) - LPCSTR *psznamespace) PURE; // return the name space name - - __checkReturn - STDMETHOD(GetIsDualOfTypeDef)( - mdTypeDef classdef, // [IN] given classdef. - ULONG *pDual) PURE; // [OUT] return dual flag here. - - __checkReturn - STDMETHOD(GetIfaceTypeOfTypeDef)( - mdTypeDef classdef, // [IN] given classdef. - ULONG *pIface) PURE; // [OUT] 0=dual, 1=vtable, 2=dispinterface - - // get the name of either methoddef - __checkReturn - STDMETHOD(GetNameOfMethodDef)( // return the name of the memberdef in UTF8 - mdMethodDef md, // given memberdef - LPCSTR *pszName) PURE; - - __checkReturn - STDMETHOD(GetNameAndSigOfMethodDef)( - mdMethodDef methoddef, // [IN] given memberdef - PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to a blob value of CLR signature - ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob - LPCSTR *pszName) PURE; - - // return the name of a FieldDef - __checkReturn - STDMETHOD(GetNameOfFieldDef)( - mdFieldDef fd, // given memberdef - LPCSTR *pszName) PURE; - - // return the name of typeref - __checkReturn - STDMETHOD(GetNameOfTypeRef)( - mdTypeRef classref, // [IN] given typeref - LPCSTR *psznamespace, // [OUT] return typeref name - LPCSTR *pszname) PURE; // [OUT] return typeref namespace - - // return the resolutionscope of typeref - __checkReturn - STDMETHOD(GetResolutionScopeOfTypeRef)( - mdTypeRef classref, // given classref - mdToken *ptkResolutionScope) PURE; - - // Find the type token given the name. - __checkReturn - STDMETHOD(FindTypeRefByName)( - LPCSTR szNamespace, // [IN] Namespace for the TypeRef. - LPCSTR szName, // [IN] Name of the TypeRef. - mdToken tkResolutionScope, // [IN] Resolution Scope fo the TypeRef. - mdTypeRef *ptk) PURE; // [OUT] TypeRef token returned. - - // return the TypeDef properties - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetTypeDefProps)( - mdTypeDef classdef, // given classdef - DWORD *pdwAttr, // return flags on class, tdPublic, tdAbstract - mdToken *ptkExtends) PURE; // [OUT] Put base class TypeDef/TypeRef here - - // return the item's guid - __checkReturn - STDMETHOD(GetItemGuid)( - mdToken tkObj, // [IN] given item. - CLSID *pGuid) PURE; // [out[ put guid here. - - // Get enclosing class of the NestedClass. - __checkReturn - STDMETHOD(GetNestedClassProps)( // S_OK or error - mdTypeDef tkNestedClass, // [IN] NestedClass token. - mdTypeDef *ptkEnclosingClass) PURE; // [OUT] EnclosingClass token. - - // Get count of Nested classes given the enclosing class. - __checkReturn - STDMETHOD(GetCountNestedClasses)( // return count of Nested classes. - mdTypeDef tkEnclosingClass, // Enclosing class. - ULONG *pcNestedClassesCount) PURE; - - // Return array of Nested classes given the enclosing class. - __checkReturn - STDMETHOD(GetNestedClasses)( // Return actual count. - mdTypeDef tkEnclosingClass, // [IN] Enclosing class. - mdTypeDef *rNestedClasses, // [OUT] Array of nested class tokens. - ULONG ulNestedClasses, // [IN] Size of array. - ULONG *pcNestedClasses) PURE; - - // return the ModuleRef properties - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetModuleRefProps)( - mdModuleRef mur, // [IN] moduleref token - LPCSTR *pszName) PURE; // [OUT] buffer to fill with the moduleref name - - //***************************************** - // - // GetSig* functions - // - //***************************************** - __checkReturn - STDMETHOD(GetSigOfMethodDef)( - mdMethodDef tkMethodDef, // [IN] given MethodDef - ULONG * pcbSigBlob, // [OUT] count of bytes in the signature blob - PCCOR_SIGNATURE * ppSig) PURE; - - __checkReturn - STDMETHOD(GetSigOfFieldDef)( - mdFieldDef tkFieldDef, // [IN] given FieldDef - ULONG * pcbSigBlob, // [OUT] count of bytes in the signature blob - PCCOR_SIGNATURE * ppSig) PURE; - - __checkReturn - STDMETHOD(GetSigFromToken)( - mdToken tk, // FieldDef, MethodDef, Signature or TypeSpec token - ULONG * pcbSig, - PCCOR_SIGNATURE * ppSig) PURE; - - - - //***************************************** - // get method property - //***************************************** - __checkReturn - STDMETHOD(GetMethodDefProps)( - mdMethodDef md, // The method for which to get props. - DWORD *pdwFlags) PURE; - - //***************************************** - // return method implementation informaiton, like RVA and implflags - //***************************************** - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetMethodImplProps)( - mdToken tk, // [IN] MethodDef - ULONG *pulCodeRVA, // [OUT] CodeRVA - DWORD *pdwImplFlags) PURE; // [OUT] Impl. Flags - - //***************************************** - // return method implementation informaiton, like RVA and implflags - //***************************************** - __checkReturn - STDMETHOD(GetFieldRVA)( - mdFieldDef fd, // [IN] fielddef - ULONG *pulCodeRVA) PURE; // [OUT] CodeRVA - - //***************************************** - // get field property - //***************************************** - __checkReturn - STDMETHOD(GetFieldDefProps)( - mdFieldDef fd, // [IN] given fielddef - DWORD *pdwFlags) PURE; // [OUT] return fdPublic, fdPrive, etc flags - - //***************************************************************************** - // return default value of a token(could be paramdef, fielddef, or property - //***************************************************************************** - __checkReturn - STDMETHOD(GetDefaultValue)( - mdToken tk, // [IN] given FieldDef, ParamDef, or Property - MDDefaultValue *pDefaultValue) PURE;// [OUT] default value to fill - - - //***************************************** - // get dispid of a MethodDef or a FieldDef - //***************************************** - __checkReturn - STDMETHOD(GetDispIdOfMemberDef)( // return hresult - mdToken tk, // [IN] given methoddef or fielddef - ULONG *pDispid) PURE; // [OUT] Put the dispid here. - - //***************************************** - // return TypeRef/TypeDef given an InterfaceImpl token - //***************************************** - __checkReturn - STDMETHOD(GetTypeOfInterfaceImpl)( // return the TypeRef/typedef token for the interfaceimpl - mdInterfaceImpl iiImpl, // given a interfaceimpl - mdToken *ptkType) PURE; - - //***************************************** - // look up function for TypeDef - //***************************************** - __checkReturn - STDMETHOD(FindTypeDef)( - LPCSTR szNamespace, // [IN] Namespace for the TypeDef. - LPCSTR szName, // [IN] Name of the TypeDef. - mdToken tkEnclosingClass, // [IN] TypeRef/TypeDef Token for the enclosing class. - mdTypeDef *ptypedef) PURE; // [IN] return typedef - - //***************************************** - // return name and sig of a memberref - //***************************************** - __checkReturn - STDMETHOD(GetNameAndSigOfMemberRef)( // return name here - mdMemberRef memberref, // given memberref - PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to a blob value of CLR signature - ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob - LPCSTR *pszName) PURE; - - //***************************************************************************** - // Given memberref, return the parent. It can be TypeRef, ModuleRef, MethodDef - //***************************************************************************** - __checkReturn - STDMETHOD(GetParentOfMemberRef)( - mdMemberRef memberref, // given memberref - mdToken *ptkParent) PURE; // return the parent token - - __checkReturn - STDMETHOD(GetParamDefProps)( - mdParamDef paramdef, // given a paramdef - USHORT *pusSequence, // [OUT] slot number for this parameter - DWORD *pdwAttr, // [OUT] flags - LPCSTR *pszName) PURE; // [OUT] return the name of the parameter - - __checkReturn - STDMETHOD(GetPropertyInfoForMethodDef)( // Result. - mdMethodDef md, // [IN] memberdef - mdProperty *ppd, // [OUT] put property token here - LPCSTR *pName, // [OUT] put pointer to name here - ULONG *pSemantic) PURE; // [OUT] put semantic here - - //***************************************** - // class layout/sequence information - //***************************************** - __checkReturn - STDMETHOD(GetClassPackSize)( // return error if class doesn't have packsize - mdTypeDef td, // [IN] give typedef - ULONG *pdwPackSize) PURE; // [OUT] 1, 2, 4, 8, or 16 - - __checkReturn - STDMETHOD(GetClassTotalSize)( // return error if class doesn't have total size info - mdTypeDef td, // [IN] give typedef - ULONG *pdwClassSize) PURE; // [OUT] return the total size of the class - - __checkReturn - STDMETHOD(GetClassLayoutInit)( - mdTypeDef td, // [IN] give typedef - MD_CLASS_LAYOUT *pLayout) PURE; // [OUT] set up the status of query here - - __checkReturn - STDMETHOD(GetClassLayoutNext)( - MD_CLASS_LAYOUT *pLayout, // [IN|OUT] set up the status of query here - mdFieldDef *pfd, // [OUT] return the fielddef - ULONG *pulOffset) PURE; // [OUT] return the offset/ulSequence associate with it - - //***************************************** - // marshal information of a field - //***************************************** - __checkReturn - STDMETHOD(GetFieldMarshal)( // return error if no native type associate with the token - mdFieldDef fd, // [IN] given fielddef - PCCOR_SIGNATURE *pSigNativeType, // [OUT] the native type signature - ULONG *pcbNativeType) PURE; // [OUT] the count of bytes of *ppvNativeType - - - //***************************************** - // property APIs - //***************************************** - // find a property by name - __checkReturn - STDMETHOD(FindProperty)( - mdTypeDef td, // [IN] given a typdef - LPCSTR szPropName, // [IN] property name - mdProperty *pProp) PURE; // [OUT] return property token - - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetPropertyProps)( - mdProperty prop, // [IN] property token - LPCSTR *szProperty, // [OUT] property name - DWORD *pdwPropFlags, // [OUT] property flags. - PCCOR_SIGNATURE *ppvSig, // [OUT] property type. pointing to meta data internal blob - ULONG *pcbSig) PURE; // [OUT] count of bytes in *ppvSig - - //********************************** - // Event APIs - //********************************** - __checkReturn - STDMETHOD(FindEvent)( - mdTypeDef td, // [IN] given a typdef - LPCSTR szEventName, // [IN] event name - mdEvent *pEvent) PURE; // [OUT] return event token - - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetEventProps)( - mdEvent ev, // [IN] event token - LPCSTR *pszEvent, // [OUT] Event name - DWORD *pdwEventFlags, // [OUT] Event flags. - mdToken *ptkEventType) PURE; // [OUT] EventType class - - - //********************************** - // find a particular associate of a property or an event - //********************************** - __checkReturn - STDMETHOD(FindAssociate)( - mdToken evprop, // [IN] given a property or event token - DWORD associate, // [IN] given a associate semantics(setter, getter, testdefault, reset, AddOn, RemoveOn, Fire) - mdMethodDef *pmd) PURE; // [OUT] return method def token - - // Note, void function in v1.0/v1.1 - __checkReturn - STDMETHOD(EnumAssociateInit)( - mdToken evprop, // [IN] given a property or an event token - HENUMInternal *phEnum) PURE; // [OUT] cursor to hold the query result - - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetAllAssociates)( - HENUMInternal *phEnum, // [IN] query result form GetPropertyAssociateCounts - ASSOCIATE_RECORD *pAssociateRec, // [OUT] struct to fill for output - ULONG cAssociateRec) PURE; // [IN] size of the buffer - - - //********************************** - // Get info about a PermissionSet. - //********************************** - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetPermissionSetProps)( - mdPermission pm, // [IN] the permission token. - DWORD *pdwAction, // [OUT] CorDeclSecurity. - void const **ppvPermission, // [OUT] permission blob. - ULONG *pcbPermission) PURE; // [OUT] count of bytes of pvPermission. - - //**************************************** - // Get the String given the String token. - // Returns a pointer to the string, or NULL in case of error. - //**************************************** - __checkReturn - 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; - - //***************************************************************************** - // p-invoke APIs. - //***************************************************************************** - __checkReturn - STDMETHOD(GetPinvokeMap)( - mdToken tk, // [IN] FieldDef, MethodDef. - DWORD *pdwMappingFlags, // [OUT] Flags used for mapping. - LPCSTR *pszImportName, // [OUT] Import name. - mdModuleRef *pmrImportDLL) PURE; // [OUT] ModuleRef token for the target DLL. - - //***************************************************************************** - // helpers to convert a text signature to a com format - //***************************************************************************** - __checkReturn - STDMETHOD(ConvertTextSigToComSig)( // Return hresult. - BOOL fCreateTrIfNotFound, // [IN] create typeref if not found - LPCSTR pSignature, // [IN] class file format signature - CQuickBytes *pqbNewSig, // [OUT] place holder for CLR signature - ULONG *pcbCount) PURE; // [OUT] the result size of signature - - //***************************************************************************** - // Assembly MetaData APIs. - //***************************************************************************** - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetAssemblyProps)( - mdAssembly mda, // [IN] The Assembly for which to get the properties. - const void **ppbPublicKey, // [OUT] Pointer to the public key. - ULONG *pcbPublicKey, // [OUT] Count of bytes in the public key. - ULONG *pulHashAlgId, // [OUT] Hash Algorithm. - LPCSTR *pszName, // [OUT] Buffer to fill with name. - AssemblyMetaDataInternal *pMetaData,// [OUT] Assembly MetaData. - DWORD *pdwAssemblyFlags) PURE;// [OUT] Flags. - - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetAssemblyRefProps)( - mdAssemblyRef mdar, // [IN] The AssemblyRef for which to get the properties. - const void **ppbPublicKeyOrToken, // [OUT] Pointer to the public key or token. - ULONG *pcbPublicKeyOrToken, // [OUT] Count of bytes in the public key or token. - LPCSTR *pszName, // [OUT] Buffer to fill with name. - AssemblyMetaDataInternal *pMetaData,// [OUT] Assembly MetaData. - const void **ppbHashValue, // [OUT] Hash blob. - ULONG *pcbHashValue, // [OUT] Count of bytes in the hash blob. - DWORD *pdwAssemblyRefFlags) PURE; // [OUT] Flags. - - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetFileProps)( - mdFile mdf, // [IN] The File for which to get the properties. - LPCSTR *pszName, // [OUT] Buffer to fill with name. - const void **ppbHashValue, // [OUT] Pointer to the Hash Value Blob. - ULONG *pcbHashValue, // [OUT] Count of bytes in the Hash Value Blob. - DWORD *pdwFileFlags) PURE; // [OUT] Flags. - - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetExportedTypeProps)( - mdExportedType mdct, // [IN] The ExportedType for which to get the properties. - LPCSTR *pszNamespace, // [OUT] Namespace. - LPCSTR *pszName, // [OUT] Name. - mdToken *ptkImplementation, // [OUT] mdFile or mdAssemblyRef that provides the ExportedType. - mdTypeDef *ptkTypeDef, // [OUT] TypeDef token within the file. - DWORD *pdwExportedTypeFlags) PURE; // [OUT] Flags. - - // returned void in v1.0/v1.1 - __checkReturn - STDMETHOD(GetManifestResourceProps)( - mdManifestResource mdmr, // [IN] The ManifestResource for which to get the properties. - LPCSTR *pszName, // [OUT] Buffer to fill with name. - mdToken *ptkImplementation, // [OUT] mdFile or mdAssemblyRef that provides the ExportedType. - DWORD *pdwOffset, // [OUT] Offset to the beginning of the resource within the file. - DWORD *pdwResourceFlags) PURE;// [OUT] Flags. - - __checkReturn - STDMETHOD(FindExportedTypeByName)( // S_OK or error - LPCSTR szNamespace, // [IN] Namespace of the ExportedType. - LPCSTR szName, // [IN] Name of the ExportedType. - mdExportedType tkEnclosingType, // [IN] ExportedType for the enclosing class. - mdExportedType *pmct) PURE; // [OUT] Put ExportedType token here. - - __checkReturn - STDMETHOD(FindManifestResourceByName)( // S_OK or error - LPCSTR szName, // [IN] Name of the ManifestResource. - mdManifestResource *pmmr) PURE; // [OUT] Put ManifestResource token here. - - __checkReturn - STDMETHOD(GetAssemblyFromScope)( // S_OK or error - mdAssembly *ptkAssembly) PURE; // [OUT] Put token here. - - __checkReturn - STDMETHOD(GetCustomAttributeByName)( // S_OK or error - mdToken tkObj, // [IN] Object with Custom Attribute. - LPCUTF8 szName, // [IN] Name of desired Custom Attribute. - const void **ppData, // [OUT] Put pointer to data here. - ULONG *pcbData) PURE; // [OUT] Put size of data here. - - // Note: The return type of this method was void in v1 - __checkReturn - STDMETHOD(GetTypeSpecFromToken)( // S_OK or error. - mdTypeSpec typespec, // [IN] Signature token. - PCCOR_SIGNATURE *ppvSig, // [OUT] return pointer to token. - ULONG *pcbSig) PURE; // [OUT] return size of signature. - - __checkReturn - STDMETHOD(SetUserContextData)( // S_OK or E_NOTIMPL - IUnknown *pIUnk) PURE; // The user context. - - __checkReturn - STDMETHOD_(BOOL, IsValidToken)( // True or False. - mdToken tk) PURE; // [IN] Given token. - - __checkReturn - STDMETHOD(TranslateSigWithScope)( - IMDInternalImport *pAssemImport, // [IN] import assembly scope. - const void *pbHashValue, // [IN] hash value for the import assembly. - ULONG cbHashValue, // [IN] count of bytes in the hash value. - PCCOR_SIGNATURE pbSigBlob, // [IN] signature in the importing scope - ULONG cbSigBlob, // [IN] count of bytes of signature - IMetaDataAssemblyEmit *pAssemEmit, // [IN] assembly emit scope. - IMetaDataEmit *emit, // [IN] emit interface - CQuickBytes *pqkSigEmit, // [OUT] buffer to hold translated signature - ULONG *pcbSig) PURE; // [OUT] count of bytes in the translated signature - - STDMETHOD_(IMetaModelCommon*, GetMetaModelCommon)( // Return MetaModelCommon interface. - ) PURE; - - STDMETHOD_(IUnknown *, GetCachedPublicInterface)(BOOL fWithLock) PURE; // return the cached public interface - __checkReturn - STDMETHOD(SetCachedPublicInterface)(IUnknown *pUnk) PURE; // no return value - STDMETHOD_(UTSemReadWrite*, GetReaderWriterLock)() PURE; // return the reader writer lock - __checkReturn - STDMETHOD(SetReaderWriterLock)(UTSemReadWrite * pSem) PURE; - - STDMETHOD_(mdModule, GetModuleFromScope)() PURE; // [OUT] Put mdModule token here. - - - //----------------------------------------------------------------- - // Additional custom methods - - // finding a particular method - __checkReturn - STDMETHOD(FindMethodDefUsingCompare)( - mdTypeDef classdef, // [IN] given typedef - LPCSTR szName, // [IN] member name - PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of CLR signature - ULONG cbSigBlob, // [IN] count of bytes in the signature blob - PSIGCOMPARE pSignatureCompare, // [IN] Routine to compare signatures - void* pSignatureArgs, // [IN] Additional info to supply the compare function - mdMethodDef *pmd) PURE; // [OUT] matching memberdef - - // Additional v2 methods. - - //***************************************** - // return a field offset for a given field - //***************************************** - __checkReturn - STDMETHOD(GetFieldOffset)( - mdFieldDef fd, // [IN] fielddef - ULONG *pulOffset) PURE; // [OUT] FieldOffset - - __checkReturn - STDMETHOD(GetMethodSpecProps)( - mdMethodSpec ms, // [IN] The method instantiation - mdToken *tkParent, // [OUT] MethodDef or MemberRef - PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to the blob value of meta data - ULONG *pcbSigBlob) PURE; // [OUT] actual size of signature blob - - __checkReturn - STDMETHOD(GetTableInfoWithIndex)( - ULONG index, // [IN] pass in the table index - void **pTable, // [OUT] pointer to table at index - void **pTableSize) PURE; // [OUT] size of table at index - - __checkReturn - STDMETHOD(ApplyEditAndContinue)( - void *pDeltaMD, // [IN] the delta metadata - ULONG cbDeltaMD, // [IN] length of pData - IMDInternalImport **ppv) PURE; // [OUT] the resulting metadata interface - - //********************************** - // Generics APIs - //********************************** - __checkReturn - STDMETHOD(GetGenericParamProps)( // S_OK or error. - mdGenericParam rd, // [IN] The type parameter - ULONG* pulSequence, // [OUT] Parameter sequence number - DWORD* pdwAttr, // [OUT] Type parameter flags (for future use) - mdToken *ptOwner, // [OUT] The owner (TypeDef or MethodDef) - DWORD *reserved, // [OUT] The kind (TypeDef/Ref/Spec, for future use) - LPCSTR *szName) PURE; // [OUT] The name - - __checkReturn - STDMETHOD(GetGenericParamConstraintProps)( // S_OK or error. - mdGenericParamConstraint rd, // [IN] The constraint token - mdGenericParam *ptGenericParam, // [OUT] GenericParam that is constrained - mdToken *ptkConstraintType) PURE; // [OUT] TypeDef/Ref/Spec constraint - - //***************************************************************************** - // This function gets the "built for" version of a metadata scope. - // NOTE: if the scope has never been saved, it will not have a built-for - // version, and an empty string will be returned. - //***************************************************************************** - __checkReturn - STDMETHOD(GetVersionString)( // S_OK or error. - LPCSTR *pVer) PURE; // [OUT] Put version string here. - - - __checkReturn - STDMETHOD(GetTypeDefRefTokenInTypeSpec)(// return S_FALSE if enclosing type does not have a token - mdTypeSpec tkTypeSpec, // [IN] TypeSpec token to look at - mdToken *tkEnclosedToken) PURE; // [OUT] The enclosed type token - -#define MD_STREAM_VER_1X 0x10000 -#define MD_STREAM_VER_2_B1 0x10001 -#define MD_STREAM_VER_2 0x20000 - STDMETHOD_(DWORD, GetMetadataStreamVersion)() PURE; //returns DWORD with major version of - // MD stream in senior word and minor version--in junior word - - __checkReturn - STDMETHOD(GetNameOfCustomAttribute)(// S_OK or error - mdCustomAttribute mdAttribute, // [IN] The Custom Attribute - LPCUTF8 *pszNamespace, // [OUT] Namespace of Custom Attribute. - LPCUTF8 *pszName) PURE; // [OUT] Name of Custom Attribute. - - STDMETHOD(SetOptimizeAccessForSpeed)(// S_OK or error - BOOL fOptSpeed) PURE; - - STDMETHOD(SetVerifiedByTrustedSource)(// S_OK or error - BOOL fVerified) PURE; - - STDMETHOD(GetRvaOffsetData)( - DWORD *pFirstMethodRvaOffset, // [OUT] Offset (from start of metadata) to the first RVA field in MethodDef table. - DWORD *pMethodDefRecordSize, // [OUT] Size of each record in MethodDef table. - DWORD *pMethodDefCount, // [OUT] Number of records in MethodDef table. - DWORD *pFirstFieldRvaOffset, // [OUT] Offset (from start of metadata) to the first RVA field in FieldRVA table. - DWORD *pFieldRvaRecordSize, // [OUT] Size of each record in FieldRVA table. - DWORD *pFieldRvaCount // [OUT] Number of records in FieldRVA table. - ) PURE; - - //---------------------------------------------------------------------------------------- - // !!! READ THIS !!! - // - // New methods have to be added at the end. The order and signatures of the existing methods - // have to be preserved. We need to maintain a backward compatibility for this interface to - // allow ildasm to work on SingleCLR. - // - //---------------------------------------------------------------------------------------- - -}; // IMDInternalImport - - -// {E03D7730-D7E3-11d2-8C0D-00C04FF7431A} -EXTERN_GUID(IID_IMDInternalImportENC, 0xe03d7730, 0xd7e3, 0x11d2, 0x8c, 0xd, 0x0, 0xc0, 0x4f, 0xf7, 0x43, 0x1a); - -#undef INTERFACE -#define INTERFACE IMDInternalImportENC -DECLARE_INTERFACE_(IMDInternalImportENC, IMDInternalImport) -{ -private: - using IMDInternalImport::ApplyEditAndContinue; -public: - // ENC only methods here. - STDMETHOD(ApplyEditAndContinue)( // S_OK or error. - MDInternalRW *pDelta) PURE; // Interface to MD with the ENC delta. - - STDMETHOD(EnumDeltaTokensInit)( // return hresult - HENUMInternal *phEnum) PURE; // [OUT] buffer to fill for enumerator data - -}; // IMDInternalImportENC - -// {F102C526-38CB-49ed-9B5F-498816AE36E0} -EXTERN_GUID(IID_IMDInternalEmit, 0xf102c526, 0x38cb, 0x49ed, 0x9b, 0x5f, 0x49, 0x88, 0x16, 0xae, 0x36, 0xe0); - -#undef INTERFACE -#define INTERFACE IMDInternalEmit -DECLARE_INTERFACE_(IMDInternalEmit, IUnknown) -{ - STDMETHOD(ChangeMvid)( // S_OK or error. - REFGUID newMvid) PURE; // GUID to use as the MVID - - STDMETHOD(SetMDUpdateMode)( - ULONG updateMode, ULONG *pPreviousUpdateMode) PURE; - -}; // IMDInternalEmit - -#ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE - -struct IMDCustomDataSource; -class CMiniMdSchema; -struct CMiniTableDef; -namespace MetaData -{ - class DataBlob; -} - -// {CC0C8F7A-A00B-493D-80B6-CE0C92491670} -EXTERN_GUID(IID_IMDCustomDataSource, 0xcc0c8f7a, 0xa00b, 0x493d, 0x80, 0xb6, 0xce, 0xc, 0x92, 0x49, 0x16, 0x70); - -#undef INTERFACE -#define INTERFACE IMDCustomDataSource -DECLARE_INTERFACE_(IMDCustomDataSource, IUnknown) -{ - STDMETHOD(GetSchema)(CMiniMdSchema* pSchema) PURE; - STDMETHOD(GetTableDef)(ULONG32 tableIndex, CMiniTableDef* pTableDef) PURE; - STDMETHOD(GetBlobHeap)(MetaData::DataBlob* pBlobHeapData) PURE; - STDMETHOD(GetGuidHeap)(MetaData::DataBlob* pGuidHeapData) PURE; - STDMETHOD(GetStringHeap)(MetaData::DataBlob* pStringHeapData) PURE; - STDMETHOD(GetUserStringHeap)(MetaData::DataBlob* pUserStringHeapData) PURE; - STDMETHOD(GetTableRecords)(ULONG32 tableIndex, MetaData::DataBlob* pTableRecordData) PURE; - STDMETHOD(GetTableSortable)(ULONG32 tableIndex, BOOL* pSortable) PURE; - STDMETHOD(GetStorageSignature)(MetaData::DataBlob* pStorageSignature) PURE; - -}; // IMDCustomDataSource - -// {503F79FB-7AAE-4364-BDA6-8E235D173AEC} -EXTERN_GUID(IID_IMetaDataDispenserCustom, - 0x503f79fb, 0x7aae, 0x4364, 0xbd, 0xa6, 0x8e, 0x23, 0x5d, 0x17, 0x3a, 0xec); - -#undef INTERFACE -#define INTERFACE IMetaDataDispenserCustom -DECLARE_INTERFACE_(IMetaDataDispenserCustom, IUnknown) -{ - STDMETHOD(OpenScopeOnCustomDataSource)( // Return code. - IMDCustomDataSource *pCustomSource, // [in] The scope to open. - DWORD dwOpenFlags, // [in] Open mode flags. - REFIID riid, // [in] The interface desired. - IUnknown **ppIUnk) PURE; // [out] Return interface on success. - -}; // IMetaDataDispenserCustom - -#endif // FEATURE_METADATA_CUSTOM_DATA_SOURCE - -#ifdef FEATURE_METADATA_DEBUGGEE_DATA_SOURCE -struct ICorDebugDataTarget; -HRESULT CreateRemoteMDInternalRWSource(TADDR mdInternalRWRemoteAddress, ICorDebugDataTarget* pDataTarget, DWORD defines, DWORD dataStructureVersion, IMDCustomDataSource** ppDataSource); -#endif - -enum MetaDataReorderingOptions { - NoReordering=0x0, - ReArrangeStringPool=0x1 -}; - -#ifdef __HOLDER_H_ - -void DECLSPEC_NORETURN ThrowHR(HRESULT hr); - -// This wrapper class ensures that the HENUMInternal is EnumClose'd no matter how the scope is exited. -class HENUMTypeDefInternalHolder -{ -public: - FORCEINLINE HENUMTypeDefInternalHolder(IMDInternalImport *pInternalImport) - { - WRAPPER_NO_CONTRACT; - - m_pInternalImport = pInternalImport; - m_fAcquired = FALSE; - } - - FORCEINLINE VOID EnumTypeDefInit() - { - CONTRACTL { - THROWS; - } CONTRACTL_END; - - _ASSERTE(!m_fAcquired); - HRESULT hr = m_pInternalImport->EnumTypeDefInit(&m_hEnum); - if (FAILED(hr)) - { - ThrowHR(hr); - } - m_fAcquired = TRUE; - - } - - FORCEINLINE HRESULT EnumTypeDefInitNoThrow() - { - WRAPPER_NO_CONTRACT; - - _ASSERTE(!m_fAcquired); - HRESULT hr = m_pInternalImport->EnumTypeDefInit(&m_hEnum); - if (FAILED(hr)) - { - return hr; - } - m_fAcquired = TRUE; - - return hr; - } - - FORCEINLINE ~HENUMTypeDefInternalHolder() - { - WRAPPER_NO_CONTRACT; - - if (m_fAcquired) - { - m_pInternalImport->EnumClose(&m_hEnum); - } - } - - FORCEINLINE HENUMInternal* operator& () - { - LIMITED_METHOD_CONTRACT; - - _ASSERTE(m_fAcquired); - return &m_hEnum; - } - -private: - FORCEINLINE HENUMTypeDefInternalHolder(const HENUMTypeDefInternalHolder &) - { - LIMITED_METHOD_CONTRACT; - - _ASSERTE(!"Don't try to assign this class."); - } - -private: - IMDInternalImport *m_pInternalImport; - HENUMInternal m_hEnum; - BOOL m_fAcquired; -}; - - -// This wrapper class ensures that the HENUMInternal is EnumClose'd no matter how the scope is exited. -class HENUMInternalHolder -{ -public: - FORCEINLINE HENUMInternalHolder(IMDInternalImport *pInternalImport) - { - WRAPPER_NO_CONTRACT; - - m_pInternalImport = pInternalImport; - m_fAcquired = FALSE; - } - - FORCEINLINE VOID EnumGlobalFunctionsInit() - { - CONTRACTL { - THROWS; - } CONTRACTL_END; - - _ASSERTE(!m_fAcquired); - HRESULT hr = m_pInternalImport->EnumGlobalFunctionsInit(&m_hEnum); - if (FAILED(hr)) - { - ThrowHR(hr); - } - m_fAcquired = TRUE; - - } - - - FORCEINLINE VOID EnumGlobalFieldsInit() - { - CONTRACTL { - THROWS; - } CONTRACTL_END; - - _ASSERTE(!m_fAcquired); - HRESULT hr = m_pInternalImport->EnumGlobalFieldsInit(&m_hEnum); - if (FAILED(hr)) - { - ThrowHR(hr); - } - m_fAcquired = TRUE; - - } - - FORCEINLINE VOID EnumTypeDefInit() - { - CONTRACTL { - THROWS; - } CONTRACTL_END; - - _ASSERTE(!m_fAcquired); - HRESULT hr = m_pInternalImport->EnumTypeDefInit(&m_hEnum); - if (FAILED(hr)) - { - ThrowHR(hr); - } - m_fAcquired = TRUE; - } - - FORCEINLINE VOID EnumAssociateInit(mdToken tkParent) // [IN] token to scope the search - { - CONTRACTL { - THROWS; - } CONTRACTL_END; - - _ASSERTE(!m_fAcquired); - IfFailThrow(m_pInternalImport->EnumAssociateInit(tkParent, &m_hEnum)); - m_fAcquired = TRUE; - } - - FORCEINLINE VOID EnumInit(DWORD tkKind, // [IN] which table to work on - mdToken tkParent // [IN] token to scope the search - ) - { - CONTRACTL { - THROWS; - } CONTRACTL_END; - - HRESULT hr = EnumInitNoThrow(tkKind, tkParent); - if (FAILED(hr)) - { - ThrowHR(hr); - } - } - - __checkReturn - FORCEINLINE HRESULT EnumInitNoThrow(DWORD tkKind, // [IN] which table to work on - mdToken tkParent // [IN] token to scope the search - ) - { - CONTRACTL { - NOTHROW; - } CONTRACTL_END; - - _ASSERTE(!m_fAcquired); - HRESULT hr = m_pInternalImport->EnumInit(tkKind, tkParent, &m_hEnum); - if (SUCCEEDED(hr)) - { - m_fAcquired = TRUE; - } - return hr; - } - - FORCEINLINE VOID EnumAllInit(DWORD tkKind // [IN] which table to work on - ) - { - CONTRACTL { - THROWS; - } CONTRACTL_END; - - _ASSERTE(!m_fAcquired); - HRESULT hr = m_pInternalImport->EnumAllInit(tkKind, &m_hEnum); - if (FAILED(hr)) - { - ThrowHR(hr); - } - m_fAcquired = TRUE; - - } - - FORCEINLINE ULONG EnumGetCount() - { - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - CONSISTENCY_CHECK(m_fAcquired); - } CONTRACTL_END; - - return m_pInternalImport->EnumGetCount(&m_hEnum); - } - - FORCEINLINE bool EnumNext(mdToken * pTok) - { - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - CONSISTENCY_CHECK(m_fAcquired); - } CONTRACTL_END; - - return m_pInternalImport->EnumNext(&m_hEnum, pTok); - } - - FORCEINLINE void EnumReset() - { - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - CONSISTENCY_CHECK(m_fAcquired); - } CONTRACTL_END; - - return m_pInternalImport->EnumReset(&m_hEnum); - } - - FORCEINLINE ~HENUMInternalHolder() - { - WRAPPER_NO_CONTRACT; - - if (m_fAcquired) - { - // Ignore the error - (void)m_pInternalImport->EnumClose(&m_hEnum); - } - } - - FORCEINLINE HENUMInternal* operator& () - { - LIMITED_METHOD_CONTRACT; - - _ASSERTE(m_fAcquired); - return &m_hEnum; - } - -private: - FORCEINLINE HENUMInternalHolder(const HENUMInternalHolder &) - { - WRAPPER_NO_CONTRACT; - - _ASSERTE(!"Don't try to assign this class."); - } - - -protected: - IMDInternalImport *m_pInternalImport; - HENUMInternal m_hEnum; - BOOL m_fAcquired; -}; - -class HENUMInternalMethodImplHolder : protected HENUMInternalHolder -{ - public: - FORCEINLINE HENUMInternalMethodImplHolder(IMDInternalImport *pInternalImport) - : HENUMInternalHolder(pInternalImport) - { - WRAPPER_NO_CONTRACT; - } - - FORCEINLINE ~HENUMInternalMethodImplHolder() - { - WRAPPER_NO_CONTRACT; - - if (m_fAcquired) - { - // Ignore the error - (void)m_pInternalImport->EnumClose(&m_hEnum2); - } - } - - FORCEINLINE void EnumMethodImplInit(mdToken tkParent // [IN] token to scope the search - ) - { - CONTRACTL { - THROWS; - } CONTRACTL_END; - - HRESULT hr = EnumMethodImplInitNoThrow(tkParent); - if (FAILED(hr)) - { - ThrowHR(hr); - } - } - - __checkReturn - FORCEINLINE HRESULT EnumMethodImplInitNoThrow(mdToken tkParent // [IN] token to scope the search - ) - { - CONTRACTL { - NOTHROW; - } CONTRACTL_END; - - _ASSERTE(!m_fAcquired); - HRESULT hr = m_pInternalImport->EnumMethodImplInit(tkParent, &m_hEnum, &m_hEnum2); - if (SUCCEEDED(hr)) - { - m_fAcquired = TRUE; - } - return hr; - } - - __checkReturn - FORCEINLINE HRESULT EnumMethodImplNext( - mdToken *ptkImpl, - mdToken *ptkDecl) - { - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - CONSISTENCY_CHECK(m_fAcquired); - } CONTRACTL_END; - - return m_pInternalImport->EnumMethodImplNext(&m_hEnum, &m_hEnum2, ptkImpl, ptkDecl); - } - - FORCEINLINE ULONG EnumMethodImplGetCount() - { - CONTRACTL { - NOTHROW; - GC_NOTRIGGER; - CONSISTENCY_CHECK(m_fAcquired); - } CONTRACTL_END; - - return m_pInternalImport->EnumMethodImplGetCount(&m_hEnum, &m_hEnum2); - } - - protected: - HENUMInternal m_hEnum2; -}; - -#endif //__HOLDER_H_ - -#endif // _METADATA_H_ diff --git a/src/shared/inc/metahost.idl b/src/shared/inc/metahost.idl index 3b455b1477..27c6e9a5cd 100644 --- a/src/shared/inc/metahost.idl +++ b/src/shared/inc/metahost.idl @@ -76,7 +76,7 @@ typedef void (__stdcall *RuntimeLoadedCallbackFnPtr)( typedef enum { - Unknown = 0, + UnknownIndex = 0, Identity = 1, Runtime = 2, } LIBRARY_PROVIDER_INDEX_TYPE; diff --git a/src/shared/inc/mscorsvc.idl b/src/shared/inc/mscorsvc.idl deleted file mode 100644 index a7eadbc37b..0000000000 --- a/src/shared/inc/mscorsvc.idl +++ /dev/null @@ -1,664 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -/* -------------------------------------------------------------------------- * - * Microsoft .NET Framework Service - * -------------------------------------------------------------------------- */ - -#ifndef IN_MSCOREE -cpp_quote("#if 0") // So that the outputted header file doesn't cause redefines - -import "unknwn.idl"; - -cpp_quote("#endif") - -// CLSID_CorSvcWorker -cpp_quote("EXTERN_GUID(CLSID_CorSvcWorker, 0x8ed1a844, 0x32a7, 0x4a67, 0xba, 0x62, 0xf8, 0xd5, 0xaf, 0xdf, 0xf4, 0x60);") - -// CLSID_CorSvcBindToWorker -cpp_quote("EXTERN_GUID(CLSID_CorSvcBindToWorker, 0x9f74fb09, 0x4221, 0x40b4, 0xae, 0x21, 0xae, 0xb6, 0xdf, 0xf2, 0x99, 0x4e);") - -#pragma midl_echo("STDAPI CorGetSvc(IUnknown **pIUnknown);") - -[ - uuid(d69cca64-16f7-485c-8cf1-67063e44f0c3), - version(2.0), - helpstring("Common Language Runtime Execution Engine 2.0 Library") -] -library mscorsvc -{ - importlib("stdole32.tlb"); - -#endif // IN_MSCOREE - - - //***************************************************************************** - // ICorSvcDependencies is used to enumerate the dependencies of an - // IL image. It is used by the native image service. - //*****************************************************************************[ - - [ - object, - oleautomation, - uuid(ddb34005-9ba3-4025-9554-f00a2df5dbf5), - pointer_default(unique), - ] - interface ICorSvcDependencies : IUnknown - { - HRESULT GetAssemblyDependencies( - [in] BSTR pAssemblyName, - [out] SAFEARRAY(BSTR) *pDependencies, - [out] DWORD *assemblyNGenSetting, - [out] BSTR *pNativeImageIdentity, - [out] BSTR *pAssemblyDisplayName, - [out] SAFEARRAY(DWORD) *pDependencyLoadSetting, - [out] SAFEARRAY(DWORD) *pDependencyNGenSetting - ); - } - - //***************************************************************************** - // ICorSvcWorker contains methods for generating native images and enumerating - // their dependencies. - //*****************************************************************************[ - - typedef enum - { - ScenarioDefault = 0x00000000, // No special scenario flags - ScenarioAll = 0x00000001, // All scenarios (used to indicate all configurations) - ScenarioDebug = 0x00000002, // Unoptimized debuggable code - ScenarioProfile = 0x00000008, // Used for profiling (enter/leave notifications) - ScenarioTuningDataCollection = 0x00000010, // Used to gather IBC data - ScenarioLegacy = 0x00000020, // Follow hard dependencies only - - ScenarioNgenLastRetry = 0x00010000, // Ngen failed last time and this a final retry - ScenarioAutoNGen = 0x00100000, // This is an Auto NGen request - ScenarioRepositoryOnly = 0x00200000, // Install from repository only, no real NGen - } OptimizationScenario; - - typedef enum - { - ScenarioEmitFixups = 0x00010000, // Emit fixups for Vulcan - ScenarioProfileInfo = 0x00020000 // Generate a PE section with profile ranges data - } PrivateOptimizationScenario; - - typedef struct _SvcWorkerPriority - { - DWORD dwPriorityClass; - } SvcWorkerPriority; - - [ - object, - oleautomation, - uuid(d1047bc2-67c0-400c-a94c-e64446a67fbe), - pointer_default(unique), - ] - interface ICorSvcWorker : IUnknown - { - HRESULT SetPriority( - [in] SvcWorkerPriority priority - ); - - HRESULT OptimizeAssembly( - [in] BSTR pAssemblyName, - [in] BSTR pApplicationName, - [in] OptimizationScenario scenario, - [in] SAFEARRAY(BSTR) loadAlwaysList, - [in] SAFEARRAY(BSTR) loadSometimesList, - [in] SAFEARRAY(BSTR) loadNeverList, - [out] BSTR *pNativeImageIdentity - ); - - HRESULT DeleteNativeImage( - [in] BSTR pAssemblyName, - [in] BSTR pNativeImage - ); - - HRESULT DisplayNativeImages( - [in] BSTR pAssemblyName - ); - - HRESULT GetCorSvcDependencies( - [in] BSTR pApplicationName, - [in] OptimizationScenario scenario, - [out] ICorSvcDependencies **pCorSvcDependencies - ); - - HRESULT Stop( - ); - } - - [ - object, - oleautomation, - uuid(f3358a7d-0061-4776-880e-a2f21b9ef93e), - pointer_default(unique), - ] - interface ICorSvcWorker2 : ICorSvcWorker { - // Create a PDB for the NGEN image that was generated for pAssemblyName - // when compiled with the given appbase and scenario. - HRESULT CreatePdb([in] BSTR pAssemblyName, - [in] BSTR pAppBaseOrConfig, - [in] OptimizationScenario scenario, - [in] BSTR pNativeImagePath, - [in] BSTR pPdbPath); - }; - - [ - object, - oleautomation, - uuid(DC516615-47BE-477e-8B55-C5ABE0D76B8F), - pointer_default(unique), - ] - interface ICorSvcWorker3 : ICorSvcWorker2 { - // Create a PDB for the NGEN image that was generated for pAssemblyName - // when compiled with the given appbase and scenario. Optionally include - // source lines information in the geneated PDB - HRESULT CreatePdb2([in] BSTR pAssemblyName, - [in] BSTR pAppBaseOrConfig, - [in] OptimizationScenario scenario, - [in] BSTR pNativeImagePath, - [in] BSTR pPdbPath, - [in] BOOL pdbLines, - [in] BSTR managedPdbSearchPath); - }; - - //***************************************************************************** - // ICorSvcSetPrivateAttributes sets private attributes that are used just for - // the initial compilation - //*****************************************************************************[ - - typedef enum - { - DbgTypePdb = 0x00000001, // Generate a pdb for the NGen image - } NGenPrivateAttributesFlags; - - typedef struct _NGenPrivateAttributes - { - DWORD Flags; - DWORD ZapStats; - BSTR DbgDir; - } NGenPrivateAttributes; - - [ - object, - oleautomation, - uuid(b18e0b40-c089-4350-8328-066c668bccc2), - pointer_default(unique), - ] - interface ICorSvcSetPrivateAttributes : IUnknown - { - HRESULT SetNGenPrivateAttributes( - [in] NGenPrivateAttributes ngenPrivateAttributes - ); - - } - - //***************************************************************************** - // ICorSvcRepository controls native images repository - //*****************************************************************************[ - - typedef enum - { - RepositoryDefault = 0x0, // default settings - MoveFromRepository = 0x1, // move the native images from repository - CopyToRepository = 0x2, // copy the generated native images to repository - IgnoreRepository = 0x4, // Do not use the repository - } RepositoryFlags; - - [ - object, - oleautomation, - uuid(d5346658-b5fd-4353-9647-07ad4783d5a0), - pointer_default(unique), - ] - interface ICorSvcRepository : IUnknown - { - HRESULT SetRepository( - [in] BSTR pRepositoryDir, - [in] RepositoryFlags repositoryFlags - ); - - } - - //***************************************************************************** - // ICorSvcLogger is used to log various messages to the service process - //*****************************************************************************[ - - typedef enum CorSvcLogLevel - { - LogLevel_Error, - LogLevel_Warning, - LogLevel_Success, - LogLevel_Info - } CorSvcLogLevel; - - [ - object, - oleautomation, - uuid(d189ff1a-e266-4f13-9637-4b9522279ffc), - pointer_default(unique), - ] - interface ICorSvcLogger : IUnknown - { - HRESULT Log( - [in] CorSvcLogLevel logLevel, - [in] BSTR message - ); - } - - //***************************************************************************** - // ICorSvcPooledWorker is used to determine whether a worker process can be - // reused - //*****************************************************************************[ - - [ - object, - oleautomation, - uuid(0631e7e2-6046-4fde-8b6d-a09b64fda6f3), - pointer_default(unique), - ] - interface ICorSvcPooledWorker : IUnknown - { - HRESULT CanReuseProcess( - [in] OptimizationScenario scenario, - [in] ICorSvcLogger *pCorSvcLogger, - [out] BOOL *pCanContinue - ); - } - - - //***************************************************************************** - // ICorSvcBindToWorker is used to bind to a specific runtime version. - //*****************************************************************************[ - - - [ - object, - oleautomation, - uuid(5c6fb596-4828-4ed5-b9dd-293dad736fb5), - pointer_default(unique), - ] - interface ICorSvcBindToWorker : IUnknown - { - HRESULT BindToRuntimeWorker( - [in] BSTR pRuntimeVersion, - [in] DWORD ParentProcessID, - [in] BSTR pInterruptEventName, - [in] ICorSvcLogger *pCorSvcLogger, - [out] ICorSvcWorker **pCorSvcWorker - ); - } - -#ifndef IN_MSCOREE -} - -typedef enum -{ - Service_NoAction = -1 , - Service_Start = 0x0, // start service - Service_Stop = 0x1, // Stop service - Service_Pause = 0x2, // pause service - Service_Continue = 0x3, // continue a paused service - Service_Interrogate = 0x4, // continue a paused service - Service_StartPaused = 0x5, // pause service. start and pause if it's stopped -} ControlServiceAction; - -// Haven't seen a better way of doing this. Everybody seems to be duplicating -// into IDLs (for example wtypes.idl) -typedef struct _COR_SERVICE_STATUS -{ - WCHAR sServiceName[64]; - DWORD dwServiceType; - DWORD dwCurrentState; - DWORD dwControlsAccepted; - DWORD dwWin32ExitCode; - DWORD dwServiceSpecificExitCode; - DWORD dwCheckPoint; - DWORD dwWaitHint; -} COR_SERVICE_STATUS, *LPCOR_SERVICE_STATUS; - -/* -------------------------------------------------------------------------- * - * ICorSvc is implemented by the service dispatcher and contains APIs - * for installing/uninstalling/starting/stopping the native image service, - * as well as marshaling logic that provides the ICorOptSvcManager interface. - * -------------------------------------------------------------------------- */ -typedef struct _ServiceOptions -{ - BOOL RunAsWindowsService; - BOOL RunAsPrivateRuntime; - BOOL StartPaused; -} ServiceOptions; - - -[ - object, - uuid(3eef5ff0-3680-4f20-8a8f-9051aca66b22), - pointer_default(unique), -] -interface ICorSvc : IUnknown -{ - HRESULT GetServiceManagerInterface( - [in] IUnknown **pIUnknown - ); - - HRESULT InstallService( - ); - - HRESULT UninstallService( - ); - - HRESULT ControlService( - [in] ControlServiceAction Action, - [out] LPCOR_SERVICE_STATUS lpServiceStatus - ); - - HRESULT RunService( - [in] ServiceOptions options - ); -} - -[ - object, - uuid(01c10030-6c81-4671-bd51-14b184c673b2), - pointer_default(unique), -] -interface ICompileProgressNotification : IUnknown -{ - // Notify the installer that compilation has started, and give it an - // estimation of how long it will take. - HRESULT CompileStarted( - [in] DWORD cAssembliesToCompile, - [in] DWORD cTimeEstimate - ); - - // Notify the installer that one more assembly has been compiled. The - // installer can return E_ABORT from ProgressNotification if it wants to - // abort the compilation. - HRESULT ProgressNotification( - [in] DWORD cAssembly, - [in] BSTR pAssemblyName, - [in] BOOL isStartNotification, // if TRUE: we're starting to compile, if FALSE, we finished - [in] HRESULT hrResult, - [in] BSTR errorExplanation, - [in] DWORD cTimeRemainingEstimate - ); - - -} - -/* - * Ndp v4 interface that provides a threadID in notification messages - */ -[ - object, - uuid(98E5BDE2-E9A0-4ADE-9CB2-6CD06FDB1A85), - pointer_default(unique), -] -interface ICompileProgressNotification2 : IUnknown -{ - // Notify the installer that compilation has started, and give it an - // estimation of how long it will take. - HRESULT CompileStarted( - [in] DWORD cAssembliesToCompile, - [in] DWORD cTimeEstimate, - [in] DWORD threadID - ); - - // Notify the installer that one more assembly has been compiled. The - // installer can return E_ABORT from ProgressNotification if it wants to - // abort the compilation. - HRESULT ProgressNotification( - [in] DWORD cAssembly, - [in] BSTR pAssemblyName, - [in] BOOL isStartNotification, // if TRUE: we're starting to compile, if FALSE, we finished - [in] HRESULT hrResult, - [in] BSTR errorExplanation, - [in] DWORD cTimeRemainingEstimate, - [in] DWORD threadID - ); - - -} - -typedef enum -{ - DefaultOptimizeFlags = 0x0, // default settings - TolerateCompilationFailures = 0x1, // continue after encoutering compilation failures - OptimizeNGenQueueOnly = 0x2 // only take work items from the NGen Queue -} OptimizeFlags; - - -[ - object, - uuid(0523feee-eb0e-4857-b2aa-db787521d077), - pointer_default(unique), -] -interface ICorSvcInstaller : IUnknown -{ - HRESULT Install( - [in] BSTR path - ); - - HRESULT Uninstall( - [in] BSTR path - ); - - HRESULT Optimize( - [in] ICompileProgressNotification *pCompileProgressNotification, - [in] OptimizeFlags optimizeFlags - ); - - HRESULT SetLogger( - [in] ICorSvcLogger *pCorSvcLogger - ); -} - -typedef enum -{ - DefaultFlags = 0x0, // default settings - AllowPartialNames = 0x1, // input path allows partial names - KeepPriority = 0x2, // keep priority after ngen completes - NoRoot = 0x4, // Do not persist NGen root (automatically initiated NGen) -} GeneralFlags; - -typedef enum -{ - Priority_None = -1, - Priority_0 = 0x0, // NGen offline queue. Do not use for anything else - Priority_1 = 0x1, - Priority_2 = 0x2, - Priority_3 = 0x3, // If you add or remove priorities, update Priority_Lowest - - Priority_Default = Priority_3, - Priority_Lowest = Priority_3, - Priority_LowestAggressive = Priority_2, // The lowest priority for which assemblies are compiled aggressively - Priority_Highest = Priority_0, - Priority_Highest_Root = Priority_1, - Priority_Lowest_Root = Priority_3 -} PriorityLevel; - - -/* -------------------------------------------------------------------------- * - * ICorSvcAdvancedInstaller is implemented by the service manager and - * used by installers with custom install requirements - * such as special scenarios or hosting requirements). - * -------------------------------------------------------------------------- */ - -[ - object, - uuid(0871fb80-3ea0-47cc-9b51-d92e2aee75db), - pointer_default(unique), -] -interface ICorSvcAdvancedInstaller : IUnknown -{ - HRESULT Install( - [in] BSTR path, - [in] OptimizationScenario optScenario, - [in] BSTR config, - [in] GeneralFlags generalFlags, - [in] PriorityLevel priorityLevel - ); - - HRESULT Uninstall( - [in] BSTR path, - [in] OptimizationScenario optScenario, - [in] BSTR config, - [in] GeneralFlags generalFlags - ); -} - - -/* -------------------------------------------------------------------------- * - * ICorSvcOptimizer is implemented by the service manager and is called - * by installers and other tools to repair the native image caches. - * -------------------------------------------------------------------------- */ - -typedef enum -{ - UpdateDefault = 0x0, // no hints about the scope of the update - Force = 0x1, // force generation of new native images - PostReboot = 0x2 // Update must happen after reboot -} UpdateFlags; - - -[ - object, - uuid(94af0ec4-c10d-45d4-a625-d68d1b02a396), - pointer_default(unique), -] -interface ICorSvcOptimizer : IUnknown -{ - // Optimize the native image for a given application or assembly (will regenerate - // native images that are out of date) - HRESULT Update( - [in] BSTR path, - [in] UpdateFlags updateFlags, - [in] GeneralFlags generalFlags - ); - - HRESULT Display( - [in] BSTR path, - [in] GeneralFlags generalFlags - ); - - HRESULT ScheduleWork( - [in] PriorityLevel priorityLevel - ); -} - -[ - object, - uuid(ee3b09c2-0110-4b6e-a73f-a3d6562f98ab), - pointer_default(unique) -] -interface ICorSvcOptimizer2 : ICorSvcOptimizer { - // generate a PDB for the given native image - HRESULT CreatePdb([in] BSTR nativeImagePath, [in] BSTR pdbPath); -} - -[ - object, - uuid(6EED164F-61EE-4a07-ABE8-670F92B4B7A9), - pointer_default(unique) -] -interface ICorSvcOptimizer3 : ICorSvcOptimizer2 { - // generate a PDB for the given native image, optionally including source lines info - HRESULT CreatePdb2([in] BSTR nativeImagePath, [in] BSTR pdbPath, [in] BOOL pdbLines, [in] BSTR managedPdbSearchPath); -} - -typedef enum -{ - NewWorkAvailable = 0x0, // Notify the service that there is new work to do. - ClientWorkStart = 0x1, // Notify the service that there is client starting to do work. - ClientWorkDone = 0x2, // Notify the service that the client is done doing work. - UpdatePostReboot = 0x3, // Notify the service that it should do an 'ngen update' after reboot - NewWorkAvailableWithDelay = 0x4, // Like NewWorkAvailable, but service should wait a while before working -} ServiceNotification; - - -/* -------------------------------------------------------------------------- * - * ICorSvcManager is implemented by the service manager and used by - * the service controller in balancing the need to generate native images - * with the desire to not interfere with the usage of the computer. - * -------------------------------------------------------------------------- */ -[ - object, - uuid(8f416a48-d663-4a7e-9732-fbca3fc46ea8), - pointer_default(unique), -] -interface ICorSvcManager : IUnknown -{ - // Schedule work only for selected priority level - HRESULT ScheduleWorkForSinglePriorityLevel( - [in] PriorityLevel priorityLevel, - [in] BSTR pInterruptEventName, - [out] BOOL* pWorkScheduled - ); - - // Do scheduled work - HRESULT Optimize( - [in] DWORD dwWorkerPriorityClass, - [in] ICompileProgressNotification *pCompileProgressNotification, - [in] BSTR pInterruptEventName - ); - - // Notify the service of new work - HRESULT NotifyService(ServiceNotification notification); - - HRESULT IsWorkAvailable ([in] PriorityLevel priorityLevel, - [out] BOOL* pWorkAvailable); - - HRESULT Update( - [in] UpdateFlags updateFlags, - [in] BSTR pInterruptEventName - ); - - HRESULT SetSvcLogger( - [in] ICorSvcLogger *pCorSvcLogger - ); -} - -[ - object, - uuid(29626056-8031-441b-affa-7a82480058b3), - pointer_default(unique), -] -interface ICorSvcManager2 : IUnknown -{ - HRESULT SetRuntimeVersion(BSTR version); - - HRESULT SetPackageMoniker(BSTR moniker); - - HRESULT SetLocalAppData(BSTR directory); -} - -[ - object, - uuid(35e5d609-ec3d-4fc2-9ba2-5f99e42ff42f), - pointer_default(unique), -] -interface ICorSvcSetLegacyServiceBehavior : IUnknown -{ - HRESULT SetLegacyServiceBehavior(); -} - -[ - object, - uuid(115466A4-7005-4CA3-971F-01F0A2C8EF09), - pointer_default(unique), -] -interface ICorSvcSetTaskBootTriggerState : IUnknown -{ - HRESULT SetTaskBootTriggerState(BOOL bEnabled); -} - -[ - object, - uuid(261DD1E3-F07E-4B8D-B54E-F26889413626), - pointer_default(unique), -] -interface ICorSvcSetTaskDelayStartTriggerState : IUnknown -{ - HRESULT SetTaskDelayStartTriggerState(BOOL bEnabled); -} - -#endif // IN_MSCOREE diff --git a/src/shared/inc/new.hpp b/src/shared/inc/new.hpp deleted file mode 100644 index 09eec5d1ff..0000000000 --- a/src/shared/inc/new.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// - -#ifndef __new__hpp -#define __new__hpp - -#if defined(_MSC_VER) && _MSC_VER < 1900 -#define NOEXCEPT -#else -#define NOEXCEPT noexcept -#endif - -struct NoThrow { int x; }; -extern const NoThrow nothrow; - -void * __cdecl operator new(size_t n, const NoThrow&) NOEXCEPT; -void * __cdecl operator new[](size_t n, const NoThrow&) NOEXCEPT; - -#ifdef _DEBUG -void DisableThrowCheck(); -#endif - -#endif diff --git a/src/shared/inc/nibblemapmacros.h b/src/shared/inc/nibblemapmacros.h index 9554b5d1dd..b9da5b39f2 100644 --- a/src/shared/inc/nibblemapmacros.h +++ b/src/shared/inc/nibblemapmacros.h @@ -26,7 +26,6 @@ #if defined(HOST_64BIT) // TODO: bump up the windows CODE_ALIGN to 16 and iron out any nibble map bugs that exist. -// TODO: there is something wrong with USE_INDIRECT_CODEHEADER with CODE_ALIGN=16 # define CODE_ALIGN 4 # define LOG2_CODE_ALIGN 2 #else diff --git a/src/shared/inc/nsutilpriv.h b/src/shared/inc/nsutilpriv.h index 5ea9d0eba2..238b34618b 100644 --- a/src/shared/inc/nsutilpriv.h +++ b/src/shared/inc/nsutilpriv.h @@ -208,8 +208,6 @@ void MakeNestedTypeName( // throws on out of memory #define ASSEMBLY_SEPARATOR_STR ", " #define ASSEMBLY_SEPARATOR_WSTR W(", ") #define ASSEMBLY_SEPARATOR_LEN 2 -#define BACKSLASH_CHAR '\\' -#define BACKSLASH_WCHAR W('\\') #define NESTED_SEPARATOR_CHAR '+' #define NESTED_SEPARATOR_WCHAR W('+') #define NESTED_SEPARATOR_STR "+" diff --git a/src/shared/inc/ostype.h b/src/shared/inc/ostype.h index 78494c71c2..58a8f726d5 100644 --- a/src/shared/inc/ostype.h +++ b/src/shared/inc/ostype.h @@ -14,12 +14,9 @@ //***************************************************************************** // Enum to track which version of the OS we are running -// Note that NT5 (Win2k) is the minimum supported platform. Any code using +// Note that Win7 is the minimum supported platform. Any code using // utilcode (which includes the CLR's execution engine) will fail to start -// on a pre-Win2k platform. This is enforced by InitRunningOnVersionStatus. -// -// Note: The value is used for data mining from links clicked by user in shim dialog - see code:FWLinkTemplateFromTextID -// Please do not modify existing values, adding new ones is fine. +// on a pre-Win7 platform. This is enforced by InitRunningOnVersionStatus. //***************************************************************************** typedef enum { RUNNING_ON_STATUS_UNINITED = 0, diff --git a/src/shared/inc/palclr.h b/src/shared/inc/palclr.h index 2ab9c62c3e..98321ba87f 100644 --- a/src/shared/inc/palclr.h +++ b/src/shared/inc/palclr.h @@ -481,6 +481,8 @@ #define PAL_CPP_THROW(type, obj) do { SCAN_THROW_MARKER; throw obj; } while (false) #define PAL_CPP_RETHROW do { SCAN_THROW_MARKER; throw; } while (false) #define PAL_CPP_CATCH_DERIVED(type, obj) catch (type * obj) +#define PAL_CPP_CATCH_NON_DERIVED(type, obj) catch (type obj) +#define PAL_CPP_CATCH_NON_DERIVED_NOARG(type) catch (type) #define PAL_CPP_CATCH_ALL catch (...) #define PAL_CPP_CATCH_EXCEPTION_NOARG catch (Exception *) @@ -606,4 +608,8 @@ #include "palclr_win.h" +#ifndef IMAGE_FILE_MACHINE_LOONGARCH64 +#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264 // LOONGARCH64. +#endif + #endif // defined(HOST_WINDOWS) diff --git a/src/shared/inc/palclr_win.h b/src/shared/inc/palclr_win.h index a9ee78e32f..be0b725e1a 100644 --- a/src/shared/inc/palclr_win.h +++ b/src/shared/inc/palclr_win.h @@ -140,8 +140,4 @@ typedef HMODULE NATIVE_LIBRARY_HANDLE; #endif // HOST_WINDOWS -#ifndef FALLTHROUGH -#define FALLTHROUGH __fallthrough -#endif // FALLTHROUGH - #endif // __PALCLR_WIN_H__ diff --git a/src/shared/inc/pedecoder.h b/src/shared/inc/pedecoder.h index 769c0b0116..057dfa9a25 100644 --- a/src/shared/inc/pedecoder.h +++ b/src/shared/inc/pedecoder.h @@ -37,6 +37,8 @@ #include "cor.h" #include "corhdr.h" +#include "corcompile.h" + #include "readytorun.h" typedef DPTR(struct READYTORUN_CORE_HEADER) PTR_READYTORUN_CORE_HEADER; typedef DPTR(struct READYTORUN_HEADER) PTR_READYTORUN_HEADER; @@ -58,7 +60,7 @@ class Module; typedef DWORD RVA; #ifdef _MSC_VER -// Wrapper to suppress ambigous overload problems with MSVC. +// Wrapper to suppress ambiguous overload problems with MSVC. inline CHECK CheckOverflow(RVA value1, COUNT_T value2) { WRAPPER_NO_CONTRACT; @@ -79,6 +81,10 @@ inline CHECK CheckOverflow(RVA value1, COUNT_T value2) #define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_ARMNT #elif defined(TARGET_ARM64) #define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_ARM64 +#elif defined(TARGET_LOONGARCH64) +#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_LOONGARCH64 +#elif defined(TARGET_POWERPC64) +#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_POWERPC #elif defined(TARGET_S390X) #define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_UNKNOWN #elif defined(TARGET_RISCV64) @@ -173,8 +179,6 @@ class PEDecoder DWORD GetCheckSum() const; WORD GetMachine() const; WORD GetCharacteristics() const; - DWORD GetFileAlignment() const; - DWORD GetSectionAlignment() const; SIZE_T GetSizeOfStackReserve() const; SIZE_T GetSizeOfStackCommit() const; SIZE_T GetSizeOfHeapReserve() const; @@ -305,8 +309,6 @@ class PEDecoder BOOL HasReadyToRunHeader() const; READYTORUN_HEADER *GetReadyToRunHeader() const; - void GetEXEStackSizes(SIZE_T *PE_SizeOfStackReserve, SIZE_T *PE_SizeOfStackCommit) const; - // Native DLLMain Entrypoint BOOL HasNativeEntryPoint() const; void *GetNativeEntryPoint() const; @@ -314,6 +316,12 @@ class PEDecoder // Look up a named symbol in the export directory PTR_VOID GetExport(LPCSTR exportName) const; +#ifdef _DEBUG + // Stress mode for relocations + static BOOL GetForceRelocs(); + static BOOL ForceRelocForDLL(LPCWSTR lpFileName); +#endif + #ifdef DACCESS_COMPILE void EnumMemoryRegions(CLRDataEnumMemoryFlags flags, bool enumThis); #endif @@ -324,7 +332,7 @@ class PEDecoder // Protected API for subclass use // ------------------------------------------------------------ - // Checking utilites + // Checking utilities static CHECK CheckBounds(RVA rangeBase, COUNT_T rangeSize, RVA rva); static CHECK CheckBounds(RVA rangeBase, COUNT_T rangeSize, RVA rva, COUNT_T size); diff --git a/src/shared/inc/pedecoder.inl b/src/shared/inc/pedecoder.inl index 44339248cb..7257bd9a78 100644 --- a/src/shared/inc/pedecoder.inl +++ b/src/shared/inc/pedecoder.inl @@ -200,9 +200,9 @@ inline void PEDecoder::Reset() GC_NOTRIGGER; } CONTRACTL_END; - m_base=NULL; - m_flags=NULL; - m_size=NULL; + m_base=(TADDR)0; + m_flags=0; + m_size=0; m_pNTHeaders=NULL; m_pCorHeader=NULL; m_pReadyToRunHeader=NULL; @@ -383,36 +383,6 @@ inline DWORD PEDecoder::GetCheckSum() const return VAL32(FindNTHeaders()->OptionalHeader.CheckSum); } -inline DWORD PEDecoder::GetFileAlignment() const -{ - CONTRACTL - { - INSTANCE_CHECK; - PRECONDITION(CheckNTHeaders()); - NOTHROW; - GC_NOTRIGGER; - } - CONTRACTL_END; - - //even though some data in OptionalHeader is different for 32 and 64, this field is the same - return VAL32(FindNTHeaders()->OptionalHeader.FileAlignment); -} - -inline DWORD PEDecoder::GetSectionAlignment() const -{ - CONTRACTL - { - INSTANCE_CHECK; - PRECONDITION(CheckNTHeaders()); - NOTHROW; - GC_NOTRIGGER; - } - CONTRACTL_END; - - //even though some data in OptionalHeader is different for 32 and 64, this field is the same - return VAL32(FindNTHeaders()->OptionalHeader.SectionAlignment); -} - inline WORD PEDecoder::GetMachine() const { CONTRACTL @@ -441,42 +411,6 @@ inline WORD PEDecoder::GetCharacteristics() const return VAL16(FindNTHeaders()->FileHeader.Characteristics); } -inline SIZE_T PEDecoder::GetSizeOfStackReserve() const -{ - CONTRACTL - { - INSTANCE_CHECK; - PRECONDITION(CheckNTHeaders()); - NOTHROW; - GC_NOTRIGGER; - } - CONTRACTL_END; - - if (Has32BitNTHeaders()) - return (SIZE_T) VAL32(GetNTHeaders32()->OptionalHeader.SizeOfStackReserve); - else - return (SIZE_T) VAL64(GetNTHeaders64()->OptionalHeader.SizeOfStackReserve); -} - - -inline SIZE_T PEDecoder::GetSizeOfStackCommit() const -{ - CONTRACTL - { - INSTANCE_CHECK; - PRECONDITION(CheckNTHeaders()); - NOTHROW; - GC_NOTRIGGER; - } - CONTRACTL_END; - - if (Has32BitNTHeaders()) - return (SIZE_T) VAL32(GetNTHeaders32()->OptionalHeader.SizeOfStackCommit); - else - return (SIZE_T) VAL64(GetNTHeaders64()->OptionalHeader.SizeOfStackCommit); -} - - inline SIZE_T PEDecoder::GetSizeOfHeapReserve() const { CONTRACTL @@ -964,7 +898,7 @@ inline PTR_IMAGE_SECTION_HEADER PEDecoder::FindFirstSection(IMAGE_NT_HEADERS * p return dac_cast( dac_cast(pNTHeaders) + - FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader) + + offsetof(IMAGE_NT_HEADERS, OptionalHeader) + VAL16(pNTHeaders->FileHeader.SizeOfOptionalHeader)); } diff --git a/src/shared/inc/random.h b/src/shared/inc/random.h index 0bd2164cbb..6a8d7001b2 100644 --- a/src/shared/inc/random.h +++ b/src/shared/inc/random.h @@ -13,10 +13,7 @@ // 2) It can have multiple instantiations with different seeds // 3) It behaves the same regardless of whether we build with VC++ or GCC // -// If you are working in the VM, we have a convenience method: code:GetRandomInt. This usess a thread-local -// Random instance if a Thread object is available, and otherwise falls back to a global instance -// with a spin-lock. -// +// If you are working in the VM, we have a convenience method: code:GetRandomInt. #ifndef _CLRRANDOM_H_ #define _CLRRANDOM_H_ @@ -27,7 +24,7 @@ // Forbid the use of srand()/rand(), as these are globally shared facilities and our use of them would // interfere with native user code in the same process. This override is not compatible with stl headers. // -#if !defined(DO_NOT_DISABLE_RAND) && !defined(USE_STL) +#if !defined(DO_NOT_DISABLE_RAND) #ifdef srand #undef srand @@ -39,7 +36,7 @@ #endif #define rand Do_not_use_rand -#endif //!DO_NOT_DISABLE_RAND && !USE_STL +#endif //!DO_NOT_DISABLE_RAND class CLRRandom diff --git a/src/shared/inc/readytorun.h b/src/shared/inc/readytorun.h index 25bd45d376..d13c660993 100644 --- a/src/shared/inc/readytorun.h +++ b/src/shared/inc/readytorun.h @@ -14,11 +14,15 @@ #define READYTORUN_SIGNATURE 0x00525452 // 'RTR' -// Keep these in sync with src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs -#define READYTORUN_MAJOR_VERSION 0x0006 -#define READYTORUN_MINOR_VERSION 0x0000 +// Keep these in sync with +// src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs +// src/coreclr/nativeaot/Runtime/inc/ModuleHeaders.h +// If you update this, ensure you run `git grep MINIMUM_READYTORUN_MAJOR_VERSION` +// and handle pending work. +#define READYTORUN_MAJOR_VERSION 10 +#define READYTORUN_MINOR_VERSION 0x0001 -#define MINIMUM_READYTORUN_MAJOR_VERSION 0x006 +#define MINIMUM_READYTORUN_MAJOR_VERSION 10 // R2R Version 2.1 adds the InliningInfo section // R2R Version 2.2 adds the ProfileDataInfo section @@ -26,6 +30,14 @@ // R2R 3.0 is not backward compatible with 2.x. // R2R Version 6.0 changes managed layout for sequential types with any unmanaged non-blittable fields. // R2R 6.0 is not backward compatible with 5.x or earlier. +// R2R Version 8.0 Changes the alignment of the Int128 type +// R2R Version 9.0 adds support for the Vector512 type +// R2R Version 9.1 adds new helpers to allocate objects on frozen segments +// R2R Version 9.2 adds MemZero and NativeMemSet helpers +// R2R Version 9.3 adds BulkWriteBarrier helper +// uses GCInfo v3, which makes safe points in partially interruptible code interruptible. +// R2R Version 10.0 adds support for the statics being allocated on a per type basis instead of on a per module basis +// R2R Version 10.1 adds Unbox_TypeTest helper struct READYTORUN_CORE_HEADER { @@ -60,6 +72,8 @@ enum ReadyToRunFlag READYTORUN_FLAG_NONSHARED_PINVOKE_STUBS = 0x00000008, // PInvoke stubs compiled into image are non-shareable (no secret parameter) READYTORUN_FLAG_EMBEDDED_MSIL = 0x00000010, // MSIL is embedded in the composite R2R executable READYTORUN_FLAG_COMPONENT = 0x00000020, // This is the header describing a component assembly of composite R2R + READYTORUN_FLAG_MULTIMODULE_VERSION_BUBBLE = 0x00000040, // This R2R module has multiple modules within its version bubble (For versions before version 6.2, all modules are assumed to possibly have this characteristic) + READYTORUN_FLAG_UNRELATED_R2R_CODE = 0x00000080, // This R2R module has code in it that would not be naturally encoded into this module }; enum class ReadyToRunSectionType : uint32_t @@ -83,6 +97,11 @@ enum class ReadyToRunSectionType : uint32_t OwnerCompositeExecutable = 116, // Added in V4.1 PgoInstrumentationData = 117, // Added in V5.2 ManifestAssemblyMvids = 118, // Added in V5.3 + CrossModuleInlineInfo = 119, // Added in V6.2 + HotColdMap = 120, // Added in V8.0 + MethodIsGenericMap = 121, // Added in V9.0 + EnclosingTypeMap = 122, // Added in V9.0 + TypeGenericInfoMap = 123, // Added in V9.0 // If you add a new section consider whether it is a breaking or non-breaking change. // Usually it is non-breaking, but if it is preferable to have older runtimes fail @@ -97,6 +116,43 @@ struct READYTORUN_SECTION IMAGE_DATA_DIRECTORY Section; }; +enum class ReadyToRunImportSectionType : uint8_t +{ + Unknown = 0, + StubDispatch = 2, + StringHandle = 3, + ILBodyFixups = 7, +}; + +enum class ReadyToRunImportSectionFlags : uint16_t +{ + None = 0x0000, + Eager = 0x0001, // Section at module load time. + PCode = 0x0004, // Section contains pointers to code +}; + +// All values in this enum should within a nibble (4 bits). +enum class ReadyToRunTypeGenericInfo : uint8_t +{ + GenericCountMask = 0x3, + HasConstraints = 0x4, + HasVariance = 0x8, +}; + +// All values in this enum should fit within 2 bits. +enum class ReadyToRunGenericInfoGenericCount : uint32_t +{ + Zero = 0, + One = 1, + Two = 2, + MoreThanTwo = 3 +}; + +enum class ReadyToRunEnclosingTypeMap +{ + MaxTypeCount = 0xFFFE +}; + // // READYTORUN_IMPORT_SECTION describes image range with references to code or runtime data structures // @@ -105,22 +161,12 @@ struct READYTORUN_SECTION // struct READYTORUN_IMPORT_SECTION { - IMAGE_DATA_DIRECTORY Section; // Section containing values to be fixed up - USHORT Flags; // One or more of ReadyToRunImportSectionFlags - BYTE Type; // One of ReadyToRunImportSectionType - BYTE EntrySize; - DWORD Signatures; // RVA of optional signature descriptors - DWORD AuxiliaryData; // RVA of optional auxiliary data (typically GC info) -}; - -enum ReadyToRunImportSectionType -{ - READYTORUN_IMPORT_SECTION_TYPE_UNKNOWN = 0, -}; - -enum ReadyToRunImportSectionFlags -{ - READYTORUN_IMPORT_SECTION_FLAGS_EAGER = 0x0001, + IMAGE_DATA_DIRECTORY Section; // Section containing values to be fixed up + ReadyToRunImportSectionFlags Flags; // One or more of ReadyToRunImportSectionFlags + ReadyToRunImportSectionType Type; // One of ReadyToRunImportSectionType + BYTE EntrySize; + DWORD Signatures; // RVA of optional signature descriptors + DWORD AuxiliaryData; // RVA of optional auxiliary data (typically GC info) }; // @@ -141,7 +187,6 @@ enum ReadyToRunMethodSigFlags enum ReadyToRunFieldSigFlags { - READYTORUN_FIELD_SIG_IndexInsteadOfToken = 0x08, READYTORUN_FIELD_SIG_MemberRefToken = 0x10, READYTORUN_FIELD_SIG_OwnerType = 0x40, }; @@ -158,7 +203,17 @@ enum ReadyToRunTypeLayoutFlags enum ReadyToRunVirtualFunctionOverrideFlags { READYTORUN_VIRTUAL_OVERRIDE_None = 0x00, - READYTORUN_VIRTUAL_OVERRIDE_VirtualFunctionOverriden = 0x01, + READYTORUN_VIRTUAL_OVERRIDE_VirtualFunctionOverridden = 0x01, +}; + +enum class ReadyToRunCrossModuleInlineFlags : uint32_t +{ + CrossModuleInlinee = 0x1, + HasCrossModuleInliners = 0x2, + CrossModuleInlinerIndexShift = 2, + + InlinerRidHasModule = 0x1, + InlinerRidShift = 1, }; // @@ -223,6 +278,9 @@ enum ReadyToRunFixupKind READYTORUN_FIXUP_Check_VirtualFunctionOverride = 0x33, /* Generate a runtime check to ensure that virtual function resolution has equivalent behavior at runtime as at compile time. If not equivalent, code will not be used */ READYTORUN_FIXUP_Verify_VirtualFunctionOverride = 0x34, /* Generate a runtime check to ensure that virtual function resolution has equivalent behavior at runtime as at compile time. If not equivalent, generate runtime failure. */ + + READYTORUN_FIXUP_Check_IL_Body = 0x35, /* Check to see if an IL method is defined the same at runtime as at compile time. A failed match will cause code not to be used. */ + READYTORUN_FIXUP_Verify_IL_Body = 0x36, /* Verify an IL body is defined the same at compile time and runtime. A failed match will cause a hard runtime failure. */ }; // @@ -266,12 +324,15 @@ enum ReadyToRunHelper READYTORUN_HELPER_WriteBarrier = 0x30, READYTORUN_HELPER_CheckedWriteBarrier = 0x31, READYTORUN_HELPER_ByRefWriteBarrier = 0x32, + READYTORUN_HELPER_BulkWriteBarrier = 0x33, // Array helpers READYTORUN_HELPER_Stelem_Ref = 0x38, READYTORUN_HELPER_Ldelema_Ref = 0x39, - READYTORUN_HELPER_MemSet = 0x40, + READYTORUN_HELPER_MemZero = 0x3E, + READYTORUN_HELPER_MemSet = 0x3F, + READYTORUN_HELPER_NativeMemSet = 0x40, READYTORUN_HELPER_MemCpy = 0x41, // PInvoke helpers @@ -297,6 +358,7 @@ enum ReadyToRunHelper READYTORUN_HELPER_Unbox = 0x5A, READYTORUN_HELPER_Unbox_Nullable = 0x5B, READYTORUN_HELPER_NewMultiDimArr = 0x5C, + READYTORUN_HELPER_Unbox_TypeTest = 0x5D, // Helpers used with generic handle lookup cases READYTORUN_HELPER_NewObject = 0x60, @@ -308,6 +370,9 @@ enum ReadyToRunHelper READYTORUN_HELPER_GenericGcTlsBase = 0x66, READYTORUN_HELPER_GenericNonGcTlsBase = 0x67, READYTORUN_HELPER_VirtualFuncPtr = 0x68, + READYTORUN_HELPER_IsInstanceOfException = 0x69, + READYTORUN_HELPER_NewMaybeFrozenArray = 0x6A, + READYTORUN_HELPER_NewMaybeFrozenObject = 0x6B, // Long mul/div/shift ops READYTORUN_HELPER_LMul = 0xC0, @@ -342,11 +407,13 @@ enum ReadyToRunHelper // Floating point ops READYTORUN_HELPER_DblRem = 0xE0, READYTORUN_HELPER_FltRem = 0xE1, + + // Unused since READYTORUN_MAJOR_VERSION 10.0 READYTORUN_HELPER_DblRound = 0xE2, READYTORUN_HELPER_FltRound = 0xE3, #ifdef FEATURE_EH_FUNCLETS - // Personality rountines + // Personality routines READYTORUN_HELPER_PersonalityRoutine = 0xF0, READYTORUN_HELPER_PersonalityRoutineFilterFunclet = 0xF1, #endif diff --git a/src/shared/inc/readytoruninstructionset.h b/src/shared/inc/readytoruninstructionset.h index 1b66c6e520..4ad8c6b4e5 100644 --- a/src/shared/inc/readytoruninstructionset.h +++ b/src/shared/inc/readytoruninstructionset.h @@ -34,6 +34,27 @@ enum ReadyToRunInstructionSet READYTORUN_INSTRUCTION_Dp=23, READYTORUN_INSTRUCTION_Rdm=24, READYTORUN_INSTRUCTION_AvxVnni=25, + READYTORUN_INSTRUCTION_Rcpc=26, + READYTORUN_INSTRUCTION_Movbe=27, + READYTORUN_INSTRUCTION_X86Serialize=28, + READYTORUN_INSTRUCTION_Avx512F=29, + READYTORUN_INSTRUCTION_Avx512F_VL=30, + READYTORUN_INSTRUCTION_Avx512BW=31, + READYTORUN_INSTRUCTION_Avx512BW_VL=32, + READYTORUN_INSTRUCTION_Avx512CD=33, + READYTORUN_INSTRUCTION_Avx512CD_VL=34, + READYTORUN_INSTRUCTION_Avx512DQ=35, + READYTORUN_INSTRUCTION_Avx512DQ_VL=36, + READYTORUN_INSTRUCTION_Avx512Vbmi=37, + READYTORUN_INSTRUCTION_Avx512Vbmi_VL=38, + READYTORUN_INSTRUCTION_VectorT128=39, + READYTORUN_INSTRUCTION_VectorT256=40, + READYTORUN_INSTRUCTION_VectorT512=41, + READYTORUN_INSTRUCTION_Rcpc2=42, + READYTORUN_INSTRUCTION_Sve=43, + READYTORUN_INSTRUCTION_Avx10v1=44, + READYTORUN_INSTRUCTION_Avx10v1_V512=46, + READYTORUN_INSTRUCTION_EVEX=47, }; diff --git a/src/shared/inc/regdisp.h b/src/shared/inc/regdisp.h index 02e67dbdd4..b4431c3519 100644 --- a/src/shared/inc/regdisp.h +++ b/src/shared/inc/regdisp.h @@ -44,7 +44,11 @@ struct REGDISPLAY_BASE { #endif // DEBUG_REGDISPLAY TADDR SP; - TADDR ControlPC; + TADDR ControlPC; // LOONGARCH: use RA for PC + +#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) + TADDR SSP; +#endif }; inline PCODE GetControlPC(const REGDISPLAY_BASE *pRD) { @@ -131,6 +135,12 @@ inline LPVOID GetRegdisplayFPAddress(REGDISPLAY *display) { return (LPVOID)display->GetEbpLocation(); } +inline void SetRegdisplayPCTAddr(REGDISPLAY *display, TADDR addr) +{ + display->PCTAddr = addr; + display->ControlPC = *PTR_PCODE(addr); +} + // This function tells us if the given stack pointer is in one of the frames of the functions called by the given frame inline BOOL IsInCalleesFrames(REGDISPLAY *display, LPVOID stackPointer) { @@ -185,6 +195,31 @@ typedef struct _Arm64VolatileContextPointer } Arm64VolatileContextPointer; #endif //TARGET_ARM64 +#if defined(TARGET_LOONGARCH64) +typedef struct _LoongArch64VolatileContextPointer +{ + PDWORD64 R0; + PDWORD64 A0; + PDWORD64 A1; + PDWORD64 A2; + PDWORD64 A3; + PDWORD64 A4; + PDWORD64 A5; + PDWORD64 A6; + PDWORD64 A7; + PDWORD64 T0; + PDWORD64 T1; + PDWORD64 T2; + PDWORD64 T3; + PDWORD64 T4; + PDWORD64 T5; + PDWORD64 T6; + PDWORD64 T7; + PDWORD64 T8; + PDWORD64 X0; +} LoongArch64VolatileContextPointer; +#endif + #if defined(TARGET_RISCV64) typedef struct _RiscV64VolatileContextPointer { @@ -212,6 +247,10 @@ struct REGDISPLAY : public REGDISPLAY_BASE { Arm64VolatileContextPointer volatileCurrContextPointers; #endif +#ifdef TARGET_LOONGARCH64 + LoongArch64VolatileContextPointer volatileCurrContextPointers; +#endif + #ifdef TARGET_RISCV64 RiscV64VolatileContextPointer volatileCurrContextPointers; #endif @@ -226,12 +265,12 @@ struct REGDISPLAY : public REGDISPLAY_BASE { inline TADDR GetRegdisplayFP(REGDISPLAY *display) { LIMITED_METHOD_CONTRACT; - return NULL; + return 0; } inline TADDR GetRegdisplayFPAddress(REGDISPLAY *display) { LIMITED_METHOD_CONTRACT; - return NULL; + return 0; } // This function tells us if the given stack pointer is in one of the frames of the functions called by the given frame @@ -248,7 +287,7 @@ inline TADDR GetRegdisplayStackMark(REGDISPLAY *display) _ASSERTE(GetRegdisplaySP(display) == GetSP(display->pCurrentContext)); return GetRegdisplaySP(display); -#elif defined(TARGET_ARM64) +#elif defined(TARGET_ARM64) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64) _ASSERTE(display->IsCallerContextValid); return GetSP(display->pCallerContext); @@ -289,7 +328,7 @@ struct REGDISPLAY : public REGDISPLAY_BASE { memset(this, 0, sizeof(REGDISPLAY)); // Setup the pointer to ControlPC field - pPC = &ControlPC; + pPC = (DWORD *)&ControlPC; } }; @@ -324,6 +363,8 @@ inline LPVOID GetRegdisplayReturnValue(REGDISPLAY *display) return (LPVOID)((TADDR)display->pCurrentContext->R0); #elif defined(TARGET_X86) return (LPVOID)display->pCurrentContext->Eax; +#elif defined(TARGET_LOONGARCH64) + return (LPVOID)display->pCurrentContext->A0; #elif defined(TARGET_RISCV64) return (LPVOID)display->pCurrentContext->A0; #else @@ -370,7 +411,20 @@ inline void FillContextPointers(PT_KNONVOLATILE_CONTEXT_POINTERS pCtxPtrs, PT_CO { *(&pCtxPtrs->X19 + i) = (&pCtx->X19 + i); } -#elif defined(TARGET_ARM) // TARGET_ARM64 +#elif defined(TARGET_LOONGARCH64) // TARGET_ARM64 + *(&pCtxPtrs->S0) = &pCtx->S0; + *(&pCtxPtrs->S1) = &pCtx->S1; + *(&pCtxPtrs->S2) = &pCtx->S2; + *(&pCtxPtrs->S3) = &pCtx->S3; + *(&pCtxPtrs->S4) = &pCtx->S4; + *(&pCtxPtrs->S5) = &pCtx->S5; + *(&pCtxPtrs->S6) = &pCtx->S6; + *(&pCtxPtrs->S7) = &pCtx->S7; + *(&pCtxPtrs->S8) = &pCtx->S8; + *(&pCtxPtrs->Tp) = &pCtx->Tp; + *(&pCtxPtrs->Fp) = &pCtx->Fp; + *(&pCtxPtrs->Ra) = &pCtx->Ra; +#elif defined(TARGET_ARM) // TARGET_LOONGARCH64 // Copy over the nonvolatile integer registers (R4-R11) for (int i = 0; i < 8; i++) { @@ -403,7 +457,7 @@ inline void FillContextPointers(PT_KNONVOLATILE_CONTEXT_POINTERS pCtxPtrs, PT_CO } #endif // FEATURE_EH_FUNCLETS -inline void FillRegDisplay(const PREGDISPLAY pRD, PT_CONTEXT pctx, PT_CONTEXT pCallerCtx = NULL) +inline void FillRegDisplay(const PREGDISPLAY pRD, PT_CONTEXT pctx, PT_CONTEXT pCallerCtx = NULL, bool fLightUnwind = false) { WRAPPER_NO_CONTRACT; @@ -453,6 +507,22 @@ inline void FillRegDisplay(const PREGDISPLAY pRD, PT_CONTEXT pctx, PT_CONTEXT pC pRD->IsCallerSPValid = TRUE; // Don't add usage of this field. This is only temporary. } +#ifdef DEBUG_REGDISPLAY + pRD->_pThread = NULL; +#endif // DEBUG_REGDISPLAY + + // This will setup the PC and SP + SyncRegDisplayToCurrentContext(pRD); + +#if !defined(DACCESS_COMPILE) +#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS) + pRD->SSP = GetSSP(pctx); +#endif +#endif // !DACCESS_COMPILE + + if (fLightUnwind) + return; + FillContextPointers(&pRD->ctxPtrsOne, pctx); #if defined(TARGET_ARM) @@ -469,7 +539,26 @@ inline void FillRegDisplay(const PREGDISPLAY pRD, PT_CONTEXT pctx, PT_CONTEXT pC // Fill volatile context pointers. They can be used by GC in the case of the leaf frame for (int i=0; i < 18; i++) pRD->volatileCurrContextPointers.X[i] = &pctx->X[i]; -#elif defined(TARGET_RISCV64) // TARGET_ARM64 +#elif defined(TARGET_LOONGARCH64) // TARGET_ARM64 + pRD->volatileCurrContextPointers.A0 = &pctx->A0; + pRD->volatileCurrContextPointers.A1 = &pctx->A1; + pRD->volatileCurrContextPointers.A2 = &pctx->A2; + pRD->volatileCurrContextPointers.A3 = &pctx->A3; + pRD->volatileCurrContextPointers.A4 = &pctx->A4; + pRD->volatileCurrContextPointers.A5 = &pctx->A5; + pRD->volatileCurrContextPointers.A6 = &pctx->A6; + pRD->volatileCurrContextPointers.A7 = &pctx->A7; + pRD->volatileCurrContextPointers.T0 = &pctx->T0; + pRD->volatileCurrContextPointers.T1 = &pctx->T1; + pRD->volatileCurrContextPointers.T2 = &pctx->T2; + pRD->volatileCurrContextPointers.T3 = &pctx->T3; + pRD->volatileCurrContextPointers.T4 = &pctx->T4; + pRD->volatileCurrContextPointers.T5 = &pctx->T5; + pRD->volatileCurrContextPointers.T6 = &pctx->T6; + pRD->volatileCurrContextPointers.T7 = &pctx->T7; + pRD->volatileCurrContextPointers.T8 = &pctx->T8; + pRD->volatileCurrContextPointers.X0 = &pctx->X0; +#elif defined(TARGET_RISCV64) // TARGET_LOONGARCH64 pRD->volatileCurrContextPointers.A0 = &pctx->A0; pRD->volatileCurrContextPointers.A1 = &pctx->A1; pRD->volatileCurrContextPointers.A2 = &pctx->A2; @@ -487,12 +576,6 @@ inline void FillRegDisplay(const PREGDISPLAY pRD, PT_CONTEXT pctx, PT_CONTEXT pC pRD->volatileCurrContextPointers.T6 = &pctx->T6; #endif // TARGET_RISCV64 -#ifdef DEBUG_REGDISPLAY - pRD->_pThread = NULL; -#endif // DEBUG_REGDISPLAY - - // This will setup the PC and SP - SyncRegDisplayToCurrentContext(pRD); #endif // !FEATURE_EH_FUNCLETS } @@ -558,13 +641,16 @@ inline size_t * getRegAddr (unsigned regNum, PTR_CONTEXT regs) return (PTR_size_t)(PTR_BYTE(regs) + OFFSET_OF_REGISTERS[regNum]); #elif defined(TARGET_AMD64) _ASSERTE(regNum < 16); - return ®s->Rax + regNum; + return (size_t *)®s->Rax + regNum; #elif defined(TARGET_ARM) _ASSERTE(regNum < 16); return (size_t *)®s->R0 + regNum; #elif defined(TARGET_ARM64) _ASSERTE(regNum < 31); return (size_t *)®s->X0 + regNum; +#elif defined(TARGET_LOONGARCH64) + _ASSERTE(regNum < 32); + return (size_t *)®s->R0 + regNum; #elif defined(TARGET_RISCV64) _ASSERTE(regNum < 32); return (size_t *)®s->R0 + regNum; diff --git a/src/shared/inc/registrywrapper.h b/src/shared/inc/registrywrapper.h deleted file mode 100644 index 8504d9f820..0000000000 --- a/src/shared/inc/registrywrapper.h +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** -// File: registrywrapper.h -// -// Wrapper around Win32 Registry Functions allowing redirection of .NET -// Framework root registry location -// -//***************************************************************************** -#ifndef __REGISTRYWRAPPER_H -#define __REGISTRYWRAPPER_H - - -#define ClrRegCreateKeyEx RegCreateKeyExW -#define ClrRegOpenKeyEx RegOpenKeyExW -#define IsNgenOffline() false - - -#endif // __REGISTRYWRAPPER_H diff --git a/src/shared/inc/safemath.h b/src/shared/inc/safemath.h index 3c020de688..e40e267984 100644 --- a/src/shared/inc/safemath.h +++ b/src/shared/inc/safemath.h @@ -31,11 +31,11 @@ #include "static_assert.h" -#ifdef PAL_STDCPP_COMPAT #include -#else -#include "clr_std/type_traits" -#endif + +#ifdef FEATURE_PAL +#include "pal_mstypes.h" +#endif // FEATURE_PAL //================================================================== // Semantics: if val can be represented as the exact same value @@ -159,7 +159,7 @@ inline bool DoubleFitsInIntType(double val) // Modified to track an overflow bit instead of throwing exceptions. In most // cases the Visual C++ optimizer (Whidbey beta1 - v14.00.40607) is able to // optimize the bool away completely. -// Note that using a sentinal value (IntMax for example) to represent overflow +// Note that using a sentinel value (IntMax for example) to represent overflow // actually results in poorer code-gen. // // This has also been simplified significantly to remove functionality we @@ -485,100 +485,14 @@ template class ClrSafeInt { if(Is64Bit()) { - //fast track this one - and avoid DIV_0 below - if(lhs == 0 || rhs == 0) - { - result = 0; - return true; - } - //we're 64 bit - slow, but the only way to do it if(IsSigned()) { - if(!IsMixedSign(lhs, rhs)) - { - //both positive or both negative - //result will be positive, check for lhs * rhs > MaxInt - if(lhs > 0) - { - //both positive - if(MaxInt()/lhs < rhs) - { - //overflow - return false; - } - } - else - { - //both negative - - //comparison gets tricky unless we force it to positive - //EXCEPT that -MinInt is undefined - can't be done - //And MinInt always has a greater magnitude than MaxInt - if(lhs == MinInt() || rhs == MinInt()) - { - //overflow - return false; - } - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning( disable : 4146 ) // unary minus applied to unsigned is still unsigned -#endif - if(MaxInt()/(-lhs) < (-rhs) ) - { - //overflow - return false; - } -#ifdef _MSC_VER -#pragma warning(pop) -#endif - } - } - else - { - //mixed sign - this case is difficult - //test case is lhs * rhs < MinInt => overflow - //if lhs < 0 (implies rhs > 0), - //lhs < MinInt/rhs is the correct test - //else if lhs > 0 - //rhs < MinInt/lhs is the correct test - //avoid dividing MinInt by a negative number, - //because MinInt/-1 is a corner case - - if(lhs < 0) - { - if(lhs < MinInt()/rhs) - { - //overflow - return false; - } - } - else - { - if(rhs < MinInt()/lhs) - { - //overflow - return false; - } - } - } - - //ok - result = lhs * rhs; - return true; + return ClrSafeInt::multiply((int64_t)lhs, (int64_t)rhs, (int64_t&)result); } else { - //unsigned, easy case - if(MaxInt()/lhs < rhs) - { - //overflow - return false; - } - //ok - result = lhs * rhs; - return true; + return ClrSafeInt::multiply((uint64_t)lhs, (uint64_t)rhs, (uint64_t&)result); } } else if(Is32Bit()) @@ -586,32 +500,11 @@ template class ClrSafeInt //we're 32-bit if(IsSigned()) { - INT64 tmp = (INT64)lhs * (INT64)rhs; - - //upper 33 bits must be the same - //most common case is likely that both are positive - test first - if( (tmp & 0xffffffff80000000LL) == 0 || - (tmp & 0xffffffff80000000LL) == 0xffffffff80000000LL) - { - //this is OK - result = (T)tmp; - return true; - } - - //overflow - return false; - + return ClrSafeInt::multiply((int32_t)lhs, (int32_t)rhs, (int32_t&)result); } else { - UINT64 tmp = (UINT64)lhs * (UINT64)rhs; - if (tmp & 0xffffffff00000000ULL) //overflow - { - //overflow - return false; - } - result = (T)tmp; - return true; + return ClrSafeInt::multiply((uint32_t)lhs, (uint32_t)rhs, (uint32_t&)result); } } else if(Is16Bit()) @@ -619,59 +512,23 @@ template class ClrSafeInt //16-bit if(IsSigned()) { - INT32 tmp = (INT32)lhs * (INT32)rhs; - //upper 17 bits must be the same - //most common case is likely that both are positive - test first - if( (tmp & 0xffff8000) == 0 || (tmp & 0xffff8000) == 0xffff8000) - { - //this is OK - result = (T)tmp; - return true; - } - - //overflow - return false; + return ClrSafeInt::multiply((int16_t)lhs, (int16_t)rhs, (int16_t&)result); } else { - UINT32 tmp = (UINT32)lhs * (UINT32)rhs; - if (tmp & 0xffff0000) //overflow - { - return false; - } - result = (T)tmp; - return true; + return ClrSafeInt::multiply((uint16_t)lhs, (uint16_t)rhs, (uint16_t&)result); } } else //8-bit { _ASSERTE_SAFEMATH(Is8Bit()); - if(IsSigned()) { - INT16 tmp = (INT16)lhs * (INT16)rhs; - //upper 9 bits must be the same - //most common case is likely that both are positive - test first - if( (tmp & 0xff80) == 0 || (tmp & 0xff80) == 0xff80) - { - //this is OK - result = (T)tmp; - return true; - } - - //overflow - return false; + return ClrSafeInt::multiply((int8_t)lhs, (int8_t)rhs, (int8_t&)result); } else { - UINT16 tmp = ((UINT16)lhs) * ((UINT16)rhs); - - if (tmp & 0xff00) //overflow - { - return false; - } - result = (T)tmp; - return true; + return ClrSafeInt::multiply((uint8_t)lhs, (uint8_t)rhs, (uint8_t&)result); } } } @@ -831,6 +688,192 @@ template class ClrSafeInt INDEBUG( mutable bool m_checkedOverflow; ) }; +template <> +inline bool ClrSafeInt::multiply(int64_t lhs, int64_t rhs, int64_t &result) +{ + //fast track this one - and avoid DIV_0 below + if(lhs == 0 || rhs == 0) + { + result = 0; + return true; + } + if(!IsMixedSign(lhs, rhs)) + { + //both positive or both negative + //result will be positive, check for lhs * rhs > MaxInt + if(lhs > 0) + { + //both positive + if(MaxInt()/lhs < rhs) + { + //overflow + return false; + } + } + else + { + //both negative + + //comparison gets tricky unless we force it to positive + //EXCEPT that -MinInt is undefined - can't be done + //And MinInt always has a greater magnitude than MaxInt + if(lhs == MinInt() || rhs == MinInt()) + { + //overflow + return false; + } + if(MaxInt()/(-lhs) < (-rhs) ) + { + //overflow + return false; + } + } + } + else + { + //mixed sign - this case is difficult + //test case is lhs * rhs < MinInt => overflow + //if lhs < 0 (implies rhs > 0), + //lhs < MinInt/rhs is the correct test + //else if lhs > 0 + //rhs < MinInt/lhs is the correct test + //avoid dividing MinInt by a negative number, + //because MinInt/-1 is a corner case + + if(lhs < 0) + { + if(lhs < MinInt()/rhs) + { + //overflow + return false; + } + } + else + { + if(rhs < MinInt()/lhs) + { + //overflow + return false; + } + } + } + + //ok + result = lhs * rhs; + return true; +} + +template <> +inline bool ClrSafeInt::multiply(uint64_t lhs, uint64_t rhs, uint64_t &result) +{ + //fast track this one - and avoid DIV_0 below + if(lhs == 0 || rhs == 0) + { + result = 0; + return true; + } + //unsigned, easy case + if(MaxInt()/lhs < rhs) + { + //overflow + return false; + } + //ok + result = lhs * rhs; + return true; +} + +template <> +inline bool ClrSafeInt::multiply(int32_t lhs, int32_t rhs, int32_t &result) +{ + INT64 tmp = (INT64)lhs * (INT64)rhs; + + //upper 33 bits must be the same + //most common case is likely that both are positive - test first + if( (tmp & 0xffffffff80000000LL) == 0 || + (tmp & 0xffffffff80000000LL) == 0xffffffff80000000LL) + { + //this is OK + result = (int32_t)tmp; + return true; + } + + //overflow + return false; +} + +template <> +inline bool ClrSafeInt::multiply(uint32_t lhs, uint32_t rhs, uint32_t &result) +{ + UINT64 tmp = (UINT64)lhs * (UINT64)rhs; + if (tmp & 0xffffffff00000000ULL) //overflow + { + //overflow + return false; + } + result = (uint32_t)tmp; + return true; +} + +template <> +inline bool ClrSafeInt::multiply(int16_t lhs, int16_t rhs, int16_t &result) +{ + INT32 tmp = (INT32)lhs * (INT32)rhs; + //upper 17 bits must be the same + //most common case is likely that both are positive - test first + if( (tmp & 0xffff8000) == 0 || (tmp & 0xffff8000) == 0xffff8000) + { + //this is OK + result = (int16_t)tmp; + return true; + } + + //overflow + return false; +} + +template <> +inline bool ClrSafeInt::multiply(uint16_t lhs, uint16_t rhs, uint16_t &result) +{ + UINT32 tmp = (UINT32)lhs * (UINT32)rhs; + if (tmp & 0xffff0000) //overflow + { + return false; + } + result = (uint16_t)tmp; + return true; +} + +template <> +inline bool ClrSafeInt::multiply(int8_t lhs, int8_t rhs, int8_t &result) +{ + INT16 tmp = (INT16)lhs * (INT16)rhs; + //upper 9 bits must be the same + //most common case is likely that both are positive - test first + if( (tmp & 0xff80) == 0 || (tmp & 0xff80) == 0xff80) + { + //this is OK + result = (int8_t)tmp; + return true; + } + + //overflow + return false; +} + +template <> +inline bool ClrSafeInt::multiply(uint8_t lhs, uint8_t rhs, uint8_t &result) +{ + UINT16 tmp = ((UINT16)lhs) * ((UINT16)rhs); + + if (tmp & 0xff00) //overflow + { + return false; + } + result = (uint8_t)tmp; + return true; +} + // Allows creation of a ClrSafeInt corresponding to the type of the argument. template ClrSafeInt AsClrSafeInt(T t) diff --git a/src/shared/inc/safewrap.h b/src/shared/inc/safewrap.h index c2f260a4b4..a23dafd78c 100644 --- a/src/shared/inc/safewrap.h +++ b/src/shared/inc/safewrap.h @@ -25,16 +25,14 @@ consistency's sake. Return non-oom failure codes because callees actually freqeuntly expect an API to fail. For example, the callee will have special handling for file-not-found. - For convenience, you could add a no-throwing wrapper version of the API: - ClrGetEnvironmentVariable <-- default throws on oom. - ClrGetEnvironmentVariableNoThrow <-- never throws. + For convenience, you could add a no-throwing wrapper version of the API. - NAMING: Prefix the name with 'Clr', just like we do for win32 APIs going through hosting. - DON'T FORGET CONTRACTS: Most of these APIs will likely be Throws/GC_Notrigger. Also use PRECONDITIONs + POSTCONDITIONS when possible. -- SIGNATURES: Keep the method signture as close the the original win32 API as possible. +- SIGNATURES: Keep the method signture as close the original win32 API as possible. - Preserve the return type + value. (except allow it to throw on oom). If the return value should be a holder, then use that as an out-parameter at the end of the argument list. We don't want to return holders because that will cause the dtors to be called. @@ -58,46 +56,6 @@ consistency's sake. #include "holder.h" -class SString; -bool ClrGetEnvironmentVariable(LPCSTR szEnvVarName, SString & value); -bool ClrGetEnvironmentVariableNoThrow(LPCSTR szEnvVarName, SString & value); -void ClrGetModuleFileName(HMODULE hModule, SString & value); - -void ClrGetCurrentDirectory(SString & value); - - -/* --------------------------------------------------------------------------- * - * Simple wrapper around WszFindFirstFile/WszFindNextFile - * --------------------------------------------------------------------------- */ -class ClrDirectoryEnumerator -{ - WIN32_FIND_DATAW data; - FindHandleHolder dirHandle; - BOOL fFindNext; // Skip FindNextFile first time around - -public: - ClrDirectoryEnumerator(LPCWSTR pBaseDirectory, LPCWSTR pMask = W("*")); - bool Next(); - - LPCWSTR GetFileName() - { - return data.cFileName; - } - - DWORD GetFileAttributes() - { - return data.dwFileAttributes; - } - - void Close() - { - dirHandle.Clear(); - } -}; - -// Read a REG_SZ (null-terminated string) value from the registry. Throws. -void ClrRegReadString(HKEY hKey, const SString & szValueName, SString & value); - /* --------------------------------------------------------------------------- * * Simple wrapper around RegisterEventSource/ReportEvent/DeregisterEventSource * --------------------------------------------------------------------------- */ diff --git a/src/shared/inc/sbuffer.h b/src/shared/inc/sbuffer.h index 05c75faa57..aa74369589 100644 --- a/src/shared/inc/sbuffer.h +++ b/src/shared/inc/sbuffer.h @@ -97,6 +97,7 @@ class SBuffer SBuffer(COUNT_T size); SBuffer(const BYTE *buffer, COUNT_T size); explicit SBuffer(const SBuffer &buffer); + SBuffer(SBuffer &&buffer); // Immutable constructor should ONLY be used if buffer will // NEVER BE FREED OR MODIFIED. PERIOD. . @@ -108,6 +109,10 @@ class SBuffer ~SBuffer(); + private: + void InitializeInstance(); + + public: void Clear(); void Set(const SBuffer &buffer); @@ -137,11 +142,11 @@ class SBuffer // Preallocate some memory you expect to use. This can prevent // multiple reallocations. Note this does not change the visible // size of the buffer. - void Preallocate(COUNT_T allocation) const; + void Preallocate(COUNT_T allocation); // Shrink memory usage of buffer to minimal amount. Note that // this does not change the visible size of the buffer. - void Trim() const; + void Trim(); //-------------------------------------------------------------------- // Content manipulation routines @@ -550,13 +555,6 @@ class EMPTY_BASES_DECL InlineSBuffer : public SBuffer #define GARBAGE_FILL_DWORD 0x24242424 // $$$$ #define GARBAGE_FILL_BUFFER_ITEMS 16 #define GARBAGE_FILL_BUFFER_SIZE GARBAGE_FILL_BUFFER_ITEMS*sizeof(DWORD) -// ================================================================================ -// StackSBuffer : SBuffer with relatively large preallocated buffer for stack use -// ================================================================================ - -#define STACK_ALLOC 256 - -typedef InlineSBuffer StackSBuffer; // ================================================================================ // Inline definitions diff --git a/src/shared/inc/sbuffer.inl b/src/shared/inc/sbuffer.inl index 3da80bcc77..402cda72f4 100644 --- a/src/shared/inc/sbuffer.inl +++ b/src/shared/inc/sbuffer.inl @@ -19,7 +19,7 @@ inline SBuffer::SBuffer(PreallocFlag flag, void *buffer, COUNT_T size) : m_size(0), - m_allocation(NULL), + m_allocation(0), m_flags(0), m_buffer(NULL) { @@ -114,6 +114,32 @@ inline SBuffer::SBuffer(const SBuffer &buffer) RETURN; } +inline SBuffer::SBuffer(SBuffer &&buffer) +{ + CONTRACT_VOID + { + CONSTRUCTOR_CHECK; + PRECONDITION(buffer.Check()); + POSTCONDITION(Check()); + THROWS; + GC_NOTRIGGER; + } + CONTRACT_END; + + m_size = buffer.m_size; + m_allocation = buffer.m_allocation; + m_flags = buffer.m_flags; + m_buffer = buffer.m_buffer; + +#ifdef _DEBUG + m_revision = buffer.m_revision; +#endif + + buffer.InitializeInstance(); + + RETURN; +} + inline SBuffer::SBuffer(const BYTE *buffer, COUNT_T size) : m_size(0), m_allocation(0), @@ -189,6 +215,18 @@ inline SBuffer::~SBuffer() RETURN; } +inline void SBuffer::InitializeInstance() +{ + m_size = 0; + m_allocation = 0; + m_flags = 0; + m_buffer = NULL; + +#ifdef _DEBUG + m_revision = 0; +#endif +} + inline void SBuffer::Set(const SBuffer &buffer) { CONTRACT_VOID @@ -258,7 +296,8 @@ inline void SBuffer::Set(const BYTE *buffer, COUNT_T size) // From the code for Resize, this is clearly impossible. PREFIX_ASSUME( (this->m_buffer != NULL) || (size == 0) ); - MoveMemory(m_buffer, buffer, size); + if (size != 0) + MoveMemory(m_buffer, buffer, size); RETURN; } @@ -343,7 +382,7 @@ inline COUNT_T SBuffer::GetAllocation() const RETURN m_allocation; } -inline void SBuffer::Preallocate(COUNT_T allocation) const +inline void SBuffer::Preallocate(COUNT_T allocation) { CONTRACT_VOID { @@ -357,12 +396,12 @@ inline void SBuffer::Preallocate(COUNT_T allocation) const CONTRACT_END; if (allocation > m_allocation) - const_cast(this)->ReallocateBuffer(allocation, PRESERVE); + ReallocateBuffer(allocation, PRESERVE); RETURN; } -inline void SBuffer::Trim() const +inline void SBuffer::Trim() { CONTRACT_VOID { @@ -373,7 +412,7 @@ inline void SBuffer::Trim() const CONTRACT_END; if (!IsImmutable()) - const_cast(this)->ReallocateBuffer(m_size, PRESERVE); + ReallocateBuffer(m_size, PRESERVE); RETURN; } @@ -907,7 +946,6 @@ static const UINT64 SBUFFER_CANARY_VALUE = UI64(0xD00BED00BED00BAA); #ifdef ALIGN_ACCESS static const int SBUFFER_ALIGNMENT = ALIGN_ACCESS; #else -// This is only 4 bytes on win98 and below static const int SBUFFER_ALIGNMENT = 4; #endif diff --git a/src/shared/inc/sigparser.h b/src/shared/inc/sigparser.h index e7fb503c6b..475cdf81ad 100644 --- a/src/shared/inc/sigparser.h +++ b/src/shared/inc/sigparser.h @@ -2,31 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. // // sigparser.h -// - -// #ifndef _H_SIGPARSER #define _H_SIGPARSER -#ifndef LIMITED_METHOD_DAC_CONTRACT -#define LIMITED_METHOD_DAC_CONTRACT ((void)0) -#endif -#ifndef LIMITED_METHOD_CONTRACT -#define LIMITED_METHOD_CONTRACT ((void)0) -#endif -#ifndef WRAPPER_NO_CONTRACT -#define WRAPPER_NO_CONTRACT ((void)0) -#endif -#ifndef SUPPORTS_DAC -#define SUPPORTS_DAC ((void)0) -#endif -#ifndef _ASSERT -#define _ASSERT _ASSERTE -#endif - +//#include "utilcode.h" #include "corhdr.h" - +//#include "corinfo.h" +//#include "corpriv.h" #include //--------------------------------------------------------------------------------------- @@ -42,34 +25,6 @@ #define STACK_GROWS_UP_ON_ARGS_WALK #endif -////////////////////////////////////////////////////////////////////////////// -// enum CorElementTypeZapSig defines some additional internal ELEMENT_TYPE's -// values that are only used by ZapSig signatures. -////////////////////////////////////////////////////////////////////////////// -typedef enum CorElementTypeZapSig -{ - // ZapSig encoding for ELEMENT_TYPE_VAR and ELEMENT_TYPE_MVAR. It is always followed - // by the RID of a GenericParam token, encoded as a compressed integer. - ELEMENT_TYPE_VAR_ZAPSIG = 0x3b, - - // UNUSED = 0x3c, - - // ZapSig encoding for native value types in IL stubs. IL stub signatures may contain - // ELEMENT_TYPE_INTERNAL followed by ParamTypeDesc with ELEMENT_TYPE_VALUETYPE element - // type. It acts like a modifier to the underlying structure making it look like its - // unmanaged view (size determined by unmanaged layout, blittable, no GC pointers). - // - // ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG is used when encoding such types to NGEN images. - // The signature looks like this: ET_NATIVE_VALUETYPE_ZAPSIG ET_VALUETYPE . - // See code:ZapSig.GetSignatureForTypeHandle and code:SigPointer.GetTypeHandleThrowing - // where the encoding/decoding takes place. - ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG = 0x3d, - - ELEMENT_TYPE_CANON_ZAPSIG = 0x3e, // zapsig encoding for System.__Canon - ELEMENT_TYPE_MODULE_ZAPSIG = 0x3f, // zapsig encoding for external module id# - -} CorElementTypeZapSig; - //------------------------------------------------------------------------ // Encapsulates how compressed integers and typeref tokens are encoded into // a bytestream. @@ -530,7 +485,7 @@ class SigParser } //------------------------------------------------------------------------ - // Is this at the Sentinal (the ... in a varargs signature) that marks + // Is this at the Sentinel (the ... in a varargs signature) that marks // the beginning of varguments that are not decared at the target bool AtSentinel() const @@ -758,7 +713,7 @@ class SigParser // the arguments. //------------------------------------------------------------------------ __checkReturn - HRESULT SkipMethodHeaderSignature(uint32_t *pcArgs); + HRESULT SkipMethodHeaderSignature(uint32_t *pcArgs, bool skipReturnType = true); //------------------------------------------------------------------------ // Skip a sub signature (as immediately follows an ELEMENT_TYPE_FNPTR). diff --git a/src/shared/inc/sospriv.idl b/src/shared/inc/sospriv.idl index 98cfa0afe9..141f597dcb 100644 --- a/src/shared/inc/sospriv.idl +++ b/src/shared/inc/sospriv.idl @@ -519,3 +519,46 @@ interface ISOSDacInterface14 : IUnknown HRESULT GetThreadStaticBaseAddress(CLRDATA_ADDRESS methodTable, CLRDATA_ADDRESS thread, CLRDATA_ADDRESS *nonGCStaticsAddress, CLRDATA_ADDRESS *GCStaticsAddress); HRESULT GetMethodTableInitializationFlags(CLRDATA_ADDRESS methodTable, MethodTableInitializationFlags *initializationStatus); } + +cpp_quote("#ifndef _SOS_MethodData") +cpp_quote("#define _SOS_MethodData") + +typedef struct _SOSMethodData +{ + // At least one of MethodDesc, Entrypoint, or Token/DefiningMethodTable/DefiningModule is guaranteed to be set. + // Multiple of them may be set as well + CLRDATA_ADDRESS MethodDesc; + + CLRDATA_ADDRESS Entrypoint; + + CLRDATA_ADDRESS DefininingMethodTable; // Useful for when the method is inherited from a parent type which is instantiated + CLRDATA_ADDRESS DefiningModule; + unsigned int Token; + + // Slot data, a given MethodDesc may be present in multiple slots for a single MethodTable + unsigned int Slot; // Will be set to 0xFFFFFFFF for EnC added methods +} SOSMethodData; + +cpp_quote("#endif //_SOS_MethodData") + +[ + object, + local, + uuid(3c0fe725-c324-4a4f-8100-d399588a662e) +] +interface ISOSMethodEnum : ISOSEnum +{ + HRESULT Next([in] unsigned int count, + [out, size_is(count), length_is(*pNeeded)] SOSMethodData handles[], + [out] unsigned int *pNeeded); +} + +[ + object, + local, + uuid(7ed81261-52a9-4a23-a358-c3313dea30a8) +] +interface ISOSDacInterface15 : IUnknown +{ + HRESULT GetMethodTableSlotEnumerator(CLRDATA_ADDRESS mt, ISOSMethodEnum **enumerator); +} diff --git a/src/shared/inc/sstring.h b/src/shared/inc/sstring.h index c2c3b9c7d2..1b58f299be 100644 --- a/src/shared/inc/sstring.h +++ b/src/shared/inc/sstring.h @@ -82,7 +82,6 @@ class EMPTY_BASES_DECL SString : private SBuffer REPRESENTATION_UNICODE = 0x04, // 100 REPRESENTATION_ASCII = 0x01, // 001 REPRESENTATION_UTF8 = 0x03, // 011 - REPRESENTATION_ANSI = 0x07, // 111 REPRESENTATION_VARIABLE_MASK = 0x02, REPRESENTATION_SINGLE_MASK = 0x01, @@ -105,16 +104,11 @@ class EMPTY_BASES_DECL SString : private SBuffer protected: class Index; - class UIndex; friend class Index; - friend class UIndex; public: - // UIterator is character-level assignable. - class UIterator; - // CIterators/Iterator'string must be modified by SString APIs. class CIterator; class Iterator; @@ -123,8 +117,7 @@ class EMPTY_BASES_DECL SString : private SBuffer enum tagUTF8Literal { Utf8Literal }; enum tagLiteral { Literal }; enum tagUTF8 { Utf8 }; - enum tagANSI { Ansi }; - enum tagASCII {Ascii }; + enum tagASCII { Ascii }; static void Startup(); static CHECK CheckStartup(); @@ -134,21 +127,20 @@ class EMPTY_BASES_DECL SString : private SBuffer SString(); explicit SString(const SString &s); + SString(SString&& string) = default; SString(const SString &s1, const SString &s2); SString(const SString &s1, const SString &s2, const SString &s3); SString(const SString &s1, const SString &s2, const SString &s3, const SString &s4); SString(const SString &s, const CIterator &i, COUNT_T length); SString(const SString &s, const CIterator &start, const CIterator &end); - SString(const WCHAR *string); + explicit SString(const WCHAR *string); SString(const WCHAR *string, COUNT_T count); SString(enum tagASCII dummyTag, const ASCII *string); SString(enum tagASCII dummyTag, const ASCII *string, COUNT_T count); SString(enum tagUTF8 dummytag, const UTF8 *string); SString(enum tagUTF8 dummytag, const UTF8 *string, COUNT_T count); - SString(enum tagANSI dummytag, const ANSI *string); - SString(enum tagANSI dummytag, const ANSI *string, COUNT_T count); - SString(WCHAR character); + explicit SString(WCHAR character); // NOTE: Literals MUST be read-only never-freed strings. SString(enum tagLiteral dummytag, const CHAR *literal); @@ -172,19 +164,18 @@ class EMPTY_BASES_DECL SString : private SBuffer void Set(const WCHAR *string); void SetASCII(const ASCII *string); void SetUTF8(const UTF8 *string); - void SetANSI(const ANSI *string); + void SetAndConvertToUTF8(const WCHAR* string); // Set this string to a copy of the first count chars of the given string void Set(const WCHAR *string, COUNT_T count); // Set this string to a prellocated copy of a given string. - // The caller is the owner of the bufffer and has to coordinate its lifetime. + // The caller is the owner of the buffer and has to coordinate its lifetime. void SetPreallocated(const WCHAR *string, COUNT_T count); void SetASCII(const ASCII *string, COUNT_T count); void SetUTF8(const UTF8 *string, COUNT_T count); - void SetANSI(const ANSI *string, COUNT_T count); // Set this string to the unicode character void Set(WCHAR character); @@ -192,7 +183,7 @@ class EMPTY_BASES_DECL SString : private SBuffer // Set this string to the UTF8 character void SetUTF8(CHAR character); - // This this string to the given literal. We share the mem and don't make a copy. + // Set this string to the given literal. We share the mem and don't make a copy. void SetLiteral(const CHAR *literal); void SetLiteral(const WCHAR *literal); @@ -202,7 +193,7 @@ class EMPTY_BASES_DECL SString : private SBuffer // Normalizes the string representation to unicode. This can be used to // make basic read-only operations non-failing. - void Normalize() const; + void Normalize(); // Return the number of characters in the string (excluding the terminating NULL). COUNT_T GetCount() const; @@ -311,10 +302,10 @@ class EMPTY_BASES_DECL SString : private SBuffer void Replace(const Iterator &i, COUNT_T length, const SString &s); // Make sure that string buffer has room to grow - void Preallocate(COUNT_T characters) const; + void Preallocate(COUNT_T characters); // Shrink buffer size as much as possible (reallocate if necessary.) - void Trim() const; + void Trim(); // ------------------------------------------------------------------ // Iterators: @@ -325,56 +316,9 @@ class EMPTY_BASES_DECL SString : private SBuffer // CIterator and Iterator are cheap to create, but allow only read-only // access to the string. // - // UIterator forces a unicode conversion, but allows - // assignment to individual string characters. They are also a bit more - // efficient once created. - - // ------------------------------------------------------------------ - // UIterator: - // ------------------------------------------------------------------ - - protected: - - class EMPTY_BASES_DECL UIndex : public SBuffer::Index - { - friend class SString; - friend class Indexer; - - protected: - - UIndex(); - UIndex(SString *string, SCOUNT_T index); - WCHAR &GetAt(SCOUNT_T delta) const; - void Skip(SCOUNT_T delta); - SCOUNT_T Subtract(const UIndex &i) const; - CHECK DoCheck(SCOUNT_T delta) const; - - WCHAR *GetUnicode() const; - }; - - public: - - class EMPTY_BASES_DECL UIterator : public UIndex, public Indexer - { - friend class SString; - - public: - UIterator() - { - } - - UIterator(SString *string, int index) - : UIndex(string, index) - { - } - }; - - UIterator BeginUnicode(); - UIterator EndUnicode(); - // For CIterator & Iterator, we try our best to iterate the string without // modifying it. (Currently, we do require an ASCII or Unicode string - // for simple WCHAR retrival, but you could imagine being more flexible + // for simple WCHAR retrieval, but you could imagine being more flexible // going forward - perhaps even supporting iterating multibyte encodings // directly.) // @@ -412,8 +356,8 @@ class EMPTY_BASES_DECL SString : private SBuffer const CHAR *GetASCII() const; public: - // Note these should supercede the Indexer versions - // since this class comes first in the inheritence list + // Note these should supersede the Indexer versions + // since this class comes first in the inheritance list WCHAR operator*() const; void operator->() const; WCHAR operator[](int index) const; @@ -527,38 +471,12 @@ class EMPTY_BASES_DECL SString : private SBuffer // Helper function to convert string in-place to lower-case (no allocation overhead for SString instance) static void LowerCase(__inout_z LPWSTR wszString); - // These routines will use the given scratch string if necessary - // to perform a conversion to the desired representation - - // Use a local declaration of InlineScratchBuffer or StackScratchBuffer for parameters of - // AbstractScratchBuffer. - class AbstractScratchBuffer; - - // These routines will use the given scratch buffer if necessary - // to perform a conversion to the desired representation. Note that - // the lifetime of the pointer return is limited by BOTH the - // scratch string and the source (this) string. - // - // Typical usage: - // - // SString *s = ...; - // { - // StackScratchBuffer buffer; - // const UTF8 *utf8 = s->GetUTF8(buffer); - // CallFoo(utf8); - // } - // // No more pointers to returned buffer allowed. - - const UTF8 *GetUTF8(AbstractScratchBuffer &scratch) const; - const UTF8 *GetUTF8(AbstractScratchBuffer &scratch, COUNT_T *pcbUtf8) const; - const ANSI *GetANSI(AbstractScratchBuffer &scratch) const; - - // Used when the representation is known, throws if the representation doesn't match - const UTF8 *GetUTF8NoConvert() const; + // You can always get a UTF8 string. This will force a conversion + // if necessary. + const UTF8 *GetUTF8() const; // Converts/copies into the given output string void ConvertToUnicode(SString &dest) const; - void ConvertToANSI(SString &dest) const; COUNT_T ConvertToUTF8(SString &dest) const; //------------------------------------------------------------------- @@ -575,7 +493,7 @@ class EMPTY_BASES_DECL SString : private SBuffer // example usage: // void GetName(SString & str) { - // char * p = str.OpenANSIBuffer(3); + // char * p = str.OpenUTF8Buffer(3); // strcpy(p, "Cat"); // str.CloseBuffer(); // } @@ -597,11 +515,13 @@ class EMPTY_BASES_DECL SString : private SBuffer // Open the raw buffer for writing countChars characters (not including the null). WCHAR *OpenUnicodeBuffer(COUNT_T maxCharCount); UTF8 *OpenUTF8Buffer(COUNT_T maxSingleCharCount); - ANSI *OpenANSIBuffer(COUNT_T maxSingleCharCount); - //Returns the unicode string, the caller is reponsible for lifetime of the string + //Returns the unicode string, the caller is responsible for lifetime of the string WCHAR *GetCopyOfUnicodeString(); + //Returns the UTF8 string, the caller is responsible for the lifetime of the string + UTF8 *GetCopyOfUTF8String(); + // Get the max size that can be passed to OpenUnicodeBuffer without causing allocations. COUNT_T GetUnicodeAllocation(); @@ -646,27 +566,14 @@ class EMPTY_BASES_DECL SString : private SBuffer // Utilities //--------------------------------------------------------------------- - // WARNING: The MBCS version of printf function are factory for globalization - // issues when used to format Unicode strings (%S). The Unicode versions are - // preferred in this case. void Printf(const CHAR *format, ...); void VPrintf(const CHAR *format, va_list args); - - void Printf(const WCHAR *format, ...); - void PPrintf(const WCHAR *format, ...); - void VPrintf(const WCHAR *format, va_list args); - - void PVPrintf(const WCHAR *format, va_list args); - void AppendPrintf(const CHAR *format, ...); void AppendVPrintf(const CHAR *format, va_list args); - void AppendPrintf(const WCHAR *format, ...); - void AppendVPrintf(const WCHAR *format, va_list args); - +public: BOOL LoadResource(CCompRC::ResourceCategory eCategory, int resourceID); HRESULT LoadResourceAndReturnHR(CCompRC::ResourceCategory eCategory, int resourceID); - HRESULT LoadResourceAndReturnHR(CCompRC* pResourceDLL, CCompRC::ResourceCategory eCategory, int resourceID); BOOL FormatMessage(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, const SString &arg1 = Empty(), const SString &arg2 = Empty(), const SString &arg3 = Empty(), const SString &arg4 = Empty(), @@ -685,11 +592,9 @@ class EMPTY_BASES_DECL SString : private SBuffer operator const WCHAR * () const { WRAPPER_NO_CONTRACT; return GetUnicode(); } - WCHAR operator[](int index) { WRAPPER_NO_CONTRACT; return Begin()[index]; } WCHAR operator[](int index) const { WRAPPER_NO_CONTRACT; return Begin()[index]; } SString &operator= (const SString &s) { WRAPPER_NO_CONTRACT; Set(s); return *this; } - SString &operator+= (const SString &s) { WRAPPER_NO_CONTRACT; Append(s); return *this; } // ------------------------------------------------------------------- // Check functions @@ -712,11 +617,11 @@ class EMPTY_BASES_DECL SString : private SBuffer #endif // CHECK_INVARIANTS // Helpers for CRT function equivalance. - static int __cdecl _stricmp(const CHAR *buffer1, const CHAR *buffer2); - static int __cdecl _strnicmp(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count); + static int _stricmp(const CHAR *buffer1, const CHAR *buffer2); + static int _strnicmp(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count); - static int __cdecl _wcsicmp(const WCHAR *buffer1, const WCHAR *buffer2); - static int __cdecl _wcsnicmp(const WCHAR *buffer1, const WCHAR *buffer2, COUNT_T count); + static int _wcsicmp(const WCHAR *buffer1, const WCHAR *buffer2); + static int _wcsnicmp(const WCHAR *buffer1, const WCHAR *buffer2, COUNT_T count); // C++ convenience overloads static int _tstricmp(const CHAR *buffer1, const CHAR *buffer2); @@ -776,7 +681,9 @@ class EMPTY_BASES_DECL SString : private SBuffer BOOL IsASCIIScanned() const; void SetASCIIScanned() const; void SetNormalized() const; +public: BOOL IsNormalized() const; +private: void ClearNormalized() const; void EnsureWritable() const; @@ -786,6 +693,7 @@ class EMPTY_BASES_DECL SString : private SBuffer void ConvertASCIIToUnicode(SString &dest) const; void ConvertToUnicode() const; void ConvertToUnicode(const CIterator &i) const; + void ConvertToUTF8() const; const SString &GetCompatibleString(const SString &s, SString &scratch) const; const SString &GetCompatibleString(const SString &s, SString &scratch, const CIterator &i) const; @@ -874,6 +782,13 @@ class EMPTY_BASES_DECL InlineSString : public SString Set(string, count); } + FORCEINLINE InlineSString(enum tagLiteral, const WCHAR *string) + : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE)) + { + WRAPPER_NO_CONTRACT; + Set(string); + } + FORCEINLINE InlineSString(enum tagASCII, const CHAR *string) : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE)) { @@ -902,20 +817,6 @@ class EMPTY_BASES_DECL InlineSString : public SString SetUTF8(string, count); } - FORCEINLINE InlineSString(enum tagANSI dummytag, const ANSI *string) - : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE)) - { - WRAPPER_NO_CONTRACT; - SetANSI(string); - } - - FORCEINLINE InlineSString(enum tagANSI dummytag, const ANSI *string, COUNT_T count) - : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE)) - { - WRAPPER_NO_CONTRACT; - SetANSI(string, count); - } - FORCEINLINE InlineSString(WCHAR character) : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE)) { @@ -973,36 +874,7 @@ typedef InlineSString<2 * 260> LongPathString; // s = SL("My literal String"); // ================================================================================ -#define SL(_literal) SString(SString::Literal, _literal) - -// ================================================================================ -// ScratchBuffer classes are used by the GetXXX() routines to allocate scratch space in. -// ================================================================================ - -class EMPTY_BASES_DECL SString::AbstractScratchBuffer : private SString -{ - protected: - // Do not use this class directly - use - // ScratchBuffer or StackScratchBuffer. - AbstractScratchBuffer(void *buffer, COUNT_T size); -}; - -template -class EMPTY_BASES_DECL ScratchBuffer : public SString::AbstractScratchBuffer -{ - private: - DAC_ALIGNAS(::SString::AbstractScratchBuffer) - BYTE m_inline[MEMSIZE]; - - public: - ScratchBuffer() - : AbstractScratchBuffer((void *)m_inline, MEMSIZE) - { - WRAPPER_NO_CONTRACT; - } -}; - -typedef ScratchBuffer<256> StackScratchBuffer; +#define SL(_literal) SString{ SString::Literal, _literal } // ================================================================================ // Special contract definition - THROWS_UNLESS_NORMALIZED diff --git a/src/shared/inc/sstring.inl b/src/shared/inc/sstring.inl index 03fc26fe96..0b78ec3bc3 100644 --- a/src/shared/inc/sstring.inl +++ b/src/shared/inc/sstring.inl @@ -231,6 +231,9 @@ inline SString::SString(const WCHAR *string) Set(string); + _ASSERTE(IsRepresentation(REPRESENTATION_UNICODE)); + SetNormalized(); + SS_RETURN; } @@ -249,6 +252,9 @@ inline SString::SString(const WCHAR *string, COUNT_T count) Set(string, count); + _ASSERTE(IsRepresentation(REPRESENTATION_UNICODE)); + SetNormalized(); + SS_RETURN; } @@ -327,41 +333,6 @@ inline SString::SString(tagUTF8 dummytag, const UTF8 *string, COUNT_T count) SS_RETURN; } -inline SString::SString(tagANSI dummytag, const ANSI *string) - : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer)) -{ - SS_CONTRACT_VOID - { - SS_CONSTRUCTOR_CHECK; - PRECONDITION(CheckPointer(string, NULL_OK)); - THROWS; - GC_NOTRIGGER; - } - SS_CONTRACT_END; - - SetANSI(string); - - SS_RETURN; -} - -inline SString::SString(tagANSI dummytag, const ANSI *string, COUNT_T count) - : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer)) -{ - SS_CONTRACT_VOID - { - SS_CONSTRUCTOR_CHECK; - PRECONDITION(CheckPointer(string, NULL_OK)); - PRECONDITION(CheckCount(count)); - THROWS; - GC_NOTRIGGER; - } - SS_CONTRACT_END; - - SetANSI(string, count); - - SS_RETURN; -} - inline SString::SString(WCHAR character) : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer)) { @@ -415,7 +386,7 @@ inline SString::SString(tagUTF8Literal dummytag, const UTF8 *literal) } inline SString::SString(tagLiteral dummytag, const WCHAR *literal) - : SBuffer(Immutable, (const BYTE *) literal, (COUNT_T) (wcslen(literal)+1)*sizeof(WCHAR)) + : SBuffer(Immutable, (const BYTE *) literal, (COUNT_T) (u16_strlen(literal)+1)*sizeof(WCHAR)) { SS_CONTRACT_VOID { @@ -651,8 +622,27 @@ inline const WCHAR *SString::GetUnicode() const SS_RETURN GetRawUnicode(); } +// Get a const pointer to the internal buffer as a UTF8 string. +inline const UTF8 *SString::GetUTF8() const +{ + SS_CONTRACT(const UTF8 *) + { + GC_NOTRIGGER; + PRECONDITION(CheckPointer(this)); + SS_POSTCONDITION(CheckPointer(RETVAL)); + if (IsRepresentation(REPRESENTATION_UTF8)) NOTHROW; else THROWS; + GC_NOTRIGGER; + SUPPORTS_DAC; + } + SS_CONTRACT_END; + + ConvertToUTF8(); + + SS_RETURN GetRawUTF8(); +} + // Normalize the string to unicode. This will make many operations nonfailing. -inline void SString::Normalize() const +inline void SString::Normalize() { SS_CONTRACT_VOID { @@ -800,7 +790,7 @@ inline void SString::AppendUTF8(const CHAR c) // Helpers for CRT function equivalance. /* static */ -inline int __cdecl SString::_stricmp(const CHAR *buffer1, const CHAR *buffer2) { +inline int SString::_stricmp(const CHAR *buffer1, const CHAR *buffer2) { WRAPPER_NO_CONTRACT; int returnValue = CaseCompareHelperA(buffer1, buffer2, 0, TRUE, FALSE); #ifdef VERIFY_CRT_EQUIVALNCE @@ -811,7 +801,7 @@ inline int __cdecl SString::_stricmp(const CHAR *buffer1, const CHAR *buffer2) { } /* static */ -inline int __cdecl SString::_strnicmp(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count) { +inline int SString::_strnicmp(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count) { WRAPPER_NO_CONTRACT; int returnValue = CaseCompareHelperA(buffer1, buffer2, count, TRUE, TRUE); #ifdef VERIFY_CRT_EQUIVALNCE @@ -821,7 +811,7 @@ inline int __cdecl SString::_strnicmp(const CHAR *buffer1, const CHAR *buffer2, } /* static */ -inline int __cdecl SString::_wcsicmp(const WCHAR *buffer1, const WCHAR *buffer2) { +inline int SString::_wcsicmp(const WCHAR *buffer1, const WCHAR *buffer2) { WRAPPER_NO_CONTRACT; int returnValue = CaseCompareHelper(buffer1, buffer2, 0, TRUE, FALSE); #ifdef VERIFY_CRT_EQUIVALNCE @@ -832,7 +822,7 @@ inline int __cdecl SString::_wcsicmp(const WCHAR *buffer1, const WCHAR *buffer2) } /* static */ -inline int __cdecl SString::_wcsnicmp(const WCHAR *buffer1, const WCHAR *buffer2, COUNT_T count) { +inline int SString::_wcsnicmp(const WCHAR *buffer1, const WCHAR *buffer2, COUNT_T count) { WRAPPER_NO_CONTRACT; int returnValue = CaseCompareHelper(buffer1, buffer2, count, TRUE, TRUE); #ifdef VERIFY_CRT_EQUIVALNCE @@ -1113,7 +1103,7 @@ inline void SString::Delete(const Iterator &i, COUNT_T length) } // Preallocate some space for the string buffer -inline void SString::Preallocate(COUNT_T characters) const +inline void SString::Preallocate(COUNT_T characters) { WRAPPER_NO_CONTRACT; @@ -1122,14 +1112,14 @@ inline void SString::Preallocate(COUNT_T characters) const } // Trim unused space from the buffer -inline void SString::Trim() const +inline void SString::Trim() { WRAPPER_NO_CONTRACT; if (GetRawCount() == 0) { // Share the global empty string buffer. - const_cast(this)->SBuffer::SetImmutable(s_EmptyBuffer, sizeof(s_EmptyBuffer)); + SBuffer::SetImmutable(s_EmptyBuffer, sizeof(s_EmptyBuffer)); } else { @@ -1504,7 +1494,7 @@ inline COUNT_T SString::GetBufferSizeInCharIncludeNullChar() const //---------------------------------------------------------------------------- // Assert helper -// Asser that the iterator is within the given string. +// Assert that the iterator is within the given string. //---------------------------------------------------------------------------- inline CHECK SString::CheckIteratorRange(const CIterator &i) const { @@ -1516,7 +1506,7 @@ inline CHECK SString::CheckIteratorRange(const CIterator &i) const //---------------------------------------------------------------------------- // Assert helper -// Asser that the iterator is within the given string. +// Assert that the iterator is within the given string. //---------------------------------------------------------------------------- inline CHECK SString::CheckIteratorRange(const CIterator &i, COUNT_T length) const { @@ -1555,8 +1545,7 @@ inline CHECK SString::CheckRepresentation(int representation) CHECK(representation == REPRESENTATION_EMPTY || representation == REPRESENTATION_UNICODE || representation == REPRESENTATION_ASCII - || representation == REPRESENTATION_UTF8 - || representation == REPRESENTATION_ANSI); + || representation == REPRESENTATION_UTF8); CHECK((representation & REPRESENTATION_MASK) == representation); CHECK_OK; @@ -1666,28 +1655,25 @@ inline WCHAR *SString::GetCopyOfUnicodeString() } //---------------------------------------------------------------------------- -// Return a writeable buffer that can store 'countChars'+1 ansi characters. -// Call CloseBuffer when done. +// Return a copy of the underlying buffer, the caller is responsible for managing +// the returned memory //---------------------------------------------------------------------------- -inline ANSI *SString::OpenANSIBuffer(COUNT_T countChars) +inline UTF8 *SString::GetCopyOfUTF8String() { - SS_CONTRACT(ANSI*) + SS_CONTRACT(UTF8*) { GC_NOTRIGGER; PRECONDITION(CheckPointer(this)); - PRECONDITION(CheckCount(countChars)); -#if _DEBUG - SS_POSTCONDITION(IsBufferOpen()); -#endif - SS_POSTCONDITION(GetRawCount() == countChars); - SS_POSTCONDITION(GetRepresentation() == REPRESENTATION_ANSI || countChars == 0); - SS_POSTCONDITION(CheckPointer(RETVAL)); + SS_POSTCONDITION(CheckPointer(buffer)); THROWS; } SS_CONTRACT_END; + NewArrayHolder buffer = NULL; + + buffer = new UTF8[GetSize()]; + strncpy(buffer, GetUTF8(), GetSize()); - OpenBuffer(REPRESENTATION_ANSI, countChars); - SS_RETURN GetRawANSI(); + SS_RETURN buffer.Extract(); } //---------------------------------------------------------------------------- @@ -1878,7 +1864,7 @@ inline void SString::ConvertToFixed() const //----------------------------------------------------------------------------- // Convert the internal representation to be an iteratable one (current -// requirements here are that it be trivially convertable to unicode chars.) +// requirements here are that it be trivially convertible to unicode chars.) //----------------------------------------------------------------------------- inline void SString::ConvertToIteratable() const { @@ -1906,44 +1892,6 @@ inline void SString::ConvertToIteratable() const SS_RETURN; } -//----------------------------------------------------------------------------- -// Create iterators on the string. -//----------------------------------------------------------------------------- - -inline SString::UIterator SString::BeginUnicode() -{ - SS_CONTRACT(SString::UIterator) - { - GC_NOTRIGGER; - PRECONDITION(CheckPointer(this)); - SS_POSTCONDITION(CheckValue(RETVAL)); - THROWS; - } - SS_CONTRACT_END; - - ConvertToUnicode(); - EnsureWritable(); - - SS_RETURN UIterator(this, 0); -} - -inline SString::UIterator SString::EndUnicode() -{ - SS_CONTRACT(SString::UIterator) - { - GC_NOTRIGGER; - PRECONDITION(CheckPointer(this)); - SS_POSTCONDITION(CheckValue(RETVAL)); - THROWS; - } - SS_CONTRACT_END; - - ConvertToUnicode(); - EnsureWritable(); - - SS_RETURN UIterator(this, GetCount()); -} - //----------------------------------------------------------------------------- // Create CIterators on the string. //----------------------------------------------------------------------------- @@ -1975,6 +1923,7 @@ FORCEINLINE SString::CIterator SString::End() const } SS_CONTRACT_END; + ConvertToIteratable(); ConvertToIteratable(); SS_RETURN CIterator(this, GetCount()); @@ -2135,92 +2084,6 @@ inline WCHAR SString::Index::operator[](int index) const return *(WCHAR*)&GetAt(index); } -//----------------------------------------------------------------------------- -// Iterator support routines -//----------------------------------------------------------------------------- - -inline SString::UIndex::UIndex() -{ - LIMITED_METHOD_CONTRACT; -} - -inline SString::UIndex::UIndex(SString *string, SCOUNT_T index) - : SBuffer::Index(string, index*sizeof(WCHAR)) -{ - SS_CONTRACT_VOID - { - GC_NOTRIGGER; - PRECONDITION(CheckPointer(string)); - PRECONDITION(string->IsRepresentation(REPRESENTATION_UNICODE)); - PRECONDITION(DoCheck(0)); - SS_POSTCONDITION(CheckPointer(this)); - NOTHROW; - CANNOT_TAKE_LOCK; - } - SS_CONTRACT_END; - - SS_RETURN; -} - -inline WCHAR &SString::UIndex::GetAt(SCOUNT_T delta) const -{ - LIMITED_METHOD_CONTRACT; - - return ((WCHAR*)m_ptr)[delta]; -} - -inline void SString::UIndex::Skip(SCOUNT_T delta) -{ - LIMITED_METHOD_CONTRACT; - - m_ptr += delta * sizeof(WCHAR); -} - -inline SCOUNT_T SString::UIndex::Subtract(const UIndex &i) const -{ - WRAPPER_NO_CONTRACT; - - return (SCOUNT_T) (GetUnicode() - i.GetUnicode()); -} - -inline CHECK SString::UIndex::DoCheck(SCOUNT_T delta) const -{ - CANNOT_HAVE_CONTRACT; -#if _DEBUG - const SString *string = (const SString *) GetContainerDebug(); - - CHECK(GetUnicode() + delta >= string->GetRawUnicode()); - CHECK(GetUnicode() + delta <= string->GetRawUnicode() + string->GetCount()); -#endif - - CHECK_OK; -} - -inline WCHAR *SString::UIndex::GetUnicode() const -{ - LIMITED_METHOD_CONTRACT; - - return (WCHAR*) m_ptr; -} - -//----------------------------------------------------------------------------- -// Opaque scratch buffer class routines -//----------------------------------------------------------------------------- -inline SString::AbstractScratchBuffer::AbstractScratchBuffer(void *buffer, COUNT_T size) - : SString(buffer, size) -{ - SS_CONTRACT_VOID - { - GC_NOTRIGGER; - PRECONDITION(CheckPointer(buffer)); - PRECONDITION(CheckCount(size)); - NOTHROW; - } - SS_CONTRACT_END; - - SS_RETURN; -} - #ifdef _MSC_VER #pragma warning(pop) #endif // _MSC_VER diff --git a/src/shared/inc/static_assert.h b/src/shared/inc/static_assert.h index e344e83bac..67336e1290 100644 --- a/src/shared/inc/static_assert.h +++ b/src/shared/inc/static_assert.h @@ -14,12 +14,6 @@ #ifndef __STATIC_ASSERT_H__ #define __STATIC_ASSERT_H__ -// static_assert( cond, msg ) is now a compiler-supported intrinsic in Dev10 C++ compiler. -// Replaces previous uses of STATIC_ASSERT_MSG and COMPILE_TIME_ASSERT_MSG. - -// Replaces previous uses of CPP_ASSERT -#define static_assert_n( n, cond ) static_assert( cond, #cond ) - // Replaces previous uses of C_ASSERT and COMPILE_TIME_ASSERT #define static_assert_no_msg( cond ) static_assert( cond, #cond ) diff --git a/src/shared/inc/staticcontract.h b/src/shared/inc/staticcontract.h index 4cb71b7b5d..df26383593 100644 --- a/src/shared/inc/staticcontract.h +++ b/src/shared/inc/staticcontract.h @@ -23,7 +23,7 @@ #endif // -// PDB annotations for the static contract analysis tool. These are seperated +// PDB annotations for the static contract analysis tool. These are separated // from Contract.h to allow their inclusion in any part of the system. // @@ -93,8 +93,6 @@ #define ANNOTATION_FN_MODE_COOPERATIVE __annotation(W("MODE_COOPERATIVE ") SCAN_WIDEN(__FUNCTION__)) #define ANNOTATION_FN_MODE_PREEMPTIVE __annotation(W("MODE_PREEMPTIVE ") SCAN_WIDEN(__FUNCTION__)) #define ANNOTATION_FN_MODE_ANY __annotation(W("MODE_ANY ") SCAN_WIDEN(__FUNCTION__)) -#define ANNOTATION_FN_HOST_NOCALLS __annotation(W("HOST_NOCALLS ") SCAN_WIDEN(__FUNCTION__)) -#define ANNOTATION_FN_HOST_CALLS __annotation(W("HOST_CALLS ") SCAN_WIDEN(__FUNCTION__)) #define ANNOTATION_ENTRY_POINT __annotation(W("SO_EP ") SCAN_WIDEN(__FUNCTION__)) @@ -135,9 +133,6 @@ #define ANNOTATION_TRY_MARKER { } #define ANNOTATION_CATCH_MARKER { } -#define ANNOTATION_FN_HOST_NOCALLS { } -#define ANNOTATION_FN_HOST_CALLS { } - #define ANNOTATION_FN_SPECIAL_HOLDER_BEGIN { } #define ANNOTATION_SPECIAL_HOLDER_END { } #define ANNOTATION_SPECIAL_HOLDER_CALLER_NEEDS_DYNAMIC_CONTRACT { } @@ -155,8 +150,6 @@ #define ANNOTATION_FN_MODE_COOPERATIVE { } #define ANNOTATION_FN_MODE_PREEMPTIVE { } #define ANNOTATION_FN_MODE_ANY { } -#define ANNOTATION_FN_HOST_NOCALLS { } -#define ANNOTATION_FN_HOST_CALLS { } #define ANNOTATION_SUPPORTS_DAC { } #define ANNOTATION_SUPPORTS_DAC_HOST_ONLY { } @@ -179,8 +172,6 @@ #define STATIC_CONTRACT_FORBID_FAULT ANNOTATION_FN_FORBID_FAULT #define STATIC_CONTRACT_GC_TRIGGERS ANNOTATION_FN_GC_TRIGGERS #define STATIC_CONTRACT_GC_NOTRIGGER ANNOTATION_FN_GC_NOTRIGGER -#define STATIC_CONTRACT_HOST_NOCALLS ANNOTATION_FN_HOST_NOCALLS -#define STATIC_CONTRACT_HOST_CALLS ANNOTATION_FN_HOST_CALLS #define STATIC_CONTRACT_SUPPORTS_DAC ANNOTATION_SUPPORTS_DAC #define STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY ANNOTATION_SUPPORTS_DAC_HOST_ONLY diff --git a/src/shared/inc/stdmacros.h b/src/shared/inc/stdmacros.h index 2d0a057617..79f9225321 100644 --- a/src/shared/inc/stdmacros.h +++ b/src/shared/inc/stdmacros.h @@ -111,6 +111,34 @@ #define NOT_ARM64_ARG(x) , x #endif +#ifdef TARGET_LOONGARCH64 +#define LOONGARCH64_FIRST_ARG(x) x , +#define LOONGARCH64_ARG(x) , x +#define LOONGARCH64_ONLY(x) x +#define NOT_LOONGARCH64(x) +#define NOT_LOONGARCH64_ARG(x) +#else +#define LOONGARCH64_FIRST_ARG(x) +#define LOONGARCH64_ARG(x) +#define LOONGARCH64_ONLY(x) +#define NOT_LOONGARCH64(x) x +#define NOT_LOONGARCH64_ARG(x) , x +#endif + +#ifdef TARGET_RISCV64 +#define RISCV64_FIRST_ARG(x) x , +#define RISCV64_ARG(x) , x +#define RISCV64_ONLY(x) x +#define NOT_RISCV64(x) +#define NOT_RISCV64_ARG(x) +#else +#define RISCV64_FIRST_ARG(x) +#define RISCV64_ARG(x) +#define RISCV64_ONLY(x) +#define NOT_RISCV64(x) x +#define NOT_RISCV64_ARG(x) , x +#endif + #ifdef TARGET_64BIT #define LOG2_PTRSIZE 3 #else @@ -131,9 +159,9 @@ #define DBG_ADDR(ptr) (DWORD)((UINT_PTR)(ptr)) #endif // HOST_64BIT -#ifdef TARGET_ARM +#if defined(HOST_ARM) || defined(HOST_RISCV64) #define ALIGN_ACCESS ((1< // offsetof #else //STRESS_LOG_READONLY @@ -59,11 +60,11 @@ %pK // The pointer is a code address (used for stack track) */ -/* STRESS_LOG_VA was added to allow sendign GC trace output to the stress log. msg must be enclosed - in ()'s and contain a format string followed by 0 - 4 arguments. The arguments must be numbers or - string literals. LogMsgOL is overloaded so that all of the possible sets of parameters are covered. - This was done becasue GC Trace uses dprintf which dosen't contain info on how many arguments are - getting passed in and using va_args would require parsing the format string during the GC +/* STRESS_LOG_VA was added to allow sending GC trace output to the stress log. msg must be enclosed + in ()'s and contain a format string followed by 0 to 12 arguments. The arguments must be numbers + or string literals. This was done because GC Trace uses dprintf which doesn't contain info on + how many arguments are getting passed in and using va_args would require parsing the format + string during the GC */ #define STRESS_LOG_VA(dprintfLevel,msg) do { \ if (StressLog::LogOn(LF_GC, LL_ALWAYS)) \ @@ -71,126 +72,36 @@ LOGALWAYS(msg); \ } while(0) -#define STRESS_LOG0(facility, level, msg) do { \ - if (StressLog::LogOn(facility, level)) \ - StressLog::LogMsg(level, facility, 0, msg); \ - LOG((facility, level, msg)); \ - } while(0) - -#define STRESS_LOG1(facility, level, msg, data1) do { \ - if (StressLog::LogOn(facility, level)) \ - StressLog::LogMsg(level, facility, 1, msg, (void*)(size_t)(data1));\ - LOG((facility, level, msg, data1)); \ - } while(0) - -#define STRESS_LOG2(facility, level, msg, data1, data2) do { \ - if (StressLog::LogOn(facility, level)) \ - StressLog::LogMsg(level, facility, 2, msg, \ - (void*)(size_t)(data1), (void*)(size_t)(data2)); \ - LOG((facility, level, msg, data1, data2)); \ - } while(0) - -#define STRESS_LOG2_CHECK_EE_STARTED(facility, level, msg, data1, data2) do { \ - if (g_fEEStarted) \ - STRESS_LOG2(facility, level, msg, data1, data2); \ - else \ - LOG((facility, level, msg, data1, data2)); \ - } while(0) - -#define STRESS_LOG3(facility, level, msg, data1, data2, data3) do { \ - if (StressLog::LogOn(facility, level)) \ - StressLog::LogMsg(level, facility, 3, msg, \ - (void*)(size_t)(data1),(void*)(size_t)(data2),(void*)(size_t)(data3)); \ - LOG((facility, level, msg, data1, data2, data3)); \ - } while(0) - -#define STRESS_LOG4(facility, level, msg, data1, data2, data3, data4) do { \ - if (StressLog::LogOn(facility, level)) \ - StressLog::LogMsg(level, facility, 4, msg, (void*)(size_t)(data1), \ - (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4)); \ - LOG((facility, level, msg, data1, data2, data3, data4)); \ - } while(0) - -#define STRESS_LOG5(facility, level, msg, data1, data2, data3, data4, data5) do { \ - if (StressLog::LogOn(facility, level)) \ - StressLog::LogMsg(level, facility, 5, msg, (void*)(size_t)(data1), \ - (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4), \ - (void*)(size_t)(data5)); \ - LOG((facility, level, msg, data1, data2, data3, data4, data5)); \ +#define STRESS_LOG_WRITE(facility, level, msg, ...) do { \ + if (StressLog::StressLogOn(facility, level)) \ + StressLog::LogMsgOL(facility, level, msg, __VA_ARGS__); \ } while(0) -#define STRESS_LOG6(facility, level, msg, data1, data2, data3, data4, data5, data6) do { \ - if (StressLog::LogOn(facility, level)) \ - StressLog::LogMsg(level, facility, 6, msg, (void*)(size_t)(data1), \ - (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4), \ - (void*)(size_t)(data5), (void*)(size_t)(data6)); \ - LOG((facility, level, msg, data1, data2, data3, data4, data5, data6)); \ +#define STRESS_LOG0(facility, level, msg) do { \ + if (StressLog::StressLogOn(facility, level)) \ + StressLog::LogMsg(facility, level, 0, msg); \ } while(0) -#define STRESS_LOG7(facility, level, msg, data1, data2, data3, data4, data5, data6, data7) do { \ - if (StressLog::LogOn(facility, level)) \ - StressLog::LogMsg(level, facility, 7, msg, (void*)(size_t)(data1), \ - (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4), \ - (void*)(size_t)(data5), (void*)(size_t)(data6), (void*)(size_t)(data7)); \ - LOG((facility, level, msg, data1, data2, data3, data4, data5, data6, data7)); \ - } while(0) +#define STRESS_LOG1(facility, level, msg, data1) \ + STRESS_LOG_WRITE(facility, level, msg, data1) -#define STRESS_LOG_COND0(facility, level, cond, msg) do { \ - if (StressLog::LogOn(facility, level) && (cond)) \ - StressLog::LogMsg(level, facility, 0, msg); \ - LOG((facility, level, msg)); \ - } while(0) +#define STRESS_LOG2(facility, level, msg, data1, data2) \ + STRESS_LOG_WRITE(facility, level, msg, data1, data2) -#define STRESS_LOG_COND1(facility, level, cond, msg, data1) do { \ - if (StressLog::LogOn(facility, level) && (cond)) \ - StressLog::LogMsg(level, facility, 1, msg, (void*)(size_t)(data1)); \ - LOG((facility, level, msg, data1)); \ - } while(0) +#define STRESS_LOG3(facility, level, msg, data1, data2, data3) \ + STRESS_LOG_WRITE(facility, level, msg, data1, data2, data3) -#define STRESS_LOG_COND2(facility, level, cond, msg, data1, data2) do { \ - if (StressLog::LogOn(facility, level) && (cond)) \ - StressLog::LogMsg(level, facility, 2, msg, \ - (void*)(size_t)(data1), (void*)(size_t)(data2)); \ - LOG((facility, level, msg, data1, data2)); \ - } while(0) +#define STRESS_LOG4(facility, level, msg, data1, data2, data3, data4) \ + STRESS_LOG_WRITE(facility, level, msg, data1, data2, data3, data4) -#define STRESS_LOG_COND3(facility, level, cond, msg, data1, data2, data3) do { \ - if (StressLog::LogOn(facility, level) && (cond)) \ - StressLog::LogMsg(level, facility, 3, msg, \ - (void*)(size_t)(data1),(void*)(size_t)(data2),(void*)(size_t)(data3)); \ - LOG((facility, level, msg, data1, data2, data3)); \ - } while(0) +#define STRESS_LOG5(facility, level, msg, data1, data2, data3, data4, data5) \ + STRESS_LOG_WRITE(facility, level, msg, data1, data2, data3, data4, data5) -#define STRESS_LOG_COND4(facility, level, cond, msg, data1, data2, data3, data4) do { \ - if (StressLog::LogOn(facility, level) && (cond)) \ - StressLog::LogMsg(level, facility, 4, msg, (void*)(size_t)(data1), \ - (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4)); \ - LOG((facility, level, msg, data1, data2, data3, data4)); \ - } while(0) +#define STRESS_LOG6(facility, level, msg, data1, data2, data3, data4, data5, data6) \ + STRESS_LOG_WRITE(facility, level, msg, data1, data2, data3, data4, data5, data6) -#define STRESS_LOG_COND5(facility, level, cond, msg, data1, data2, data3, data4, data5) do { \ - if (StressLog::LogOn(facility, level) && (cond)) \ - StressLog::LogMsg(level, facility, 5, msg, (void*)(size_t)(data1), \ - (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4), \ - (void*)(size_t)(data5)); \ - LOG((facility, level, msg, data1, data2, data3, data4, data5)); \ - } while(0) - -#define STRESS_LOG_COND6(facility, level, cond, msg, data1, data2, data3, data4, data5, data6) do { \ - if (StressLog::LogOn(facility, level) && (cond)) \ - StressLog::LogMsg(level, facility, 6, msg, (void*)(size_t)(data1), \ - (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4), \ - (void*)(size_t)(data5), (void*)(size_t)(data6)); \ - LOG((facility, level, msg, data1, data2, data3, data4, data5, data6)); \ - } while(0) - -#define STRESS_LOG_COND7(facility, level, cond, msg, data1, data2, data3, data4, data5, data6, data7) do { \ - if (StressLog::LogOn(facility, level) && (cond)) \ - StressLog::LogMsg(level, facility, 7, msg, (void*)(size_t)(data1), \ - (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4), \ - (void*)(size_t)(data5), (void*)(size_t)(data6), (void*)(size_t)(data7)); \ - LOG((facility, level, msg, data1, data2, data3, data4, data5, data6, data7)); \ - } while(0) +#define STRESS_LOG7(facility, level, msg, data1, data2, data3, data4, data5, data6, data7) \ + STRESS_LOG_WRITE(facility, level, msg, data1, data2, data3, data4, data5, data6, data7) #define STRESS_LOG_RESERVE_MEM(numChunks) do { \ if (StressLog::StressLogOn(LF_ALL, LL_ALWAYS)) \ @@ -259,6 +170,8 @@ #define STRESS_LOG_GC_STACK #endif //_DEBUG +void ReplacePid(LPCWSTR original, LPWSTR replaced, size_t replacedLength); + class ThreadStressLog; struct StressLogMsg; @@ -312,8 +225,8 @@ class StressLog { unsigned padding; // Preserve the layout for SOS Volatile deadCount; // count of dead threads in the log CRITSEC_COOKIE lock; // lock - unsigned __int64 tickFrequency; // number of ticks per second - unsigned __int64 startTimeStamp; // start time from when tick counter started + uint64_t tickFrequency; // number of ticks per second + uint64_t startTimeStamp; // start time from when tick counter started FILETIME startTime; // time the application started SIZE_T moduleOffset; // Used to compute format strings. struct ModuleDesc @@ -357,21 +270,31 @@ class StressLog { #ifdef MEMORY_MAPPED_STRESSLOG + // + // Intentionally avoid unmapping the file during destructor to avoid a race + // condition between additional logging in other thread and the destructor. + // + // The operating system will make sure the file get unmapped during process shutdown + // + LPVOID hMapView; static void* AllocMemoryMapped(size_t n); struct StressLogHeader { size_t headerSize; // size of this header including size field and moduleImage uint32_t magic; // must be 'STRL' - uint32_t version; // must be 0x00010001 + uint32_t version; // must be >=0x00010001. + // 0x00010001 is the legacy short-offset format. + // 0x00010002 is the large-module-offset format introduced in .NET 8. uint8_t* memoryBase; // base address of the memory mapped file uint8_t* memoryCur; // highest address currently used uint8_t* memoryLimit; // limit that can be used Volatile logs; // the list of logs for every thread. uint64_t tickFrequency; // number of ticks per second uint64_t startTimeStamp; // start time from when tick counter started - uint64_t threadsWithNoLog; // threads that didn't get a log - uint64_t reserved[15]; // for future expansion + uint32_t threadsWithNoLog; // threads that didn't get a log + uint32_t reserved1; + uint64_t reserved2[15]; // for future expansion ModuleDesc modules[MAX_MODULES]; // descriptor of the modules images uint8_t moduleImage[64*1024*1024];// copy of the module images described by modules field }; @@ -396,6 +319,13 @@ class StressLog { static void AddModule(uint8_t* moduleBase); + template + static void* ConvertArgument(T arg) + { + static_assert_no_msg(sizeof(T) <= sizeof(void*)); + return (void*)(size_t)arg; + } + // Support functions for STRESS_LOG_VA // We disable the warning "conversion from 'type' to 'type' of greater size" since everything will // end up on the stack, and LogMsg will know the size of the variable based on the format string. @@ -403,91 +333,20 @@ class StressLog { #pragma warning( push ) #pragma warning( disable : 4312 ) #endif + static void LogMsgOL(const char* format) { LogMsg(LL_ALWAYS, LF_GC, 0, format); } - template < typename T1 > - static void LogMsgOL(const char* format, T1 data1) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 1, format, (void*)(size_t)data1); - } - - template < typename T1, typename T2 > - static void LogMsgOL(const char* format, T1 data1, T2 data2) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 2, format, (void*)(size_t)data1, (void*)(size_t)data2); - } - - template < typename T1, typename T2, typename T3 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 3, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3); - } - - template < typename T1, typename T2, typename T3, typename T4 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 4, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4); - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 5, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5); - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 6, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6); - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 7, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7); - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 8, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8); - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 9, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8, (void*)(size_t)data9); - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 10, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8, (void*)(size_t)data9, (void*)(size_t)data10); - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10, T11 data11) + template + static void LogMsgOL(const char* format, Ts... args) { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*) && sizeof(T11) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 11, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8, (void*)(size_t)data9, (void*)(size_t)data10, (void*)(size_t)data11); + LogMsg(LL_ALWAYS, LF_GC, sizeof...(args), format, ConvertArgument(args)...); } - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12 > - static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10, T11 data11, T12 data12) + template + static void LogMsgOL(unsigned facility, unsigned level, const char* format, Ts... args) { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*) && sizeof(T11) <= sizeof(void*) && sizeof(T12) <= sizeof(void*)); - LogMsg(LL_ALWAYS, LF_GC, 12, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8, (void*)(size_t)data9, (void*)(size_t)data10, (void*)(size_t)data11, (void*)(size_t)data12); + LogMsg(level, facility, sizeof...(args), format, ConvertArgument(args)...); } #ifdef _MSC_VER @@ -512,8 +371,36 @@ typedef USHORT static StressLog theLog; // We only have one log, and this is it }; + +template<> +void* StressLog::ConvertArgument(float arg) = delete; + +#if TARGET_64BIT +template<> +inline void* StressLog::ConvertArgument(double arg) +{ + return (void*)(size_t)(*((uint64_t*)&arg)); +} +#else +template<> +void* StressLog::ConvertArgument(double arg) = delete; + +// COMPAT: Truncate 64-bit integer arguments to 32-bit +template<> +inline void* StressLog::ConvertArgument(uint64_t arg) +{ + return (void*)(size_t)arg; +} + +template<> +inline void* StressLog::ConvertArgument(int64_t arg) +{ + return (void*)(size_t)arg; +} +#endif + #ifndef STRESS_LOG_ANALYZER -typedef Holder> StressLogLockHolder; +typedef Holder> StressLogLockHolder; #endif //!STRESS_LOG_ANALYZER #if defined(DACCESS_COMPILE) @@ -534,9 +421,8 @@ inline BOOL StressLog::LogOn(unsigned facility, unsigned level) #pragma warning(disable:4200 4201) // don't warn about 0 sized array below or unnamed structures #endif -// The order of fields is important. Keep the prefix length as the first field. -// And make sure the timeStamp field is naturally alligned, so we don't waste -// space on 32-bit platforms +// The order of fields is important. Ensure that we minimize padding +// to fit more messages in a chunk. struct StressMsg { private: @@ -602,6 +488,7 @@ struct StressMsg }; static_assert(sizeof(StressMsg) == sizeof(uint64_t) * 2, "StressMsg bitfields aren't aligned correctly"); + #ifdef HOST_64BIT #define STRESSLOG_CHUNK_SIZE (32 * 1024) #else //HOST_64BIT @@ -630,14 +517,14 @@ struct StressLogChunk void * operator new (size_t size) throw() { - if (IsInCantAllocStressLogRegion ()) - { - return NULL; - } #ifdef MEMORY_MAPPED_STRESSLOG if (s_memoryMapped) return StressLog::AllocMemoryMapped(size); #endif //MEMORY_MAPPED_STRESSLOG + if (IsInCantAllocStressLogRegion ()) + { + return NULL; + } #ifdef HOST_WINDOWS _ASSERTE(s_LogChunkHeap); return HeapAlloc(s_LogChunkHeap, 0, size); @@ -781,7 +668,7 @@ class ThreadStressLog { #endif //!STRESS_LOG_READONLY && !STRESS_LOG_ANALYZER #if defined(MEMORY_MAPPED_STRESSLOG) && !defined(STRESS_LOG_ANALYZER) - void* __cdecl operator new(size_t n, const NoThrow&) NOEXCEPT; + void* __cdecl operator new(size_t n, const std::nothrow_t&) noexcept; void __cdecl operator delete (void * chunk); #endif @@ -907,7 +794,7 @@ inline StressMsg* ThreadStressLog::AdvReadPastBoundary() { } curReadChunk = curReadChunk->next; void** p = (void**)curReadChunk->StartPtr(); - while (*p == NULL && (size_t)(p-(void**)curReadChunk->StartPtr ()) < (StressMsg::maxMsgSize()/sizeof(void*))) + while (*p == NULL && (size_t)(p-(void**)curReadChunk->StartPtr()) < (StressMsg::maxMsgSize() / sizeof(void*))) { ++p; } @@ -983,154 +870,13 @@ struct StressLogMsg { } - template < typename T1 > - StressLogMsg(const char* format, T1 data1) : m_cArgs(1), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - } - - template < typename T1, typename T2 > - StressLogMsg(const char* format, T1 data1, T2 data2) : m_cArgs(2), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - } - - template < typename T1, typename T2, typename T3 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3) : m_cArgs(3), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - } - - template < typename T1, typename T2, typename T3, typename T4 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4) : m_cArgs(4), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - m_args[3] = (void*)(size_t)data4; - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5) : m_cArgs(5), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - m_args[3] = (void*)(size_t)data4; - m_args[4] = (void*)(size_t)data5; - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6) : m_cArgs(6), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - m_args[3] = (void*)(size_t)data4; - m_args[4] = (void*)(size_t)data5; - m_args[5] = (void*)(size_t)data6; - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7) : m_cArgs(7), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - m_args[3] = (void*)(size_t)data4; - m_args[4] = (void*)(size_t)data5; - m_args[5] = (void*)(size_t)data6; - m_args[6] = (void*)(size_t)data7; - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8) : m_cArgs(8), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - m_args[3] = (void*)(size_t)data4; - m_args[4] = (void*)(size_t)data5; - m_args[5] = (void*)(size_t)data6; - m_args[6] = (void*)(size_t)data7; - m_args[7] = (void*)(size_t)data8; - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9) : m_cArgs(9), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - m_args[3] = (void*)(size_t)data4; - m_args[4] = (void*)(size_t)data5; - m_args[5] = (void*)(size_t)data6; - m_args[6] = (void*)(size_t)data7; - m_args[7] = (void*)(size_t)data8; - m_args[8] = (void*)(size_t)data9; - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10) : m_cArgs(10), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - m_args[3] = (void*)(size_t)data4; - m_args[4] = (void*)(size_t)data5; - m_args[5] = (void*)(size_t)data6; - m_args[6] = (void*)(size_t)data7; - m_args[7] = (void*)(size_t)data8; - m_args[8] = (void*)(size_t)data9; - m_args[9] = (void*)(size_t)data10; - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10, T11 data11) : m_cArgs(11), m_format(format) - { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*) && sizeof(T11) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - m_args[3] = (void*)(size_t)data4; - m_args[4] = (void*)(size_t)data5; - m_args[5] = (void*)(size_t)data6; - m_args[6] = (void*)(size_t)data7; - m_args[7] = (void*)(size_t)data8; - m_args[8] = (void*)(size_t)data9; - m_args[9] = (void*)(size_t)data10; - m_args[10] = (void*)(size_t)data11; - } - - template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12 > - StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10, T11 data11, T12 data12) : m_cArgs(12), m_format(format) + template + StressLogMsg(const char* format, Ts... args) + : m_cArgs(sizeof...(args)) + , m_format(format) + , m_args{ StressLog::ConvertArgument(args)... } { - static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*) && sizeof(T11) <= sizeof(void*) && sizeof(T12) <= sizeof(void*)); - m_args[0] = (void*)(size_t)data1; - m_args[1] = (void*)(size_t)data2; - m_args[2] = (void*)(size_t)data3; - m_args[3] = (void*)(size_t)data4; - m_args[4] = (void*)(size_t)data5; - m_args[5] = (void*)(size_t)data6; - m_args[6] = (void*)(size_t)data7; - m_args[7] = (void*)(size_t)data8; - m_args[8] = (void*)(size_t)data9; - m_args[9] = (void*)(size_t)data10; - m_args[10] = (void*)(size_t)data11; - m_args[11] = (void*)(size_t)data12; + static_assert_no_msg(sizeof...(args) <= ARRAY_SIZE(m_args)); } }; @@ -1140,7 +886,6 @@ struct StressLogMsg #define STRESS_LOG0(facility, level, msg) do { } while(0) #define STRESS_LOG1(facility, level, msg, data1) do { } while(0) #define STRESS_LOG2(facility, level, msg, data1, data2) do { } while(0) -#define STRESS_LOG2_CHECK_EE_STARTED(facility, level, msg, data1, data2)do { } while(0) #define STRESS_LOG3(facility, level, msg, data1, data2, data3) do { } while(0) #define STRESS_LOG4(facility, level, msg, data1, data2, data3, data4) do { } while(0) #define STRESS_LOG5(facility, level, msg, data1, data2, data3, data4, data5) do { } while(0) diff --git a/src/shared/inc/switches.h b/src/shared/inc/switches.h index 6a4f6d6371..bbdcab16ce 100644 --- a/src/shared/inc/switches.h +++ b/src/shared/inc/switches.h @@ -19,7 +19,9 @@ #define USE_CHECKED_OBJECTREFS #endif +#ifndef TARGET_64BIT #define FAT_DISPATCH_TOKENS +#endif #define FEATURE_SHARE_GENERIC_CODE @@ -31,7 +33,7 @@ #if defined(TARGET_X86) || defined(TARGET_ARM) #define USE_LAZY_PREFERRED_RANGE 0 -#elif defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_S390X) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) +#elif defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_S390X) || defined(TARGET_LOONGARCH64) || defined(TARGET_POWERPC64) || defined(TARGET_RISCV64) #if defined(HOST_UNIX) // In PAL we have a smechanism that reserves memory on start up that is @@ -52,10 +54,7 @@ #endif // ALLOW_SXS_JIT enables AltJit support for JIT-ing, via DOTNET_AltJit / DOTNET_AltJitName. -// ALLOW_SXS_JIT_NGEN enables AltJit support for NGEN, via DOTNET_AltJitNgen / DOTNET_AltJitName. -// Note that if ALLOW_SXS_JIT_NGEN is defined, then ALLOW_SXS_JIT must be defined. #define ALLOW_SXS_JIT -#define ALLOW_SXS_JIT_NGEN #if !defined(TARGET_UNIX) // PLATFORM_SUPPORTS_THREADSUSPEND is defined for platforms where it is safe to call @@ -146,9 +145,3 @@ #endif #define FEATURE_MINIMETADATA_IN_TRIAGEDUMPS - -// If defined, support interpretation. - -#if !defined(TARGET_UNIX) -#define FEATURE_STACK_SAMPLING -#endif // defined (ALLOW_SXS_JIT) diff --git a/src/shared/inc/unreachable.h b/src/shared/inc/unreachable.h index 3fcb1d3bb4..a770209abe 100644 --- a/src/shared/inc/unreachable.h +++ b/src/shared/inc/unreachable.h @@ -9,14 +9,7 @@ #define __UNREACHABLE_H__ #if defined(_MSC_VER) || defined(_PREFIX_) -#if defined(TARGET_AMD64) -// Empty methods that consist of UNREACHABLE() result in a zero-sized declspec(noreturn) method -// which causes the pdb file to make the next method declspec(noreturn) as well, thus breaking BBT -// Remove when we get a VC compiler that fixes VSW 449170 -# define __UNREACHABLE() do { DebugBreak(); __assume(0); } while (0) -#else -# define __UNREACHABLE() __assume(0) -#endif +#define __UNREACHABLE() __assume(0) #else #define __UNREACHABLE() __builtin_unreachable() #endif diff --git a/src/shared/inc/utilcode.h b/src/shared/inc/utilcode.h index 7c359ef979..30f1d2b5ce 100644 --- a/src/shared/inc/utilcode.h +++ b/src/shared/inc/utilcode.h @@ -10,14 +10,19 @@ #ifndef __UtilCode_h__ #define __UtilCode_h__ +#include +#include +#include +#include +#include + +using std::nothrow; + #include "crtwrap.h" #include "winwrap.h" #include -#include -#include #include #include -#include #include "clrtypes.h" #include "safewrap.h" #include "volatile.h" @@ -25,21 +30,13 @@ #include "clrhost.h" #include "debugmacros.h" #include "corhlprpriv.h" -#include "winnls.h" #include "check.h" #include "safemath.h" -#include "new.hpp" - -#ifdef PAL_STDCPP_COMPAT -#include -#else -#include "clr_std/type_traits" -#endif #include "contract.h" -#include "entrypoints.h" -#include +#include +#include #include "clrnt.h" @@ -59,7 +56,8 @@ #define CoreLibNameLen 22 #define CoreLibSatelliteName_A "System.Private.CoreLib.resources" #define CoreLibSatelliteNameLen 32 -#define LegacyCoreLibName_A "mscorlib" + +bool ValidateModuleName(LPCWSTR pwzModuleName); class StringArrayList; @@ -158,11 +156,6 @@ typedef LPSTR LPUTF8; #define DIGIT_TO_INT(ch) ((ch) - W('0')) #define INT_TO_DIGIT(i) ((WCHAR)(W('0') + (i))) -#define IS_HEXDIGIT(ch) ((((ch) >= W('a')) && ((ch) <= W('f'))) || \ - (((ch) >= W('A')) && ((ch) <= W('F')))) -#define HEXDIGIT_TO_INT(ch) ((towlower(ch) - W('a')) + 10) -#define INT_TO_HEXDIGIT(i) ((WCHAR)(W('a') + ((i) - 10))) - // Helper will 4 byte align a value, rounding up. #define ALIGN4BYTE(val) (((val) + 3) & ~0x3) @@ -173,6 +166,12 @@ typedef LPSTR LPUTF8; #define DEBUGARG(x) #endif +#if defined(FEATURE_READYTORUN) +#define R2RARG(x) , x +#else +#define R2RARG(x) +#endif + #ifndef sizeofmember // Returns the size of a class or struct member. #define sizeofmember(c,m) (sizeof(((c*)0)->m)) @@ -192,15 +191,6 @@ typedef LPSTR LPUTF8; // given and ANSI String, copy it into a wide buffer. // be careful about scoping when using this macro! // -// how to use the below two macros: -// -// ... -// LPSTR pszA; -// pszA = MyGetAnsiStringRoutine(); -// MAKE_WIDEPTR_FROMANSI(pwsz, pszA); -// MyUseWideStringRoutine(pwsz); -// ... -// // similarily for MAKE_ANSIPTR_FROMWIDE. note that the first param does not // have to be declared, and no clean up must be done. // @@ -218,265 +208,105 @@ typedef LPSTR LPUTF8; #define MAKE_TRANSLATIONFAILED ThrowWin32(ERROR_NO_UNICODE_TRANSLATION) #endif -// This version throws on conversion errors (ie, no best fit character -// mapping to characters that look similar, and no use of the default char -// ('?') when printing out unrepresentable characters. Use this method for -// most development in the EE, especially anything like metadata or class -// names. See the BESTFIT version if you're printing out info to the console. -#define MAKE_MULTIBYTE_FROMWIDE(ptrname, widestr, codepage) \ - int __l##ptrname = (int)wcslen(widestr); \ - if (__l##ptrname > MAKE_MAX_LENGTH) \ - MAKE_TOOLONGACTION; \ - __l##ptrname = (int)((__l##ptrname + 1) * 2 * sizeof(char)); \ - CQuickBytes __CQuickBytes##ptrname; \ - __CQuickBytes##ptrname.AllocThrows(__l##ptrname); \ - BOOL __b##ptrname; \ - DWORD __cBytes##ptrname = WszWideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, widestr, -1, (LPSTR)__CQuickBytes##ptrname.Ptr(), __l##ptrname, NULL, &__b##ptrname); \ - if (__b##ptrname || (__cBytes##ptrname == 0 && (widestr[0] != W('\0')))) { \ - MAKE_TRANSLATIONFAILED; \ - } \ - LPSTR ptrname = (LPSTR)__CQuickBytes##ptrname.Ptr() - // This version does best fit character mapping and also allows the use // of the default char ('?') for any Unicode character that isn't // representable. This is reasonable for writing to the console, but // shouldn't be used for most string conversions. #define MAKE_MULTIBYTE_FROMWIDE_BESTFIT(ptrname, widestr, codepage) \ - int __l##ptrname = (int)wcslen(widestr); \ + int __l##ptrname = (int)u16_strlen(widestr); \ if (__l##ptrname > MAKE_MAX_LENGTH) \ MAKE_TOOLONGACTION; \ __l##ptrname = (int)((__l##ptrname + 1) * 2 * sizeof(char)); \ CQuickBytes __CQuickBytes##ptrname; \ __CQuickBytes##ptrname.AllocThrows(__l##ptrname); \ - DWORD __cBytes##ptrname = WszWideCharToMultiByte(codepage, 0, widestr, -1, (LPSTR)__CQuickBytes##ptrname.Ptr(), __l##ptrname, NULL, NULL); \ + DWORD __cBytes##ptrname = WideCharToMultiByte(codepage, 0, widestr, -1, (LPSTR)__CQuickBytes##ptrname.Ptr(), __l##ptrname, NULL, NULL); \ if (__cBytes##ptrname == 0 && __l##ptrname != 0) { \ MAKE_TRANSLATIONFAILED; \ } \ LPSTR ptrname = (LPSTR)__CQuickBytes##ptrname.Ptr() -// Use for anything critical other than output to console, where weird -// character mappings are unacceptable. -#define MAKE_ANSIPTR_FROMWIDE(ptrname, widestr) MAKE_MULTIBYTE_FROMWIDE(ptrname, widestr, CP_ACP) - -// Use for output to the console. -#define MAKE_ANSIPTR_FROMWIDE_BESTFIT(ptrname, widestr) MAKE_MULTIBYTE_FROMWIDE_BESTFIT(ptrname, widestr, CP_ACP) - -#define MAKE_WIDEPTR_FROMANSI(ptrname, ansistr) \ - CQuickBytes __qb##ptrname; \ - int __l##ptrname; \ - __l##ptrname = WszMultiByteToWideChar(CP_ACP, 0, ansistr, -1, 0, 0); \ - if (__l##ptrname > MAKE_MAX_LENGTH) \ - MAKE_TOOLONGACTION; \ - LPWSTR ptrname = (LPWSTR) __qb##ptrname.AllocThrows((__l##ptrname+1)*sizeof(WCHAR)); \ - if (WszMultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, ansistr, -1, ptrname, __l##ptrname) == 0) { \ - MAKE_TRANSLATIONFAILED; \ - } - -#define MAKE_WIDEPTR_FROMANSI_NOTHROW(ptrname, ansistr) \ - CQuickBytes __qb##ptrname; \ - LPWSTR ptrname = 0; \ - int __l##ptrname; \ - __l##ptrname = WszMultiByteToWideChar(CP_ACP, 0, ansistr, -1, 0, 0); \ - if (__l##ptrname <= MAKE_MAX_LENGTH) { \ - ptrname = (LPWSTR) __qb##ptrname.AllocNoThrow((__l##ptrname+1)*sizeof(WCHAR)); \ - if (ptrname) { \ - if (WszMultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, ansistr, -1, ptrname, __l##ptrname) != 0) { \ - ptrname[__l##ptrname] = 0; \ - } else { \ - ptrname = 0; \ - } \ - } \ - } - #define MAKE_UTF8PTR_FROMWIDE(ptrname, widestr) CQuickBytes _##ptrname; _##ptrname.ConvertUnicode_Utf8(widestr); LPSTR ptrname = (LPSTR) _##ptrname.Ptr(); #define MAKE_UTF8PTR_FROMWIDE_NOTHROW(ptrname, widestr) \ CQuickBytes __qb##ptrname; \ - int __l##ptrname = (int)wcslen(widestr); \ - LPUTF8 ptrname = 0; \ + int __l##ptrname = (int)u16_strlen(widestr); \ + LPUTF8 ptrname = NULL; \ if (__l##ptrname <= MAKE_MAX_LENGTH) { \ __l##ptrname = (int)((__l##ptrname + 1) * 2 * sizeof(char)); \ ptrname = (LPUTF8) __qb##ptrname.AllocNoThrow(__l##ptrname); \ } \ if (ptrname) { \ - INT32 __lresult##ptrname=WszWideCharToMultiByte(CP_UTF8, 0, widestr, -1, ptrname, __l##ptrname-1, NULL, NULL); \ + INT32 __lresult##ptrname=WideCharToMultiByte(CP_UTF8, 0, widestr, -1, ptrname, __l##ptrname-1, NULL, NULL); \ DWORD __dwCaptureLastError##ptrname = ::GetLastError(); \ if ((__lresult##ptrname==0) && (((LPCWSTR)widestr)[0] != W('\0'))) { \ if (__dwCaptureLastError##ptrname==ERROR_INSUFFICIENT_BUFFER) { \ - INT32 __lsize##ptrname=WszWideCharToMultiByte(CP_UTF8, 0, widestr, -1, NULL, 0, NULL, NULL); \ + INT32 __lsize##ptrname=WideCharToMultiByte(CP_UTF8, 0, widestr, -1, NULL, 0, NULL, NULL); \ ptrname = (LPSTR) __qb##ptrname .AllocNoThrow(__lsize##ptrname); \ if (ptrname) { \ - if (WszWideCharToMultiByte(CP_UTF8, 0, widestr, -1, ptrname, __lsize##ptrname, NULL, NULL) != 0) { \ + if (WideCharToMultiByte(CP_UTF8, 0, widestr, -1, ptrname, __lsize##ptrname, NULL, NULL) != 0) { \ ptrname[__l##ptrname] = 0; \ } else { \ - ptrname = 0; \ + ptrname = NULL; \ } \ } \ } \ else { \ - ptrname = 0; \ + ptrname = NULL; \ } \ } \ } \ -#define MAKE_WIDEPTR_FROMUTF8N(ptrname, utf8str, n8chrs) \ - CQuickBytes __qb##ptrname; \ - int __l##ptrname; \ - __l##ptrname = WszMultiByteToWideChar(CP_UTF8, 0, utf8str, n8chrs, 0, 0); \ - if (__l##ptrname > MAKE_MAX_LENGTH) \ - MAKE_TOOLONGACTION; \ - LPWSTR ptrname = (LPWSTR) __qb##ptrname .AllocThrows((__l##ptrname+1)*sizeof(WCHAR)); \ - if (0==WszMultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8str, n8chrs, ptrname, __l##ptrname)) { \ - MAKE_TRANSLATIONFAILED; \ - } \ - ptrname[__l##ptrname] = 0; - - #define MAKE_WIDEPTR_FROMUTF8(ptrname, utf8str) CQuickBytes _##ptrname; _##ptrname.ConvertUtf8_Unicode(utf8str); LPCWSTR ptrname = (LPCWSTR) _##ptrname.Ptr(); - #define MAKE_WIDEPTR_FROMUTF8N_NOTHROW(ptrname, utf8str, n8chrs) \ CQuickBytes __qb##ptrname; \ int __l##ptrname; \ - LPWSTR ptrname = 0; \ - __l##ptrname = WszMultiByteToWideChar(CP_UTF8, 0, utf8str, n8chrs, 0, 0); \ + LPWSTR ptrname = NULL; \ + __l##ptrname = MultiByteToWideChar(CP_UTF8, 0, utf8str, n8chrs, 0, 0); \ if (__l##ptrname <= MAKE_MAX_LENGTH) { \ ptrname = (LPWSTR) __qb##ptrname.AllocNoThrow((__l##ptrname+1)*sizeof(WCHAR)); \ if (ptrname) { \ - if (WszMultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8str, n8chrs, ptrname, __l##ptrname) != 0) { \ + if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8str, n8chrs, ptrname, __l##ptrname) != 0) { \ ptrname[__l##ptrname] = 0; \ } else { \ - ptrname = 0; \ + ptrname = NULL; \ } \ } \ } #define MAKE_WIDEPTR_FROMUTF8_NOTHROW(ptrname, utf8str) MAKE_WIDEPTR_FROMUTF8N_NOTHROW(ptrname, utf8str, -1) -// This method takes the number of characters -#define MAKE_MULTIBYTE_FROMWIDEN(ptrname, widestr, _nCharacters, _pCnt, codepage) \ - CQuickBytes __qb##ptrname; \ - int __l##ptrname; \ - __l##ptrname = WszWideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, widestr, _nCharacters, NULL, 0, NULL, NULL); \ - if (__l##ptrname > MAKE_MAX_LENGTH) \ - MAKE_TOOLONGACTION; \ - ptrname = (LPUTF8) __qb##ptrname .AllocThrows(__l##ptrname+1); \ - BOOL __b##ptrname; \ - DWORD _pCnt = WszWideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, widestr, _nCharacters, ptrname, __l##ptrname, NULL, &__b##ptrname); \ - if (__b##ptrname || (_pCnt == 0 && _nCharacters > 0)) { \ - MAKE_TRANSLATIONFAILED; \ - } \ - ptrname[__l##ptrname] = 0; - -#define MAKE_MULTIBYTE_FROMWIDEN_BESTFIT(ptrname, widestr, _nCharacters, _pCnt, codepage) \ - CQuickBytes __qb##ptrname; \ - int __l##ptrname; \ - __l##ptrname = WszWideCharToMultiByte(codepage, 0, widestr, _nCharacters, NULL, 0, NULL, NULL); \ - if (__l##ptrname > MAKE_MAX_LENGTH) \ - MAKE_TOOLONGACTION; \ - ptrname = (LPUTF8) __qb##ptrname .AllocThrows(__l##ptrname+1); \ - DWORD _pCnt = WszWideCharToMultiByte(codepage, 0, widestr, _nCharacters, ptrname, __l##ptrname, NULL, NULL); \ - if (_pCnt == 0 && _nCharacters > 0) { \ - MAKE_TRANSLATIONFAILED; \ - } \ - ptrname[__l##ptrname] = 0; - -#define MAKE_ANSIPTR_FROMWIDEN(ptrname, widestr, _nCharacters, _pCnt) \ - MAKE_MULTIBYTE_FROMWIDEN(ptrname, widestr, _nCharacters, _pCnt, CP_ACP) +const SIZE_T MaxSigned32BitDecString = ARRAY_SIZE("-2147483648") - 1; +const SIZE_T MaxUnsigned32BitDecString = ARRAY_SIZE("4294967295") - 1; +const SIZE_T MaxIntegerDecHexString = ARRAY_SIZE("-9223372036854775808") - 1; +const SIZE_T Max32BitHexString = ARRAY_SIZE("12345678") - 1; +const SIZE_T Max64BitHexString = ARRAY_SIZE("1234567812345678") - 1; -inline -LPWSTR DuplicateString( - LPCWSTR wszString, - size_t cchString) +template +inline WCHAR* FormatInteger(WCHAR* str, size_t strCount, const char* fmt, I v) { - STATIC_CONTRACT_NOTHROW; - - LPWSTR wszDup = NULL; - if (wszString != NULL) - { - wszDup = new (nothrow) WCHAR[cchString + 1]; - if (wszDup != NULL) - { - wcscpy_s(wszDup, cchString + 1, wszString); - } - } - return wszDup; -} + static_assert(std::is_integral::value, "Integral type required."); + assert(str != NULL && fmt != NULL); -inline -LPWSTR DuplicateString( - LPCWSTR wszString) -{ - STATIC_CONTRACT_NOTHROW; + // Represents the most amount of space needed to format + // an integral type (i.e., %d or %llx). + char tmp[MaxIntegerDecHexString + 1]; + int cnt = sprintf_s(tmp, ARRAY_SIZE(tmp), fmt, v); + assert(0 <= cnt); - if (wszString != NULL) + WCHAR* end = str + strCount; + for (int i = 0; i < cnt; ++i) { - return DuplicateString(wszString, wcslen(wszString)); - } - else - { - return NULL; - } -} - -void DECLSPEC_NORETURN ThrowOutOfMemory(); - -inline -LPWSTR DuplicateStringThrowing( - LPCWSTR wszString, - size_t cchString) -{ - STATIC_CONTRACT_THROWS; - - if (wszString == NULL) - return NULL; - - LPWSTR wszDup = DuplicateString(wszString, cchString); - if (wszDup == NULL) - ThrowOutOfMemory(); - - return wszDup; -} + if (str == end) + return NULL; -inline -LPWSTR DuplicateStringThrowing( - LPCWSTR wszString) -{ - STATIC_CONTRACT_THROWS; - - if (wszString == NULL) - return NULL; - - LPWSTR wszDup = DuplicateString(wszString); - if (wszDup == NULL) - ThrowOutOfMemory(); - - return wszDup; -} - - -//***************************************************************************** -// Placement new is used to new and object at an exact location. The pointer -// is simply returned to the caller without actually using the heap. The -// advantage here is that you cause the ctor() code for the object to be run. -// This is ideal for heaps of C++ objects that need to get init'd multiple times. -// Example: -// void *pMem = GetMemFromSomePlace(); -// Foo *p = new (pMem) Foo; -// DoSomething(p); -// p->~Foo(); -//***************************************************************************** -#ifndef __PLACEMENT_NEW_INLINE -#define __PLACEMENT_NEW_INLINE -inline void *__cdecl operator new(size_t, void *_P) -{ - LIMITED_METHOD_DAC_CONTRACT; + *str++ = (WCHAR)tmp[i]; + } - return (_P); + *str = W('\0'); + return str; } -#endif // __PLACEMENT_NEW_INLINE - /********************************************************************************/ /* portability helpers */ @@ -496,10 +326,10 @@ _Ret_bytecap_(n) void * __cdecl operator new[](size_t n); void __cdecl -operator delete(void *p) NOEXCEPT; +operator delete(void *p) noexcept; void __cdecl -operator delete[](void *p) NOEXCEPT; +operator delete[](void *p) noexcept; #ifdef _DEBUG_IMPL HRESULT _OutOfMemory(LPCSTR szFile, int iLine); @@ -543,7 +373,7 @@ HMODULE CLRLoadLibraryEx(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags); BOOL CLRFreeLibrary(HMODULE hModule); // Load a string using the resources for the current module. -STDAPI UtilLoadStringRC(UINT iResouceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax, int bQuiet=FALSE); +STDAPI UtilLoadStringRC(UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax, int bQuiet=FALSE); // Specify callbacks so that UtilLoadStringRC can find out which language we're in. // If no callbacks specified (or both parameters are NULL), we default to the @@ -602,7 +432,7 @@ class CCulturedHInstance if (id == UICULTUREID_DONTCARE) return FALSE; - return wcscmp(id, m_LangId) == 0; + return u16_strcmp(id, m_LangId) == 0; } HRESOURCEDLL GetLibraryHandle() @@ -738,7 +568,7 @@ class CCompRC } private: -// String resouces packaged as PE files only exist on Windows +// String resources packaged as PE files only exist on Windows #ifdef HOST_WINDOWS HRESULT GetLibrary(LocaleID langId, HRESOURCEDLL* phInst); #ifndef DACCESS_COMPILE @@ -774,85 +604,7 @@ class CCompRC FPGETTHREADUICULTURENAMES m_fpGetThreadUICultureNames; }; -HRESULT UtilLoadResourceString(CCompRC::ResourceCategory eCategory, UINT iResouceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax); - - -int UtilMessageBox( - HWND hWnd, // Handle to Owner Window - UINT uText, // Resource Identifier for Text message - UINT uCaption, // Resource Identifier for Caption - UINT uType, // Style of MessageBox - BOOL displayForNonInteractive, // Display even if the process is running non interactive - BOOL ShowFileNameInTitle, // Flag to show FileName in Caption - ...); // Additional Arguments - -int UtilMessageBoxNonLocalized( - HWND hWnd, // Handle to Owner Window - LPCWSTR lpText, // Resource Identifier for Text message - LPCWSTR lpTitle, // Resource Identifier for Caption - UINT uType, // Style of MessageBox - BOOL displayForNonInteractive, // Display even if the process is running non interactive - BOOL ShowFileNameInTitle, // Flag to show FileName in Caption - ...); // Additional Arguments - -int UtilMessageBoxVA( - HWND hWnd, // Handle to Owner Window - UINT uText, // Resource Identifier for Text message - UINT uCaption, // Resource Identifier for Caption - UINT uType, // Style of MessageBox - BOOL displayForNonInteractive, // Display even if the process is running non interactive - BOOL ShowFileNameInTitle, // Flag to show FileName in Caption - va_list args); // Additional Arguments - -int UtilMessageBoxNonLocalizedVA( - HWND hWnd, // Handle to Owner Window - LPCWSTR lpText, // Text message - LPCWSTR lpCaption, // Caption - UINT uType, // Style of MessageBox - BOOL displayForNonInteractive, // Display even if the process is running non interactive - BOOL ShowFileNameInTitle, // Flag to show FileName in Caption - BOOL * pInputFromUser, // To distinguish between user pressing abort vs. assuming abort. - va_list args); // Additional Arguments - -int UtilMessageBoxNonLocalizedVA( - HWND hWnd, // Handle to Owner Window - LPCWSTR lpText, // Text message - LPCWSTR lpCaption, // Caption - LPCWSTR lpDetails, // Details that may be shown in a collapsed extended area of the dialog (Vista or higher). - UINT uType, // Style of MessageBox - BOOL displayForNonInteractive, // Display even if the process is running non interactive - BOOL ShowFileNameInTitle, // Flag to show FileName in Caption - BOOL * pInputFromUser, // To distinguish between user pressing abort vs. assuming abort. - va_list args); // Additional Arguments - -int UtilMessageBoxCatastrophic( - UINT uText, // Text for MessageBox - UINT uTitle, // Title for MessageBox - UINT uType, // Style of MessageBox - BOOL ShowFileNameInTitle, // Flag to show FileName in Caption - ...); - -int UtilMessageBoxCatastrophicNonLocalized( - LPCWSTR lpText, // Text for MessageBox - LPCWSTR lpTitle, // Title for MessageBox - UINT uType, // Style of MessageBox - BOOL ShowFileNameInTitle, // Flag to show FileName in Caption - ...); - -int UtilMessageBoxCatastrophicVA( - UINT uText, // Text for MessageBox - UINT uTitle, // Title for MessageBox - UINT uType, // Style of MessageBox - BOOL ShowFileNameInTitle, // Flag to show FileName in Caption - va_list args); // Additional Arguments - -int UtilMessageBoxCatastrophicNonLocalizedVA( - LPCWSTR lpText, // Text for MessageBox - LPCWSTR lpTitle, // Title for MessageBox - UINT uType, // Style of MessageBox - BOOL ShowFileNameInTitle, // Flag to show FileName in Caption - va_list args); // Additional Arguments - +HRESULT UtilLoadResourceString(CCompRC::ResourceCategory eCategory, UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax); // The HRESULT_FROM_WIN32 macro evaluates its arguments three times. // TODO: All HRESULT_FROM_WIN32(GetLastError()) should be replaced by calls to @@ -926,20 +678,46 @@ inline int CountBits(int iNum) return (iBits); } +// Convert the currency to a decimal and canonicalize. +inline void VarDecFromCyCanonicalize(CY cyIn, DECIMAL* dec) +{ + WRAPPER_NO_CONTRACT; + + (*(ULONG*)dec) = 0; + DECIMAL_HI32(*dec) = 0; + if (cyIn.int64 == 0) // For compatibility, a currency of 0 emits the Decimal "0.0000" (scale set to 4). + { + DECIMAL_SCALE(*dec) = 4; + DECIMAL_LO32(*dec) = 0; + DECIMAL_MID32(*dec) = 0; + return; + } + + if (cyIn.int64 < 0) { + DECIMAL_SIGN(*dec) = DECIMAL_NEG; + cyIn.int64 = -cyIn.int64; + } + + BYTE scale = 4; + ULONGLONG absoluteCy = (ULONGLONG)cyIn.int64; + while (scale != 0 && ((absoluteCy % 10) == 0)) + { + scale--; + absoluteCy /= 10; + } + DECIMAL_SCALE(*dec) = scale; + DECIMAL_LO32(*dec) = (ULONG)absoluteCy; + DECIMAL_MID32(*dec) = (ULONG)(absoluteCy >> 32); +} + //***************************************************************************** // // Paths functions. Use these instead of the CRT. // //***************************************************************************** -// secure version! Specify the size of the each buffer in count of elements -void SplitPath(const WCHAR *path, - __inout_z __inout_ecount_opt(driveSizeInWords) WCHAR *drive, int driveSizeInWords, - __inout_z __inout_ecount_opt(dirSizeInWords) WCHAR *dir, int dirSizeInWords, - __inout_z __inout_ecount_opt(fnameSizeInWords) WCHAR *fname, size_t fnameSizeInWords, - __inout_z __inout_ecount_opt(extSizeInWords) WCHAR *ext, size_t extSizeInWords); //******************************************************************************* -// A much more sensible version that just points to each section of the string. +// Split a path into individual components - points to each section of the string //******************************************************************************* void SplitPathInterior( _In_ LPCWSTR wszPath, @@ -949,25 +727,6 @@ void SplitPathInterior( _Out_opt_ LPCWSTR *pwszExt, _Out_opt_ size_t *pcchExt); -void MakePath(_Out_ CQuickWSTR &path, - _In_ LPCWSTR drive, - _In_ LPCWSTR dir, - _In_ LPCWSTR fname, - _In_ LPCWSTR ext); - -WCHAR * FullPath(_Out_writes_ (maxlen) WCHAR *UserBuf, const WCHAR *path, size_t maxlen); - -//***************************************************************************** -// -// SString version of the path functions. -// -//***************************************************************************** -void SplitPath(_In_ SString const &path, - __inout_opt SString *drive, - __inout_opt SString *dir, - __inout_opt SString *fname, - __inout_opt SString *ext); - #include "ostype.h" #define CLRGetTickCount64() GetTickCount64() @@ -987,42 +746,15 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, // LPVOID ClrVirtualAllocAligned(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect, SIZE_T alignment); -class NumaNodeInfo -{ -private: - static BOOL m_enableGCNumaAware; - static uint16_t m_nNodes; - static BOOL InitNumaNodeInfoAPI(); - -public: - static BOOL CanEnableGCNumaAware(); - static void InitNumaNodeInfo(); - -#if !defined(FEATURE_REDHAWK) -public: // functions - - static LPVOID VirtualAllocExNuma(HANDLE hProc, LPVOID lpAddr, SIZE_T size, - DWORD allocType, DWORD prot, DWORD node); -#ifdef HOST_WINDOWS - static BOOL GetNumaProcessorNodeEx(PPROCESSOR_NUMBER proc_no, PUSHORT node_no); - static bool GetNumaInfo(PUSHORT total_nodes, DWORD* max_procs_per_node); -#else // HOST_WINDOWS - static BOOL GetNumaProcessorNodeEx(USHORT proc_no, PUSHORT node_no); -#endif // HOST_WINDOWS -#endif -}; - #ifdef HOST_WINDOWS struct CPU_Group_Info { - WORD nr_active; // at most 64 - WORD reserved[1]; - WORD begin; - WORD end; - DWORD_PTR active_mask; - DWORD groupWeight; - DWORD activeThreadWeight; + DWORD_PTR active_mask; + WORD nr_active; // at most 64 + WORD begin; + DWORD groupWeight; + DWORD activeThreadWeight; }; class CPUGroupInfo @@ -1038,7 +770,6 @@ class CPUGroupInfo static CPU_Group_Info *m_CPUGroupInfoArray; static BOOL InitCPUGroupInfoArray(); - static BOOL InitCPUGroupInfoRange(); static void InitCPUGroupInfo(); static BOOL IsInitialized(); @@ -1054,7 +785,6 @@ class CPUGroupInfo static bool GetCPUGroupInfo(PUSHORT total_groups, DWORD* max_procs_per_group); //static void PopulateCPUUsageArray(void * infoBuffer, ULONG infoSize); -#if !defined(FEATURE_REDHAWK) public: static BOOL GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP relationship, SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *slpiex, PDWORD count); @@ -1065,7 +795,6 @@ class CPUGroupInfo static void ChooseCPUGroupAffinity(GROUP_AFFINITY *gf); static void ClearCPUGroupAffinity(GROUP_AFFINITY *gf); static BOOL GetCPUGroupRange(WORD group_number, WORD* group_begin, WORD* group_size); -#endif }; DWORD_PTR GetCurrentProcessCpuMask(); @@ -1124,7 +853,7 @@ template class SimpleListNode { public: - SimpleListNode(const T& _t) + SimpleListNode(const T& _t) { data = _t; next = 0; @@ -1140,7 +869,7 @@ class SimpleList public: typedef SimpleListNode NodeType; - SimpleList() + SimpleList() { head = NULL; } @@ -1173,79 +902,6 @@ class SimpleList }; -template < typename T, typename U > -struct Pair -{ -public: - typedef Pair< T, U > this_type; - typedef T first_type; - typedef U second_type; - - Pair() - {} - - Pair( T const & t, U const & u ) - : m_first( t ) - , m_second( u ) - { SUPPORTS_DAC; } - - Pair( this_type const & obj ) - : m_first( obj.m_first ) - , m_second( obj.m_second ) - {} - - this_type & operator=( this_type const & obj ) - { - m_first = obj.m_first; - m_second = obj.m_second; - return *this; - } - - T & First() - { - return m_first; - } - - T const & First() const - { - return m_first; - } - - U & Second() - { - return m_second; - } - - U const & Second() const - { - return m_second; - } - - bool operator==(const Pair& rhs) const - { - return ((this->First() == rhs.First()) && - (this->Second() == rhs.Second())); - } - - bool operator!=(const Pair& rhs) const - { - return !(*this == rhs); - } - -private: - first_type m_first; - second_type m_second; -}; - - -template < typename T, typename U > -Pair< T, U > MakePair( T const & t, U const & u ) -{ - SUPPORTS_DAC; - return Pair< T, U >( t, u ); -} - - //***************************************************************************** // This class implements a dynamic array of structures for which the order of // the elements is unimportant. This means that any item placed in the list @@ -1455,7 +1111,8 @@ T *CUnorderedArrayWithAllocator::Grow() // exception if c // try to allocate memory for reallocation. pTemp = ALLOCATOR::AllocThrowing(this, m_iSize+iGrowInc); - memcpy (pTemp, m_pTable, m_iSize*sizeof(T)); + if (m_iSize > 0) + memcpy (pTemp, m_pTable, m_iSize*sizeof(T)); ALLOCATOR::Free(this, m_pTable); m_pTable = pTemp; m_iSize += iGrowInc; @@ -1673,112 +1330,6 @@ typedef CDynArray ULONGARRAY; typedef CDynArray BYTEARRAY; typedef CDynArray TOKENARRAY; -template class CStackArray : public CStructArray -{ -public: - CStackArray(short iGrowInc=4) : - CStructArray(sizeof(T), iGrowInc), - m_curPos(0) - { - LIMITED_METHOD_CONTRACT; - } - - void Push(T p) - { - WRAPPER_NO_CONTRACT; - // We should only inc m_curPos after we grow the array. - T *pT = (T *)CStructArray::InsertThrowing(m_curPos); - m_curPos ++; - *pT = p; - } - - T * Pop() - { - WRAPPER_NO_CONTRACT; - T * retPtr; - - _ASSERTE(m_curPos > 0); - - retPtr = (T *)CStructArray::Get(m_curPos-1); - CStructArray::Delete(m_curPos--); - - return (retPtr); - } - - int Count() - { - LIMITED_METHOD_CONTRACT; - return(m_curPos); - } - -private: - int m_curPos; -}; - - -//***************************************************************************** -// This template manages a list of free entries by their 0 based offset. By -// making it a template, you can use whatever size free chain will match your -// maximum count of items. -1 is reserved. -//***************************************************************************** -template class TFreeList -{ -public: - void Init( - T *rgList, - int iCount) - { - LIMITED_METHOD_CONTRACT; - // Save off values. - m_rgList = rgList; - m_iCount = iCount; - m_iNext = 0; - - // Init free list. - int i; - for (i=0; i class CQuickSort if (iLeft >= iRight) return; - // ASSERT that we now have valid indicies. This is statically provable - // since this private function is only called with valid indicies, + // ASSERT that we now have valid indices. This is statically provable + // since this private function is only called with valid indices, // and iLeft and iRight only converge towards eachother. However, // PreFast can't detect this because it doesn't know about our callers. COMPILER_ASSUME(iLeft >= 0 && iLeft < m_iCount); @@ -2195,13 +1746,13 @@ class CHashTable //***************************************************************************** // Returns the first entry in the first hash bucket and inits the search // struct. Use the FindNextEntry function to continue walking the list. The -// return order is not gauranteed. +// return order is not guaranteed. //***************************************************************************** BYTE *FindFirstEntry( // First entry found, or 0. HASHFIND *psSrch) // Search object. { WRAPPER_NO_CONTRACT; - if (m_piBuckets == 0) + if (m_piBuckets == nullptr) return (0); psSrch->iBucket = 1; psSrch->iNext = m_piBuckets[0]; @@ -2353,7 +1904,7 @@ class CHashTableAndData : public CHashTable ~CHashTableAndData() { WRAPPER_NO_CONTRACT; - if (m_pcEntries != NULL) + if (m_pcEntries != (TADDR)NULL) MemMgr::Free((BYTE*)m_pcEntries, MemMgr::RoundSize(m_iEntries * m_iEntrySize)); } @@ -2436,7 +1987,7 @@ class CHashTableAndData : public CHashTable // accessors here. So if you're not using these functions, don't start. // We can hopefully remove them. // Note that we can't just make RCThread a friend of this class (we tried - // originally) because the inheritence chain has a private modifier, + // originally) because the inheritance chain has a private modifier, // so DebuggerPatchTable::m_pcEntries is illegal. static SIZE_T helper_GetOffsetOfEntries() { @@ -2533,7 +2084,7 @@ int CHashTableAndData::Grow() // 1 if successful, 0 if not. int iCurSize; // Current size in bytes. int iEntries; // New # of entries. - _ASSERTE(m_pcEntries != NULL); + _ASSERTE(m_pcEntries != (TADDR)NULL); _ASSERTE(m_iFree == UINT32_MAX); // Compute the current size and new # of entries. @@ -2581,32 +2132,6 @@ inline COUNT_T HashPtr(COUNT_T currentHash, PTR_VOID ptr) return HashCOUNT_T(currentHash, COUNT_T(SIZE_T(dac_cast(ptr)))); } -inline DWORD HashThreeToOne(DWORD a, DWORD b, DWORD c) -{ - LIMITED_METHOD_DAC_CONTRACT; - - /* - lookup3.c, by Bob Jenkins, May 2006, Public Domain. - - These are functions for producing 32-bit hashes for hash table lookup. - hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() - are externally useful functions. Routines to test the hash are included - if SELF_TEST is defined. You can use this free for any purpose. It's in - the public domain. It has no warranty. - */ - - #define rot32(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) - c ^= b; c -= rot32(b,14); - a ^= c; a -= rot32(c,11); - b ^= a; b -= rot32(a,25); - c ^= b; c -= rot32(b,16); - a ^= c; a -= rot32(c,4); - b ^= a; b -= rot32(a,14); - c ^= b; c -= rot32(b,24); - - return c; -} - inline ULONG HashBytes(BYTE const *pbData, size_t iSize) { LIMITED_METHOD_CONTRACT; @@ -2659,7 +2184,7 @@ inline ULONG HashStringN(LPCWSTR szStr, SIZE_T cchStr) ULONG *ptr = (ULONG *)szStr; // we assume that szStr is null-terminated - _ASSERTE(cchStr <= wcslen(szStr)); + _ASSERTE(cchStr <= u16_strlen(szStr)); SIZE_T cDwordCount = (cchStr + 1) / 2; for (SIZE_T i = 0; i < cDwordCount; i++) @@ -3022,139 +2547,6 @@ class CClosedHashBase BYTE *m_rgData; // Data element list. }; -//***************************************************************************** -// IMPORTANT: This data structure is deprecated, please do not add any new uses. -// The hashtable implementation that should be used instead is code:SHash. -// If code:SHash does not work for you, talk to mailto:clrdeag. -//***************************************************************************** -template class CClosedHash : public CClosedHashBase -{ -public: - CClosedHash( - int iBuckets, // How many buckets should we start with. - bool bPerfect=false) : // true if bucket size will hash with no collisions. - CClosedHashBase(iBuckets, sizeof(T), bPerfect) - { - WRAPPER_NO_CONTRACT; - } - - T &operator[](int iIndex) - { - WRAPPER_NO_CONTRACT; - return ((T &) *(Data() + (iIndex * sizeof(T)))); - } - - -//***************************************************************************** -// Add a new item to hash table given the key value. If this new entry -// exceeds maximum size, then the table will grow and be re-hashed, which -// may cause a memory error. -//***************************************************************************** - T *Add( // New item to fill out on success. - void *pData) // The value to hash on. - { - WRAPPER_NO_CONTRACT; - return ((T *) CClosedHashBase::Add(pData)); - } - -//***************************************************************************** -// Lookup a key value and return a pointer to the element if found. -//***************************************************************************** - T *Find( // The item if found, 0 if not. - void *pData) // The key to lookup. - { - WRAPPER_NO_CONTRACT; - return ((T *) CClosedHashBase::Find(pData)); - } - -//***************************************************************************** -// Look for an item in the table. If it isn't found, then create a new one and -// return that. -//***************************************************************************** - T *FindOrAdd( // The item if found, 0 if not. - void *pData, // The key to lookup. - bool &bNew) // true if created. - { - WRAPPER_NO_CONTRACT; - return ((T *) CClosedHashBase::FindOrAdd(pData, bNew)); - } - - -//***************************************************************************** -// The following functions are used to traverse each used entry. This code -// will skip over deleted and free entries freeing the caller up from such -// logic. -//***************************************************************************** - T *GetFirst() // The first entry, 0 if none. - { - WRAPPER_NO_CONTRACT; - return ((T *) CClosedHashBase::GetFirst()); - } - - T *GetNext(T *Prev) // The next entry, 0 if done. - { - WRAPPER_NO_CONTRACT; - return ((T *) CClosedHashBase::GetNext((BYTE *) Prev)); - } -}; - - -//***************************************************************************** -// IMPORTANT: This data structure is deprecated, please do not add any new uses. -// The hashtable implementation that should be used instead is code:SHash. -// If code:SHash does not work for you, talk to mailto:clrdeag. -//***************************************************************************** -// Closed hash with typed parameters. The derived class is the second -// parameter to the template. The derived class must implement: -// unsigned long Hash(const T *pData); -// unsigned long Compare(const T *p1, T *p2); -// ELEMENTSTATUS Status(T *pEntry); -// void SetStatus(T *pEntry, ELEMENTSTATUS s); -// void* GetKey(T *pEntry); -//***************************************************************************** -templateclass CClosedHashEx : public CClosedHash -{ -public: - CClosedHashEx( - int iBuckets, // How many buckets should we start with. - bool bPerfect=false) : // true if bucket size will hash with no collisions. - CClosedHash (iBuckets, bPerfect) - { - WRAPPER_NO_CONTRACT; - } - - unsigned int Hash(const void *pData) - { - WRAPPER_NO_CONTRACT; - return static_cast(this)->Hash((const T*)pData); - } - - unsigned int Compare(const void *p1, BYTE *p2) - { - WRAPPER_NO_CONTRACT; - return static_cast(this)->Compare((const T*)p1, (T*)p2); - } - - typename CClosedHash::ELEMENTSTATUS Status(BYTE *p) - { - WRAPPER_NO_CONTRACT; - return static_cast(this)->Status((T*)p); - } - - void SetStatus(BYTE *p, typename CClosedHash::ELEMENTSTATUS s) - { - WRAPPER_NO_CONTRACT; - static_cast(this)->SetStatus((T*)p, s); - } - - void* GetKey(BYTE *p) - { - WRAPPER_NO_CONTRACT; - return static_cast(this)->GetKey((T*)p); - } -}; - - //***************************************************************************** // IMPORTANT: This data structure is deprecated, please do not add any new uses. // The hashtable implementation that should be used instead is code:SHash. @@ -3544,28 +2936,51 @@ class MethodNamesList : public MethodNamesListBase } }; + +// 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 +int GuidToLPSTR(REFGUID guid, CHAR (&s)[N]) +{ + return GuidToLPSTR(guid, s, N); +} + //***************************************************************************** // Convert a pointer to a string into a GUID. //***************************************************************************** -HRESULT LPCSTRToGuid( // Return status. - LPCSTR szGuid, // String to convert. - GUID *psGuid); // Buffer for converted GUID. +BOOL LPCSTRToGuid( + LPCSTR szGuid, // [IN] String to convert. + GUID* pGuid); // [OUT] Buffer for converted GUID. //***************************************************************************** // Convert a GUID into a pointer to a string //***************************************************************************** -int GuidToLPWSTR( // Return status. - GUID Guid, // [IN] The GUID to convert. - _Out_writes_ (cchGuid) LPWSTR szGuid, // [OUT] String into which the GUID is stored - DWORD cchGuid); // [IN] Size in wide chars of szGuid +int GuidToLPWSTR( + REFGUID guid, // [IN] The GUID to convert. + LPWSTR szGuid, // [OUT] String into which the GUID is stored + DWORD cchGuid); // [IN] Size in wide chars of szGuid + +template +int GuidToLPWSTR(REFGUID guid, WCHAR (&s)[N]) +{ + return GuidToLPWSTR(guid, s, N); +} //***************************************************************************** // Parse a Wide char string into a GUID //***************************************************************************** -BOOL LPWSTRToGuid( - GUID * Guid, // [OUT] The GUID to fill in - _In_reads_(cchGuid) LPCWSTR szGuid, // [IN] String to parse - DWORD cchGuid); // [IN] Count in wchars in string +BOOL LPCWSTRToGuid( + LPCWSTR szGuid, // [IN] String to convert. + GUID* pGuid); // [OUT] Buffer for converted GUID. typedef VPTR(class RangeList) PTR_RangeList; @@ -3733,7 +3148,7 @@ BOOL GetRegistryLongValue(HKEY hKeyParent, // Parent key. long *pValue, // Put value here, if found. BOOL fReadNonVirtualizedKey); // Whether to read 64-bit hive on WOW64 -HRESULT GetCurrentModuleFileName(SString& pBuffer); +HRESULT GetCurrentExecutableFileName(SString& pBuffer); //***************************************************************************** // Retrieve information regarding what registered default debugger @@ -3743,6 +3158,7 @@ HRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *p void TrimWhiteSpace(__inout_ecount(*pcch) LPCWSTR *pwsz, __inout LPDWORD pcch); +void OutputDebugStringUtf8(LPCUTF8 utf8str); //***************************************************************************** // Convert a UTF8 string to Unicode, into a CQuickArray. @@ -3752,49 +3168,6 @@ HRESULT Utf2Quick( CQuickArray &rStr, // The QuickArray to convert it into. int iCurLen = 0); // Initial characters in the array to leave (default 0). -//***************************************************************************** -// Extract the movl 64-bit unsigned immediate from an IA64 bundle -// (Format X2) -//***************************************************************************** -UINT64 GetIA64Imm64(UINT64 * pBundle); -UINT64 GetIA64Imm64(UINT64 qword0, UINT64 qword1); - -//***************************************************************************** -// Deposit the movl 64-bit unsigned immediate into an IA64 bundle -// (Format X2) -//***************************************************************************** -void PutIA64Imm64(UINT64 * pBundle, UINT64 imm64); - -//***************************************************************************** -// Extract the IP-Relative signed 25-bit immediate from an IA64 bundle -// (Formats B1, B2 or B3) -// Note that due to branch target alignment requirements -// the lowest four bits in the result will always be zero. -//***************************************************************************** -INT32 GetIA64Rel25(UINT64 * pBundle, UINT32 slot); -INT32 GetIA64Rel25(UINT64 qword0, UINT64 qword1, UINT32 slot); - -//***************************************************************************** -// Deposit the IP-Relative signed 25-bit immediate into an IA64 bundle -// (Formats B1, B2 or B3) -// Note that due to branch target alignment requirements -// the lowest four bits are required to be zero. -//***************************************************************************** -void PutIA64Rel25(UINT64 * pBundle, UINT32 slot, INT32 imm25); - -//***************************************************************************** -// Extract the IP-Relative signed 64-bit immediate from an IA64 bundle -// (Formats X3 or X4) -//***************************************************************************** -INT64 GetIA64Rel64(UINT64 * pBundle); -INT64 GetIA64Rel64(UINT64 qword0, UINT64 qword1); - -//***************************************************************************** -// Deposit the IP-Relative signed 64-bit immediate into a IA64 bundle -// (Formats X3 or X4) -//***************************************************************************** -void PutIA64Rel64(UINT64 * pBundle, INT64 imm64); - //***************************************************************************** // Extract the 32-bit immediate from movw/movt Thumb2 sequence //***************************************************************************** @@ -3845,6 +3218,26 @@ void PutArm64Rel21(UINT32 * pCode, INT32 imm21); //***************************************************************************** void PutArm64Rel12(UINT32 * pCode, INT32 imm12); +//***************************************************************************** +// Extract the PC-Relative page address and page offset from pcalau12i+add/ld +//***************************************************************************** +INT64 GetLoongArch64PC12(UINT32 * pCode); + +//***************************************************************************** +// Extract the jump offset into pcaddu18i+jirl instructions +//***************************************************************************** +INT64 GetLoongArch64JIR(UINT32 * pCode); + +//***************************************************************************** +// Deposit the PC-Relative page address and page offset into pcalau12i+add/ld +//***************************************************************************** +void PutLoongArch64PC12(UINT32 * pCode, INT64 imm); + +//***************************************************************************** +// Deposit the jump offset into pcaddu18i+jirl instructions +//***************************************************************************** +void PutLoongArch64JIR(UINT32 * pCode, INT64 imm); + //***************************************************************************** // Returns whether the offset fits into bl instruction //***************************************************************************** @@ -3900,26 +3293,6 @@ inline BOOL IsGCSpecialThread () return !!(t_ThreadType & ThreadType_GC); } -// check if current thread is a Gate thread -inline BOOL IsGateSpecialThread () -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_MODE_ANY; - - return !!(t_ThreadType & ThreadType_Gate); -} - -// check if current thread is a Timer thread -inline BOOL IsTimerSpecialThread () -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_MODE_ANY; - - return !!(t_ThreadType & ThreadType_Timer); -} - // check if current thread is a debugger helper thread inline BOOL IsDbgHelperSpecialThread () { @@ -3960,33 +3333,6 @@ inline BOOL IsShutdownSpecialThread () return !!(t_ThreadType & ThreadType_Shutdown); } -inline BOOL IsThreadPoolIOCompletionSpecialThread () -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_MODE_ANY; - - return !!(t_ThreadType & ThreadType_Threadpool_IOCompletion); -} - -inline BOOL IsThreadPoolWorkerSpecialThread () -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_MODE_ANY; - - return !!(t_ThreadType & ThreadType_Threadpool_Worker); -} - -inline BOOL IsWaitSpecialThread () -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_MODE_ANY; - - return !!(t_ThreadType & ThreadType_Wait); -} - // check if current thread is a thread which is performing shutdown inline BOOL IsSuspendEEThread () { @@ -4006,15 +3352,6 @@ inline BOOL IsFinalizerThread () return !!(t_ThreadType & ThreadType_Finalizer); } -inline BOOL IsShutdownHelperThread () -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_MODE_ANY; - - return !!(t_ThreadType & ThreadType_ShutdownHelper); -} - inline BOOL IsProfilerAttachThread () { STATIC_CONTRACT_NOTHROW; @@ -4205,48 +3542,13 @@ namespace util } } +INDEBUG(BOOL DbgIsExecutable(LPVOID lpMem, SIZE_T length);) -/* ------------------------------------------------------------------------ * - * Overloaded operators for the executable heap - * ------------------------------------------------------------------------ */ - -#ifdef HOST_WINDOWS - -struct CExecutable { int x; }; -extern const CExecutable executable; - -void * __cdecl operator new(size_t n, const CExecutable&); -void * __cdecl operator new[](size_t n, const CExecutable&); -void * __cdecl operator new(size_t n, const CExecutable&, const NoThrow&); -void * __cdecl operator new[](size_t n, const CExecutable&, const NoThrow&); - - -// -// Executable heap delete to match the executable heap new above. -// -template void DeleteExecutable(T *p) -{ - if (p != NULL) - { - p->T::~T(); - - HeapFree(ClrGetProcessExecutableHeap(), 0, p); - } -} - -#endif // HOST_WINDOWS - -BOOL NoGuiOnAssert(); -#ifdef _DEBUG -VOID TerminateOnAssert(); -#endif // _DEBUG - - -BOOL ThreadWillCreateGuardPage(SIZE_T sizeReservedStack, SIZE_T sizeCommitedStack); - +#ifdef FEATURE_COMINTEROP FORCEINLINE void HolderSysFreeString(BSTR str) { CONTRACT_VIOLATION(ThrowsViolation); SysFreeString(str); } typedef Wrapper BSTRHolder; +#endif BOOL IsIPInModule(PTR_VOID pModuleBaseAddress, PCODE ip); @@ -4399,37 +3701,6 @@ inline T* InterlockedCompareExchangeT( return InterlockedCompareExchangeT(destination, exchange, static_cast(comparand)); } -// NULL pointer variants of the above to avoid having to cast NULL -// to the appropriate pointer type. -template -inline T* InterlockedExchangeT( - T* volatile * target, - int value) // When NULL is provided as argument. -{ - //STATIC_ASSERT(value == 0); - return InterlockedExchangeT(target, nullptr); -} - -template -inline T* InterlockedCompareExchangeT( - T* volatile * destination, - int exchange, // When NULL is provided as argument. - T* comparand) -{ - //STATIC_ASSERT(exchange == 0); - return InterlockedCompareExchangeT(destination, nullptr, comparand); -} - -template -inline T* InterlockedCompareExchangeT( - T* volatile * destination, - T* exchange, - int comparand) // When NULL is provided as argument. -{ - //STATIC_ASSERT(comparand == 0); - return InterlockedCompareExchangeT(destination, exchange, nullptr); -} - #undef InterlockedExchangePointer #define InterlockedExchangePointer Use_InterlockedExchangeT #undef InterlockedCompareExchangePointer @@ -4438,13 +3709,7 @@ inline T* InterlockedCompareExchangeT( // Returns the directory for clr module. So, if path was for "C:\Dir1\Dir2\Filename.DLL", // then this would return "C:\Dir1\Dir2\" (note the trailing backslash). HRESULT GetClrModuleDirectory(SString& wszPath); -HRESULT CopySystemDirectory(const SString& pPathString, SString& pbuffer); - -HMODULE LoadLocalizedResourceDLLForSDK(_In_z_ LPCWSTR wzResourceDllName, _In_opt_z_ LPCWSTR modulePath=NULL, bool trySelf=true); -// This is a slight variation that can be used for anything else -typedef void* (__cdecl *LocalizedFileHandler)(LPCWSTR); -void* FindLocalizedFile(_In_z_ LPCWSTR wzResourceDllName, LocalizedFileHandler lfh, _In_opt_z_ LPCWSTR modulePath=NULL); - +void* GetCurrentModuleBase(); namespace Clr { namespace Util { diff --git a/src/shared/inc/volatile.h b/src/shared/inc/volatile.h index 9a811309ed..efcb25f8ac 100644 --- a/src/shared/inc/volatile.h +++ b/src/shared/inc/volatile.h @@ -68,8 +68,8 @@ #error The Volatile type is currently only defined for Visual C++ and GNU C++ #endif -#if defined(__GNUC__) && !defined(HOST_X86) && !defined(HOST_AMD64) && !defined(HOST_ARM) && !defined(HOST_ARM64) && !defined(HOST_RISCV64) && !defined(HOST_S390X) -#error The Volatile type is currently only defined for GCC when targeting x86, AMD64, ARM, ARM64, RISCV64, or S390X CPUs +#if defined(__GNUC__) && !defined(HOST_X86) && !defined(HOST_AMD64) && !defined(HOST_ARM) && !defined(HOST_ARM64) && !defined(HOST_LOONGARCH64) && !defined(HOST_RISCV64) && !defined(HOST_S390X) && !defined(HOST_POWERPC64) +#error The Volatile type is currently only defined for GCC when targeting x86, AMD64, ARM, ARM64, LOONGARCH64, RISCV64, PPC64LE, or S390X CPUs #endif #if defined(__GNUC__) @@ -79,6 +79,10 @@ #elif defined(HOST_ARM) || defined(HOST_ARM64) // This is functionally equivalent to the MemoryBarrier() macro used on ARM on Windows. #define VOLATILE_MEMORY_BARRIER() asm volatile ("dmb ish" : : : "memory") +#elif defined(HOST_LOONGARCH64) +#define VOLATILE_MEMORY_BARRIER() asm volatile ("dbar 0 " : : : "memory") +#elif defined(HOST_RISCV64) +#define VOLATILE_MEMORY_BARRIER() asm volatile ("fence rw,rw" : : : "memory") #else // // For GCC, we prevent reordering by the compiler by inserting the following after a volatile @@ -99,8 +103,6 @@ // currently don't have a cheap way to determine the number of CPUs from this header file. Revisit this if it // turns out to be a performance issue for the uni-proc case. #define VOLATILE_MEMORY_BARRIER() MemoryBarrier() -#elif defined(HOST_RISCV64) -#define VOLATILE_MEMORY_BARRIER() asm volatile ("fence rw,rw" : : : "memory") #else // // On VC++, reorderings at the compiler and machine level are prevented by the use of the @@ -159,7 +161,6 @@ T VolatileLoad(T const * pt) #elif defined(HOST_ARM64) && defined(_MSC_VER) // silence warnings on casts in branches that are not taken. #pragma warning(push) -#pragma warning(disable : 4302) #pragma warning(disable : 4311) #pragma warning(disable : 4312) T val; @@ -167,16 +168,16 @@ T VolatileLoad(T const * pt) switch (sizeof(T)) { case 1: - *(unsigned __int8* )pv = __ldar8 ((unsigned __int8 volatile*)pt); + *(uint8_t* )pv = __ldar8 ((uint8_t volatile*)pt); break; case 2: - *(unsigned __int16*)pv = __ldar16((unsigned __int16 volatile*)pt); + *(uint16_t*)pv = __ldar16((uint16_t volatile*)pt); break; case 4: - *(unsigned __int32*)pv = __ldar32((unsigned __int32 volatile*)pt); + *(uint32_t*)pv = __ldar32((uint32_t volatile*)pt); break; case 8: - *(unsigned __int64*)pv = __ldar64((unsigned __int64 volatile*)pt); + *(uint64_t*)pv = __ldar64((uint64_t volatile*)pt); break; default: val = *(T volatile const*)pt; @@ -218,7 +219,7 @@ T VolatileLoad(Volatile const * pt) } // -// VolatileStore stores a T into the target of a pointer to T. Is is guaranteed that this store will +// VolatileStore stores a T into the target of a pointer to T. It is guaranteed that this store will // not be optimized away by the compiler, and that any operation that occurs before this store, in program // order, will not be moved after this store. In general, it is not guaranteed that the store will be // atomic, though this is the case for most aligned scalar data types. If you need atomic loads or stores, @@ -245,23 +246,22 @@ void VolatileStore(T* pt, T val) #elif defined(HOST_ARM64) && defined(_MSC_VER) // silence warnings on casts in branches that are not taken. #pragma warning(push) -#pragma warning(disable : 4302) #pragma warning(disable : 4311) #pragma warning(disable : 4312) T* pv = &val; switch (sizeof(T)) { case 1: - __stlr8 ((unsigned __int8 volatile*)pt, *(unsigned __int8* )pv); + __stlr8 ((uint8_t volatile*)pt, *(uint8_t* )pv); break; case 2: - __stlr16((unsigned __int16 volatile*)pt, *(unsigned __int16*)pv); + __stlr16((uint16_t volatile*)pt, *(uint16_t*)pv); break; case 4: - __stlr32((unsigned __int32 volatile*)pt, *(unsigned __int32*)pv); + __stlr32((uint32_t volatile*)pt, *(uint32_t*)pv); break; case 8: - __stlr64((unsigned __int64 volatile*)pt, *(unsigned __int64*)pv); + __stlr64((uint64_t volatile*)pt, *(uint64_t*)pv); break; default: __dmb(_ARM64_BARRIER_ISH); @@ -308,7 +308,7 @@ void VolatileLoadBarrier() __dmb(_ARM64_BARRIER_ISHLD); #else VOLATILE_MEMORY_BARRIER(); -#endif +#endif } // @@ -331,6 +331,9 @@ void VolatileLoadBarrier() template class Volatile { + // To enable the DAC table to correctly handle volatile DAC-ized statics while also being computed at compile time, we need to + // give the dac table type access to the internal field directly to take the address of it. + friend struct _DacGlobals; private: // // The data which we are treating as volatile @@ -339,12 +342,9 @@ class Volatile public: // - // Default constructor. Results in an unitialized value! + // Default constructor. // - inline Volatile() - { - STATIC_CONTRACT_SUPPORTS_DAC; - } + inline Volatile() = default; // // Allow initialization of Volatile from a T diff --git a/src/shared/inc/winwrap.h b/src/shared/inc/winwrap.h index 0c1b7c2245..07821ea9d1 100644 --- a/src/shared/inc/winwrap.h +++ b/src/shared/inc/winwrap.h @@ -1,30 +1,17 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + //***************************************************************************** // WinWrap.h // -// This file contains wrapper functions for Win32 API's that take strings. -// -// The Common Language Runtime internally uses UNICODE as the internal state -// and string format. This file will undef the mapping macros so that one -// cannot mistakingly call a method that isn't going to work. Instead, you -// have to call the correct wrapper API. +// This file contains wrapper functions for Win32 API's. // //***************************************************************************** #ifndef __WIN_WRAP_H__ #define __WIN_WRAP_H__ -//********** Macros. ********************************************************** -#if !defined(WIN32_LEAN_AND_MEAN) -#define WIN32_LEAN_AND_MEAN -#endif - -// -// WinCE uniformly uses cdecl calling convention on x86. __stdcall is defined as __cdecl in SDK. -// STDCALL macro is meant to be used where we have hard dependency on __stdcall calling convention -// - the unification with __cdecl does not apply to STDCALL. -// +// STDCALL macro is meant to be used where we have hard dependency on __stdcall calling convention on x86. #define STDCALL _stdcall //********** Includes. ******************************************************** @@ -34,159 +21,15 @@ #include #include -#include "registrywrapper.h" #include "longfilepathwrappers.h" -#if defined(_PREFAST_) || defined(SOURCE_FORMATTING) -// -// For PREFAST we don't want the C_ASSERT to be expanded since it always -// involves the comparison of two constants which causes PREfast warning 326 -// -#undef C_ASSERT -#define C_ASSERT(expr) -#endif - #include "palclr.h" -#if !defined(__TODO_PORT_TO_WRAPPERS__) -//***************************************************************************** -// Undefine all of the windows wrappers so you can't use them. -//***************************************************************************** - -// winbase.h -#undef GetBinaryType -#undef GetShortPathName -#undef GetEnvironmentStrings -#undef FreeEnvironmentStrings -#undef FormatMessage -#undef lstrcmp -#undef lstrcmpi -#undef lstrcpyn -#undef lstrlen -#undef CreateMutex -#undef OpenMutex -#undef CreateEvent -#undef OpenEvent #undef CreateSemaphore -#undef OpenSemaphore -#undef CreateWaitableTimer -#undef CreateFileMapping -#undef OpenFileMapping -#undef LoadLibrary -#undef LoadLibraryEx -#undef GetModuleFileName -#undef GetModuleHandle -#undef GetModuleHandleEx -#undef CreateProcess -#undef GetCommandLine -#undef GetEnvironmentVariable -#undef SetEnvironmentVariable -#undef ExpandEnvironmentStrings -#undef OutputDebugString -#undef FindResource -#undef FindResourceEx -#undef BeginUpdateResource -#undef UpdateResource -#undef EndUpdateResource -#undef GetPrivateProfileInt -#undef GetSystemDirectory -#undef GetTempPath -#undef GetTempFileName -#undef GetCurrentDirectory -#undef GetFullPathName -#undef CreateFile -#undef GetFileAttributes -#undef GetFileAttributesEx -#undef DeleteFile -#undef FindFirstFileEx -#undef FindFirstFile -#undef FindNextFile -#undef CopyFile -#undef CopyFileEx -#undef MoveFile -#undef MoveFileEx -#undef CreateHardLink -#undef CreateNamedPipe -#undef WaitNamedPipe -#undef LookupPrivilegeValue -#undef GetVersionEx - -// winuser.h -#undef MAKEINTRESOURCE -#undef GetUserObjectInformation -#undef GetMessage - -#undef SendMessage -#undef CharLower -#undef MessageBox -#undef GetClassName -#undef LoadString -#undef GetCalendarInfo -#undef GetDateFormat -#undef GetTimeFormat -#undef LCMapString - -#endif // !defined(__TODO_PORT_TO_WRAPPERS__) - -// -// NT supports the wide entry points. So we redefine the wrappers right back -// to the *W entry points as macros. This way no client code needs a wrapper on NT. -// - -// winbase.h -#define WszFormatMessage FormatMessageW -#define Wszlstrcmp lstrcmpW -#define Wszlstrcmpi lstrcmpiW -#define WszCreateMutex CreateMutexW -#define WszOpenMutex OpenMutexW #define WszCreateEvent CreateEventW #define WszOpenEvent OpenEventW -#define WszCreateWaitableTimer CreateWaitableTimerW #define WszCreateFileMapping CreateFileMappingW -#define WszOpenFileMapping OpenFileMappingW -#define WszGetModuleHandle GetModuleHandleW -#define WszGetModuleHandleEx GetModuleHandleExW -#define WszGetCommandLine GetCommandLineW -#define WszSetEnvironmentVariable SetEnvironmentVariableW -#define WszExpandEnvironmentStrings ExpandEnvironmentStringsW -#define WszOutputDebugString OutputDebugStringW -#define WszFindResource FindResourceW -#define WszFindResourceEx FindResourceExW -#define WszBeginUpdateResource BeginUpdateResourceW -#define WszUpdateResource UpdateResourceW -#define WszEndUpdateResource EndUpdateResourceW -#define WszGetPrivateProfileInt GetPrivateProfileIntW -#define WszGetSystemDirectory GetSystemDirectoryW -#define WszCreateNamedPipe CreateNamedPipeW -#define WszWaitNamedPipe WaitNamedPipeW -#define WszLookupPrivilegeValue LookupPrivilegeValueW - -// winuser.h -#define WszMAKEINTRESOURCE MAKEINTRESOURCEW -#define WszGetUserObjectInformation GetUserObjectInformationW -#define WszGetMessage GetMessageW -#define WszSendMessage SendMessageW -#define WszCharLower CharLowerW -#define WszMessageBox LateboundMessageBoxW -#define WszGetClassName GetClassNameW -#define WszLoadString LoadStringW -#define WszRegOpenKeyEx ClrRegOpenKeyEx -#define WszRegOpenKey(hKey, wszSubKey, phkRes) ClrRegOpenKeyEx(hKey, wszSubKey, 0, KEY_ALL_ACCESS, phkRes) -#define WszRegQueryValue RegQueryValueW -#define WszRegQueryValueEx RegQueryValueExW -#define WszRegQueryValueExTrue RegQueryValueExW -#define WszRegQueryStringValueEx RegQueryValueExW - -#define WszRegQueryInfoKey RegQueryInfoKeyW -#define WszRegEnumValue RegEnumValueW -#define WszRegEnumKeyEx RegEnumKeyExW -#define WszGetCalendarInfo GetCalendarInfoW -#define WszGetDateFormat GetDateFormatW -#define WszGetTimeFormat GetTimeFormatW -#define WszLCMapString LCMapStringW -#define WszMultiByteToWideChar MultiByteToWideChar -#define WszWideCharToMultiByte WideCharToMultiByte -#define WszCreateSemaphore(_secattr, _count, _maxcount, _name) CreateSemaphoreExW((_secattr), (_count), (_maxcount), (_name), 0, MAXIMUM_ALLOWED | SYNCHRONIZE | SEMAPHORE_MODIFY_STATE) +#define CreateSemaphore(_secattr, _count, _maxcount, _name) CreateSemaphoreExW((_secattr), (_count), (_maxcount), (_name), 0, MAXIMUM_ALLOWED | SYNCHRONIZE | SEMAPHORE_MODIFY_STATE) #undef GetFileVersionInfo #define GetFileVersionInfo(_filename, _handle, _len, _data) GetFileVersionInfoEx(0, (_filename), (_handle), (_len), (_data)) @@ -199,71 +42,27 @@ //File and Directory Functions which need special handling for LongFile Names //Note only the functions which are currently used are defined +#ifdef HOST_WINDOWS #define WszLoadLibrary LoadLibraryExWrapper -#define WszLoadLibraryEx LoadLibraryExWrapper #define WszCreateFile CreateFileWrapper -#define WszGetFileAttributes GetFileAttributesWrapper #define WszGetFileAttributesEx GetFileAttributesExWrapper -#define WszDeleteFile DeleteFileWrapper -#define WszFindFirstFileEx FindFirstFileExWrapper -#define WszFindNextFile FindNextFileW -#define WszMoveFileEx MoveFileExWrapper - -//Can not use extended syntax -#define WszGetFullPathName GetFullPathNameW - -//Long Files will not work on these till redstone -#define WszGetCurrentDirectory GetCurrentDirectoryWrapper -#define WszGetTempFileName GetTempFileNameWrapper -#define WszGetTempPath GetTempPathWrapper +#else // HOST_WINDOWS +#define WszLoadLibrary LoadLibraryExW +#define WszCreateFile CreateFileW +#define WszGetFileAttributesEx GetFileAttributesExW +#endif // HOST_WINDOWS //APIS which have a buffer as an out parameter #define WszGetEnvironmentVariable GetEnvironmentVariableWrapper #define WszSearchPath SearchPathWrapper #define WszGetModuleFileName GetModuleFileNameWrapper -//NOTE: IF the following API's are enabled ensure that they can work with LongFile Names -//See the usage and implementation of above API's -// -//#define WszGetBinaryType GetBinaryTypeWrapper //Coresys does not seem to have this API - -#if HOST_UNIX -#define WszFindFirstFile FindFirstFileW +#ifdef HOST_WINDOWS +DWORD GetMaxDBCSCharByteSize(); #else -#define WszFindFirstFile(_lpFileName_, _lpFindData_) FindFirstFileExWrapper(_lpFileName_, FindExInfoStandard, _lpFindData_, FindExSearchNameMatch, NULL, 0) -#endif // HOST_UNIX -//***************************************************************************** -// Prototypes for API's. -//***************************************************************************** - -extern DWORD g_dwMaxDBCSCharByteSize; - -void EnsureCharSetInfoInitialized(); - -inline DWORD GetMaxDBCSCharByteSize() -{ - // contract.h not visible here - __annotation(W("WRAPPER ") W("GetMaxDBCSCharByteSize")); -#ifndef HOST_UNIX - EnsureCharSetInfoInitialized(); - - _ASSERTE(g_dwMaxDBCSCharByteSize != 0); - return (g_dwMaxDBCSCharByteSize); -#else // HOST_UNIX - return 3; -#endif // HOST_UNIX -} - -#ifndef Wsz_mbstowcs -#define Wsz_mbstowcs(szOut, szIn, iSize) WszMultiByteToWideChar(CP_ACP, 0, szIn, -1, szOut, iSize) -#endif - -#ifndef Wsz_wcstombs -#define Wsz_wcstombs(szOut, szIn, iSize) WszWideCharToMultiByte(CP_ACP, 0, szIn, -1, szOut, iSize, 0, 0) +#define GetMaxDBCSCharByteSize() 3 // UTF8 #endif -// For all platforms: - BOOL WszCreateProcess( LPCWSTR lpApplicationName, @@ -278,199 +77,4 @@ WszCreateProcess( LPPROCESS_INFORMATION lpProcessInformation ); -#if defined(HOST_X86) && defined(_MSC_VER) - -// -// Windows SDK does not use intrinsics on x86. Redefine the interlocked operations to use intrinsics. -// - -#include "intrin.h" - -#define InterlockedIncrement _InterlockedIncrement -#define InterlockedDecrement _InterlockedDecrement -#define InterlockedExchange _InterlockedExchange -#define InterlockedCompareExchange _InterlockedCompareExchange -#define InterlockedExchangeAdd _InterlockedExchangeAdd -#define InterlockedCompareExchange64 _InterlockedCompareExchange64 -#define InterlockedAnd _InterlockedAnd -#define InterlockedOr _InterlockedOr - -// -// There is no _InterlockedCompareExchangePointer intrinsic in VC++ for x86. -// winbase.h #defines InterlockedCompareExchangePointer as __InlineInterlockedCompareExchangePointer, -// which calls the Win32 InterlockedCompareExchange, not the intrinsic _InterlockedCompareExchange. -// We want the intrinsic, so we #undef the Windows version of this API, and define our own. -// -#ifdef InterlockedCompareExchangePointer -#undef InterlockedCompareExchangePointer -#endif - -FORCEINLINE -PVOID -InterlockedCompareExchangePointer ( - __inout PVOID volatile *Destination, - _In_opt_ PVOID ExChange, - _In_opt_ PVOID Comperand - ) -{ - return((PVOID)(LONG_PTR)_InterlockedCompareExchange((LONG volatile *)Destination, (LONG)(LONG_PTR)ExChange, (LONG)(LONG_PTR)Comperand)); -} - -#endif // HOST_X86 && _MSC_VER - -#if defined(HOST_X86) & !defined(InterlockedIncrement64) - -// Interlockedxxx64 that do not have intrinsics are only supported on Windows Server 2003 -// or higher for X86 so define our own portable implementation - -#undef InterlockedIncrement64 -#define InterlockedIncrement64 __InterlockedIncrement64 -#undef InterlockedDecrement64 -#define InterlockedDecrement64 __InterlockedDecrement64 -#undef InterlockedExchange64 -#define InterlockedExchange64 __InterlockedExchange64 -#undef InterlockedExchangeAdd64 -#define InterlockedExchangeAdd64 __InterlockedExchangeAdd64 - -__forceinline LONGLONG __InterlockedIncrement64(LONGLONG volatile *Addend) -{ - LONGLONG Old; - - do { - Old = *Addend; - } while (InterlockedCompareExchange64(Addend, - Old + 1, - Old) != Old); - - return Old + 1; -} - -__forceinline LONGLONG __InterlockedDecrement64(LONGLONG volatile *Addend) -{ - LONGLONG Old; - - do { - Old = *Addend; - } while (InterlockedCompareExchange64(Addend, - Old - 1, - Old) != Old); - - return Old - 1; -} - -__forceinline LONGLONG __InterlockedExchange64(LONGLONG volatile * Target, LONGLONG Value) -{ - LONGLONG Old; - - do { - Old = *Target; - } while (InterlockedCompareExchange64(Target, - Value, - Old) != Old); - - return Old; -} - -__forceinline LONGLONG __InterlockedExchangeAdd64(LONGLONG volatile * Addend, LONGLONG Value) -{ - LONGLONG Old; - - do { - Old = *Addend; - } while (InterlockedCompareExchange64(Addend, - Old + Value, - Old) != Old); - - return Old; -} - -#endif // HOST_X86 - -// Output printf-style formatted text to the debugger if it's present or stdout otherwise. -inline void DbgWPrintf(const LPCWSTR wszFormat, ...) -{ - WCHAR wszBuffer[4096]; - - va_list args; - va_start(args, wszFormat); - - _vsnwprintf_s(wszBuffer, sizeof(wszBuffer) / sizeof(WCHAR), _TRUNCATE, wszFormat, args); - - va_end(args); - - if (IsDebuggerPresent()) - { - OutputDebugStringW(wszBuffer); - } - else - { - fwprintf(stdout, W("%s"), wszBuffer); - fflush(stdout); - } -} - -typedef int (*MessageBoxWFnPtr)(HWND hWnd, - LPCWSTR lpText, - LPCWSTR lpCaption, - UINT uType); - -inline int LateboundMessageBoxW(HWND hWnd, - LPCWSTR lpText, - LPCWSTR lpCaption, - UINT uType) -{ -#ifndef HOST_UNIX - // User32 should exist on all systems where displaying a message box makes sense. - HMODULE hGuiExtModule = WszLoadLibrary(W("user32")); - if (hGuiExtModule) - { - int result = IDCANCEL; - MessageBoxWFnPtr fnptr = (MessageBoxWFnPtr)GetProcAddress(hGuiExtModule, "MessageBoxW"); - if (fnptr) - result = fnptr(hWnd, lpText, lpCaption, uType); - - FreeLibrary(hGuiExtModule); - return result; - } -#endif // !HOST_UNIX - - // No luck. Output the caption and text to the debugger if present or stdout otherwise. - if (lpText == NULL) - lpText = W(""); - if (lpCaption == NULL) - lpCaption = W(""); - DbgWPrintf(W("**** MessageBox invoked, title '%s' ****\n"), lpCaption); - DbgWPrintf(W(" %s\n"), lpText); - DbgWPrintf(W("********\n")); - DbgWPrintf(W("\n")); - - // Indicate to the caller that message box was not actually displayed - SetLastError(ERROR_NOT_SUPPORTED); - return 0; -} - -inline int LateboundMessageBoxA(HWND hWnd, - LPCSTR lpText, - LPCSTR lpCaption, - UINT uType) -{ - if (lpText == NULL) - lpText = ""; - if (lpCaption == NULL) - lpCaption = ""; - - SIZE_T cchText = strlen(lpText) + 1; - LPWSTR wszText = (LPWSTR)_alloca(cchText * sizeof(WCHAR)); - swprintf_s(wszText, cchText, W("%S"), lpText); - - SIZE_T cchCaption = strlen(lpCaption) + 1; - LPWSTR wszCaption = (LPWSTR)_alloca(cchCaption * sizeof(WCHAR)); - swprintf_s(wszCaption, cchCaption, W("%S"), lpCaption); - - return LateboundMessageBoxW(hWnd, wszText, wszCaption, uType); -} - -#define MessageBoxW LateboundMessageBoxW -#define MessageBoxA LateboundMessageBoxA - #endif // __WIN_WRAP_H__ diff --git a/src/shared/inc/xclrdata.idl b/src/shared/inc/xclrdata.idl index aeddf9529b..943fe9ac67 100644 --- a/src/shared/inc/xclrdata.idl +++ b/src/shared/inc/xclrdata.idl @@ -2080,7 +2080,7 @@ interface IXCLRDataFrame : IUnknown /* * Return an argument by (0-based) index. - * The name parameter is filled in if name information is availble. + * The name parameter is filled in if name information is available. */ HRESULT GetArgumentByIndex([in] ULONG32 index, [out] IXCLRDataValue** arg, @@ -2095,7 +2095,7 @@ interface IXCLRDataFrame : IUnknown /* * Return a local variable by (0-based) index. - * The name parameter is filled in if name information is availble. + * The name parameter is filled in if name information is available. */ HRESULT GetLocalVariableByIndex([in] ULONG32 index, [out] IXCLRDataValue** localVariable, @@ -2177,7 +2177,7 @@ typedef enum } CLRDataExceptionSameFlag; #pragma warning(push) -#pragma warning(disable:28718) /* suppress warning 28718 for inteface IXCLRDataExceptionState */ +#pragma warning(disable:28718) /* suppress warning 28718 for interface IXCLRDataExceptionState */ [ object, local, diff --git a/src/shared/inc/yieldprocessornormalized.h b/src/shared/inc/yieldprocessornormalized.h index 121e60b033..e37bf79f0c 100644 --- a/src/shared/inc/yieldprocessornormalized.h +++ b/src/shared/inc/yieldprocessornormalized.h @@ -3,14 +3,11 @@ #pragma once -// Undefine YieldProcessor to encourage using the normalized versions below instead. System_YieldProcessor() can be used where -// the intention is to use the system-default implementation of YieldProcessor(). -#define HAS_SYSTEM_YIELDPROCESSOR +#ifdef FEATURE_NATIVEAOT +FORCEINLINE void System_YieldProcessor() { PalYieldProcessor(); } +#else FORCEINLINE void System_YieldProcessor() { YieldProcessor(); } -#ifdef YieldProcessor -#undef YieldProcessor #endif -#define YieldProcessor Dont_Use_YieldProcessor #define DISABLE_COPY(T) \ T(const T &) = delete; \ @@ -144,9 +141,9 @@ FORCEINLINE void YieldProcessorNormalized(const YieldProcessorNormalizationInfo { _ASSERTE(count != 0); - if (sizeof(SIZE_T) <= sizeof(unsigned int)) + if (sizeof(size_t) <= sizeof(unsigned int)) { - // On platforms with a small SIZE_T, prevent overflow on the multiply below + // On platforms with a small size_t, prevent overflow on the multiply below const unsigned int MaxCount = UINT_MAX / YieldProcessorNormalization::MaxYieldsPerNormalizedYield; if (count > MaxCount) { @@ -154,7 +151,7 @@ FORCEINLINE void YieldProcessorNormalized(const YieldProcessorNormalizationInfo } } - SIZE_T n = (SIZE_T)count * normalizationInfo.yieldsPerNormalizedYield; + size_t n = (size_t)count * normalizationInfo.yieldsPerNormalizedYield; _ASSERTE(n != 0); do { @@ -189,9 +186,9 @@ FORCEINLINE void YieldProcessorNormalizedForPreSkylakeCount( { _ASSERTE(preSkylakeCount != 0); - if (sizeof(SIZE_T) <= sizeof(unsigned int)) + if (sizeof(size_t) <= sizeof(unsigned int)) { - // On platforms with a small SIZE_T, prevent overflow on the multiply below + // On platforms with a small size_t, prevent overflow on the multiply below const unsigned int MaxCount = UINT_MAX / YieldProcessorNormalization::MaxYieldsPerNormalizedYield; if (preSkylakeCount > MaxCount) { @@ -200,7 +197,7 @@ FORCEINLINE void YieldProcessorNormalizedForPreSkylakeCount( } const unsigned int PreSkylakeCountToSkylakeCountDivisor = 8; - SIZE_T n = (SIZE_T)preSkylakeCount * normalizationInfo.yieldsPerNormalizedYield / PreSkylakeCountToSkylakeCountDivisor; + size_t n = (size_t)preSkylakeCount * normalizationInfo.yieldsPerNormalizedYield / PreSkylakeCountToSkylakeCountDivisor; if (n == 0) { n = 1; @@ -227,9 +224,9 @@ FORCEINLINE void YieldProcessorNormalizedForPreSkylakeCount(unsigned int preSkyl _ASSERTE(preSkylakeCount != 0); - if (sizeof(SIZE_T) <= sizeof(unsigned int)) + if (sizeof(size_t) <= sizeof(unsigned int)) { - // On platforms with a small SIZE_T, prevent overflow on the multiply below + // On platforms with a small size_t, prevent overflow on the multiply below const unsigned int MaxCount = UINT_MAX / YieldProcessorNormalization::MaxYieldsPerNormalizedYield; if (preSkylakeCount > MaxCount) { @@ -238,8 +235,8 @@ FORCEINLINE void YieldProcessorNormalizedForPreSkylakeCount(unsigned int preSkyl } const unsigned int PreSkylakeCountToSkylakeCountDivisor = 8; - SIZE_T n = - (SIZE_T)preSkylakeCount * + size_t n = + (size_t)preSkylakeCount * YieldProcessorNormalization::s_yieldsPerNormalizedYield / PreSkylakeCountToSkylakeCountDivisor; if (n == 0) @@ -268,11 +265,11 @@ FORCEINLINE void YieldProcessorWithBackOffNormalized( unsigned int spinIteration) { // This shift value should be adjusted based on the asserted conditions below - const UINT8 MaxShift = 3; - static_assert_no_msg( - ((unsigned int)1 << MaxShift) <= YieldProcessorNormalization::MaxOptimalMaxNormalizedYieldsPerSpinIteration); - static_assert_no_msg( - ((unsigned int)1 << (MaxShift + 1)) > YieldProcessorNormalization::MaxOptimalMaxNormalizedYieldsPerSpinIteration); + const uint8_t MaxShift = 3; + static_assert( + ((unsigned int)1 << MaxShift) <= YieldProcessorNormalization::MaxOptimalMaxNormalizedYieldsPerSpinIteration, ""); + static_assert( + ((unsigned int)1 << (MaxShift + 1)) > YieldProcessorNormalization::MaxOptimalMaxNormalizedYieldsPerSpinIteration, ""); unsigned int n; if (spinIteration <= MaxShift && diff --git a/src/shared/minipal/CMakeLists.txt b/src/shared/minipal/CMakeLists.txt new file mode 100644 index 0000000000..78a1726af3 --- /dev/null +++ b/src/shared/minipal/CMakeLists.txt @@ -0,0 +1,8 @@ +include_directories(.) +include_directories(${CLR_SRC_NATIVE_DIR}) +if (CLR_CMAKE_HOST_UNIX) + add_subdirectory(Unix) +else (CLR_CMAKE_HOST_UNIX) + add_subdirectory(Windows) +endif (CLR_CMAKE_HOST_UNIX) + diff --git a/src/shared/minipal/Unix/CMakeLists.txt b/src/shared/minipal/Unix/CMakeLists.txt new file mode 100644 index 0000000000..02a912d364 --- /dev/null +++ b/src/shared/minipal/Unix/CMakeLists.txt @@ -0,0 +1,18 @@ +set(SOURCES + dn-u16.cpp + ${CLR_SRC_NATIVE_DIR}/minipal/time.c +) + +if(NOT CLR_CROSS_COMPONENTS_BUILD) + list(APPEND SOURCES + ${CLR_SRC_NATIVE_DIR}/minipal/cpufeatures.c + ) +endif() + +add_library(coreclrminipal + STATIC + ${SOURCES} +) + +include(${CLR_SRC_NATIVE_DIR}/minipal/configure.cmake) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/shared/minipal/Unix/dn-u16.cpp b/src/shared/minipal/Unix/dn-u16.cpp new file mode 100644 index 0000000000..7832e50102 --- /dev/null +++ b/src/shared/minipal/Unix/dn-u16.cpp @@ -0,0 +1,195 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +typedef char16_t WCHAR; + +#include +#include + +size_t u16_strlen(const WCHAR* str) +{ + size_t nChar = 0; + while (*str++) + nChar++; + return nChar; +} + +int u16_strcmp(const WCHAR* str1, const WCHAR* str2) +{ + return u16_strncmp(str1, str2, 0x7fffffff); +} + +int u16_strncmp(const WCHAR* str1, const WCHAR* str2, size_t count) +{ + int diff = 0; + for (size_t i = 0; i < count; i++) + { + diff = str1[i] - str2[i]; + if (diff != 0) + break; + + // stop if we reach the end of the string + if(str1[i] == (WCHAR)'\0') + break; + } + return diff; +} + +WCHAR* u16_strcat_s(WCHAR* dst, size_t dstLen, const WCHAR* src) +{ + if (dst == nullptr || src == nullptr) + { + return nullptr; + } + + WCHAR* start = dst; + WCHAR* end = dst + dstLen; + + // find end of source string + while (*dst) + { + dst++; + if (dst >= end) + return nullptr; + } + + // concatenate new string + size_t srcLength = u16_strlen(src); + size_t loopCount = 0; + while (*src && loopCount < srcLength) + { + *dst++ = *src++; + if (dst >= end) + return nullptr; + loopCount++; + } + + // add terminating null + *dst = (WCHAR)'\0'; + return start; +} + +WCHAR* u16_strcpy_s(WCHAR* dst, size_t dstLen, const WCHAR* src) +{ + if (dst == nullptr || src == nullptr) + { + return nullptr; + } + + WCHAR* start = dst; + WCHAR* end = dst + dstLen; + + // copy source string to destination string + while (*src) + { + *dst++ = *src++; + if (dst >= end) + return nullptr; + } + + // add terminating null + *dst = (WCHAR)'\0'; + return start; +} + +WCHAR* u16_strncpy_s(WCHAR* dst, size_t dstLen, const WCHAR* src, size_t count) +{ + ::memset(dst, 0, dstLen * sizeof(WCHAR)); + + size_t srcLength = u16_strlen(src); + size_t length = (count < srcLength) ? count : srcLength; + if (length > dstLen) + return nullptr; + + ::memcpy(dst, src, length * sizeof(WCHAR)); + return dst; +} + +const WCHAR* u16_strstr(const WCHAR *str, const WCHAR *strCharSet) +{ + if (str == nullptr || strCharSet == nullptr) + { + return nullptr; + } + + // No characters to examine + if (u16_strlen(strCharSet) == 0) + return str; + + const WCHAR* ret = nullptr; + int i; + while (*str != (WCHAR)'\0') + { + i = 0; + while (true) + { + if (*(strCharSet + i) == (WCHAR)'\0') + { + ret = str; + goto LEAVE; + } + else if (*(str + i) == (WCHAR)'\0') + { + ret = nullptr; + goto LEAVE; + } + else if (*(str + i) != *(strCharSet + i)) + { + break; + } + i++; + } + str++; + } + LEAVE: + return ret; +} + +const WCHAR* u16_strchr(const WCHAR* str, WCHAR ch) +{ + while (*str) + { + if (*str == ch) + return str; + str++; + } + + // Check if the comparand was \000 + if (*str == ch) + return str; + + return nullptr; +} + +const WCHAR* u16_strrchr(const WCHAR* str, WCHAR ch) +{ + const WCHAR* last = nullptr; + while (*str) + { + if (*str == ch) + last = str; + str++; + } + + return last; +} + +// Forward declare PAL function +extern "C" uint32_t PAL_wcstoul(const WCHAR* nptr, WCHAR** endptr, int base); +extern "C" uint64_t PAL__wcstoui64(const WCHAR* nptr, WCHAR** endptr, int base); +extern "C" double PAL_wcstod(const WCHAR* nptr, WCHAR** endptr); + +uint32_t u16_strtoul(const WCHAR* nptr, WCHAR** endptr, int base) +{ + return PAL_wcstoul(nptr, endptr, base); +} + +uint64_t u16_strtoui64(const WCHAR* nptr, WCHAR** endptr, int base) +{ + return PAL__wcstoui64(nptr, endptr, base); +} + +double u16_strtod(const WCHAR* nptr, WCHAR** endptr) +{ + return PAL_wcstod(nptr, endptr); +} \ No newline at end of file diff --git a/src/shared/minipal/Windows/CMakeLists.txt b/src/shared/minipal/Windows/CMakeLists.txt new file mode 100644 index 0000000000..3ae032655a --- /dev/null +++ b/src/shared/minipal/Windows/CMakeLists.txt @@ -0,0 +1,16 @@ +set(SOURCES + dn-u16.cpp + ${CLR_SRC_NATIVE_DIR}/minipal/utf8.c + ${CLR_SRC_NATIVE_DIR}/minipal/time.c +) + +if(NOT CLR_CROSS_COMPONENTS_BUILD) + list(APPEND SOURCES + ${CLR_SRC_NATIVE_DIR}/minipal/cpufeatures.c + ) +endif() + +add_library(coreclrminipal + STATIC + ${SOURCES} +) diff --git a/src/shared/minipal/Windows/dn-u16.cpp b/src/shared/minipal/Windows/dn-u16.cpp new file mode 100644 index 0000000000..c915a8907b --- /dev/null +++ b/src/shared/minipal/Windows/dn-u16.cpp @@ -0,0 +1,73 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include +#include + +#include + +size_t u16_strlen(const WCHAR* str) +{ + return ::wcslen(str); +} + +int u16_strcmp(const WCHAR* str1, const WCHAR* str2) +{ + return ::wcscmp(str1, str2); +} + +int u16_strncmp(const WCHAR* str1, const WCHAR* str2, size_t count) +{ + return ::wcsncmp(str1, str2, count); +} + +WCHAR* u16_strcpy_s(WCHAR* dst, size_t dstLen, const WCHAR* src) +{ + if (0 != ::wcscpy_s(dst, dstLen, src)) + return nullptr; + return dst; +} + +WCHAR* u16_strcat_s(WCHAR* dst, size_t dstLen, const WCHAR* src) +{ + if (0 != ::wcscat_s(dst, dstLen, src)) + return nullptr; + return dst; +} + +WCHAR* u16_strncpy_s(WCHAR* dst, size_t dstLen, const WCHAR* src, size_t count) +{ + if (0 != ::wcsncpy_s(dst, dstLen, src, count)) + return nullptr; + return dst; +} + +const WCHAR* u16_strstr(const WCHAR *str, const WCHAR *strCharSet) +{ + return ::wcsstr(str, strCharSet); +} + +const WCHAR* u16_strchr(const WCHAR* str, WCHAR ch) +{ + return ::wcschr(str, ch); +} + +const WCHAR* u16_strrchr(const WCHAR* str, WCHAR ch) +{ + return ::wcsrchr(str, ch); +} + +uint32_t u16_strtoul(const WCHAR* nptr, WCHAR** endptr, int base) +{ + return ::wcstoul(nptr, endptr, base); +} + +uint64_t u16_strtoui64(const WCHAR* nptr, WCHAR** endptr, int base) +{ + return ::_wcstoui64(nptr, endptr, base); +} + +double u16_strtod(const WCHAR* nptr, WCHAR** endptr) +{ + return ::wcstod(nptr, endptr); +} \ No newline at end of file diff --git a/src/shared/minipal/dn-u16.h b/src/shared/minipal/dn-u16.h new file mode 100644 index 0000000000..73279aca16 --- /dev/null +++ b/src/shared/minipal/dn-u16.h @@ -0,0 +1,22 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include +#include + +// +// Wide character (UTF-16) abstraction layer. +// + +size_t u16_strlen(const WCHAR* str); +int u16_strcmp(const WCHAR* str1, const WCHAR* str2); +int u16_strncmp(const WCHAR* str1, const WCHAR* str2, size_t count); +WCHAR* u16_strcat_s(WCHAR* dst, size_t dstLen, const WCHAR* src); +WCHAR* u16_strcpy_s(WCHAR* dst, size_t dstLen, const WCHAR* src); +WCHAR* u16_strncpy_s(WCHAR* dst, size_t dstLen, const WCHAR* src, size_t count); +const WCHAR* u16_strstr(const WCHAR* str, const WCHAR* strCharSet); +const WCHAR* u16_strchr(const WCHAR* str, WCHAR ch); +const WCHAR* u16_strrchr(const WCHAR* str, WCHAR ch); +uint32_t u16_strtoul(const WCHAR* nptr, WCHAR** endptr, int base); +uint64_t u16_strtoui64(const WCHAR* nptr, WCHAR** endptr, int base); +double u16_strtod(const WCHAR* nptr, WCHAR** endptr); \ No newline at end of file diff --git a/src/shared/minipal/minipal.h b/src/shared/minipal/minipal.h new file mode 100644 index 0000000000..38ab07ec63 --- /dev/null +++ b/src/shared/minipal/minipal.h @@ -0,0 +1,78 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +#include + +// Interface between the runtime and platform specific functionality +class VMToOSInterface +{ +private: + ~VMToOSInterface() {} +public: + // Create double mapped memory mapper + // Parameters: + // pHandle - receives handle of the double mapped memory mapper + // pMaxExecutableCodeSize - receives the maximum executable memory size it can map + // Return: + // true if it succeeded, false if it failed + static bool CreateDoubleMemoryMapper(void **pHandle, size_t *pMaxExecutableCodeSize); + + // Destroy the double mapped memory mapper represented by the passed in handle + // Parameters: + // mapperHandle - handle of the double mapped memory mapper to destroy + static void DestroyDoubleMemoryMapper(void *mapperHandle); + + // Reserve a block of memory that can be double mapped. + // Parameters: + // mapperHandle - handle of the double mapped memory mapper to use + // offset - offset in the underlying shared memory + // size - size of the block to reserve + // rangeStart + // rangeEnd - Requests reserving virtual memory in the specified range. + // Setting both rangeStart and rangeEnd to 0 means that the + // requested range is not limited. + // When a specific range is requested, it is obligatory. + // Return: + // starting virtual address of the reserved memory or NULL if it failed + static void* ReserveDoubleMappedMemory(void *mapperHandle, size_t offset, size_t size, const void *rangeStart, const void* rangeEnd); + + // Commit a block of memory in the range previously reserved by the ReserveDoubleMappedMemory + // Parameters: + // pStart - start address of the virtual address range to commit + // size - size of the memory block to commit + // isExecutable - true means that the mapping should be RX, false means RW + // Return: + // Committed range start + static void* CommitDoubleMappedMemory(void* pStart, size_t size, bool isExecutable); + + // Release a block of virtual memory previously committed by the CommitDoubleMappedMemory + // Parameters: + // mapperHandle - handle of the double mapped memory mapper to use + // pStart - start address of the virtual address range to release. It must be one + // that was previously returned by the CommitDoubleMappedMemory + // offset - offset in the underlying shared memory + // size - size of the memory block to release + // Return: + // true if it succeeded, false if it failed + static bool ReleaseDoubleMappedMemory(void *mapperHandle, void* pStart, size_t offset, size_t size); + + // Get a RW mapping for the RX block specified by the arguments + // Parameters: + // mapperHandle - handle of the double mapped memory mapper to use + // pStart - start address of the RX virtual address range. + // offset - offset in the underlying shared memory + // size - size of the memory block to map as RW + // Return: + // Starting virtual address of the RW mapping. + static void* GetRWMapping(void *mapperHandle, void* pStart, size_t offset, size_t size); + + // Release RW mapping of the block specified by the arguments + // Parameters: + // pStart - Start address of the RW virtual address range. It must be an address + // previously returned by the GetRWMapping. + // size - Size of the memory block to release. It must be the size previously + // passed to the GetRWMapping that returned the pStart. + // Return: + // true if it succeeded, false if it failed + static bool ReleaseRWMapping(void* pStart, size_t size); +}; diff --git a/src/shared/minipal/utils.h b/src/shared/minipal/utils.h deleted file mode 100644 index 140ea158fd..0000000000 --- a/src/shared/minipal/utils.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#ifndef HAVE_MINIPAL_UTILS_H -#define HAVE_MINIPAL_UTILS_H - -#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0])) - -// Number of characters in a string literal. Excludes terminating NULL. -#define STRING_LENGTH(str) (ARRAY_SIZE(str) - 1) - -#endif // HAVE_MINIPAL_UTILS_H diff --git a/src/shared/native/minipal/asansupport.cpp b/src/shared/native/minipal/asansupport.cpp new file mode 100644 index 0000000000..b5873cd95b --- /dev/null +++ b/src/shared/native/minipal/asansupport.cpp @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +#include "utils.h" + +// Use a typedef here as __declspec + pointer return type causes a parse error in MSVC +typedef const char* charptr_t; +extern "C" charptr_t SANITIZER_CALLBACK_CALLCONV __asan_default_options() { + // symbolize=1 to get symbolized stack traces + // use_sigaltstack=0 as coreclr uses own alternate stack for signal handlers + // detect_leaks=0 as coreclr intentionally doesn't clean up all memory on exit + // handle_segv=0 as coreclr has it causes AddressSanitizer to crash the process even when in + // the middle of a block that is allowed to AV and can recover from AVs. + // (see the AVInRuntimeImplOkayHolder mechanism in CoreCLR for an example) + // allocator_may_return_null=1 as .NET handles this gracefully by throwing an OutOfMemoryException. + return "symbolize=1 use_sigaltstack=0 detect_leaks=0 handle_segv=0 allocator_may_return_null=1"; +} + +extern "C" void SANITIZER_CALLBACK_CALLCONV __asan_on_error() { +} diff --git a/src/shared/native/minipal/configure.cmake b/src/shared/native/minipal/configure.cmake new file mode 100644 index 0000000000..5394fb8774 --- /dev/null +++ b/src/shared/native/minipal/configure.cmake @@ -0,0 +1,16 @@ +include(CheckFunctionExists) +include(CheckIncludeFiles) +include(CheckSymbolExists) + +check_include_files("sys/auxv.h;asm/hwcap.h" HAVE_AUXV_HWCAP_H) +check_function_exists(sysctlbyname HAVE_SYSCTLBYNAME) + +check_symbol_exists(arc4random_buf "stdlib.h" HAVE_ARC4RANDOM_BUF) +check_symbol_exists(O_CLOEXEC fcntl.h HAVE_O_CLOEXEC) + +check_symbol_exists( + clock_gettime_nsec_np + time.h + HAVE_CLOCK_GETTIME_NSEC_NP) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/minipalconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/minipalconfig.h) diff --git a/src/shared/native/minipal/cpufeatures.c b/src/shared/native/minipal/cpufeatures.c new file mode 100644 index 0000000000..8d6a063ce4 --- /dev/null +++ b/src/shared/native/minipal/cpufeatures.c @@ -0,0 +1,473 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include +#include +#include +#include +#include +#include + +#include "cpufeatures.h" +#include "cpuid.h" + +#if HOST_WINDOWS + +#include + +#ifndef PF_ARM_SVE_INSTRUCTIONS_AVAILABLE +#define PF_ARM_SVE_INSTRUCTIONS_AVAILABLE (46) +#endif + +#else // HOST_WINDOWS + +#include "minipalconfig.h" + +#if HAVE_AUXV_HWCAP_H + +#include +#include + +// Light-up for hardware capabilities that are not present in older headers used by the portable build. +#ifndef HWCAP_ASIMDRDM +#define HWCAP_ASIMDRDM (1 << 12) +#endif +#ifndef HWCAP_LRCPC +#define HWCAP_LRCPC (1 << 15) +#endif +#ifndef HWCAP_ILRCPC +#define HWCAP_ILRCPC (1 << 26) +#endif +#ifndef HWCAP_ASIMDDP +#define HWCAP_ASIMDDP (1 << 20) +#endif +#ifndef HWCAP_SVE +#define HWCAP_SVE (1 << 22) +#endif + +#endif + +#if HAVE_SYSCTLBYNAME +#include +#endif + +#endif // !HOST_WINDOWS + +#if defined(HOST_UNIX) +#if defined(HOST_X86) || defined(HOST_AMD64) + +static uint32_t xmmYmmStateSupport() +{ + uint32_t eax; + __asm(" xgetbv\n" \ + : "=a"(eax) /*output in eax*/\ + : "c"(0) /*inputs - 0 in ecx*/\ + : "edx" /* registers that are clobbered*/ + ); + // check OS has enabled both XMM and YMM state support + return ((eax & 0x06) == 0x06) ? 1 : 0; +} + +#ifndef XSTATE_MASK_AVX512 +#define XSTATE_MASK_AVX512 (0xE0) /* 0b1110_0000 */ +#endif // XSTATE_MASK_AVX512 + +static uint32_t avx512StateSupport() +{ +#if defined(HOST_APPLE) + // MacOS has specialized behavior where it reports AVX512 support but doesnt + // actually enable AVX512 until the first instruction is executed and does so + // on a per thread basis. It does this by catching the faulting instruction and + // checking for the EVEX encoding. The kmov instructions, despite being part + // of the AVX512 instruction set are VEX encoded and dont trigger the enablement + // + // See https://github.com/apple/darwin-xnu/blob/main/osfmk/i386/fpu.c#L174 + + // TODO-AVX512: Enabling this for OSX requires ensuring threads explicitly trigger + // the AVX-512 enablement so that arbitrary usage doesn't cause downstream problems + + return false; +#else + uint32_t eax; + __asm(" xgetbv\n" \ + : "=a"(eax) /*output in eax*/\ + : "c"(0) /*inputs - 0 in ecx*/\ + : "edx" /* registers that are clobbered*/ + ); + // check OS has enabled XMM, YMM and ZMM state support + return ((eax & 0xE6) == 0x0E6) ? 1 : 0; +#endif +} + +static bool IsAvxEnabled() +{ + return true; +} + +static bool IsAvx512Enabled() +{ + return true; +} +#endif // defined(HOST_X86) || defined(HOST_AMD64) +#endif // HOST_UNIX + +#if defined(HOST_WINDOWS) +#if defined(HOST_X86) || defined(HOST_AMD64) +static uint32_t xmmYmmStateSupport() +{ + // check OS has enabled both XMM and YMM state support + return ((_xgetbv(0) & 0x06) == 0x06) ? 1 : 0; +} + +static uint32_t avx512StateSupport() +{ + // check OS has enabled XMM, YMM and ZMM state support + return ((_xgetbv(0) & 0xE6) == 0x0E6) ? 1 : 0; +} + +static bool IsAvxEnabled() +{ + DWORD64 FeatureMask = GetEnabledXStateFeatures(); + return ((FeatureMask & XSTATE_MASK_AVX) != 0); +} + +static bool IsAvx512Enabled() +{ + DWORD64 FeatureMask = GetEnabledXStateFeatures(); + return ((FeatureMask & XSTATE_MASK_AVX512) != 0); +} + +#endif // defined(HOST_X86) || defined(HOST_AMD64) +#endif // HOST_WINDOWS + +int minipal_getcpufeatures(void) +{ + int result = 0; + +#if defined(HOST_X86) || defined(HOST_AMD64) + + int cpuidInfo[4]; + + const int CPUID_EAX = 0; + const int CPUID_EBX = 1; + const int CPUID_ECX = 2; + const int CPUID_EDX = 3; + + __cpuid(cpuidInfo, 0x00000000); + uint32_t maxCpuId = (uint32_t)cpuidInfo[CPUID_EAX]; + assert(maxCpuId >= 1); + + __cpuid(cpuidInfo, 0x00000001); + + assert((cpuidInfo[CPUID_EDX] & (1 << 25)) != 0); // SSE + assert((cpuidInfo[CPUID_EDX] & (1 << 26)) != 0); // SSE2 + + if ((cpuidInfo[CPUID_ECX] & (1 << 25)) != 0) // AESNI + { + result |= XArchIntrinsicConstants_Aes; + } + + if ((cpuidInfo[CPUID_ECX] & (1 << 1)) != 0) // PCLMULQDQ + { + result |= XArchIntrinsicConstants_Pclmulqdq; + } + + if ((cpuidInfo[CPUID_ECX] & (1 << 0)) != 0) // SSE3 + { + result |= XArchIntrinsicConstants_Sse3; + + if ((cpuidInfo[CPUID_ECX] & (1 << 9)) != 0) // SSSE3 + { + result |= XArchIntrinsicConstants_Ssse3; + + if ((cpuidInfo[CPUID_ECX] & (1 << 19)) != 0) // SSE4.1 + { + result |= XArchIntrinsicConstants_Sse41; + + if ((cpuidInfo[CPUID_ECX] & (1 << 20)) != 0) // SSE4.2 + { + result |= XArchIntrinsicConstants_Sse42; + + if ((cpuidInfo[CPUID_ECX] & (1 << 22)) != 0) // MOVBE + { + result |= XArchIntrinsicConstants_Movbe; + } + + if ((cpuidInfo[CPUID_ECX] & (1 << 23)) != 0) // POPCNT + { + result |= XArchIntrinsicConstants_Popcnt; + } + + const int requiredAvxEcxFlags = (1 << 27) // OSXSAVE + | (1 << 28); // AVX + + if ((cpuidInfo[CPUID_ECX] & requiredAvxEcxFlags) == requiredAvxEcxFlags) + { + if (IsAvxEnabled() && (xmmYmmStateSupport() == 1)) // XGETBV == 11 + { + result |= XArchIntrinsicConstants_Avx; + + if ((cpuidInfo[CPUID_ECX] & (1 << 12)) != 0) // FMA + { + result |= XArchIntrinsicConstants_Fma; + } + + if (maxCpuId >= 0x07) + { + __cpuidex(cpuidInfo, 0x00000007, 0x00000000); + + if ((cpuidInfo[CPUID_EBX] & (1 << 5)) != 0) // AVX2 + { + result |= XArchIntrinsicConstants_Avx2; + + if (IsAvx512Enabled() && (avx512StateSupport() == 1)) // XGETBV XRC0[7:5] == 111 + { + if (((cpuidInfo[CPUID_EBX] & (1 << 16)) != 0) && // AVX512F + ((cpuidInfo[CPUID_EBX] & (1 << 30)) != 0) && // AVX512BW + ((cpuidInfo[CPUID_EBX] & (1 << 28)) != 0) && // AVX512CD + ((cpuidInfo[CPUID_EBX] & (1 << 17)) != 0) && // AVX512DQ + ((cpuidInfo[CPUID_EBX] & (1 << 31)) != 0)) // AVX512VL + { + // While the AVX-512 ISAs can be individually lit-up, they really + // need F, BW, CD, DQ, and VL to be fully functional without adding + // significant complexity into the JIT. Additionally, unlike AVX/AVX2 + // there was never really any hardware that didn't provide all 5 at + // once, with the notable exception being Knight's Landing which + // provided a similar but not quite the same feature. + + result |= XArchIntrinsicConstants_Evex; + result |= XArchIntrinsicConstants_Avx512; + + if ((cpuidInfo[CPUID_ECX] & (1 << 1)) != 0) // AVX512VBMI + { + result |= XArchIntrinsicConstants_Avx512Vbmi; + } + } + } + + __cpuidex(cpuidInfo, 0x00000007, 0x00000001); + + if ((cpuidInfo[CPUID_EAX] & (1 << 4)) != 0) // AVX-VNNI + { + result |= XArchIntrinsicConstants_AvxVnni; + } + + if ((cpuidInfo[CPUID_EDX] & (1 << 19)) != 0) // Avx10 + { + __cpuidex(cpuidInfo, 0x00000024, 0x00000000); + uint8_t avx10Version = (uint8_t)(cpuidInfo[CPUID_EBX] & 0xFF); + + if((avx10Version >= 1) && + ((cpuidInfo[CPUID_EBX] & (1 << 16)) != 0) && // Avx10/V128 + ((cpuidInfo[CPUID_EBX] & (1 << 17)) != 0)) // Avx10/V256 + { + result |= XArchIntrinsicConstants_Evex; + result |= XArchIntrinsicConstants_Avx10v1; + + // We assume that the Avx10/V512 support can be inferred from + // both Avx10v1 and Avx512 being present. + assert(((cpuidInfo[CPUID_EBX] & (1 << 18)) != 0) == // Avx10/V512 + ((result & XArchIntrinsicConstants_Avx512) != 0)); + } + } + } + } + } + } + } + } + } + } + + if (maxCpuId >= 0x07) + { + __cpuidex(cpuidInfo, 0x00000007, 0x00000000); + + if ((cpuidInfo[CPUID_EBX] & (1 << 3)) != 0) // BMI1 + { + result |= XArchIntrinsicConstants_Bmi1; + } + + if ((cpuidInfo[CPUID_EBX] & (1 << 8)) != 0) // BMI2 + { + result |= XArchIntrinsicConstants_Bmi2; + } + + if ((cpuidInfo[CPUID_EDX] & (1 << 14)) != 0) + { + result |= XArchIntrinsicConstants_Serialize; // SERIALIZE + } + } + + __cpuid(cpuidInfo, 0x80000000); + uint32_t maxCpuIdEx = (uint32_t)cpuidInfo[CPUID_EAX]; + + if (maxCpuIdEx >= 0x80000001) + { + __cpuid(cpuidInfo, 0x80000001); + + if ((cpuidInfo[CPUID_ECX] & (1 << 5)) != 0) // LZCNT + { + result |= XArchIntrinsicConstants_Lzcnt; + } + + } +#endif // HOST_X86 || HOST_AMD64 + +#if defined(HOST_ARM64) +#if defined(HOST_UNIX) + +#if HAVE_AUXV_HWCAP_H + unsigned long hwCap = getauxval(AT_HWCAP); + + if (hwCap & HWCAP_AES) + result |= ARM64IntrinsicConstants_Aes; + + if (hwCap & HWCAP_ATOMICS) + result |= ARM64IntrinsicConstants_Atomics; + + if (hwCap & HWCAP_CRC32) + result |= ARM64IntrinsicConstants_Crc32; + + if (hwCap & HWCAP_ASIMDDP) + result |= ARM64IntrinsicConstants_Dp; + + if (hwCap & HWCAP_LRCPC) + result |= ARM64IntrinsicConstants_Rcpc; + + if (hwCap & HWCAP_ILRCPC) + result |= ARM64IntrinsicConstants_Rcpc2; + + if (hwCap & HWCAP_SHA1) + result |= ARM64IntrinsicConstants_Sha1; + + if (hwCap & HWCAP_SHA2) + result |= ARM64IntrinsicConstants_Sha256; + + if (hwCap & HWCAP_ASIMD) + result |= ARM64IntrinsicConstants_AdvSimd; + + if (hwCap & HWCAP_ASIMDRDM) + result |= ARM64IntrinsicConstants_Rdm; + + if (hwCap & HWCAP_SVE) + result |= ARM64IntrinsicConstants_Sve; + +#else // !HAVE_AUXV_HWCAP_H + +#if HAVE_SYSCTLBYNAME + int64_t valueFromSysctl = 0; + size_t sz = sizeof(valueFromSysctl); + + if ((sysctlbyname("hw.optional.arm.FEAT_AES", &valueFromSysctl, &sz, NULL, 0) == 0) && (valueFromSysctl != 0)) + result |= ARM64IntrinsicConstants_Aes; + + if ((sysctlbyname("hw.optional.armv8_crc32", &valueFromSysctl, &sz, NULL, 0) == 0) && (valueFromSysctl != 0)) + result |= ARM64IntrinsicConstants_Crc32; + + if ((sysctlbyname("hw.optional.arm.FEAT_DotProd", &valueFromSysctl, &sz, NULL, 0) == 0) && (valueFromSysctl != 0)) + result |= ARM64IntrinsicConstants_Dp; + + if ((sysctlbyname("hw.optional.arm.FEAT_RDM", &valueFromSysctl, &sz, NULL, 0) == 0) && (valueFromSysctl != 0)) + result |= ARM64IntrinsicConstants_Rdm; + + if ((sysctlbyname("hw.optional.arm.FEAT_SHA1", &valueFromSysctl, &sz, NULL, 0) == 0) && (valueFromSysctl != 0)) + result |= ARM64IntrinsicConstants_Sha1; + + if ((sysctlbyname("hw.optional.arm.FEAT_SHA256", &valueFromSysctl, &sz, NULL, 0) == 0) && (valueFromSysctl != 0)) + result |= ARM64IntrinsicConstants_Sha256; + + if ((sysctlbyname("hw.optional.armv8_1_atomics", &valueFromSysctl, &sz, NULL, 0) == 0) && (valueFromSysctl != 0)) + result |= ARM64IntrinsicConstants_Atomics; + + if ((sysctlbyname("hw.optional.arm.FEAT_LRCPC", &valueFromSysctl, &sz, NULL, 0) == 0) && (valueFromSysctl != 0)) + result |= ARM64IntrinsicConstants_Rcpc; + + if ((sysctlbyname("hw.optional.arm.FEAT_LRCPC2", &valueFromSysctl, &sz, NULL, 0) == 0) && (valueFromSysctl != 0)) + result |= ARM64IntrinsicConstants_Rcpc2; +#endif // HAVE_SYSCTLBYNAME + + // Every ARM64 CPU should support SIMD and FP + // If the OS have no function to query for CPU capabilities we set just these + + result |= ARM64IntrinsicConstants_AdvSimd; +#endif // HAVE_AUXV_HWCAP_H +#endif // HOST_UNIX + +#if defined(HOST_WINDOWS) + // FP and SIMD support are enabled by default + result |= ARM64IntrinsicConstants_AdvSimd; + + if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) + { + result |= ARM64IntrinsicConstants_Aes; + result |= ARM64IntrinsicConstants_Sha1; + result |= ARM64IntrinsicConstants_Sha256; + } + + if (IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE)) + { + result |= ARM64IntrinsicConstants_Crc32; + } + + if (IsProcessorFeaturePresent(PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE)) + { + result |= ARM64IntrinsicConstants_Atomics; + } + + if (IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)) + { + result |= ARM64IntrinsicConstants_Dp; + } + + if (IsProcessorFeaturePresent(PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE)) + { + result |= ARM64IntrinsicConstants_Rcpc; + } + + // TODO: IsProcessorFeaturePresent doesn't support LRCPC2 yet. + + if (IsProcessorFeaturePresent(PF_ARM_SVE_INSTRUCTIONS_AVAILABLE)) + { + result |= ARM64IntrinsicConstants_Sve; + } + +#endif // HOST_WINDOWS + +#endif // HOST_ARM64 + + return result; +} + +// Detect if the current process is running under the Apple Rosetta x64 emulator +bool minipal_detect_rosetta(void) +{ +#if defined(HOST_AMD64) || defined(HOST_X86) + // Check for CPU brand indicating emulation + int regs[4]; + char brand[49]; + + // Get the maximum value for extended function CPUID info + __cpuid(regs, (int)0x80000000); + if ((unsigned int)regs[0] < 0x80000004) + { + return false; // Extended CPUID not supported + } + + // Retrieve the CPU brand string + for (unsigned int i = 0x80000002; i <= 0x80000004; ++i) + { + __cpuid(regs, (int)i); + memcpy(brand + (i - 0x80000002) * sizeof(regs), regs, sizeof(regs)); + } + brand[sizeof(brand) - 1] = '\0'; + + // Check if CPU brand indicates emulation + if (strstr(brand, "VirtualApple") != NULL) + { + return true; + } +#endif // HOST_AMD64 || HOST_X86 + + return false; +} diff --git a/src/shared/native/minipal/cpufeatures.h b/src/shared/native/minipal/cpufeatures.h new file mode 100644 index 0000000000..6422fe33f9 --- /dev/null +++ b/src/shared/native/minipal/cpufeatures.h @@ -0,0 +1,73 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_CPUFEATURES_H +#define HAVE_MINIPAL_CPUFEATURES_H + +// +// Should match the constants defined in the compiler in HardwareIntrinsicHelpers.cs +// + +#if defined(HOST_X86) || defined(HOST_AMD64) +enum XArchIntrinsicConstants +{ + XArchIntrinsicConstants_Aes = 0x0001, + XArchIntrinsicConstants_Pclmulqdq = 0x0002, + XArchIntrinsicConstants_Sse3 = 0x0004, + XArchIntrinsicConstants_Ssse3 = 0x0008, + XArchIntrinsicConstants_Sse41 = 0x0010, + XArchIntrinsicConstants_Sse42 = 0x0020, + XArchIntrinsicConstants_Popcnt = 0x0040, + XArchIntrinsicConstants_Avx = 0x0080, + XArchIntrinsicConstants_Fma = 0x0100, + XArchIntrinsicConstants_Avx2 = 0x0200, + XArchIntrinsicConstants_Bmi1 = 0x0400, + XArchIntrinsicConstants_Bmi2 = 0x0800, + XArchIntrinsicConstants_Lzcnt = 0x1000, + XArchIntrinsicConstants_AvxVnni = 0x2000, + XArchIntrinsicConstants_Movbe = 0x4000, + XArchIntrinsicConstants_Avx512 = 0x8000, + XArchIntrinsicConstants_Avx512Vbmi = 0x10000, + XArchIntrinsicConstants_Serialize = 0x20000, + XArchIntrinsicConstants_Avx10v1 = 0x40000, + XArchIntrinsicConstants_Evex = 0x80000, +}; +#endif // HOST_X86 || HOST_AMD64 + +#if defined(HOST_ARM64) +enum ARM64IntrinsicConstants +{ + ARM64IntrinsicConstants_AdvSimd = 0x0001, + ARM64IntrinsicConstants_Aes = 0x0002, + ARM64IntrinsicConstants_Crc32 = 0x0004, + ARM64IntrinsicConstants_Dp = 0x0008, + ARM64IntrinsicConstants_Rdm = 0x0010, + ARM64IntrinsicConstants_Sha1 = 0x0020, + ARM64IntrinsicConstants_Sha256 = 0x0040, + ARM64IntrinsicConstants_Atomics = 0x0080, + ARM64IntrinsicConstants_Rcpc = 0x0100, + ARM64IntrinsicConstants_Rcpc2 = 0x0200, + ARM64IntrinsicConstants_Sve = 0x0400, +}; + +#include + +// Bit position for the ARM64IntrinsicConstants_Atomics flags, to be used with tbz / tbnz instructions +#define ARM64_ATOMICS_FEATURE_FLAG_BIT 7 +static_assert((1 << ARM64_ATOMICS_FEATURE_FLAG_BIT) == ARM64IntrinsicConstants_Atomics, "ARM64_ATOMICS_FEATURE_FLAG_BIT must match with ARM64IntrinsicConstants_Atomics"); + +#endif // HOST_ARM64 + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +int minipal_getcpufeatures(void); +bool minipal_detect_rosetta(void); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif diff --git a/src/shared/native/minipal/cpuid.h b/src/shared/native/minipal/cpuid.h new file mode 100644 index 0000000000..8020775dd6 --- /dev/null +++ b/src/shared/native/minipal/cpuid.h @@ -0,0 +1,57 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_CPUID_H +#define HAVE_MINIPAL_CPUID_H + +#if defined(HOST_X86) || defined(HOST_AMD64) + +#if defined(HOST_WINDOWS) + +#include + +#endif // HOST_WINDOWS + +#if defined(HOST_UNIX) + +#include + +// MSVC directly defines intrinsics for __cpuid and __cpuidex matching the below signatures +// We define matching signatures for use on Unix platforms. +// +// IMPORTANT: Unlike MSVC, Unix does not explicitly zero ECX for __cpuid + +#if !__has_builtin(__cpuid) +static void __cpuid(int cpuInfo[4], int function_id) +{ + // Based on the Clang implementation provided in cpuid.h: + // https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/cpuid.h + + __asm(" cpuid\n" \ + : "=a"(cpuInfo[0]), "=b"(cpuInfo[1]), "=c"(cpuInfo[2]), "=d"(cpuInfo[3]) \ + : "0"(function_id) + ); +} +#else +void __cpuid(int cpuInfo[4], int function_id); +#endif + +#if !__has_builtin(__cpuidex) +static void __cpuidex(int cpuInfo[4], int function_id, int subFunction_id) +{ + // Based on the Clang implementation provided in cpuid.h: + // https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/cpuid.h + + __asm(" cpuid\n" \ + : "=a"(cpuInfo[0]), "=b"(cpuInfo[1]), "=c"(cpuInfo[2]), "=d"(cpuInfo[3]) \ + : "0"(function_id), "2"(subFunction_id) + ); +} +#else +void __cpuidex(int cpuInfo[4], int function_id, int subFunction_id); +#endif + +#endif // HOST_UNIX +#endif // defined(HOST_X86) || defined(HOST_AMD64) + +#endif diff --git a/src/shared/native/minipal/entrypoints.h b/src/shared/native/minipal/entrypoints.h new file mode 100644 index 0000000000..5ef45699ca --- /dev/null +++ b/src/shared/native/minipal/entrypoints.h @@ -0,0 +1,34 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_ENTRYPOINTS_H +#define HAVE_MINIPAL_ENTRYPOINTS_H + +#include +#include +#include + +typedef struct +{ + const char* name; + const void* method; +} Entry; + +// expands to: {"impl", (void*)&impl}, +#define DllImportEntry(impl) \ + {#impl, (void*)&impl}, + +static const void* minipal_resolve_dllimport(const Entry* resolutionTable, size_t tableLength, const char* name) +{ + for (size_t i = 0; i < tableLength; i++) + { + if (strcmp(name, resolutionTable[i].name) == 0) + { + return resolutionTable[i].method; + } + } + + return NULL; +} + +#endif // HAVE_MINIPAL_ENTRYPOINTS_H diff --git a/src/shared/minipal/getexepath.h b/src/shared/native/minipal/getexepath.h similarity index 79% rename from src/shared/minipal/getexepath.h rename to src/shared/native/minipal/getexepath.h index 3c9ad5368a..607088cd3f 100644 --- a/src/shared/minipal/getexepath.h +++ b/src/shared/native/minipal/getexepath.h @@ -30,21 +30,15 @@ extern "C" { static inline char* minipal_getexepath(void) { #if defined(__APPLE__) - uint32_t path_length = 0; - if (_NSGetExecutablePath(NULL, &path_length) != -1) + uint32_t len = PATH_MAX; + char pathBuf[PATH_MAX]; + if (_NSGetExecutablePath(pathBuf, &len) != 0) { errno = EINVAL; return NULL; } - char* path_buf = (char*)alloca(path_length); - if (_NSGetExecutablePath(path_buf, &path_length) != 0) - { - errno = EINVAL; - return NULL; - } - - return realpath(path_buf, NULL); + return realpath(pathBuf, NULL); #elif defined(__FreeBSD__) static const int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 }; char path[PATH_MAX]; @@ -75,13 +69,6 @@ static inline char* minipal_getexepath(void) // This is a packaging convention that our tooling should enforce. return strdup("/managed"); #else -#if HAVE_GETAUXVAL && defined(AT_EXECFN) - const char* path = (const char *)(getauxval(AT_EXECFN)); - if (path && !errno) - { - return realpath(path, NULL); - } -#endif // HAVE_GETAUXVAL && defined(AT_EXECFN) #ifdef __linux__ const char* symlinkEntrypointExecutable = "/proc/self/exe"; #else @@ -89,7 +76,23 @@ static inline char* minipal_getexepath(void) #endif // Resolve the symlink to the executable from /proc - return realpath(symlinkEntrypointExecutable, NULL); + char* path = realpath(symlinkEntrypointExecutable, NULL); + if (path) + { + return path; + } + +#if HAVE_GETAUXVAL && defined(AT_EXECFN) + // fallback to AT_EXECFN, which does not work properly in rare cases + // when .NET process is set as interpreter (shebang). + const char* exePath = (const char *)(getauxval(AT_EXECFN)); + if (exePath) + { + return realpath(exePath, NULL); + } +#endif // HAVE_GETAUXVAL && defined(AT_EXECFN) + + return NULL; #endif // defined(__APPLE__) } diff --git a/src/shared/native/minipal/minipalconfig.h.in b/src/shared/native/minipal/minipalconfig.h.in new file mode 100644 index 0000000000..d51f47de26 --- /dev/null +++ b/src/shared/native/minipal/minipalconfig.h.in @@ -0,0 +1,10 @@ +#ifndef HAVE_MINIPAL_MINIPALCONFIG_H +#define HAVE_MINIPAL_MINIPALCONFIG_H + +#cmakedefine01 HAVE_ARC4RANDOM_BUF +#cmakedefine01 HAVE_AUXV_HWCAP_H +#cmakedefine01 HAVE_O_CLOEXEC +#cmakedefine01 HAVE_SYSCTLBYNAME +#cmakedefine01 HAVE_CLOCK_GETTIME_NSEC_NP + +#endif diff --git a/src/shared/native/minipal/random.c b/src/shared/native/minipal/random.c new file mode 100644 index 0000000000..20fcc07802 --- /dev/null +++ b/src/shared/native/minipal/random.c @@ -0,0 +1,149 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(__APPLE__) && __APPLE__ +#include +#endif + +#include "minipalconfig.h" +#include "random.h" + +/* + +Generate random bytes. The generated bytes are not cryptographically strong. + +*/ + +void minipal_get_non_cryptographically_secure_random_bytes(uint8_t* buffer, int32_t bufferLength) +{ + assert(buffer != NULL); + +#if HAVE_ARC4RANDOM_BUF + arc4random_buf(buffer, (size_t)bufferLength); +#else + long num = 0; + static bool sInitializedMRand; + + // Fall back to the secure version + minipal_get_cryptographically_secure_random_bytes(buffer, bufferLength); + + if (!sInitializedMRand) + { + srand48((long int)time(NULL)); + sInitializedMRand = true; + } + + // always xor srand48 over the whole buffer to get some randomness + // in case /dev/urandom is not really random + + for (int i = 0; i < bufferLength; i++) + { + if (i % 4 == 0) + { + num = lrand48(); + } + + *(buffer + i) ^= num; + num >>= 8; + } +#endif // HAVE_ARC4RANDOM_BUF +} + +/* + +Generate cryptographically strong random bytes. + +Return 0 on success, -1 on failure. +*/ +int32_t minipal_get_cryptographically_secure_random_bytes(uint8_t* buffer, int32_t bufferLength) +{ + assert(buffer != NULL); + +#ifdef __EMSCRIPTEN__ + extern int32_t mono_wasm_browser_entropy(uint8_t* buffer, int32_t bufferLength); + static bool sMissingBrowserCrypto; + if (!sMissingBrowserCrypto) + { + int32_t bff = mono_wasm_browser_entropy(buffer, bufferLength); + if (bff == -1) + sMissingBrowserCrypto = true; + else + return 0; + } +#elif defined(__APPLE__) && __APPLE__ + CCRNGStatus status = CCRandomGenerateBytes(buffer, (size_t)bufferLength); + + if (status == kCCSuccess) + { + return 0; + } +#else + + static volatile int rand_des = -1; + static bool sMissingDevURandom; + + if (!sMissingDevURandom) + { + if (rand_des == -1) + { + int fd; + + do + { +#if HAVE_O_CLOEXEC + fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC); +#else + fd = open("/dev/urandom", O_RDONLY); + fcntl(fd, F_SETFD, FD_CLOEXEC); +#endif + } + while ((fd == -1) && (errno == EINTR)); + + if (fd != -1) + { + int expected = -1; + if (!__atomic_compare_exchange_n(&rand_des, &expected, fd, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) + { + // Another thread has already set the rand_des + close(fd); + } + } + else if (errno == ENOENT) + { + sMissingDevURandom = true; + } + } + + if (rand_des != -1) + { + int32_t offset = 0; + do + { + ssize_t n = read(rand_des, buffer + offset , (size_t)(bufferLength - offset)); + if (n == -1) + { + if (errno == EINTR) + { + continue; + } + return -1; + } + + offset += n; + } + while (offset != bufferLength); + return 0; + } + } +#endif + return -1; +} diff --git a/src/shared/native/minipal/random.h b/src/shared/native/minipal/random.h new file mode 100644 index 0000000000..4296fd0a57 --- /dev/null +++ b/src/shared/native/minipal/random.h @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_RANDOM_H +#define HAVE_MINIPAL_RANDOM_H + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/** + * Generate random bytes. The generated bytes are not cryptographically strong. + */ +void minipal_get_non_cryptographically_secure_random_bytes(uint8_t* buffer, int32_t bufferLength); + +/** + * Generate cryptographically strong random bytes. + * + * Return 0 on success, -1 on failure. + */ +int32_t minipal_get_cryptographically_secure_random_bytes(uint8_t* buffer, int32_t bufferLength); + + +#ifdef __cplusplus +} +#endif // __cplusplus +#endif /* HAVE_MINIPAL_RANDOM_H */ diff --git a/src/shared/native/minipal/strings.h b/src/shared/native/minipal/strings.h new file mode 100644 index 0000000000..250dada9f5 --- /dev/null +++ b/src/shared/native/minipal/strings.h @@ -0,0 +1,34 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_STRINGS_H +#define HAVE_MINIPAL_STRINGS_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/** + * Convert a UTF-16 character to uppercase using invariant culture. + * + * @param code The UTF-16 character to be converted. + * @return The uppercase equivalent of the character or the character itself if no conversion is necessary. + */ +CHAR16_T minipal_toupper_invariant(CHAR16_T code); + +/** + * Convert a UTF-16 character to lowercase using invariant culture. + * + * @param code The UTF-16 character to be converted. + * @return The lowercase equivalent of the character or the character itself if no conversion is necessary. + */ +CHAR16_T minipal_tolower_invariant(CHAR16_T code); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif /* HAVE_MINIPAL_STRINGS_H */ diff --git a/src/shared/native/minipal/time.c b/src/shared/native/minipal/time.c new file mode 100644 index 0000000000..0a76df5d45 --- /dev/null +++ b/src/shared/native/minipal/time.c @@ -0,0 +1,138 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include +#include + +#ifdef HOST_WINDOWS + +#include + +int64_t minipal_hires_ticks() +{ + LARGE_INTEGER ts; + QueryPerformanceCounter(&ts); + return ts.QuadPart; +} + +int64_t minipal_hires_tick_frequency() +{ + LARGE_INTEGER ts; + QueryPerformanceFrequency(&ts); + return ts.QuadPart; +} + +#else // HOST_WINDOWS + +#include "minipalconfig.h" + +#include // nanosleep +#include + +inline static void YieldProcessor() +{ +#if defined(HOST_X86) || defined(HOST_AMD64) + __asm__ __volatile__( + "rep\n" + "nop"); +#elif defined(HOST_ARM) + __asm__ __volatile__( "yield"); +#elif defined(HOST_ARM64) + __asm__ __volatile__( + "dmb ishst\n" + "yield" + ); +#elif defined(HOST_LOONGARCH64) + __asm__ volatile( "dbar 0; \n"); +#elif defined(HOST_RISCV64) + // TODO-RISCV64-CQ: When Zihintpause is supported, replace with `pause` instruction. + __asm__ __volatile__(".word 0x0100000f"); +#else + return; +#endif +} + +#define tccSecondsToNanoSeconds 1000000000 // 10^9 +int64_t minipal_hires_tick_frequency() +{ + return tccSecondsToNanoSeconds; +} + +int64_t minipal_hires_ticks() +{ +#if HAVE_CLOCK_GETTIME_NSEC_NP + return (int64_t)clock_gettime_nsec_np(CLOCK_UPTIME_RAW); +#else + struct timespec ts; + int result = clock_gettime(CLOCK_MONOTONIC, &ts); + if (result != 0) + { + assert(!"clock_gettime(CLOCK_MONOTONIC) failed"); + } + + return ((int64_t)(ts.tv_sec) * (int64_t)(tccSecondsToNanoSeconds)) + (int64_t)(ts.tv_nsec); +#endif +} + +#endif // !HOST_WINDOWS + +void minipal_microdelay(uint32_t usecs, uint32_t* usecsSinceYield) +{ +#ifdef HOST_WINDOWS + if (usecs > 1000) + { + SleepEx(usecs / 1000, FALSE); + if (usecsSinceYield) + { + usecsSinceYield = 0; + } + + return; + } +#else + if (usecs > 10) + { + struct timespec requested; + requested.tv_sec = usecs / 1000; + requested.tv_nsec = (usecs - requested.tv_sec * 1000) * 1000; + + struct timespec remaining; + while (nanosleep(&requested, &remaining) == EINTR) + { + requested = remaining; + } + + if (usecsSinceYield) + { + usecsSinceYield = 0; + } + + return; + } +#endif + + int64_t startTicks = minipal_hires_ticks(); + int64_t ticksPerSecond = minipal_hires_tick_frequency(); + int64_t endTicks = startTicks + (usecs * ticksPerSecond) / 1000000; + + // start with 1 nop/pause and then double up until we hit the limit + // this way we should not overshoot by more than 2x. + for (int i = 0; i < 30; i++) + { + for (int j = 0; j < (1 << i); j++) + { + YieldProcessor(); + } + + int64_t currentTicks = minipal_hires_ticks(); + if (currentTicks > endTicks) + { + break; + } + } + + if (usecsSinceYield) + { + *usecsSinceYield += usecs; + } +} diff --git a/src/shared/native/minipal/time.h b/src/shared/native/minipal/time.h new file mode 100644 index 0000000000..313aeb6956 --- /dev/null +++ b/src/shared/native/minipal/time.h @@ -0,0 +1,32 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_TIME_H +#define HAVE_MINIPAL_TIME_H + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + + // Returns current count of high resolution monotonically increasing timer ticks + int64_t minipal_hires_ticks(); + + // Returns the frequency of high resolution timer ticks in Hz + int64_t minipal_hires_tick_frequency(); + + // Delays execution of current thread by `usecs` microseconds. + // The delay is best-effort and may take longer than desired. + // Some delays, depending on OS and duration, could be implemented via busy waiting. + // + // If not NULL, `usecsSinceYield` keeps track of busy-waiting time, so that + // the containing algorithm could handle cases when busy-waiting time is too high. + void minipal_microdelay(uint32_t usecs, uint32_t* usecsSinceYield); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif /* HAVE_MINIPAL_TIME_H */ diff --git a/src/shared/native/minipal/types.h b/src/shared/native/minipal/types.h new file mode 100644 index 0000000000..997e9db21c --- /dev/null +++ b/src/shared/native/minipal/types.h @@ -0,0 +1,33 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_TYPES_H +#define HAVE_MINIPAL_TYPES_H + +#include + +#if defined(TARGET_32BIT) || defined(TARGET_OSX) || defined(TARGET_WINDOWS) +#define FORMAT_PREFIX "l" +#else +#define FORMAT_PREFIX "" +#endif + +#ifndef PRIX64 +#define PRIX64 FORMAT_PREFIX "lX" +#endif + +#ifndef PRIx64 +#define PRIx64 FORMAT_PREFIX "lx" +#endif + +#ifndef PRIu64 +#define PRIu64 FORMAT_PREFIX "lu" +#endif + +#ifdef TARGET_WINDOWS +typedef wchar_t CHAR16_T; +#else +typedef unsigned short CHAR16_T; +#endif + +#endif // HAVE_MINIPAL_TYPES_H diff --git a/src/shared/native/minipal/unicodedata.c b/src/shared/native/minipal/unicodedata.c new file mode 100644 index 0000000000..e38aba8f55 --- /dev/null +++ b/src/shared/native/minipal/unicodedata.c @@ -0,0 +1,2426 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// +// THIS FILE IS GENERATED. DO NOT HAND EDIT. +// IF YOU NEED TO UPDATE UNICODE VERSION FOLLOW THE GUIDE AT src/libraries/System.Private.CoreLib/Tools/GenUnicodeProp/Updating-Unicode-Versions.md +// + +#include +#include +#include + +typedef struct +{ + CHAR16_T code; + uint8_t upperOrLower; + CHAR16_T opposingCode; +} UnicodeDataRec; + +#define UPPER_CASE 0 +#define LOWER_CASE 1 + +static const UnicodeDataRec UnicodeData[] = +{ + { 0x41, UPPER_CASE, 0x61 }, + { 0x42, UPPER_CASE, 0x62 }, + { 0x43, UPPER_CASE, 0x63 }, + { 0x44, UPPER_CASE, 0x64 }, + { 0x45, UPPER_CASE, 0x65 }, + { 0x46, UPPER_CASE, 0x66 }, + { 0x47, UPPER_CASE, 0x67 }, + { 0x48, UPPER_CASE, 0x68 }, + { 0x49, UPPER_CASE, 0x69 }, + { 0x4A, UPPER_CASE, 0x6A }, + { 0x4B, UPPER_CASE, 0x6B }, + { 0x4C, UPPER_CASE, 0x6C }, + { 0x4D, UPPER_CASE, 0x6D }, + { 0x4E, UPPER_CASE, 0x6E }, + { 0x4F, UPPER_CASE, 0x6F }, + { 0x50, UPPER_CASE, 0x70 }, + { 0x51, UPPER_CASE, 0x71 }, + { 0x52, UPPER_CASE, 0x72 }, + { 0x53, UPPER_CASE, 0x73 }, + { 0x54, UPPER_CASE, 0x74 }, + { 0x55, UPPER_CASE, 0x75 }, + { 0x56, UPPER_CASE, 0x76 }, + { 0x57, UPPER_CASE, 0x77 }, + { 0x58, UPPER_CASE, 0x78 }, + { 0x59, UPPER_CASE, 0x79 }, + { 0x5A, UPPER_CASE, 0x7A }, + { 0x61, LOWER_CASE, 0x41 }, + { 0x62, LOWER_CASE, 0x42 }, + { 0x63, LOWER_CASE, 0x43 }, + { 0x64, LOWER_CASE, 0x44 }, + { 0x65, LOWER_CASE, 0x45 }, + { 0x66, LOWER_CASE, 0x46 }, + { 0x67, LOWER_CASE, 0x47 }, + { 0x68, LOWER_CASE, 0x48 }, + { 0x69, LOWER_CASE, 0x49 }, + { 0x6A, LOWER_CASE, 0x4A }, + { 0x6B, LOWER_CASE, 0x4B }, + { 0x6C, LOWER_CASE, 0x4C }, + { 0x6D, LOWER_CASE, 0x4D }, + { 0x6E, LOWER_CASE, 0x4E }, + { 0x6F, LOWER_CASE, 0x4F }, + { 0x70, LOWER_CASE, 0x50 }, + { 0x71, LOWER_CASE, 0x51 }, + { 0x72, LOWER_CASE, 0x52 }, + { 0x73, LOWER_CASE, 0x53 }, + { 0x74, LOWER_CASE, 0x54 }, + { 0x75, LOWER_CASE, 0x55 }, + { 0x76, LOWER_CASE, 0x56 }, + { 0x77, LOWER_CASE, 0x57 }, + { 0x78, LOWER_CASE, 0x58 }, + { 0x79, LOWER_CASE, 0x59 }, + { 0x7A, LOWER_CASE, 0x5A }, + { 0xB5, LOWER_CASE, 0x39C }, + { 0xC0, UPPER_CASE, 0xE0 }, + { 0xC1, UPPER_CASE, 0xE1 }, + { 0xC2, UPPER_CASE, 0xE2 }, + { 0xC3, UPPER_CASE, 0xE3 }, + { 0xC4, UPPER_CASE, 0xE4 }, + { 0xC5, UPPER_CASE, 0xE5 }, + { 0xC6, UPPER_CASE, 0xE6 }, + { 0xC7, UPPER_CASE, 0xE7 }, + { 0xC8, UPPER_CASE, 0xE8 }, + { 0xC9, UPPER_CASE, 0xE9 }, + { 0xCA, UPPER_CASE, 0xEA }, + { 0xCB, UPPER_CASE, 0xEB }, + { 0xCC, UPPER_CASE, 0xEC }, + { 0xCD, UPPER_CASE, 0xED }, + { 0xCE, UPPER_CASE, 0xEE }, + { 0xCF, UPPER_CASE, 0xEF }, + { 0xD0, UPPER_CASE, 0xF0 }, + { 0xD1, UPPER_CASE, 0xF1 }, + { 0xD2, UPPER_CASE, 0xF2 }, + { 0xD3, UPPER_CASE, 0xF3 }, + { 0xD4, UPPER_CASE, 0xF4 }, + { 0xD5, UPPER_CASE, 0xF5 }, + { 0xD6, UPPER_CASE, 0xF6 }, + { 0xD8, UPPER_CASE, 0xF8 }, + { 0xD9, UPPER_CASE, 0xF9 }, + { 0xDA, UPPER_CASE, 0xFA }, + { 0xDB, UPPER_CASE, 0xFB }, + { 0xDC, UPPER_CASE, 0xFC }, + { 0xDD, UPPER_CASE, 0xFD }, + { 0xDE, UPPER_CASE, 0xFE }, + { 0xE0, LOWER_CASE, 0xC0 }, + { 0xE1, LOWER_CASE, 0xC1 }, + { 0xE2, LOWER_CASE, 0xC2 }, + { 0xE3, LOWER_CASE, 0xC3 }, + { 0xE4, LOWER_CASE, 0xC4 }, + { 0xE5, LOWER_CASE, 0xC5 }, + { 0xE6, LOWER_CASE, 0xC6 }, + { 0xE7, LOWER_CASE, 0xC7 }, + { 0xE8, LOWER_CASE, 0xC8 }, + { 0xE9, LOWER_CASE, 0xC9 }, + { 0xEA, LOWER_CASE, 0xCA }, + { 0xEB, LOWER_CASE, 0xCB }, + { 0xEC, LOWER_CASE, 0xCC }, + { 0xED, LOWER_CASE, 0xCD }, + { 0xEE, LOWER_CASE, 0xCE }, + { 0xEF, LOWER_CASE, 0xCF }, + { 0xF0, LOWER_CASE, 0xD0 }, + { 0xF1, LOWER_CASE, 0xD1 }, + { 0xF2, LOWER_CASE, 0xD2 }, + { 0xF3, LOWER_CASE, 0xD3 }, + { 0xF4, LOWER_CASE, 0xD4 }, + { 0xF5, LOWER_CASE, 0xD5 }, + { 0xF6, LOWER_CASE, 0xD6 }, + { 0xF8, LOWER_CASE, 0xD8 }, + { 0xF9, LOWER_CASE, 0xD9 }, + { 0xFA, LOWER_CASE, 0xDA }, + { 0xFB, LOWER_CASE, 0xDB }, + { 0xFC, LOWER_CASE, 0xDC }, + { 0xFD, LOWER_CASE, 0xDD }, + { 0xFE, LOWER_CASE, 0xDE }, + { 0xFF, LOWER_CASE, 0x178 }, + { 0x100, UPPER_CASE, 0x101 }, + { 0x101, LOWER_CASE, 0x100 }, + { 0x102, UPPER_CASE, 0x103 }, + { 0x103, LOWER_CASE, 0x102 }, + { 0x104, UPPER_CASE, 0x105 }, + { 0x105, LOWER_CASE, 0x104 }, + { 0x106, UPPER_CASE, 0x107 }, + { 0x107, LOWER_CASE, 0x106 }, + { 0x108, UPPER_CASE, 0x109 }, + { 0x109, LOWER_CASE, 0x108 }, + { 0x10A, UPPER_CASE, 0x10B }, + { 0x10B, LOWER_CASE, 0x10A }, + { 0x10C, UPPER_CASE, 0x10D }, + { 0x10D, LOWER_CASE, 0x10C }, + { 0x10E, UPPER_CASE, 0x10F }, + { 0x10F, LOWER_CASE, 0x10E }, + { 0x110, UPPER_CASE, 0x111 }, + { 0x111, LOWER_CASE, 0x110 }, + { 0x112, UPPER_CASE, 0x113 }, + { 0x113, LOWER_CASE, 0x112 }, + { 0x114, UPPER_CASE, 0x115 }, + { 0x115, LOWER_CASE, 0x114 }, + { 0x116, UPPER_CASE, 0x117 }, + { 0x117, LOWER_CASE, 0x116 }, + { 0x118, UPPER_CASE, 0x119 }, + { 0x119, LOWER_CASE, 0x118 }, + { 0x11A, UPPER_CASE, 0x11B }, + { 0x11B, LOWER_CASE, 0x11A }, + { 0x11C, UPPER_CASE, 0x11D }, + { 0x11D, LOWER_CASE, 0x11C }, + { 0x11E, UPPER_CASE, 0x11F }, + { 0x11F, LOWER_CASE, 0x11E }, + { 0x120, UPPER_CASE, 0x121 }, + { 0x121, LOWER_CASE, 0x120 }, + { 0x122, UPPER_CASE, 0x123 }, + { 0x123, LOWER_CASE, 0x122 }, + { 0x124, UPPER_CASE, 0x125 }, + { 0x125, LOWER_CASE, 0x124 }, + { 0x126, UPPER_CASE, 0x127 }, + { 0x127, LOWER_CASE, 0x126 }, + { 0x128, UPPER_CASE, 0x129 }, + { 0x129, LOWER_CASE, 0x128 }, + { 0x12A, UPPER_CASE, 0x12B }, + { 0x12B, LOWER_CASE, 0x12A }, + { 0x12C, UPPER_CASE, 0x12D }, + { 0x12D, LOWER_CASE, 0x12C }, + { 0x12E, UPPER_CASE, 0x12F }, + { 0x12F, LOWER_CASE, 0x12E }, + { 0x130, UPPER_CASE, 0x69 }, + { 0x131, LOWER_CASE, 0x49 }, + { 0x132, UPPER_CASE, 0x133 }, + { 0x133, LOWER_CASE, 0x132 }, + { 0x134, UPPER_CASE, 0x135 }, + { 0x135, LOWER_CASE, 0x134 }, + { 0x136, UPPER_CASE, 0x137 }, + { 0x137, LOWER_CASE, 0x136 }, + { 0x139, UPPER_CASE, 0x13A }, + { 0x13A, LOWER_CASE, 0x139 }, + { 0x13B, UPPER_CASE, 0x13C }, + { 0x13C, LOWER_CASE, 0x13B }, + { 0x13D, UPPER_CASE, 0x13E }, + { 0x13E, LOWER_CASE, 0x13D }, + { 0x13F, UPPER_CASE, 0x140 }, + { 0x140, LOWER_CASE, 0x13F }, + { 0x141, UPPER_CASE, 0x142 }, + { 0x142, LOWER_CASE, 0x141 }, + { 0x143, UPPER_CASE, 0x144 }, + { 0x144, LOWER_CASE, 0x143 }, + { 0x145, UPPER_CASE, 0x146 }, + { 0x146, LOWER_CASE, 0x145 }, + { 0x147, UPPER_CASE, 0x148 }, + { 0x148, LOWER_CASE, 0x147 }, + { 0x14A, UPPER_CASE, 0x14B }, + { 0x14B, LOWER_CASE, 0x14A }, + { 0x14C, UPPER_CASE, 0x14D }, + { 0x14D, LOWER_CASE, 0x14C }, + { 0x14E, UPPER_CASE, 0x14F }, + { 0x14F, LOWER_CASE, 0x14E }, + { 0x150, UPPER_CASE, 0x151 }, + { 0x151, LOWER_CASE, 0x150 }, + { 0x152, UPPER_CASE, 0x153 }, + { 0x153, LOWER_CASE, 0x152 }, + { 0x154, UPPER_CASE, 0x155 }, + { 0x155, LOWER_CASE, 0x154 }, + { 0x156, UPPER_CASE, 0x157 }, + { 0x157, LOWER_CASE, 0x156 }, + { 0x158, UPPER_CASE, 0x159 }, + { 0x159, LOWER_CASE, 0x158 }, + { 0x15A, UPPER_CASE, 0x15B }, + { 0x15B, LOWER_CASE, 0x15A }, + { 0x15C, UPPER_CASE, 0x15D }, + { 0x15D, LOWER_CASE, 0x15C }, + { 0x15E, UPPER_CASE, 0x15F }, + { 0x15F, LOWER_CASE, 0x15E }, + { 0x160, UPPER_CASE, 0x161 }, + { 0x161, LOWER_CASE, 0x160 }, + { 0x162, UPPER_CASE, 0x163 }, + { 0x163, LOWER_CASE, 0x162 }, + { 0x164, UPPER_CASE, 0x165 }, + { 0x165, LOWER_CASE, 0x164 }, + { 0x166, UPPER_CASE, 0x167 }, + { 0x167, LOWER_CASE, 0x166 }, + { 0x168, UPPER_CASE, 0x169 }, + { 0x169, LOWER_CASE, 0x168 }, + { 0x16A, UPPER_CASE, 0x16B }, + { 0x16B, LOWER_CASE, 0x16A }, + { 0x16C, UPPER_CASE, 0x16D }, + { 0x16D, LOWER_CASE, 0x16C }, + { 0x16E, UPPER_CASE, 0x16F }, + { 0x16F, LOWER_CASE, 0x16E }, + { 0x170, UPPER_CASE, 0x171 }, + { 0x171, LOWER_CASE, 0x170 }, + { 0x172, UPPER_CASE, 0x173 }, + { 0x173, LOWER_CASE, 0x172 }, + { 0x174, UPPER_CASE, 0x175 }, + { 0x175, LOWER_CASE, 0x174 }, + { 0x176, UPPER_CASE, 0x177 }, + { 0x177, LOWER_CASE, 0x176 }, + { 0x178, UPPER_CASE, 0xFF }, + { 0x179, UPPER_CASE, 0x17A }, + { 0x17A, LOWER_CASE, 0x179 }, + { 0x17B, UPPER_CASE, 0x17C }, + { 0x17C, LOWER_CASE, 0x17B }, + { 0x17D, UPPER_CASE, 0x17E }, + { 0x17E, LOWER_CASE, 0x17D }, + { 0x17F, LOWER_CASE, 0x53 }, + { 0x180, LOWER_CASE, 0x243 }, + { 0x181, UPPER_CASE, 0x253 }, + { 0x182, UPPER_CASE, 0x183 }, + { 0x183, LOWER_CASE, 0x182 }, + { 0x184, UPPER_CASE, 0x185 }, + { 0x185, LOWER_CASE, 0x184 }, + { 0x186, UPPER_CASE, 0x254 }, + { 0x187, UPPER_CASE, 0x188 }, + { 0x188, LOWER_CASE, 0x187 }, + { 0x189, UPPER_CASE, 0x256 }, + { 0x18A, UPPER_CASE, 0x257 }, + { 0x18B, UPPER_CASE, 0x18C }, + { 0x18C, LOWER_CASE, 0x18B }, + { 0x18E, UPPER_CASE, 0x1DD }, + { 0x18F, UPPER_CASE, 0x259 }, + { 0x190, UPPER_CASE, 0x25B }, + { 0x191, UPPER_CASE, 0x192 }, + { 0x192, LOWER_CASE, 0x191 }, + { 0x193, UPPER_CASE, 0x260 }, + { 0x194, UPPER_CASE, 0x263 }, + { 0x195, LOWER_CASE, 0x1F6 }, + { 0x196, UPPER_CASE, 0x269 }, + { 0x197, UPPER_CASE, 0x268 }, + { 0x198, UPPER_CASE, 0x199 }, + { 0x199, LOWER_CASE, 0x198 }, + { 0x19A, LOWER_CASE, 0x23D }, + { 0x19C, UPPER_CASE, 0x26F }, + { 0x19D, UPPER_CASE, 0x272 }, + { 0x19E, LOWER_CASE, 0x220 }, + { 0x19F, UPPER_CASE, 0x275 }, + { 0x1A0, UPPER_CASE, 0x1A1 }, + { 0x1A1, LOWER_CASE, 0x1A0 }, + { 0x1A2, UPPER_CASE, 0x1A3 }, + { 0x1A3, LOWER_CASE, 0x1A2 }, + { 0x1A4, UPPER_CASE, 0x1A5 }, + { 0x1A5, LOWER_CASE, 0x1A4 }, + { 0x1A6, UPPER_CASE, 0x280 }, + { 0x1A7, UPPER_CASE, 0x1A8 }, + { 0x1A8, LOWER_CASE, 0x1A7 }, + { 0x1A9, UPPER_CASE, 0x283 }, + { 0x1AC, UPPER_CASE, 0x1AD }, + { 0x1AD, LOWER_CASE, 0x1AC }, + { 0x1AE, UPPER_CASE, 0x288 }, + { 0x1AF, UPPER_CASE, 0x1B0 }, + { 0x1B0, LOWER_CASE, 0x1AF }, + { 0x1B1, UPPER_CASE, 0x28A }, + { 0x1B2, UPPER_CASE, 0x28B }, + { 0x1B3, UPPER_CASE, 0x1B4 }, + { 0x1B4, LOWER_CASE, 0x1B3 }, + { 0x1B5, UPPER_CASE, 0x1B6 }, + { 0x1B6, LOWER_CASE, 0x1B5 }, + { 0x1B7, UPPER_CASE, 0x292 }, + { 0x1B8, UPPER_CASE, 0x1B9 }, + { 0x1B9, LOWER_CASE, 0x1B8 }, + { 0x1BC, UPPER_CASE, 0x1BD }, + { 0x1BD, LOWER_CASE, 0x1BC }, + { 0x1BF, LOWER_CASE, 0x1F7 }, + { 0x1C4, UPPER_CASE, 0x1C6 }, + { 0x1C5, LOWER_CASE, 0x1C4 }, + { 0x1C6, LOWER_CASE, 0x1C4 }, + { 0x1C7, UPPER_CASE, 0x1C9 }, + { 0x1C8, LOWER_CASE, 0x1C7 }, + { 0x1C9, LOWER_CASE, 0x1C7 }, + { 0x1CA, UPPER_CASE, 0x1CC }, + { 0x1CB, LOWER_CASE, 0x1CA }, + { 0x1CC, LOWER_CASE, 0x1CA }, + { 0x1CD, UPPER_CASE, 0x1CE }, + { 0x1CE, LOWER_CASE, 0x1CD }, + { 0x1CF, UPPER_CASE, 0x1D0 }, + { 0x1D0, LOWER_CASE, 0x1CF }, + { 0x1D1, UPPER_CASE, 0x1D2 }, + { 0x1D2, LOWER_CASE, 0x1D1 }, + { 0x1D3, UPPER_CASE, 0x1D4 }, + { 0x1D4, LOWER_CASE, 0x1D3 }, + { 0x1D5, UPPER_CASE, 0x1D6 }, + { 0x1D6, LOWER_CASE, 0x1D5 }, + { 0x1D7, UPPER_CASE, 0x1D8 }, + { 0x1D8, LOWER_CASE, 0x1D7 }, + { 0x1D9, UPPER_CASE, 0x1DA }, + { 0x1DA, LOWER_CASE, 0x1D9 }, + { 0x1DB, UPPER_CASE, 0x1DC }, + { 0x1DC, LOWER_CASE, 0x1DB }, + { 0x1DD, LOWER_CASE, 0x18E }, + { 0x1DE, UPPER_CASE, 0x1DF }, + { 0x1DF, LOWER_CASE, 0x1DE }, + { 0x1E0, UPPER_CASE, 0x1E1 }, + { 0x1E1, LOWER_CASE, 0x1E0 }, + { 0x1E2, UPPER_CASE, 0x1E3 }, + { 0x1E3, LOWER_CASE, 0x1E2 }, + { 0x1E4, UPPER_CASE, 0x1E5 }, + { 0x1E5, LOWER_CASE, 0x1E4 }, + { 0x1E6, UPPER_CASE, 0x1E7 }, + { 0x1E7, LOWER_CASE, 0x1E6 }, + { 0x1E8, UPPER_CASE, 0x1E9 }, + { 0x1E9, LOWER_CASE, 0x1E8 }, + { 0x1EA, UPPER_CASE, 0x1EB }, + { 0x1EB, LOWER_CASE, 0x1EA }, + { 0x1EC, UPPER_CASE, 0x1ED }, + { 0x1ED, LOWER_CASE, 0x1EC }, + { 0x1EE, UPPER_CASE, 0x1EF }, + { 0x1EF, LOWER_CASE, 0x1EE }, + { 0x1F1, UPPER_CASE, 0x1F3 }, + { 0x1F2, LOWER_CASE, 0x1F1 }, + { 0x1F3, LOWER_CASE, 0x1F1 }, + { 0x1F4, UPPER_CASE, 0x1F5 }, + { 0x1F5, LOWER_CASE, 0x1F4 }, + { 0x1F6, UPPER_CASE, 0x195 }, + { 0x1F7, UPPER_CASE, 0x1BF }, + { 0x1F8, UPPER_CASE, 0x1F9 }, + { 0x1F9, LOWER_CASE, 0x1F8 }, + { 0x1FA, UPPER_CASE, 0x1FB }, + { 0x1FB, LOWER_CASE, 0x1FA }, + { 0x1FC, UPPER_CASE, 0x1FD }, + { 0x1FD, LOWER_CASE, 0x1FC }, + { 0x1FE, UPPER_CASE, 0x1FF }, + { 0x1FF, LOWER_CASE, 0x1FE }, + { 0x200, UPPER_CASE, 0x201 }, + { 0x201, LOWER_CASE, 0x200 }, + { 0x202, UPPER_CASE, 0x203 }, + { 0x203, LOWER_CASE, 0x202 }, + { 0x204, UPPER_CASE, 0x205 }, + { 0x205, LOWER_CASE, 0x204 }, + { 0x206, UPPER_CASE, 0x207 }, + { 0x207, LOWER_CASE, 0x206 }, + { 0x208, UPPER_CASE, 0x209 }, + { 0x209, LOWER_CASE, 0x208 }, + { 0x20A, UPPER_CASE, 0x20B }, + { 0x20B, LOWER_CASE, 0x20A }, + { 0x20C, UPPER_CASE, 0x20D }, + { 0x20D, LOWER_CASE, 0x20C }, + { 0x20E, UPPER_CASE, 0x20F }, + { 0x20F, LOWER_CASE, 0x20E }, + { 0x210, UPPER_CASE, 0x211 }, + { 0x211, LOWER_CASE, 0x210 }, + { 0x212, UPPER_CASE, 0x213 }, + { 0x213, LOWER_CASE, 0x212 }, + { 0x214, UPPER_CASE, 0x215 }, + { 0x215, LOWER_CASE, 0x214 }, + { 0x216, UPPER_CASE, 0x217 }, + { 0x217, LOWER_CASE, 0x216 }, + { 0x218, UPPER_CASE, 0x219 }, + { 0x219, LOWER_CASE, 0x218 }, + { 0x21A, UPPER_CASE, 0x21B }, + { 0x21B, LOWER_CASE, 0x21A }, + { 0x21C, UPPER_CASE, 0x21D }, + { 0x21D, LOWER_CASE, 0x21C }, + { 0x21E, UPPER_CASE, 0x21F }, + { 0x21F, LOWER_CASE, 0x21E }, + { 0x220, UPPER_CASE, 0x19E }, + { 0x222, UPPER_CASE, 0x223 }, + { 0x223, LOWER_CASE, 0x222 }, + { 0x224, UPPER_CASE, 0x225 }, + { 0x225, LOWER_CASE, 0x224 }, + { 0x226, UPPER_CASE, 0x227 }, + { 0x227, LOWER_CASE, 0x226 }, + { 0x228, UPPER_CASE, 0x229 }, + { 0x229, LOWER_CASE, 0x228 }, + { 0x22A, UPPER_CASE, 0x22B }, + { 0x22B, LOWER_CASE, 0x22A }, + { 0x22C, UPPER_CASE, 0x22D }, + { 0x22D, LOWER_CASE, 0x22C }, + { 0x22E, UPPER_CASE, 0x22F }, + { 0x22F, LOWER_CASE, 0x22E }, + { 0x230, UPPER_CASE, 0x231 }, + { 0x231, LOWER_CASE, 0x230 }, + { 0x232, UPPER_CASE, 0x233 }, + { 0x233, LOWER_CASE, 0x232 }, + { 0x23A, UPPER_CASE, 0x2C65 }, + { 0x23B, UPPER_CASE, 0x23C }, + { 0x23C, LOWER_CASE, 0x23B }, + { 0x23D, UPPER_CASE, 0x19A }, + { 0x23E, UPPER_CASE, 0x2C66 }, + { 0x23F, LOWER_CASE, 0x2C7E }, + { 0x240, LOWER_CASE, 0x2C7F }, + { 0x241, UPPER_CASE, 0x242 }, + { 0x242, LOWER_CASE, 0x241 }, + { 0x243, UPPER_CASE, 0x180 }, + { 0x244, UPPER_CASE, 0x289 }, + { 0x245, UPPER_CASE, 0x28C }, + { 0x246, UPPER_CASE, 0x247 }, + { 0x247, LOWER_CASE, 0x246 }, + { 0x248, UPPER_CASE, 0x249 }, + { 0x249, LOWER_CASE, 0x248 }, + { 0x24A, UPPER_CASE, 0x24B }, + { 0x24B, LOWER_CASE, 0x24A }, + { 0x24C, UPPER_CASE, 0x24D }, + { 0x24D, LOWER_CASE, 0x24C }, + { 0x24E, UPPER_CASE, 0x24F }, + { 0x24F, LOWER_CASE, 0x24E }, + { 0x250, LOWER_CASE, 0x2C6F }, + { 0x251, LOWER_CASE, 0x2C6D }, + { 0x252, LOWER_CASE, 0x2C70 }, + { 0x253, LOWER_CASE, 0x181 }, + { 0x254, LOWER_CASE, 0x186 }, + { 0x256, LOWER_CASE, 0x189 }, + { 0x257, LOWER_CASE, 0x18A }, + { 0x259, LOWER_CASE, 0x18F }, + { 0x25B, LOWER_CASE, 0x190 }, + { 0x25C, LOWER_CASE, 0xA7AB }, + { 0x260, LOWER_CASE, 0x193 }, + { 0x261, LOWER_CASE, 0xA7AC }, + { 0x263, LOWER_CASE, 0x194 }, + { 0x265, LOWER_CASE, 0xA78D }, + { 0x266, LOWER_CASE, 0xA7AA }, + { 0x268, LOWER_CASE, 0x197 }, + { 0x269, LOWER_CASE, 0x196 }, + { 0x26A, LOWER_CASE, 0xA7AE }, + { 0x26B, LOWER_CASE, 0x2C62 }, + { 0x26C, LOWER_CASE, 0xA7AD }, + { 0x26F, LOWER_CASE, 0x19C }, + { 0x271, LOWER_CASE, 0x2C6E }, + { 0x272, LOWER_CASE, 0x19D }, + { 0x275, LOWER_CASE, 0x19F }, + { 0x27D, LOWER_CASE, 0x2C64 }, + { 0x280, LOWER_CASE, 0x1A6 }, + { 0x282, LOWER_CASE, 0xA7C5 }, + { 0x283, LOWER_CASE, 0x1A9 }, + { 0x287, LOWER_CASE, 0xA7B1 }, + { 0x288, LOWER_CASE, 0x1AE }, + { 0x289, LOWER_CASE, 0x244 }, + { 0x28A, LOWER_CASE, 0x1B1 }, + { 0x28B, LOWER_CASE, 0x1B2 }, + { 0x28C, LOWER_CASE, 0x245 }, + { 0x292, LOWER_CASE, 0x1B7 }, + { 0x29D, LOWER_CASE, 0xA7B2 }, + { 0x29E, LOWER_CASE, 0xA7B0 }, + { 0x345, LOWER_CASE, 0x399 }, + { 0x370, UPPER_CASE, 0x371 }, + { 0x371, LOWER_CASE, 0x370 }, + { 0x372, UPPER_CASE, 0x373 }, + { 0x373, LOWER_CASE, 0x372 }, + { 0x376, UPPER_CASE, 0x377 }, + { 0x377, LOWER_CASE, 0x376 }, + { 0x37B, LOWER_CASE, 0x3FD }, + { 0x37C, LOWER_CASE, 0x3FE }, + { 0x37D, LOWER_CASE, 0x3FF }, + { 0x37F, UPPER_CASE, 0x3F3 }, + { 0x386, UPPER_CASE, 0x3AC }, + { 0x388, UPPER_CASE, 0x3AD }, + { 0x389, UPPER_CASE, 0x3AE }, + { 0x38A, UPPER_CASE, 0x3AF }, + { 0x38C, UPPER_CASE, 0x3CC }, + { 0x38E, UPPER_CASE, 0x3CD }, + { 0x38F, UPPER_CASE, 0x3CE }, + { 0x391, UPPER_CASE, 0x3B1 }, + { 0x392, UPPER_CASE, 0x3B2 }, + { 0x393, UPPER_CASE, 0x3B3 }, + { 0x394, UPPER_CASE, 0x3B4 }, + { 0x395, UPPER_CASE, 0x3B5 }, + { 0x396, UPPER_CASE, 0x3B6 }, + { 0x397, UPPER_CASE, 0x3B7 }, + { 0x398, UPPER_CASE, 0x3B8 }, + { 0x399, UPPER_CASE, 0x3B9 }, + { 0x39A, UPPER_CASE, 0x3BA }, + { 0x39B, UPPER_CASE, 0x3BB }, + { 0x39C, UPPER_CASE, 0x3BC }, + { 0x39D, UPPER_CASE, 0x3BD }, + { 0x39E, UPPER_CASE, 0x3BE }, + { 0x39F, UPPER_CASE, 0x3BF }, + { 0x3A0, UPPER_CASE, 0x3C0 }, + { 0x3A1, UPPER_CASE, 0x3C1 }, + { 0x3A3, UPPER_CASE, 0x3C3 }, + { 0x3A4, UPPER_CASE, 0x3C4 }, + { 0x3A5, UPPER_CASE, 0x3C5 }, + { 0x3A6, UPPER_CASE, 0x3C6 }, + { 0x3A7, UPPER_CASE, 0x3C7 }, + { 0x3A8, UPPER_CASE, 0x3C8 }, + { 0x3A9, UPPER_CASE, 0x3C9 }, + { 0x3AA, UPPER_CASE, 0x3CA }, + { 0x3AB, UPPER_CASE, 0x3CB }, + { 0x3AC, LOWER_CASE, 0x386 }, + { 0x3AD, LOWER_CASE, 0x388 }, + { 0x3AE, LOWER_CASE, 0x389 }, + { 0x3AF, LOWER_CASE, 0x38A }, + { 0x3B1, LOWER_CASE, 0x391 }, + { 0x3B2, LOWER_CASE, 0x392 }, + { 0x3B3, LOWER_CASE, 0x393 }, + { 0x3B4, LOWER_CASE, 0x394 }, + { 0x3B5, LOWER_CASE, 0x395 }, + { 0x3B6, LOWER_CASE, 0x396 }, + { 0x3B7, LOWER_CASE, 0x397 }, + { 0x3B8, LOWER_CASE, 0x398 }, + { 0x3B9, LOWER_CASE, 0x399 }, + { 0x3BA, LOWER_CASE, 0x39A }, + { 0x3BB, LOWER_CASE, 0x39B }, + { 0x3BC, LOWER_CASE, 0x39C }, + { 0x3BD, LOWER_CASE, 0x39D }, + { 0x3BE, LOWER_CASE, 0x39E }, + { 0x3BF, LOWER_CASE, 0x39F }, + { 0x3C0, LOWER_CASE, 0x3A0 }, + { 0x3C1, LOWER_CASE, 0x3A1 }, + { 0x3C2, LOWER_CASE, 0x3A3 }, + { 0x3C3, LOWER_CASE, 0x3A3 }, + { 0x3C4, LOWER_CASE, 0x3A4 }, + { 0x3C5, LOWER_CASE, 0x3A5 }, + { 0x3C6, LOWER_CASE, 0x3A6 }, + { 0x3C7, LOWER_CASE, 0x3A7 }, + { 0x3C8, LOWER_CASE, 0x3A8 }, + { 0x3C9, LOWER_CASE, 0x3A9 }, + { 0x3CA, LOWER_CASE, 0x3AA }, + { 0x3CB, LOWER_CASE, 0x3AB }, + { 0x3CC, LOWER_CASE, 0x38C }, + { 0x3CD, LOWER_CASE, 0x38E }, + { 0x3CE, LOWER_CASE, 0x38F }, + { 0x3CF, UPPER_CASE, 0x3D7 }, + { 0x3D0, LOWER_CASE, 0x392 }, + { 0x3D1, LOWER_CASE, 0x398 }, + { 0x3D5, LOWER_CASE, 0x3A6 }, + { 0x3D6, LOWER_CASE, 0x3A0 }, + { 0x3D7, LOWER_CASE, 0x3CF }, + { 0x3D8, UPPER_CASE, 0x3D9 }, + { 0x3D9, LOWER_CASE, 0x3D8 }, + { 0x3DA, UPPER_CASE, 0x3DB }, + { 0x3DB, LOWER_CASE, 0x3DA }, + { 0x3DC, UPPER_CASE, 0x3DD }, + { 0x3DD, LOWER_CASE, 0x3DC }, + { 0x3DE, UPPER_CASE, 0x3DF }, + { 0x3DF, LOWER_CASE, 0x3DE }, + { 0x3E0, UPPER_CASE, 0x3E1 }, + { 0x3E1, LOWER_CASE, 0x3E0 }, + { 0x3E2, UPPER_CASE, 0x3E3 }, + { 0x3E3, LOWER_CASE, 0x3E2 }, + { 0x3E4, UPPER_CASE, 0x3E5 }, + { 0x3E5, LOWER_CASE, 0x3E4 }, + { 0x3E6, UPPER_CASE, 0x3E7 }, + { 0x3E7, LOWER_CASE, 0x3E6 }, + { 0x3E8, UPPER_CASE, 0x3E9 }, + { 0x3E9, LOWER_CASE, 0x3E8 }, + { 0x3EA, UPPER_CASE, 0x3EB }, + { 0x3EB, LOWER_CASE, 0x3EA }, + { 0x3EC, UPPER_CASE, 0x3ED }, + { 0x3ED, LOWER_CASE, 0x3EC }, + { 0x3EE, UPPER_CASE, 0x3EF }, + { 0x3EF, LOWER_CASE, 0x3EE }, + { 0x3F0, LOWER_CASE, 0x39A }, + { 0x3F1, LOWER_CASE, 0x3A1 }, + { 0x3F2, LOWER_CASE, 0x3F9 }, + { 0x3F3, LOWER_CASE, 0x37F }, + { 0x3F4, UPPER_CASE, 0x3B8 }, + { 0x3F5, LOWER_CASE, 0x395 }, + { 0x3F7, UPPER_CASE, 0x3F8 }, + { 0x3F8, LOWER_CASE, 0x3F7 }, + { 0x3F9, UPPER_CASE, 0x3F2 }, + { 0x3FA, UPPER_CASE, 0x3FB }, + { 0x3FB, LOWER_CASE, 0x3FA }, + { 0x3FD, UPPER_CASE, 0x37B }, + { 0x3FE, UPPER_CASE, 0x37C }, + { 0x3FF, UPPER_CASE, 0x37D }, + { 0x400, UPPER_CASE, 0x450 }, + { 0x401, UPPER_CASE, 0x451 }, + { 0x402, UPPER_CASE, 0x452 }, + { 0x403, UPPER_CASE, 0x453 }, + { 0x404, UPPER_CASE, 0x454 }, + { 0x405, UPPER_CASE, 0x455 }, + { 0x406, UPPER_CASE, 0x456 }, + { 0x407, UPPER_CASE, 0x457 }, + { 0x408, UPPER_CASE, 0x458 }, + { 0x409, UPPER_CASE, 0x459 }, + { 0x40A, UPPER_CASE, 0x45A }, + { 0x40B, UPPER_CASE, 0x45B }, + { 0x40C, UPPER_CASE, 0x45C }, + { 0x40D, UPPER_CASE, 0x45D }, + { 0x40E, UPPER_CASE, 0x45E }, + { 0x40F, UPPER_CASE, 0x45F }, + { 0x410, UPPER_CASE, 0x430 }, + { 0x411, UPPER_CASE, 0x431 }, + { 0x412, UPPER_CASE, 0x432 }, + { 0x413, UPPER_CASE, 0x433 }, + { 0x414, UPPER_CASE, 0x434 }, + { 0x415, UPPER_CASE, 0x435 }, + { 0x416, UPPER_CASE, 0x436 }, + { 0x417, UPPER_CASE, 0x437 }, + { 0x418, UPPER_CASE, 0x438 }, + { 0x419, UPPER_CASE, 0x439 }, + { 0x41A, UPPER_CASE, 0x43A }, + { 0x41B, UPPER_CASE, 0x43B }, + { 0x41C, UPPER_CASE, 0x43C }, + { 0x41D, UPPER_CASE, 0x43D }, + { 0x41E, UPPER_CASE, 0x43E }, + { 0x41F, UPPER_CASE, 0x43F }, + { 0x420, UPPER_CASE, 0x440 }, + { 0x421, UPPER_CASE, 0x441 }, + { 0x422, UPPER_CASE, 0x442 }, + { 0x423, UPPER_CASE, 0x443 }, + { 0x424, UPPER_CASE, 0x444 }, + { 0x425, UPPER_CASE, 0x445 }, + { 0x426, UPPER_CASE, 0x446 }, + { 0x427, UPPER_CASE, 0x447 }, + { 0x428, UPPER_CASE, 0x448 }, + { 0x429, UPPER_CASE, 0x449 }, + { 0x42A, UPPER_CASE, 0x44A }, + { 0x42B, UPPER_CASE, 0x44B }, + { 0x42C, UPPER_CASE, 0x44C }, + { 0x42D, UPPER_CASE, 0x44D }, + { 0x42E, UPPER_CASE, 0x44E }, + { 0x42F, UPPER_CASE, 0x44F }, + { 0x430, LOWER_CASE, 0x410 }, + { 0x431, LOWER_CASE, 0x411 }, + { 0x432, LOWER_CASE, 0x412 }, + { 0x433, LOWER_CASE, 0x413 }, + { 0x434, LOWER_CASE, 0x414 }, + { 0x435, LOWER_CASE, 0x415 }, + { 0x436, LOWER_CASE, 0x416 }, + { 0x437, LOWER_CASE, 0x417 }, + { 0x438, LOWER_CASE, 0x418 }, + { 0x439, LOWER_CASE, 0x419 }, + { 0x43A, LOWER_CASE, 0x41A }, + { 0x43B, LOWER_CASE, 0x41B }, + { 0x43C, LOWER_CASE, 0x41C }, + { 0x43D, LOWER_CASE, 0x41D }, + { 0x43E, LOWER_CASE, 0x41E }, + { 0x43F, LOWER_CASE, 0x41F }, + { 0x440, LOWER_CASE, 0x420 }, + { 0x441, LOWER_CASE, 0x421 }, + { 0x442, LOWER_CASE, 0x422 }, + { 0x443, LOWER_CASE, 0x423 }, + { 0x444, LOWER_CASE, 0x424 }, + { 0x445, LOWER_CASE, 0x425 }, + { 0x446, LOWER_CASE, 0x426 }, + { 0x447, LOWER_CASE, 0x427 }, + { 0x448, LOWER_CASE, 0x428 }, + { 0x449, LOWER_CASE, 0x429 }, + { 0x44A, LOWER_CASE, 0x42A }, + { 0x44B, LOWER_CASE, 0x42B }, + { 0x44C, LOWER_CASE, 0x42C }, + { 0x44D, LOWER_CASE, 0x42D }, + { 0x44E, LOWER_CASE, 0x42E }, + { 0x44F, LOWER_CASE, 0x42F }, + { 0x450, LOWER_CASE, 0x400 }, + { 0x451, LOWER_CASE, 0x401 }, + { 0x452, LOWER_CASE, 0x402 }, + { 0x453, LOWER_CASE, 0x403 }, + { 0x454, LOWER_CASE, 0x404 }, + { 0x455, LOWER_CASE, 0x405 }, + { 0x456, LOWER_CASE, 0x406 }, + { 0x457, LOWER_CASE, 0x407 }, + { 0x458, LOWER_CASE, 0x408 }, + { 0x459, LOWER_CASE, 0x409 }, + { 0x45A, LOWER_CASE, 0x40A }, + { 0x45B, LOWER_CASE, 0x40B }, + { 0x45C, LOWER_CASE, 0x40C }, + { 0x45D, LOWER_CASE, 0x40D }, + { 0x45E, LOWER_CASE, 0x40E }, + { 0x45F, LOWER_CASE, 0x40F }, + { 0x460, UPPER_CASE, 0x461 }, + { 0x461, LOWER_CASE, 0x460 }, + { 0x462, UPPER_CASE, 0x463 }, + { 0x463, LOWER_CASE, 0x462 }, + { 0x464, UPPER_CASE, 0x465 }, + { 0x465, LOWER_CASE, 0x464 }, + { 0x466, UPPER_CASE, 0x467 }, + { 0x467, LOWER_CASE, 0x466 }, + { 0x468, UPPER_CASE, 0x469 }, + { 0x469, LOWER_CASE, 0x468 }, + { 0x46A, UPPER_CASE, 0x46B }, + { 0x46B, LOWER_CASE, 0x46A }, + { 0x46C, UPPER_CASE, 0x46D }, + { 0x46D, LOWER_CASE, 0x46C }, + { 0x46E, UPPER_CASE, 0x46F }, + { 0x46F, LOWER_CASE, 0x46E }, + { 0x470, UPPER_CASE, 0x471 }, + { 0x471, LOWER_CASE, 0x470 }, + { 0x472, UPPER_CASE, 0x473 }, + { 0x473, LOWER_CASE, 0x472 }, + { 0x474, UPPER_CASE, 0x475 }, + { 0x475, LOWER_CASE, 0x474 }, + { 0x476, UPPER_CASE, 0x477 }, + { 0x477, LOWER_CASE, 0x476 }, + { 0x478, UPPER_CASE, 0x479 }, + { 0x479, LOWER_CASE, 0x478 }, + { 0x47A, UPPER_CASE, 0x47B }, + { 0x47B, LOWER_CASE, 0x47A }, + { 0x47C, UPPER_CASE, 0x47D }, + { 0x47D, LOWER_CASE, 0x47C }, + { 0x47E, UPPER_CASE, 0x47F }, + { 0x47F, LOWER_CASE, 0x47E }, + { 0x480, UPPER_CASE, 0x481 }, + { 0x481, LOWER_CASE, 0x480 }, + { 0x48A, UPPER_CASE, 0x48B }, + { 0x48B, LOWER_CASE, 0x48A }, + { 0x48C, UPPER_CASE, 0x48D }, + { 0x48D, LOWER_CASE, 0x48C }, + { 0x48E, UPPER_CASE, 0x48F }, + { 0x48F, LOWER_CASE, 0x48E }, + { 0x490, UPPER_CASE, 0x491 }, + { 0x491, LOWER_CASE, 0x490 }, + { 0x492, UPPER_CASE, 0x493 }, + { 0x493, LOWER_CASE, 0x492 }, + { 0x494, UPPER_CASE, 0x495 }, + { 0x495, LOWER_CASE, 0x494 }, + { 0x496, UPPER_CASE, 0x497 }, + { 0x497, LOWER_CASE, 0x496 }, + { 0x498, UPPER_CASE, 0x499 }, + { 0x499, LOWER_CASE, 0x498 }, + { 0x49A, UPPER_CASE, 0x49B }, + { 0x49B, LOWER_CASE, 0x49A }, + { 0x49C, UPPER_CASE, 0x49D }, + { 0x49D, LOWER_CASE, 0x49C }, + { 0x49E, UPPER_CASE, 0x49F }, + { 0x49F, LOWER_CASE, 0x49E }, + { 0x4A0, UPPER_CASE, 0x4A1 }, + { 0x4A1, LOWER_CASE, 0x4A0 }, + { 0x4A2, UPPER_CASE, 0x4A3 }, + { 0x4A3, LOWER_CASE, 0x4A2 }, + { 0x4A4, UPPER_CASE, 0x4A5 }, + { 0x4A5, LOWER_CASE, 0x4A4 }, + { 0x4A6, UPPER_CASE, 0x4A7 }, + { 0x4A7, LOWER_CASE, 0x4A6 }, + { 0x4A8, UPPER_CASE, 0x4A9 }, + { 0x4A9, LOWER_CASE, 0x4A8 }, + { 0x4AA, UPPER_CASE, 0x4AB }, + { 0x4AB, LOWER_CASE, 0x4AA }, + { 0x4AC, UPPER_CASE, 0x4AD }, + { 0x4AD, LOWER_CASE, 0x4AC }, + { 0x4AE, UPPER_CASE, 0x4AF }, + { 0x4AF, LOWER_CASE, 0x4AE }, + { 0x4B0, UPPER_CASE, 0x4B1 }, + { 0x4B1, LOWER_CASE, 0x4B0 }, + { 0x4B2, UPPER_CASE, 0x4B3 }, + { 0x4B3, LOWER_CASE, 0x4B2 }, + { 0x4B4, UPPER_CASE, 0x4B5 }, + { 0x4B5, LOWER_CASE, 0x4B4 }, + { 0x4B6, UPPER_CASE, 0x4B7 }, + { 0x4B7, LOWER_CASE, 0x4B6 }, + { 0x4B8, UPPER_CASE, 0x4B9 }, + { 0x4B9, LOWER_CASE, 0x4B8 }, + { 0x4BA, UPPER_CASE, 0x4BB }, + { 0x4BB, LOWER_CASE, 0x4BA }, + { 0x4BC, UPPER_CASE, 0x4BD }, + { 0x4BD, LOWER_CASE, 0x4BC }, + { 0x4BE, UPPER_CASE, 0x4BF }, + { 0x4BF, LOWER_CASE, 0x4BE }, + { 0x4C0, UPPER_CASE, 0x4CF }, + { 0x4C1, UPPER_CASE, 0x4C2 }, + { 0x4C2, LOWER_CASE, 0x4C1 }, + { 0x4C3, UPPER_CASE, 0x4C4 }, + { 0x4C4, LOWER_CASE, 0x4C3 }, + { 0x4C5, UPPER_CASE, 0x4C6 }, + { 0x4C6, LOWER_CASE, 0x4C5 }, + { 0x4C7, UPPER_CASE, 0x4C8 }, + { 0x4C8, LOWER_CASE, 0x4C7 }, + { 0x4C9, UPPER_CASE, 0x4CA }, + { 0x4CA, LOWER_CASE, 0x4C9 }, + { 0x4CB, UPPER_CASE, 0x4CC }, + { 0x4CC, LOWER_CASE, 0x4CB }, + { 0x4CD, UPPER_CASE, 0x4CE }, + { 0x4CE, LOWER_CASE, 0x4CD }, + { 0x4CF, LOWER_CASE, 0x4C0 }, + { 0x4D0, UPPER_CASE, 0x4D1 }, + { 0x4D1, LOWER_CASE, 0x4D0 }, + { 0x4D2, UPPER_CASE, 0x4D3 }, + { 0x4D3, LOWER_CASE, 0x4D2 }, + { 0x4D4, UPPER_CASE, 0x4D5 }, + { 0x4D5, LOWER_CASE, 0x4D4 }, + { 0x4D6, UPPER_CASE, 0x4D7 }, + { 0x4D7, LOWER_CASE, 0x4D6 }, + { 0x4D8, UPPER_CASE, 0x4D9 }, + { 0x4D9, LOWER_CASE, 0x4D8 }, + { 0x4DA, UPPER_CASE, 0x4DB }, + { 0x4DB, LOWER_CASE, 0x4DA }, + { 0x4DC, UPPER_CASE, 0x4DD }, + { 0x4DD, LOWER_CASE, 0x4DC }, + { 0x4DE, UPPER_CASE, 0x4DF }, + { 0x4DF, LOWER_CASE, 0x4DE }, + { 0x4E0, UPPER_CASE, 0x4E1 }, + { 0x4E1, LOWER_CASE, 0x4E0 }, + { 0x4E2, UPPER_CASE, 0x4E3 }, + { 0x4E3, LOWER_CASE, 0x4E2 }, + { 0x4E4, UPPER_CASE, 0x4E5 }, + { 0x4E5, LOWER_CASE, 0x4E4 }, + { 0x4E6, UPPER_CASE, 0x4E7 }, + { 0x4E7, LOWER_CASE, 0x4E6 }, + { 0x4E8, UPPER_CASE, 0x4E9 }, + { 0x4E9, LOWER_CASE, 0x4E8 }, + { 0x4EA, UPPER_CASE, 0x4EB }, + { 0x4EB, LOWER_CASE, 0x4EA }, + { 0x4EC, UPPER_CASE, 0x4ED }, + { 0x4ED, LOWER_CASE, 0x4EC }, + { 0x4EE, UPPER_CASE, 0x4EF }, + { 0x4EF, LOWER_CASE, 0x4EE }, + { 0x4F0, UPPER_CASE, 0x4F1 }, + { 0x4F1, LOWER_CASE, 0x4F0 }, + { 0x4F2, UPPER_CASE, 0x4F3 }, + { 0x4F3, LOWER_CASE, 0x4F2 }, + { 0x4F4, UPPER_CASE, 0x4F5 }, + { 0x4F5, LOWER_CASE, 0x4F4 }, + { 0x4F6, UPPER_CASE, 0x4F7 }, + { 0x4F7, LOWER_CASE, 0x4F6 }, + { 0x4F8, UPPER_CASE, 0x4F9 }, + { 0x4F9, LOWER_CASE, 0x4F8 }, + { 0x4FA, UPPER_CASE, 0x4FB }, + { 0x4FB, LOWER_CASE, 0x4FA }, + { 0x4FC, UPPER_CASE, 0x4FD }, + { 0x4FD, LOWER_CASE, 0x4FC }, + { 0x4FE, UPPER_CASE, 0x4FF }, + { 0x4FF, LOWER_CASE, 0x4FE }, + { 0x500, UPPER_CASE, 0x501 }, + { 0x501, LOWER_CASE, 0x500 }, + { 0x502, UPPER_CASE, 0x503 }, + { 0x503, LOWER_CASE, 0x502 }, + { 0x504, UPPER_CASE, 0x505 }, + { 0x505, LOWER_CASE, 0x504 }, + { 0x506, UPPER_CASE, 0x507 }, + { 0x507, LOWER_CASE, 0x506 }, + { 0x508, UPPER_CASE, 0x509 }, + { 0x509, LOWER_CASE, 0x508 }, + { 0x50A, UPPER_CASE, 0x50B }, + { 0x50B, LOWER_CASE, 0x50A }, + { 0x50C, UPPER_CASE, 0x50D }, + { 0x50D, LOWER_CASE, 0x50C }, + { 0x50E, UPPER_CASE, 0x50F }, + { 0x50F, LOWER_CASE, 0x50E }, + { 0x510, UPPER_CASE, 0x511 }, + { 0x511, LOWER_CASE, 0x510 }, + { 0x512, UPPER_CASE, 0x513 }, + { 0x513, LOWER_CASE, 0x512 }, + { 0x514, UPPER_CASE, 0x515 }, + { 0x515, LOWER_CASE, 0x514 }, + { 0x516, UPPER_CASE, 0x517 }, + { 0x517, LOWER_CASE, 0x516 }, + { 0x518, UPPER_CASE, 0x519 }, + { 0x519, LOWER_CASE, 0x518 }, + { 0x51A, UPPER_CASE, 0x51B }, + { 0x51B, LOWER_CASE, 0x51A }, + { 0x51C, UPPER_CASE, 0x51D }, + { 0x51D, LOWER_CASE, 0x51C }, + { 0x51E, UPPER_CASE, 0x51F }, + { 0x51F, LOWER_CASE, 0x51E }, + { 0x520, UPPER_CASE, 0x521 }, + { 0x521, LOWER_CASE, 0x520 }, + { 0x522, UPPER_CASE, 0x523 }, + { 0x523, LOWER_CASE, 0x522 }, + { 0x524, UPPER_CASE, 0x525 }, + { 0x525, LOWER_CASE, 0x524 }, + { 0x526, UPPER_CASE, 0x527 }, + { 0x527, LOWER_CASE, 0x526 }, + { 0x528, UPPER_CASE, 0x529 }, + { 0x529, LOWER_CASE, 0x528 }, + { 0x52A, UPPER_CASE, 0x52B }, + { 0x52B, LOWER_CASE, 0x52A }, + { 0x52C, UPPER_CASE, 0x52D }, + { 0x52D, LOWER_CASE, 0x52C }, + { 0x52E, UPPER_CASE, 0x52F }, + { 0x52F, LOWER_CASE, 0x52E }, + { 0x531, UPPER_CASE, 0x561 }, + { 0x532, UPPER_CASE, 0x562 }, + { 0x533, UPPER_CASE, 0x563 }, + { 0x534, UPPER_CASE, 0x564 }, + { 0x535, UPPER_CASE, 0x565 }, + { 0x536, UPPER_CASE, 0x566 }, + { 0x537, UPPER_CASE, 0x567 }, + { 0x538, UPPER_CASE, 0x568 }, + { 0x539, UPPER_CASE, 0x569 }, + { 0x53A, UPPER_CASE, 0x56A }, + { 0x53B, UPPER_CASE, 0x56B }, + { 0x53C, UPPER_CASE, 0x56C }, + { 0x53D, UPPER_CASE, 0x56D }, + { 0x53E, UPPER_CASE, 0x56E }, + { 0x53F, UPPER_CASE, 0x56F }, + { 0x540, UPPER_CASE, 0x570 }, + { 0x541, UPPER_CASE, 0x571 }, + { 0x542, UPPER_CASE, 0x572 }, + { 0x543, UPPER_CASE, 0x573 }, + { 0x544, UPPER_CASE, 0x574 }, + { 0x545, UPPER_CASE, 0x575 }, + { 0x546, UPPER_CASE, 0x576 }, + { 0x547, UPPER_CASE, 0x577 }, + { 0x548, UPPER_CASE, 0x578 }, + { 0x549, UPPER_CASE, 0x579 }, + { 0x54A, UPPER_CASE, 0x57A }, + { 0x54B, UPPER_CASE, 0x57B }, + { 0x54C, UPPER_CASE, 0x57C }, + { 0x54D, UPPER_CASE, 0x57D }, + { 0x54E, UPPER_CASE, 0x57E }, + { 0x54F, UPPER_CASE, 0x57F }, + { 0x550, UPPER_CASE, 0x580 }, + { 0x551, UPPER_CASE, 0x581 }, + { 0x552, UPPER_CASE, 0x582 }, + { 0x553, UPPER_CASE, 0x583 }, + { 0x554, UPPER_CASE, 0x584 }, + { 0x555, UPPER_CASE, 0x585 }, + { 0x556, UPPER_CASE, 0x586 }, + { 0x561, LOWER_CASE, 0x531 }, + { 0x562, LOWER_CASE, 0x532 }, + { 0x563, LOWER_CASE, 0x533 }, + { 0x564, LOWER_CASE, 0x534 }, + { 0x565, LOWER_CASE, 0x535 }, + { 0x566, LOWER_CASE, 0x536 }, + { 0x567, LOWER_CASE, 0x537 }, + { 0x568, LOWER_CASE, 0x538 }, + { 0x569, LOWER_CASE, 0x539 }, + { 0x56A, LOWER_CASE, 0x53A }, + { 0x56B, LOWER_CASE, 0x53B }, + { 0x56C, LOWER_CASE, 0x53C }, + { 0x56D, LOWER_CASE, 0x53D }, + { 0x56E, LOWER_CASE, 0x53E }, + { 0x56F, LOWER_CASE, 0x53F }, + { 0x570, LOWER_CASE, 0x540 }, + { 0x571, LOWER_CASE, 0x541 }, + { 0x572, LOWER_CASE, 0x542 }, + { 0x573, LOWER_CASE, 0x543 }, + { 0x574, LOWER_CASE, 0x544 }, + { 0x575, LOWER_CASE, 0x545 }, + { 0x576, LOWER_CASE, 0x546 }, + { 0x577, LOWER_CASE, 0x547 }, + { 0x578, LOWER_CASE, 0x548 }, + { 0x579, LOWER_CASE, 0x549 }, + { 0x57A, LOWER_CASE, 0x54A }, + { 0x57B, LOWER_CASE, 0x54B }, + { 0x57C, LOWER_CASE, 0x54C }, + { 0x57D, LOWER_CASE, 0x54D }, + { 0x57E, LOWER_CASE, 0x54E }, + { 0x57F, LOWER_CASE, 0x54F }, + { 0x580, LOWER_CASE, 0x550 }, + { 0x581, LOWER_CASE, 0x551 }, + { 0x582, LOWER_CASE, 0x552 }, + { 0x583, LOWER_CASE, 0x553 }, + { 0x584, LOWER_CASE, 0x554 }, + { 0x585, LOWER_CASE, 0x555 }, + { 0x586, LOWER_CASE, 0x556 }, + { 0x10A0, UPPER_CASE, 0x2D00 }, + { 0x10A1, UPPER_CASE, 0x2D01 }, + { 0x10A2, UPPER_CASE, 0x2D02 }, + { 0x10A3, UPPER_CASE, 0x2D03 }, + { 0x10A4, UPPER_CASE, 0x2D04 }, + { 0x10A5, UPPER_CASE, 0x2D05 }, + { 0x10A6, UPPER_CASE, 0x2D06 }, + { 0x10A7, UPPER_CASE, 0x2D07 }, + { 0x10A8, UPPER_CASE, 0x2D08 }, + { 0x10A9, UPPER_CASE, 0x2D09 }, + { 0x10AA, UPPER_CASE, 0x2D0A }, + { 0x10AB, UPPER_CASE, 0x2D0B }, + { 0x10AC, UPPER_CASE, 0x2D0C }, + { 0x10AD, UPPER_CASE, 0x2D0D }, + { 0x10AE, UPPER_CASE, 0x2D0E }, + { 0x10AF, UPPER_CASE, 0x2D0F }, + { 0x10B0, UPPER_CASE, 0x2D10 }, + { 0x10B1, UPPER_CASE, 0x2D11 }, + { 0x10B2, UPPER_CASE, 0x2D12 }, + { 0x10B3, UPPER_CASE, 0x2D13 }, + { 0x10B4, UPPER_CASE, 0x2D14 }, + { 0x10B5, UPPER_CASE, 0x2D15 }, + { 0x10B6, UPPER_CASE, 0x2D16 }, + { 0x10B7, UPPER_CASE, 0x2D17 }, + { 0x10B8, UPPER_CASE, 0x2D18 }, + { 0x10B9, UPPER_CASE, 0x2D19 }, + { 0x10BA, UPPER_CASE, 0x2D1A }, + { 0x10BB, UPPER_CASE, 0x2D1B }, + { 0x10BC, UPPER_CASE, 0x2D1C }, + { 0x10BD, UPPER_CASE, 0x2D1D }, + { 0x10BE, UPPER_CASE, 0x2D1E }, + { 0x10BF, UPPER_CASE, 0x2D1F }, + { 0x10C0, UPPER_CASE, 0x2D20 }, + { 0x10C1, UPPER_CASE, 0x2D21 }, + { 0x10C2, UPPER_CASE, 0x2D22 }, + { 0x10C3, UPPER_CASE, 0x2D23 }, + { 0x10C4, UPPER_CASE, 0x2D24 }, + { 0x10C5, UPPER_CASE, 0x2D25 }, + { 0x10C7, UPPER_CASE, 0x2D27 }, + { 0x10CD, UPPER_CASE, 0x2D2D }, + { 0x10D0, LOWER_CASE, 0x1C90 }, + { 0x10D1, LOWER_CASE, 0x1C91 }, + { 0x10D2, LOWER_CASE, 0x1C92 }, + { 0x10D3, LOWER_CASE, 0x1C93 }, + { 0x10D4, LOWER_CASE, 0x1C94 }, + { 0x10D5, LOWER_CASE, 0x1C95 }, + { 0x10D6, LOWER_CASE, 0x1C96 }, + { 0x10D7, LOWER_CASE, 0x1C97 }, + { 0x10D8, LOWER_CASE, 0x1C98 }, + { 0x10D9, LOWER_CASE, 0x1C99 }, + { 0x10DA, LOWER_CASE, 0x1C9A }, + { 0x10DB, LOWER_CASE, 0x1C9B }, + { 0x10DC, LOWER_CASE, 0x1C9C }, + { 0x10DD, LOWER_CASE, 0x1C9D }, + { 0x10DE, LOWER_CASE, 0x1C9E }, + { 0x10DF, LOWER_CASE, 0x1C9F }, + { 0x10E0, LOWER_CASE, 0x1CA0 }, + { 0x10E1, LOWER_CASE, 0x1CA1 }, + { 0x10E2, LOWER_CASE, 0x1CA2 }, + { 0x10E3, LOWER_CASE, 0x1CA3 }, + { 0x10E4, LOWER_CASE, 0x1CA4 }, + { 0x10E5, LOWER_CASE, 0x1CA5 }, + { 0x10E6, LOWER_CASE, 0x1CA6 }, + { 0x10E7, LOWER_CASE, 0x1CA7 }, + { 0x10E8, LOWER_CASE, 0x1CA8 }, + { 0x10E9, LOWER_CASE, 0x1CA9 }, + { 0x10EA, LOWER_CASE, 0x1CAA }, + { 0x10EB, LOWER_CASE, 0x1CAB }, + { 0x10EC, LOWER_CASE, 0x1CAC }, + { 0x10ED, LOWER_CASE, 0x1CAD }, + { 0x10EE, LOWER_CASE, 0x1CAE }, + { 0x10EF, LOWER_CASE, 0x1CAF }, + { 0x10F0, LOWER_CASE, 0x1CB0 }, + { 0x10F1, LOWER_CASE, 0x1CB1 }, + { 0x10F2, LOWER_CASE, 0x1CB2 }, + { 0x10F3, LOWER_CASE, 0x1CB3 }, + { 0x10F4, LOWER_CASE, 0x1CB4 }, + { 0x10F5, LOWER_CASE, 0x1CB5 }, + { 0x10F6, LOWER_CASE, 0x1CB6 }, + { 0x10F7, LOWER_CASE, 0x1CB7 }, + { 0x10F8, LOWER_CASE, 0x1CB8 }, + { 0x10F9, LOWER_CASE, 0x1CB9 }, + { 0x10FA, LOWER_CASE, 0x1CBA }, + { 0x10FD, LOWER_CASE, 0x1CBD }, + { 0x10FE, LOWER_CASE, 0x1CBE }, + { 0x10FF, LOWER_CASE, 0x1CBF }, + { 0x13A0, UPPER_CASE, 0xAB70 }, + { 0x13A1, UPPER_CASE, 0xAB71 }, + { 0x13A2, UPPER_CASE, 0xAB72 }, + { 0x13A3, UPPER_CASE, 0xAB73 }, + { 0x13A4, UPPER_CASE, 0xAB74 }, + { 0x13A5, UPPER_CASE, 0xAB75 }, + { 0x13A6, UPPER_CASE, 0xAB76 }, + { 0x13A7, UPPER_CASE, 0xAB77 }, + { 0x13A8, UPPER_CASE, 0xAB78 }, + { 0x13A9, UPPER_CASE, 0xAB79 }, + { 0x13AA, UPPER_CASE, 0xAB7A }, + { 0x13AB, UPPER_CASE, 0xAB7B }, + { 0x13AC, UPPER_CASE, 0xAB7C }, + { 0x13AD, UPPER_CASE, 0xAB7D }, + { 0x13AE, UPPER_CASE, 0xAB7E }, + { 0x13AF, UPPER_CASE, 0xAB7F }, + { 0x13B0, UPPER_CASE, 0xAB80 }, + { 0x13B1, UPPER_CASE, 0xAB81 }, + { 0x13B2, UPPER_CASE, 0xAB82 }, + { 0x13B3, UPPER_CASE, 0xAB83 }, + { 0x13B4, UPPER_CASE, 0xAB84 }, + { 0x13B5, UPPER_CASE, 0xAB85 }, + { 0x13B6, UPPER_CASE, 0xAB86 }, + { 0x13B7, UPPER_CASE, 0xAB87 }, + { 0x13B8, UPPER_CASE, 0xAB88 }, + { 0x13B9, UPPER_CASE, 0xAB89 }, + { 0x13BA, UPPER_CASE, 0xAB8A }, + { 0x13BB, UPPER_CASE, 0xAB8B }, + { 0x13BC, UPPER_CASE, 0xAB8C }, + { 0x13BD, UPPER_CASE, 0xAB8D }, + { 0x13BE, UPPER_CASE, 0xAB8E }, + { 0x13BF, UPPER_CASE, 0xAB8F }, + { 0x13C0, UPPER_CASE, 0xAB90 }, + { 0x13C1, UPPER_CASE, 0xAB91 }, + { 0x13C2, UPPER_CASE, 0xAB92 }, + { 0x13C3, UPPER_CASE, 0xAB93 }, + { 0x13C4, UPPER_CASE, 0xAB94 }, + { 0x13C5, UPPER_CASE, 0xAB95 }, + { 0x13C6, UPPER_CASE, 0xAB96 }, + { 0x13C7, UPPER_CASE, 0xAB97 }, + { 0x13C8, UPPER_CASE, 0xAB98 }, + { 0x13C9, UPPER_CASE, 0xAB99 }, + { 0x13CA, UPPER_CASE, 0xAB9A }, + { 0x13CB, UPPER_CASE, 0xAB9B }, + { 0x13CC, UPPER_CASE, 0xAB9C }, + { 0x13CD, UPPER_CASE, 0xAB9D }, + { 0x13CE, UPPER_CASE, 0xAB9E }, + { 0x13CF, UPPER_CASE, 0xAB9F }, + { 0x13D0, UPPER_CASE, 0xABA0 }, + { 0x13D1, UPPER_CASE, 0xABA1 }, + { 0x13D2, UPPER_CASE, 0xABA2 }, + { 0x13D3, UPPER_CASE, 0xABA3 }, + { 0x13D4, UPPER_CASE, 0xABA4 }, + { 0x13D5, UPPER_CASE, 0xABA5 }, + { 0x13D6, UPPER_CASE, 0xABA6 }, + { 0x13D7, UPPER_CASE, 0xABA7 }, + { 0x13D8, UPPER_CASE, 0xABA8 }, + { 0x13D9, UPPER_CASE, 0xABA9 }, + { 0x13DA, UPPER_CASE, 0xABAA }, + { 0x13DB, UPPER_CASE, 0xABAB }, + { 0x13DC, UPPER_CASE, 0xABAC }, + { 0x13DD, UPPER_CASE, 0xABAD }, + { 0x13DE, UPPER_CASE, 0xABAE }, + { 0x13DF, UPPER_CASE, 0xABAF }, + { 0x13E0, UPPER_CASE, 0xABB0 }, + { 0x13E1, UPPER_CASE, 0xABB1 }, + { 0x13E2, UPPER_CASE, 0xABB2 }, + { 0x13E3, UPPER_CASE, 0xABB3 }, + { 0x13E4, UPPER_CASE, 0xABB4 }, + { 0x13E5, UPPER_CASE, 0xABB5 }, + { 0x13E6, UPPER_CASE, 0xABB6 }, + { 0x13E7, UPPER_CASE, 0xABB7 }, + { 0x13E8, UPPER_CASE, 0xABB8 }, + { 0x13E9, UPPER_CASE, 0xABB9 }, + { 0x13EA, UPPER_CASE, 0xABBA }, + { 0x13EB, UPPER_CASE, 0xABBB }, + { 0x13EC, UPPER_CASE, 0xABBC }, + { 0x13ED, UPPER_CASE, 0xABBD }, + { 0x13EE, UPPER_CASE, 0xABBE }, + { 0x13EF, UPPER_CASE, 0xABBF }, + { 0x13F0, UPPER_CASE, 0x13F8 }, + { 0x13F1, UPPER_CASE, 0x13F9 }, + { 0x13F2, UPPER_CASE, 0x13FA }, + { 0x13F3, UPPER_CASE, 0x13FB }, + { 0x13F4, UPPER_CASE, 0x13FC }, + { 0x13F5, UPPER_CASE, 0x13FD }, + { 0x13F8, LOWER_CASE, 0x13F0 }, + { 0x13F9, LOWER_CASE, 0x13F1 }, + { 0x13FA, LOWER_CASE, 0x13F2 }, + { 0x13FB, LOWER_CASE, 0x13F3 }, + { 0x13FC, LOWER_CASE, 0x13F4 }, + { 0x13FD, LOWER_CASE, 0x13F5 }, + { 0x1C80, LOWER_CASE, 0x412 }, + { 0x1C81, LOWER_CASE, 0x414 }, + { 0x1C82, LOWER_CASE, 0x41E }, + { 0x1C83, LOWER_CASE, 0x421 }, + { 0x1C84, LOWER_CASE, 0x422 }, + { 0x1C85, LOWER_CASE, 0x422 }, + { 0x1C86, LOWER_CASE, 0x42A }, + { 0x1C87, LOWER_CASE, 0x462 }, + { 0x1C88, LOWER_CASE, 0xA64A }, + { 0x1C90, UPPER_CASE, 0x10D0 }, + { 0x1C91, UPPER_CASE, 0x10D1 }, + { 0x1C92, UPPER_CASE, 0x10D2 }, + { 0x1C93, UPPER_CASE, 0x10D3 }, + { 0x1C94, UPPER_CASE, 0x10D4 }, + { 0x1C95, UPPER_CASE, 0x10D5 }, + { 0x1C96, UPPER_CASE, 0x10D6 }, + { 0x1C97, UPPER_CASE, 0x10D7 }, + { 0x1C98, UPPER_CASE, 0x10D8 }, + { 0x1C99, UPPER_CASE, 0x10D9 }, + { 0x1C9A, UPPER_CASE, 0x10DA }, + { 0x1C9B, UPPER_CASE, 0x10DB }, + { 0x1C9C, UPPER_CASE, 0x10DC }, + { 0x1C9D, UPPER_CASE, 0x10DD }, + { 0x1C9E, UPPER_CASE, 0x10DE }, + { 0x1C9F, UPPER_CASE, 0x10DF }, + { 0x1CA0, UPPER_CASE, 0x10E0 }, + { 0x1CA1, UPPER_CASE, 0x10E1 }, + { 0x1CA2, UPPER_CASE, 0x10E2 }, + { 0x1CA3, UPPER_CASE, 0x10E3 }, + { 0x1CA4, UPPER_CASE, 0x10E4 }, + { 0x1CA5, UPPER_CASE, 0x10E5 }, + { 0x1CA6, UPPER_CASE, 0x10E6 }, + { 0x1CA7, UPPER_CASE, 0x10E7 }, + { 0x1CA8, UPPER_CASE, 0x10E8 }, + { 0x1CA9, UPPER_CASE, 0x10E9 }, + { 0x1CAA, UPPER_CASE, 0x10EA }, + { 0x1CAB, UPPER_CASE, 0x10EB }, + { 0x1CAC, UPPER_CASE, 0x10EC }, + { 0x1CAD, UPPER_CASE, 0x10ED }, + { 0x1CAE, UPPER_CASE, 0x10EE }, + { 0x1CAF, UPPER_CASE, 0x10EF }, + { 0x1CB0, UPPER_CASE, 0x10F0 }, + { 0x1CB1, UPPER_CASE, 0x10F1 }, + { 0x1CB2, UPPER_CASE, 0x10F2 }, + { 0x1CB3, UPPER_CASE, 0x10F3 }, + { 0x1CB4, UPPER_CASE, 0x10F4 }, + { 0x1CB5, UPPER_CASE, 0x10F5 }, + { 0x1CB6, UPPER_CASE, 0x10F6 }, + { 0x1CB7, UPPER_CASE, 0x10F7 }, + { 0x1CB8, UPPER_CASE, 0x10F8 }, + { 0x1CB9, UPPER_CASE, 0x10F9 }, + { 0x1CBA, UPPER_CASE, 0x10FA }, + { 0x1CBD, UPPER_CASE, 0x10FD }, + { 0x1CBE, UPPER_CASE, 0x10FE }, + { 0x1CBF, UPPER_CASE, 0x10FF }, + { 0x1D79, LOWER_CASE, 0xA77D }, + { 0x1D7D, LOWER_CASE, 0x2C63 }, + { 0x1D8E, LOWER_CASE, 0xA7C6 }, + { 0x1E00, UPPER_CASE, 0x1E01 }, + { 0x1E01, LOWER_CASE, 0x1E00 }, + { 0x1E02, UPPER_CASE, 0x1E03 }, + { 0x1E03, LOWER_CASE, 0x1E02 }, + { 0x1E04, UPPER_CASE, 0x1E05 }, + { 0x1E05, LOWER_CASE, 0x1E04 }, + { 0x1E06, UPPER_CASE, 0x1E07 }, + { 0x1E07, LOWER_CASE, 0x1E06 }, + { 0x1E08, UPPER_CASE, 0x1E09 }, + { 0x1E09, LOWER_CASE, 0x1E08 }, + { 0x1E0A, UPPER_CASE, 0x1E0B }, + { 0x1E0B, LOWER_CASE, 0x1E0A }, + { 0x1E0C, UPPER_CASE, 0x1E0D }, + { 0x1E0D, LOWER_CASE, 0x1E0C }, + { 0x1E0E, UPPER_CASE, 0x1E0F }, + { 0x1E0F, LOWER_CASE, 0x1E0E }, + { 0x1E10, UPPER_CASE, 0x1E11 }, + { 0x1E11, LOWER_CASE, 0x1E10 }, + { 0x1E12, UPPER_CASE, 0x1E13 }, + { 0x1E13, LOWER_CASE, 0x1E12 }, + { 0x1E14, UPPER_CASE, 0x1E15 }, + { 0x1E15, LOWER_CASE, 0x1E14 }, + { 0x1E16, UPPER_CASE, 0x1E17 }, + { 0x1E17, LOWER_CASE, 0x1E16 }, + { 0x1E18, UPPER_CASE, 0x1E19 }, + { 0x1E19, LOWER_CASE, 0x1E18 }, + { 0x1E1A, UPPER_CASE, 0x1E1B }, + { 0x1E1B, LOWER_CASE, 0x1E1A }, + { 0x1E1C, UPPER_CASE, 0x1E1D }, + { 0x1E1D, LOWER_CASE, 0x1E1C }, + { 0x1E1E, UPPER_CASE, 0x1E1F }, + { 0x1E1F, LOWER_CASE, 0x1E1E }, + { 0x1E20, UPPER_CASE, 0x1E21 }, + { 0x1E21, LOWER_CASE, 0x1E20 }, + { 0x1E22, UPPER_CASE, 0x1E23 }, + { 0x1E23, LOWER_CASE, 0x1E22 }, + { 0x1E24, UPPER_CASE, 0x1E25 }, + { 0x1E25, LOWER_CASE, 0x1E24 }, + { 0x1E26, UPPER_CASE, 0x1E27 }, + { 0x1E27, LOWER_CASE, 0x1E26 }, + { 0x1E28, UPPER_CASE, 0x1E29 }, + { 0x1E29, LOWER_CASE, 0x1E28 }, + { 0x1E2A, UPPER_CASE, 0x1E2B }, + { 0x1E2B, LOWER_CASE, 0x1E2A }, + { 0x1E2C, UPPER_CASE, 0x1E2D }, + { 0x1E2D, LOWER_CASE, 0x1E2C }, + { 0x1E2E, UPPER_CASE, 0x1E2F }, + { 0x1E2F, LOWER_CASE, 0x1E2E }, + { 0x1E30, UPPER_CASE, 0x1E31 }, + { 0x1E31, LOWER_CASE, 0x1E30 }, + { 0x1E32, UPPER_CASE, 0x1E33 }, + { 0x1E33, LOWER_CASE, 0x1E32 }, + { 0x1E34, UPPER_CASE, 0x1E35 }, + { 0x1E35, LOWER_CASE, 0x1E34 }, + { 0x1E36, UPPER_CASE, 0x1E37 }, + { 0x1E37, LOWER_CASE, 0x1E36 }, + { 0x1E38, UPPER_CASE, 0x1E39 }, + { 0x1E39, LOWER_CASE, 0x1E38 }, + { 0x1E3A, UPPER_CASE, 0x1E3B }, + { 0x1E3B, LOWER_CASE, 0x1E3A }, + { 0x1E3C, UPPER_CASE, 0x1E3D }, + { 0x1E3D, LOWER_CASE, 0x1E3C }, + { 0x1E3E, UPPER_CASE, 0x1E3F }, + { 0x1E3F, LOWER_CASE, 0x1E3E }, + { 0x1E40, UPPER_CASE, 0x1E41 }, + { 0x1E41, LOWER_CASE, 0x1E40 }, + { 0x1E42, UPPER_CASE, 0x1E43 }, + { 0x1E43, LOWER_CASE, 0x1E42 }, + { 0x1E44, UPPER_CASE, 0x1E45 }, + { 0x1E45, LOWER_CASE, 0x1E44 }, + { 0x1E46, UPPER_CASE, 0x1E47 }, + { 0x1E47, LOWER_CASE, 0x1E46 }, + { 0x1E48, UPPER_CASE, 0x1E49 }, + { 0x1E49, LOWER_CASE, 0x1E48 }, + { 0x1E4A, UPPER_CASE, 0x1E4B }, + { 0x1E4B, LOWER_CASE, 0x1E4A }, + { 0x1E4C, UPPER_CASE, 0x1E4D }, + { 0x1E4D, LOWER_CASE, 0x1E4C }, + { 0x1E4E, UPPER_CASE, 0x1E4F }, + { 0x1E4F, LOWER_CASE, 0x1E4E }, + { 0x1E50, UPPER_CASE, 0x1E51 }, + { 0x1E51, LOWER_CASE, 0x1E50 }, + { 0x1E52, UPPER_CASE, 0x1E53 }, + { 0x1E53, LOWER_CASE, 0x1E52 }, + { 0x1E54, UPPER_CASE, 0x1E55 }, + { 0x1E55, LOWER_CASE, 0x1E54 }, + { 0x1E56, UPPER_CASE, 0x1E57 }, + { 0x1E57, LOWER_CASE, 0x1E56 }, + { 0x1E58, UPPER_CASE, 0x1E59 }, + { 0x1E59, LOWER_CASE, 0x1E58 }, + { 0x1E5A, UPPER_CASE, 0x1E5B }, + { 0x1E5B, LOWER_CASE, 0x1E5A }, + { 0x1E5C, UPPER_CASE, 0x1E5D }, + { 0x1E5D, LOWER_CASE, 0x1E5C }, + { 0x1E5E, UPPER_CASE, 0x1E5F }, + { 0x1E5F, LOWER_CASE, 0x1E5E }, + { 0x1E60, UPPER_CASE, 0x1E61 }, + { 0x1E61, LOWER_CASE, 0x1E60 }, + { 0x1E62, UPPER_CASE, 0x1E63 }, + { 0x1E63, LOWER_CASE, 0x1E62 }, + { 0x1E64, UPPER_CASE, 0x1E65 }, + { 0x1E65, LOWER_CASE, 0x1E64 }, + { 0x1E66, UPPER_CASE, 0x1E67 }, + { 0x1E67, LOWER_CASE, 0x1E66 }, + { 0x1E68, UPPER_CASE, 0x1E69 }, + { 0x1E69, LOWER_CASE, 0x1E68 }, + { 0x1E6A, UPPER_CASE, 0x1E6B }, + { 0x1E6B, LOWER_CASE, 0x1E6A }, + { 0x1E6C, UPPER_CASE, 0x1E6D }, + { 0x1E6D, LOWER_CASE, 0x1E6C }, + { 0x1E6E, UPPER_CASE, 0x1E6F }, + { 0x1E6F, LOWER_CASE, 0x1E6E }, + { 0x1E70, UPPER_CASE, 0x1E71 }, + { 0x1E71, LOWER_CASE, 0x1E70 }, + { 0x1E72, UPPER_CASE, 0x1E73 }, + { 0x1E73, LOWER_CASE, 0x1E72 }, + { 0x1E74, UPPER_CASE, 0x1E75 }, + { 0x1E75, LOWER_CASE, 0x1E74 }, + { 0x1E76, UPPER_CASE, 0x1E77 }, + { 0x1E77, LOWER_CASE, 0x1E76 }, + { 0x1E78, UPPER_CASE, 0x1E79 }, + { 0x1E79, LOWER_CASE, 0x1E78 }, + { 0x1E7A, UPPER_CASE, 0x1E7B }, + { 0x1E7B, LOWER_CASE, 0x1E7A }, + { 0x1E7C, UPPER_CASE, 0x1E7D }, + { 0x1E7D, LOWER_CASE, 0x1E7C }, + { 0x1E7E, UPPER_CASE, 0x1E7F }, + { 0x1E7F, LOWER_CASE, 0x1E7E }, + { 0x1E80, UPPER_CASE, 0x1E81 }, + { 0x1E81, LOWER_CASE, 0x1E80 }, + { 0x1E82, UPPER_CASE, 0x1E83 }, + { 0x1E83, LOWER_CASE, 0x1E82 }, + { 0x1E84, UPPER_CASE, 0x1E85 }, + { 0x1E85, LOWER_CASE, 0x1E84 }, + { 0x1E86, UPPER_CASE, 0x1E87 }, + { 0x1E87, LOWER_CASE, 0x1E86 }, + { 0x1E88, UPPER_CASE, 0x1E89 }, + { 0x1E89, LOWER_CASE, 0x1E88 }, + { 0x1E8A, UPPER_CASE, 0x1E8B }, + { 0x1E8B, LOWER_CASE, 0x1E8A }, + { 0x1E8C, UPPER_CASE, 0x1E8D }, + { 0x1E8D, LOWER_CASE, 0x1E8C }, + { 0x1E8E, UPPER_CASE, 0x1E8F }, + { 0x1E8F, LOWER_CASE, 0x1E8E }, + { 0x1E90, UPPER_CASE, 0x1E91 }, + { 0x1E91, LOWER_CASE, 0x1E90 }, + { 0x1E92, UPPER_CASE, 0x1E93 }, + { 0x1E93, LOWER_CASE, 0x1E92 }, + { 0x1E94, UPPER_CASE, 0x1E95 }, + { 0x1E95, LOWER_CASE, 0x1E94 }, + { 0x1E9B, LOWER_CASE, 0x1E60 }, + { 0x1E9E, UPPER_CASE, 0xDF }, + { 0x1EA0, UPPER_CASE, 0x1EA1 }, + { 0x1EA1, LOWER_CASE, 0x1EA0 }, + { 0x1EA2, UPPER_CASE, 0x1EA3 }, + { 0x1EA3, LOWER_CASE, 0x1EA2 }, + { 0x1EA4, UPPER_CASE, 0x1EA5 }, + { 0x1EA5, LOWER_CASE, 0x1EA4 }, + { 0x1EA6, UPPER_CASE, 0x1EA7 }, + { 0x1EA7, LOWER_CASE, 0x1EA6 }, + { 0x1EA8, UPPER_CASE, 0x1EA9 }, + { 0x1EA9, LOWER_CASE, 0x1EA8 }, + { 0x1EAA, UPPER_CASE, 0x1EAB }, + { 0x1EAB, LOWER_CASE, 0x1EAA }, + { 0x1EAC, UPPER_CASE, 0x1EAD }, + { 0x1EAD, LOWER_CASE, 0x1EAC }, + { 0x1EAE, UPPER_CASE, 0x1EAF }, + { 0x1EAF, LOWER_CASE, 0x1EAE }, + { 0x1EB0, UPPER_CASE, 0x1EB1 }, + { 0x1EB1, LOWER_CASE, 0x1EB0 }, + { 0x1EB2, UPPER_CASE, 0x1EB3 }, + { 0x1EB3, LOWER_CASE, 0x1EB2 }, + { 0x1EB4, UPPER_CASE, 0x1EB5 }, + { 0x1EB5, LOWER_CASE, 0x1EB4 }, + { 0x1EB6, UPPER_CASE, 0x1EB7 }, + { 0x1EB7, LOWER_CASE, 0x1EB6 }, + { 0x1EB8, UPPER_CASE, 0x1EB9 }, + { 0x1EB9, LOWER_CASE, 0x1EB8 }, + { 0x1EBA, UPPER_CASE, 0x1EBB }, + { 0x1EBB, LOWER_CASE, 0x1EBA }, + { 0x1EBC, UPPER_CASE, 0x1EBD }, + { 0x1EBD, LOWER_CASE, 0x1EBC }, + { 0x1EBE, UPPER_CASE, 0x1EBF }, + { 0x1EBF, LOWER_CASE, 0x1EBE }, + { 0x1EC0, UPPER_CASE, 0x1EC1 }, + { 0x1EC1, LOWER_CASE, 0x1EC0 }, + { 0x1EC2, UPPER_CASE, 0x1EC3 }, + { 0x1EC3, LOWER_CASE, 0x1EC2 }, + { 0x1EC4, UPPER_CASE, 0x1EC5 }, + { 0x1EC5, LOWER_CASE, 0x1EC4 }, + { 0x1EC6, UPPER_CASE, 0x1EC7 }, + { 0x1EC7, LOWER_CASE, 0x1EC6 }, + { 0x1EC8, UPPER_CASE, 0x1EC9 }, + { 0x1EC9, LOWER_CASE, 0x1EC8 }, + { 0x1ECA, UPPER_CASE, 0x1ECB }, + { 0x1ECB, LOWER_CASE, 0x1ECA }, + { 0x1ECC, UPPER_CASE, 0x1ECD }, + { 0x1ECD, LOWER_CASE, 0x1ECC }, + { 0x1ECE, UPPER_CASE, 0x1ECF }, + { 0x1ECF, LOWER_CASE, 0x1ECE }, + { 0x1ED0, UPPER_CASE, 0x1ED1 }, + { 0x1ED1, LOWER_CASE, 0x1ED0 }, + { 0x1ED2, UPPER_CASE, 0x1ED3 }, + { 0x1ED3, LOWER_CASE, 0x1ED2 }, + { 0x1ED4, UPPER_CASE, 0x1ED5 }, + { 0x1ED5, LOWER_CASE, 0x1ED4 }, + { 0x1ED6, UPPER_CASE, 0x1ED7 }, + { 0x1ED7, LOWER_CASE, 0x1ED6 }, + { 0x1ED8, UPPER_CASE, 0x1ED9 }, + { 0x1ED9, LOWER_CASE, 0x1ED8 }, + { 0x1EDA, UPPER_CASE, 0x1EDB }, + { 0x1EDB, LOWER_CASE, 0x1EDA }, + { 0x1EDC, UPPER_CASE, 0x1EDD }, + { 0x1EDD, LOWER_CASE, 0x1EDC }, + { 0x1EDE, UPPER_CASE, 0x1EDF }, + { 0x1EDF, LOWER_CASE, 0x1EDE }, + { 0x1EE0, UPPER_CASE, 0x1EE1 }, + { 0x1EE1, LOWER_CASE, 0x1EE0 }, + { 0x1EE2, UPPER_CASE, 0x1EE3 }, + { 0x1EE3, LOWER_CASE, 0x1EE2 }, + { 0x1EE4, UPPER_CASE, 0x1EE5 }, + { 0x1EE5, LOWER_CASE, 0x1EE4 }, + { 0x1EE6, UPPER_CASE, 0x1EE7 }, + { 0x1EE7, LOWER_CASE, 0x1EE6 }, + { 0x1EE8, UPPER_CASE, 0x1EE9 }, + { 0x1EE9, LOWER_CASE, 0x1EE8 }, + { 0x1EEA, UPPER_CASE, 0x1EEB }, + { 0x1EEB, LOWER_CASE, 0x1EEA }, + { 0x1EEC, UPPER_CASE, 0x1EED }, + { 0x1EED, LOWER_CASE, 0x1EEC }, + { 0x1EEE, UPPER_CASE, 0x1EEF }, + { 0x1EEF, LOWER_CASE, 0x1EEE }, + { 0x1EF0, UPPER_CASE, 0x1EF1 }, + { 0x1EF1, LOWER_CASE, 0x1EF0 }, + { 0x1EF2, UPPER_CASE, 0x1EF3 }, + { 0x1EF3, LOWER_CASE, 0x1EF2 }, + { 0x1EF4, UPPER_CASE, 0x1EF5 }, + { 0x1EF5, LOWER_CASE, 0x1EF4 }, + { 0x1EF6, UPPER_CASE, 0x1EF7 }, + { 0x1EF7, LOWER_CASE, 0x1EF6 }, + { 0x1EF8, UPPER_CASE, 0x1EF9 }, + { 0x1EF9, LOWER_CASE, 0x1EF8 }, + { 0x1EFA, UPPER_CASE, 0x1EFB }, + { 0x1EFB, LOWER_CASE, 0x1EFA }, + { 0x1EFC, UPPER_CASE, 0x1EFD }, + { 0x1EFD, LOWER_CASE, 0x1EFC }, + { 0x1EFE, UPPER_CASE, 0x1EFF }, + { 0x1EFF, LOWER_CASE, 0x1EFE }, + { 0x1F00, LOWER_CASE, 0x1F08 }, + { 0x1F01, LOWER_CASE, 0x1F09 }, + { 0x1F02, LOWER_CASE, 0x1F0A }, + { 0x1F03, LOWER_CASE, 0x1F0B }, + { 0x1F04, LOWER_CASE, 0x1F0C }, + { 0x1F05, LOWER_CASE, 0x1F0D }, + { 0x1F06, LOWER_CASE, 0x1F0E }, + { 0x1F07, LOWER_CASE, 0x1F0F }, + { 0x1F08, UPPER_CASE, 0x1F00 }, + { 0x1F09, UPPER_CASE, 0x1F01 }, + { 0x1F0A, UPPER_CASE, 0x1F02 }, + { 0x1F0B, UPPER_CASE, 0x1F03 }, + { 0x1F0C, UPPER_CASE, 0x1F04 }, + { 0x1F0D, UPPER_CASE, 0x1F05 }, + { 0x1F0E, UPPER_CASE, 0x1F06 }, + { 0x1F0F, UPPER_CASE, 0x1F07 }, + { 0x1F10, LOWER_CASE, 0x1F18 }, + { 0x1F11, LOWER_CASE, 0x1F19 }, + { 0x1F12, LOWER_CASE, 0x1F1A }, + { 0x1F13, LOWER_CASE, 0x1F1B }, + { 0x1F14, LOWER_CASE, 0x1F1C }, + { 0x1F15, LOWER_CASE, 0x1F1D }, + { 0x1F18, UPPER_CASE, 0x1F10 }, + { 0x1F19, UPPER_CASE, 0x1F11 }, + { 0x1F1A, UPPER_CASE, 0x1F12 }, + { 0x1F1B, UPPER_CASE, 0x1F13 }, + { 0x1F1C, UPPER_CASE, 0x1F14 }, + { 0x1F1D, UPPER_CASE, 0x1F15 }, + { 0x1F20, LOWER_CASE, 0x1F28 }, + { 0x1F21, LOWER_CASE, 0x1F29 }, + { 0x1F22, LOWER_CASE, 0x1F2A }, + { 0x1F23, LOWER_CASE, 0x1F2B }, + { 0x1F24, LOWER_CASE, 0x1F2C }, + { 0x1F25, LOWER_CASE, 0x1F2D }, + { 0x1F26, LOWER_CASE, 0x1F2E }, + { 0x1F27, LOWER_CASE, 0x1F2F }, + { 0x1F28, UPPER_CASE, 0x1F20 }, + { 0x1F29, UPPER_CASE, 0x1F21 }, + { 0x1F2A, UPPER_CASE, 0x1F22 }, + { 0x1F2B, UPPER_CASE, 0x1F23 }, + { 0x1F2C, UPPER_CASE, 0x1F24 }, + { 0x1F2D, UPPER_CASE, 0x1F25 }, + { 0x1F2E, UPPER_CASE, 0x1F26 }, + { 0x1F2F, UPPER_CASE, 0x1F27 }, + { 0x1F30, LOWER_CASE, 0x1F38 }, + { 0x1F31, LOWER_CASE, 0x1F39 }, + { 0x1F32, LOWER_CASE, 0x1F3A }, + { 0x1F33, LOWER_CASE, 0x1F3B }, + { 0x1F34, LOWER_CASE, 0x1F3C }, + { 0x1F35, LOWER_CASE, 0x1F3D }, + { 0x1F36, LOWER_CASE, 0x1F3E }, + { 0x1F37, LOWER_CASE, 0x1F3F }, + { 0x1F38, UPPER_CASE, 0x1F30 }, + { 0x1F39, UPPER_CASE, 0x1F31 }, + { 0x1F3A, UPPER_CASE, 0x1F32 }, + { 0x1F3B, UPPER_CASE, 0x1F33 }, + { 0x1F3C, UPPER_CASE, 0x1F34 }, + { 0x1F3D, UPPER_CASE, 0x1F35 }, + { 0x1F3E, UPPER_CASE, 0x1F36 }, + { 0x1F3F, UPPER_CASE, 0x1F37 }, + { 0x1F40, LOWER_CASE, 0x1F48 }, + { 0x1F41, LOWER_CASE, 0x1F49 }, + { 0x1F42, LOWER_CASE, 0x1F4A }, + { 0x1F43, LOWER_CASE, 0x1F4B }, + { 0x1F44, LOWER_CASE, 0x1F4C }, + { 0x1F45, LOWER_CASE, 0x1F4D }, + { 0x1F48, UPPER_CASE, 0x1F40 }, + { 0x1F49, UPPER_CASE, 0x1F41 }, + { 0x1F4A, UPPER_CASE, 0x1F42 }, + { 0x1F4B, UPPER_CASE, 0x1F43 }, + { 0x1F4C, UPPER_CASE, 0x1F44 }, + { 0x1F4D, UPPER_CASE, 0x1F45 }, + { 0x1F51, LOWER_CASE, 0x1F59 }, + { 0x1F53, LOWER_CASE, 0x1F5B }, + { 0x1F55, LOWER_CASE, 0x1F5D }, + { 0x1F57, LOWER_CASE, 0x1F5F }, + { 0x1F59, UPPER_CASE, 0x1F51 }, + { 0x1F5B, UPPER_CASE, 0x1F53 }, + { 0x1F5D, UPPER_CASE, 0x1F55 }, + { 0x1F5F, UPPER_CASE, 0x1F57 }, + { 0x1F60, LOWER_CASE, 0x1F68 }, + { 0x1F61, LOWER_CASE, 0x1F69 }, + { 0x1F62, LOWER_CASE, 0x1F6A }, + { 0x1F63, LOWER_CASE, 0x1F6B }, + { 0x1F64, LOWER_CASE, 0x1F6C }, + { 0x1F65, LOWER_CASE, 0x1F6D }, + { 0x1F66, LOWER_CASE, 0x1F6E }, + { 0x1F67, LOWER_CASE, 0x1F6F }, + { 0x1F68, UPPER_CASE, 0x1F60 }, + { 0x1F69, UPPER_CASE, 0x1F61 }, + { 0x1F6A, UPPER_CASE, 0x1F62 }, + { 0x1F6B, UPPER_CASE, 0x1F63 }, + { 0x1F6C, UPPER_CASE, 0x1F64 }, + { 0x1F6D, UPPER_CASE, 0x1F65 }, + { 0x1F6E, UPPER_CASE, 0x1F66 }, + { 0x1F6F, UPPER_CASE, 0x1F67 }, + { 0x1F70, LOWER_CASE, 0x1FBA }, + { 0x1F71, LOWER_CASE, 0x1FBB }, + { 0x1F72, LOWER_CASE, 0x1FC8 }, + { 0x1F73, LOWER_CASE, 0x1FC9 }, + { 0x1F74, LOWER_CASE, 0x1FCA }, + { 0x1F75, LOWER_CASE, 0x1FCB }, + { 0x1F76, LOWER_CASE, 0x1FDA }, + { 0x1F77, LOWER_CASE, 0x1FDB }, + { 0x1F78, LOWER_CASE, 0x1FF8 }, + { 0x1F79, LOWER_CASE, 0x1FF9 }, + { 0x1F7A, LOWER_CASE, 0x1FEA }, + { 0x1F7B, LOWER_CASE, 0x1FEB }, + { 0x1F7C, LOWER_CASE, 0x1FFA }, + { 0x1F7D, LOWER_CASE, 0x1FFB }, + { 0x1F80, LOWER_CASE, 0x1F88 }, + { 0x1F81, LOWER_CASE, 0x1F89 }, + { 0x1F82, LOWER_CASE, 0x1F8A }, + { 0x1F83, LOWER_CASE, 0x1F8B }, + { 0x1F84, LOWER_CASE, 0x1F8C }, + { 0x1F85, LOWER_CASE, 0x1F8D }, + { 0x1F86, LOWER_CASE, 0x1F8E }, + { 0x1F87, LOWER_CASE, 0x1F8F }, + { 0x1F88, UPPER_CASE, 0x1F80 }, + { 0x1F89, UPPER_CASE, 0x1F81 }, + { 0x1F8A, UPPER_CASE, 0x1F82 }, + { 0x1F8B, UPPER_CASE, 0x1F83 }, + { 0x1F8C, UPPER_CASE, 0x1F84 }, + { 0x1F8D, UPPER_CASE, 0x1F85 }, + { 0x1F8E, UPPER_CASE, 0x1F86 }, + { 0x1F8F, UPPER_CASE, 0x1F87 }, + { 0x1F90, LOWER_CASE, 0x1F98 }, + { 0x1F91, LOWER_CASE, 0x1F99 }, + { 0x1F92, LOWER_CASE, 0x1F9A }, + { 0x1F93, LOWER_CASE, 0x1F9B }, + { 0x1F94, LOWER_CASE, 0x1F9C }, + { 0x1F95, LOWER_CASE, 0x1F9D }, + { 0x1F96, LOWER_CASE, 0x1F9E }, + { 0x1F97, LOWER_CASE, 0x1F9F }, + { 0x1F98, UPPER_CASE, 0x1F90 }, + { 0x1F99, UPPER_CASE, 0x1F91 }, + { 0x1F9A, UPPER_CASE, 0x1F92 }, + { 0x1F9B, UPPER_CASE, 0x1F93 }, + { 0x1F9C, UPPER_CASE, 0x1F94 }, + { 0x1F9D, UPPER_CASE, 0x1F95 }, + { 0x1F9E, UPPER_CASE, 0x1F96 }, + { 0x1F9F, UPPER_CASE, 0x1F97 }, + { 0x1FA0, LOWER_CASE, 0x1FA8 }, + { 0x1FA1, LOWER_CASE, 0x1FA9 }, + { 0x1FA2, LOWER_CASE, 0x1FAA }, + { 0x1FA3, LOWER_CASE, 0x1FAB }, + { 0x1FA4, LOWER_CASE, 0x1FAC }, + { 0x1FA5, LOWER_CASE, 0x1FAD }, + { 0x1FA6, LOWER_CASE, 0x1FAE }, + { 0x1FA7, LOWER_CASE, 0x1FAF }, + { 0x1FA8, UPPER_CASE, 0x1FA0 }, + { 0x1FA9, UPPER_CASE, 0x1FA1 }, + { 0x1FAA, UPPER_CASE, 0x1FA2 }, + { 0x1FAB, UPPER_CASE, 0x1FA3 }, + { 0x1FAC, UPPER_CASE, 0x1FA4 }, + { 0x1FAD, UPPER_CASE, 0x1FA5 }, + { 0x1FAE, UPPER_CASE, 0x1FA6 }, + { 0x1FAF, UPPER_CASE, 0x1FA7 }, + { 0x1FB0, LOWER_CASE, 0x1FB8 }, + { 0x1FB1, LOWER_CASE, 0x1FB9 }, + { 0x1FB3, LOWER_CASE, 0x1FBC }, + { 0x1FB8, UPPER_CASE, 0x1FB0 }, + { 0x1FB9, UPPER_CASE, 0x1FB1 }, + { 0x1FBA, UPPER_CASE, 0x1F70 }, + { 0x1FBB, UPPER_CASE, 0x1F71 }, + { 0x1FBC, UPPER_CASE, 0x1FB3 }, + { 0x1FBE, LOWER_CASE, 0x399 }, + { 0x1FC3, LOWER_CASE, 0x1FCC }, + { 0x1FC8, UPPER_CASE, 0x1F72 }, + { 0x1FC9, UPPER_CASE, 0x1F73 }, + { 0x1FCA, UPPER_CASE, 0x1F74 }, + { 0x1FCB, UPPER_CASE, 0x1F75 }, + { 0x1FCC, UPPER_CASE, 0x1FC3 }, + { 0x1FD0, LOWER_CASE, 0x1FD8 }, + { 0x1FD1, LOWER_CASE, 0x1FD9 }, + { 0x1FD8, UPPER_CASE, 0x1FD0 }, + { 0x1FD9, UPPER_CASE, 0x1FD1 }, + { 0x1FDA, UPPER_CASE, 0x1F76 }, + { 0x1FDB, UPPER_CASE, 0x1F77 }, + { 0x1FE0, LOWER_CASE, 0x1FE8 }, + { 0x1FE1, LOWER_CASE, 0x1FE9 }, + { 0x1FE5, LOWER_CASE, 0x1FEC }, + { 0x1FE8, UPPER_CASE, 0x1FE0 }, + { 0x1FE9, UPPER_CASE, 0x1FE1 }, + { 0x1FEA, UPPER_CASE, 0x1F7A }, + { 0x1FEB, UPPER_CASE, 0x1F7B }, + { 0x1FEC, UPPER_CASE, 0x1FE5 }, + { 0x1FF3, LOWER_CASE, 0x1FFC }, + { 0x1FF8, UPPER_CASE, 0x1F78 }, + { 0x1FF9, UPPER_CASE, 0x1F79 }, + { 0x1FFA, UPPER_CASE, 0x1F7C }, + { 0x1FFB, UPPER_CASE, 0x1F7D }, + { 0x1FFC, UPPER_CASE, 0x1FF3 }, + { 0x2126, UPPER_CASE, 0x3C9 }, + { 0x212A, UPPER_CASE, 0x6B }, + { 0x212B, UPPER_CASE, 0xE5 }, + { 0x2132, UPPER_CASE, 0x214E }, + { 0x214E, LOWER_CASE, 0x2132 }, + { 0x2160, UPPER_CASE, 0x2170 }, + { 0x2161, UPPER_CASE, 0x2171 }, + { 0x2162, UPPER_CASE, 0x2172 }, + { 0x2163, UPPER_CASE, 0x2173 }, + { 0x2164, UPPER_CASE, 0x2174 }, + { 0x2165, UPPER_CASE, 0x2175 }, + { 0x2166, UPPER_CASE, 0x2176 }, + { 0x2167, UPPER_CASE, 0x2177 }, + { 0x2168, UPPER_CASE, 0x2178 }, + { 0x2169, UPPER_CASE, 0x2179 }, + { 0x216A, UPPER_CASE, 0x217A }, + { 0x216B, UPPER_CASE, 0x217B }, + { 0x216C, UPPER_CASE, 0x217C }, + { 0x216D, UPPER_CASE, 0x217D }, + { 0x216E, UPPER_CASE, 0x217E }, + { 0x216F, UPPER_CASE, 0x217F }, + { 0x2170, LOWER_CASE, 0x2160 }, + { 0x2171, LOWER_CASE, 0x2161 }, + { 0x2172, LOWER_CASE, 0x2162 }, + { 0x2173, LOWER_CASE, 0x2163 }, + { 0x2174, LOWER_CASE, 0x2164 }, + { 0x2175, LOWER_CASE, 0x2165 }, + { 0x2176, LOWER_CASE, 0x2166 }, + { 0x2177, LOWER_CASE, 0x2167 }, + { 0x2178, LOWER_CASE, 0x2168 }, + { 0x2179, LOWER_CASE, 0x2169 }, + { 0x217A, LOWER_CASE, 0x216A }, + { 0x217B, LOWER_CASE, 0x216B }, + { 0x217C, LOWER_CASE, 0x216C }, + { 0x217D, LOWER_CASE, 0x216D }, + { 0x217E, LOWER_CASE, 0x216E }, + { 0x217F, LOWER_CASE, 0x216F }, + { 0x2183, UPPER_CASE, 0x2184 }, + { 0x2184, LOWER_CASE, 0x2183 }, + { 0x24B6, UPPER_CASE, 0x24D0 }, + { 0x24B7, UPPER_CASE, 0x24D1 }, + { 0x24B8, UPPER_CASE, 0x24D2 }, + { 0x24B9, UPPER_CASE, 0x24D3 }, + { 0x24BA, UPPER_CASE, 0x24D4 }, + { 0x24BB, UPPER_CASE, 0x24D5 }, + { 0x24BC, UPPER_CASE, 0x24D6 }, + { 0x24BD, UPPER_CASE, 0x24D7 }, + { 0x24BE, UPPER_CASE, 0x24D8 }, + { 0x24BF, UPPER_CASE, 0x24D9 }, + { 0x24C0, UPPER_CASE, 0x24DA }, + { 0x24C1, UPPER_CASE, 0x24DB }, + { 0x24C2, UPPER_CASE, 0x24DC }, + { 0x24C3, UPPER_CASE, 0x24DD }, + { 0x24C4, UPPER_CASE, 0x24DE }, + { 0x24C5, UPPER_CASE, 0x24DF }, + { 0x24C6, UPPER_CASE, 0x24E0 }, + { 0x24C7, UPPER_CASE, 0x24E1 }, + { 0x24C8, UPPER_CASE, 0x24E2 }, + { 0x24C9, UPPER_CASE, 0x24E3 }, + { 0x24CA, UPPER_CASE, 0x24E4 }, + { 0x24CB, UPPER_CASE, 0x24E5 }, + { 0x24CC, UPPER_CASE, 0x24E6 }, + { 0x24CD, UPPER_CASE, 0x24E7 }, + { 0x24CE, UPPER_CASE, 0x24E8 }, + { 0x24CF, UPPER_CASE, 0x24E9 }, + { 0x24D0, LOWER_CASE, 0x24B6 }, + { 0x24D1, LOWER_CASE, 0x24B7 }, + { 0x24D2, LOWER_CASE, 0x24B8 }, + { 0x24D3, LOWER_CASE, 0x24B9 }, + { 0x24D4, LOWER_CASE, 0x24BA }, + { 0x24D5, LOWER_CASE, 0x24BB }, + { 0x24D6, LOWER_CASE, 0x24BC }, + { 0x24D7, LOWER_CASE, 0x24BD }, + { 0x24D8, LOWER_CASE, 0x24BE }, + { 0x24D9, LOWER_CASE, 0x24BF }, + { 0x24DA, LOWER_CASE, 0x24C0 }, + { 0x24DB, LOWER_CASE, 0x24C1 }, + { 0x24DC, LOWER_CASE, 0x24C2 }, + { 0x24DD, LOWER_CASE, 0x24C3 }, + { 0x24DE, LOWER_CASE, 0x24C4 }, + { 0x24DF, LOWER_CASE, 0x24C5 }, + { 0x24E0, LOWER_CASE, 0x24C6 }, + { 0x24E1, LOWER_CASE, 0x24C7 }, + { 0x24E2, LOWER_CASE, 0x24C8 }, + { 0x24E3, LOWER_CASE, 0x24C9 }, + { 0x24E4, LOWER_CASE, 0x24CA }, + { 0x24E5, LOWER_CASE, 0x24CB }, + { 0x24E6, LOWER_CASE, 0x24CC }, + { 0x24E7, LOWER_CASE, 0x24CD }, + { 0x24E8, LOWER_CASE, 0x24CE }, + { 0x24E9, LOWER_CASE, 0x24CF }, + { 0x2C00, UPPER_CASE, 0x2C30 }, + { 0x2C01, UPPER_CASE, 0x2C31 }, + { 0x2C02, UPPER_CASE, 0x2C32 }, + { 0x2C03, UPPER_CASE, 0x2C33 }, + { 0x2C04, UPPER_CASE, 0x2C34 }, + { 0x2C05, UPPER_CASE, 0x2C35 }, + { 0x2C06, UPPER_CASE, 0x2C36 }, + { 0x2C07, UPPER_CASE, 0x2C37 }, + { 0x2C08, UPPER_CASE, 0x2C38 }, + { 0x2C09, UPPER_CASE, 0x2C39 }, + { 0x2C0A, UPPER_CASE, 0x2C3A }, + { 0x2C0B, UPPER_CASE, 0x2C3B }, + { 0x2C0C, UPPER_CASE, 0x2C3C }, + { 0x2C0D, UPPER_CASE, 0x2C3D }, + { 0x2C0E, UPPER_CASE, 0x2C3E }, + { 0x2C0F, UPPER_CASE, 0x2C3F }, + { 0x2C10, UPPER_CASE, 0x2C40 }, + { 0x2C11, UPPER_CASE, 0x2C41 }, + { 0x2C12, UPPER_CASE, 0x2C42 }, + { 0x2C13, UPPER_CASE, 0x2C43 }, + { 0x2C14, UPPER_CASE, 0x2C44 }, + { 0x2C15, UPPER_CASE, 0x2C45 }, + { 0x2C16, UPPER_CASE, 0x2C46 }, + { 0x2C17, UPPER_CASE, 0x2C47 }, + { 0x2C18, UPPER_CASE, 0x2C48 }, + { 0x2C19, UPPER_CASE, 0x2C49 }, + { 0x2C1A, UPPER_CASE, 0x2C4A }, + { 0x2C1B, UPPER_CASE, 0x2C4B }, + { 0x2C1C, UPPER_CASE, 0x2C4C }, + { 0x2C1D, UPPER_CASE, 0x2C4D }, + { 0x2C1E, UPPER_CASE, 0x2C4E }, + { 0x2C1F, UPPER_CASE, 0x2C4F }, + { 0x2C20, UPPER_CASE, 0x2C50 }, + { 0x2C21, UPPER_CASE, 0x2C51 }, + { 0x2C22, UPPER_CASE, 0x2C52 }, + { 0x2C23, UPPER_CASE, 0x2C53 }, + { 0x2C24, UPPER_CASE, 0x2C54 }, + { 0x2C25, UPPER_CASE, 0x2C55 }, + { 0x2C26, UPPER_CASE, 0x2C56 }, + { 0x2C27, UPPER_CASE, 0x2C57 }, + { 0x2C28, UPPER_CASE, 0x2C58 }, + { 0x2C29, UPPER_CASE, 0x2C59 }, + { 0x2C2A, UPPER_CASE, 0x2C5A }, + { 0x2C2B, UPPER_CASE, 0x2C5B }, + { 0x2C2C, UPPER_CASE, 0x2C5C }, + { 0x2C2D, UPPER_CASE, 0x2C5D }, + { 0x2C2E, UPPER_CASE, 0x2C5E }, + { 0x2C2F, UPPER_CASE, 0x2C5F }, + { 0x2C30, LOWER_CASE, 0x2C00 }, + { 0x2C31, LOWER_CASE, 0x2C01 }, + { 0x2C32, LOWER_CASE, 0x2C02 }, + { 0x2C33, LOWER_CASE, 0x2C03 }, + { 0x2C34, LOWER_CASE, 0x2C04 }, + { 0x2C35, LOWER_CASE, 0x2C05 }, + { 0x2C36, LOWER_CASE, 0x2C06 }, + { 0x2C37, LOWER_CASE, 0x2C07 }, + { 0x2C38, LOWER_CASE, 0x2C08 }, + { 0x2C39, LOWER_CASE, 0x2C09 }, + { 0x2C3A, LOWER_CASE, 0x2C0A }, + { 0x2C3B, LOWER_CASE, 0x2C0B }, + { 0x2C3C, LOWER_CASE, 0x2C0C }, + { 0x2C3D, LOWER_CASE, 0x2C0D }, + { 0x2C3E, LOWER_CASE, 0x2C0E }, + { 0x2C3F, LOWER_CASE, 0x2C0F }, + { 0x2C40, LOWER_CASE, 0x2C10 }, + { 0x2C41, LOWER_CASE, 0x2C11 }, + { 0x2C42, LOWER_CASE, 0x2C12 }, + { 0x2C43, LOWER_CASE, 0x2C13 }, + { 0x2C44, LOWER_CASE, 0x2C14 }, + { 0x2C45, LOWER_CASE, 0x2C15 }, + { 0x2C46, LOWER_CASE, 0x2C16 }, + { 0x2C47, LOWER_CASE, 0x2C17 }, + { 0x2C48, LOWER_CASE, 0x2C18 }, + { 0x2C49, LOWER_CASE, 0x2C19 }, + { 0x2C4A, LOWER_CASE, 0x2C1A }, + { 0x2C4B, LOWER_CASE, 0x2C1B }, + { 0x2C4C, LOWER_CASE, 0x2C1C }, + { 0x2C4D, LOWER_CASE, 0x2C1D }, + { 0x2C4E, LOWER_CASE, 0x2C1E }, + { 0x2C4F, LOWER_CASE, 0x2C1F }, + { 0x2C50, LOWER_CASE, 0x2C20 }, + { 0x2C51, LOWER_CASE, 0x2C21 }, + { 0x2C52, LOWER_CASE, 0x2C22 }, + { 0x2C53, LOWER_CASE, 0x2C23 }, + { 0x2C54, LOWER_CASE, 0x2C24 }, + { 0x2C55, LOWER_CASE, 0x2C25 }, + { 0x2C56, LOWER_CASE, 0x2C26 }, + { 0x2C57, LOWER_CASE, 0x2C27 }, + { 0x2C58, LOWER_CASE, 0x2C28 }, + { 0x2C59, LOWER_CASE, 0x2C29 }, + { 0x2C5A, LOWER_CASE, 0x2C2A }, + { 0x2C5B, LOWER_CASE, 0x2C2B }, + { 0x2C5C, LOWER_CASE, 0x2C2C }, + { 0x2C5D, LOWER_CASE, 0x2C2D }, + { 0x2C5E, LOWER_CASE, 0x2C2E }, + { 0x2C5F, LOWER_CASE, 0x2C2F }, + { 0x2C60, UPPER_CASE, 0x2C61 }, + { 0x2C61, LOWER_CASE, 0x2C60 }, + { 0x2C62, UPPER_CASE, 0x26B }, + { 0x2C63, UPPER_CASE, 0x1D7D }, + { 0x2C64, UPPER_CASE, 0x27D }, + { 0x2C65, LOWER_CASE, 0x23A }, + { 0x2C66, LOWER_CASE, 0x23E }, + { 0x2C67, UPPER_CASE, 0x2C68 }, + { 0x2C68, LOWER_CASE, 0x2C67 }, + { 0x2C69, UPPER_CASE, 0x2C6A }, + { 0x2C6A, LOWER_CASE, 0x2C69 }, + { 0x2C6B, UPPER_CASE, 0x2C6C }, + { 0x2C6C, LOWER_CASE, 0x2C6B }, + { 0x2C6D, UPPER_CASE, 0x251 }, + { 0x2C6E, UPPER_CASE, 0x271 }, + { 0x2C6F, UPPER_CASE, 0x250 }, + { 0x2C70, UPPER_CASE, 0x252 }, + { 0x2C72, UPPER_CASE, 0x2C73 }, + { 0x2C73, LOWER_CASE, 0x2C72 }, + { 0x2C75, UPPER_CASE, 0x2C76 }, + { 0x2C76, LOWER_CASE, 0x2C75 }, + { 0x2C7E, UPPER_CASE, 0x23F }, + { 0x2C7F, UPPER_CASE, 0x240 }, + { 0x2C80, UPPER_CASE, 0x2C81 }, + { 0x2C81, LOWER_CASE, 0x2C80 }, + { 0x2C82, UPPER_CASE, 0x2C83 }, + { 0x2C83, LOWER_CASE, 0x2C82 }, + { 0x2C84, UPPER_CASE, 0x2C85 }, + { 0x2C85, LOWER_CASE, 0x2C84 }, + { 0x2C86, UPPER_CASE, 0x2C87 }, + { 0x2C87, LOWER_CASE, 0x2C86 }, + { 0x2C88, UPPER_CASE, 0x2C89 }, + { 0x2C89, LOWER_CASE, 0x2C88 }, + { 0x2C8A, UPPER_CASE, 0x2C8B }, + { 0x2C8B, LOWER_CASE, 0x2C8A }, + { 0x2C8C, UPPER_CASE, 0x2C8D }, + { 0x2C8D, LOWER_CASE, 0x2C8C }, + { 0x2C8E, UPPER_CASE, 0x2C8F }, + { 0x2C8F, LOWER_CASE, 0x2C8E }, + { 0x2C90, UPPER_CASE, 0x2C91 }, + { 0x2C91, LOWER_CASE, 0x2C90 }, + { 0x2C92, UPPER_CASE, 0x2C93 }, + { 0x2C93, LOWER_CASE, 0x2C92 }, + { 0x2C94, UPPER_CASE, 0x2C95 }, + { 0x2C95, LOWER_CASE, 0x2C94 }, + { 0x2C96, UPPER_CASE, 0x2C97 }, + { 0x2C97, LOWER_CASE, 0x2C96 }, + { 0x2C98, UPPER_CASE, 0x2C99 }, + { 0x2C99, LOWER_CASE, 0x2C98 }, + { 0x2C9A, UPPER_CASE, 0x2C9B }, + { 0x2C9B, LOWER_CASE, 0x2C9A }, + { 0x2C9C, UPPER_CASE, 0x2C9D }, + { 0x2C9D, LOWER_CASE, 0x2C9C }, + { 0x2C9E, UPPER_CASE, 0x2C9F }, + { 0x2C9F, LOWER_CASE, 0x2C9E }, + { 0x2CA0, UPPER_CASE, 0x2CA1 }, + { 0x2CA1, LOWER_CASE, 0x2CA0 }, + { 0x2CA2, UPPER_CASE, 0x2CA3 }, + { 0x2CA3, LOWER_CASE, 0x2CA2 }, + { 0x2CA4, UPPER_CASE, 0x2CA5 }, + { 0x2CA5, LOWER_CASE, 0x2CA4 }, + { 0x2CA6, UPPER_CASE, 0x2CA7 }, + { 0x2CA7, LOWER_CASE, 0x2CA6 }, + { 0x2CA8, UPPER_CASE, 0x2CA9 }, + { 0x2CA9, LOWER_CASE, 0x2CA8 }, + { 0x2CAA, UPPER_CASE, 0x2CAB }, + { 0x2CAB, LOWER_CASE, 0x2CAA }, + { 0x2CAC, UPPER_CASE, 0x2CAD }, + { 0x2CAD, LOWER_CASE, 0x2CAC }, + { 0x2CAE, UPPER_CASE, 0x2CAF }, + { 0x2CAF, LOWER_CASE, 0x2CAE }, + { 0x2CB0, UPPER_CASE, 0x2CB1 }, + { 0x2CB1, LOWER_CASE, 0x2CB0 }, + { 0x2CB2, UPPER_CASE, 0x2CB3 }, + { 0x2CB3, LOWER_CASE, 0x2CB2 }, + { 0x2CB4, UPPER_CASE, 0x2CB5 }, + { 0x2CB5, LOWER_CASE, 0x2CB4 }, + { 0x2CB6, UPPER_CASE, 0x2CB7 }, + { 0x2CB7, LOWER_CASE, 0x2CB6 }, + { 0x2CB8, UPPER_CASE, 0x2CB9 }, + { 0x2CB9, LOWER_CASE, 0x2CB8 }, + { 0x2CBA, UPPER_CASE, 0x2CBB }, + { 0x2CBB, LOWER_CASE, 0x2CBA }, + { 0x2CBC, UPPER_CASE, 0x2CBD }, + { 0x2CBD, LOWER_CASE, 0x2CBC }, + { 0x2CBE, UPPER_CASE, 0x2CBF }, + { 0x2CBF, LOWER_CASE, 0x2CBE }, + { 0x2CC0, UPPER_CASE, 0x2CC1 }, + { 0x2CC1, LOWER_CASE, 0x2CC0 }, + { 0x2CC2, UPPER_CASE, 0x2CC3 }, + { 0x2CC3, LOWER_CASE, 0x2CC2 }, + { 0x2CC4, UPPER_CASE, 0x2CC5 }, + { 0x2CC5, LOWER_CASE, 0x2CC4 }, + { 0x2CC6, UPPER_CASE, 0x2CC7 }, + { 0x2CC7, LOWER_CASE, 0x2CC6 }, + { 0x2CC8, UPPER_CASE, 0x2CC9 }, + { 0x2CC9, LOWER_CASE, 0x2CC8 }, + { 0x2CCA, UPPER_CASE, 0x2CCB }, + { 0x2CCB, LOWER_CASE, 0x2CCA }, + { 0x2CCC, UPPER_CASE, 0x2CCD }, + { 0x2CCD, LOWER_CASE, 0x2CCC }, + { 0x2CCE, UPPER_CASE, 0x2CCF }, + { 0x2CCF, LOWER_CASE, 0x2CCE }, + { 0x2CD0, UPPER_CASE, 0x2CD1 }, + { 0x2CD1, LOWER_CASE, 0x2CD0 }, + { 0x2CD2, UPPER_CASE, 0x2CD3 }, + { 0x2CD3, LOWER_CASE, 0x2CD2 }, + { 0x2CD4, UPPER_CASE, 0x2CD5 }, + { 0x2CD5, LOWER_CASE, 0x2CD4 }, + { 0x2CD6, UPPER_CASE, 0x2CD7 }, + { 0x2CD7, LOWER_CASE, 0x2CD6 }, + { 0x2CD8, UPPER_CASE, 0x2CD9 }, + { 0x2CD9, LOWER_CASE, 0x2CD8 }, + { 0x2CDA, UPPER_CASE, 0x2CDB }, + { 0x2CDB, LOWER_CASE, 0x2CDA }, + { 0x2CDC, UPPER_CASE, 0x2CDD }, + { 0x2CDD, LOWER_CASE, 0x2CDC }, + { 0x2CDE, UPPER_CASE, 0x2CDF }, + { 0x2CDF, LOWER_CASE, 0x2CDE }, + { 0x2CE0, UPPER_CASE, 0x2CE1 }, + { 0x2CE1, LOWER_CASE, 0x2CE0 }, + { 0x2CE2, UPPER_CASE, 0x2CE3 }, + { 0x2CE3, LOWER_CASE, 0x2CE2 }, + { 0x2CEB, UPPER_CASE, 0x2CEC }, + { 0x2CEC, LOWER_CASE, 0x2CEB }, + { 0x2CED, UPPER_CASE, 0x2CEE }, + { 0x2CEE, LOWER_CASE, 0x2CED }, + { 0x2CF2, UPPER_CASE, 0x2CF3 }, + { 0x2CF3, LOWER_CASE, 0x2CF2 }, + { 0x2D00, LOWER_CASE, 0x10A0 }, + { 0x2D01, LOWER_CASE, 0x10A1 }, + { 0x2D02, LOWER_CASE, 0x10A2 }, + { 0x2D03, LOWER_CASE, 0x10A3 }, + { 0x2D04, LOWER_CASE, 0x10A4 }, + { 0x2D05, LOWER_CASE, 0x10A5 }, + { 0x2D06, LOWER_CASE, 0x10A6 }, + { 0x2D07, LOWER_CASE, 0x10A7 }, + { 0x2D08, LOWER_CASE, 0x10A8 }, + { 0x2D09, LOWER_CASE, 0x10A9 }, + { 0x2D0A, LOWER_CASE, 0x10AA }, + { 0x2D0B, LOWER_CASE, 0x10AB }, + { 0x2D0C, LOWER_CASE, 0x10AC }, + { 0x2D0D, LOWER_CASE, 0x10AD }, + { 0x2D0E, LOWER_CASE, 0x10AE }, + { 0x2D0F, LOWER_CASE, 0x10AF }, + { 0x2D10, LOWER_CASE, 0x10B0 }, + { 0x2D11, LOWER_CASE, 0x10B1 }, + { 0x2D12, LOWER_CASE, 0x10B2 }, + { 0x2D13, LOWER_CASE, 0x10B3 }, + { 0x2D14, LOWER_CASE, 0x10B4 }, + { 0x2D15, LOWER_CASE, 0x10B5 }, + { 0x2D16, LOWER_CASE, 0x10B6 }, + { 0x2D17, LOWER_CASE, 0x10B7 }, + { 0x2D18, LOWER_CASE, 0x10B8 }, + { 0x2D19, LOWER_CASE, 0x10B9 }, + { 0x2D1A, LOWER_CASE, 0x10BA }, + { 0x2D1B, LOWER_CASE, 0x10BB }, + { 0x2D1C, LOWER_CASE, 0x10BC }, + { 0x2D1D, LOWER_CASE, 0x10BD }, + { 0x2D1E, LOWER_CASE, 0x10BE }, + { 0x2D1F, LOWER_CASE, 0x10BF }, + { 0x2D20, LOWER_CASE, 0x10C0 }, + { 0x2D21, LOWER_CASE, 0x10C1 }, + { 0x2D22, LOWER_CASE, 0x10C2 }, + { 0x2D23, LOWER_CASE, 0x10C3 }, + { 0x2D24, LOWER_CASE, 0x10C4 }, + { 0x2D25, LOWER_CASE, 0x10C5 }, + { 0x2D27, LOWER_CASE, 0x10C7 }, + { 0x2D2D, LOWER_CASE, 0x10CD }, + { 0xA640, UPPER_CASE, 0xA641 }, + { 0xA641, LOWER_CASE, 0xA640 }, + { 0xA642, UPPER_CASE, 0xA643 }, + { 0xA643, LOWER_CASE, 0xA642 }, + { 0xA644, UPPER_CASE, 0xA645 }, + { 0xA645, LOWER_CASE, 0xA644 }, + { 0xA646, UPPER_CASE, 0xA647 }, + { 0xA647, LOWER_CASE, 0xA646 }, + { 0xA648, UPPER_CASE, 0xA649 }, + { 0xA649, LOWER_CASE, 0xA648 }, + { 0xA64A, UPPER_CASE, 0xA64B }, + { 0xA64B, LOWER_CASE, 0xA64A }, + { 0xA64C, UPPER_CASE, 0xA64D }, + { 0xA64D, LOWER_CASE, 0xA64C }, + { 0xA64E, UPPER_CASE, 0xA64F }, + { 0xA64F, LOWER_CASE, 0xA64E }, + { 0xA650, UPPER_CASE, 0xA651 }, + { 0xA651, LOWER_CASE, 0xA650 }, + { 0xA652, UPPER_CASE, 0xA653 }, + { 0xA653, LOWER_CASE, 0xA652 }, + { 0xA654, UPPER_CASE, 0xA655 }, + { 0xA655, LOWER_CASE, 0xA654 }, + { 0xA656, UPPER_CASE, 0xA657 }, + { 0xA657, LOWER_CASE, 0xA656 }, + { 0xA658, UPPER_CASE, 0xA659 }, + { 0xA659, LOWER_CASE, 0xA658 }, + { 0xA65A, UPPER_CASE, 0xA65B }, + { 0xA65B, LOWER_CASE, 0xA65A }, + { 0xA65C, UPPER_CASE, 0xA65D }, + { 0xA65D, LOWER_CASE, 0xA65C }, + { 0xA65E, UPPER_CASE, 0xA65F }, + { 0xA65F, LOWER_CASE, 0xA65E }, + { 0xA660, UPPER_CASE, 0xA661 }, + { 0xA661, LOWER_CASE, 0xA660 }, + { 0xA662, UPPER_CASE, 0xA663 }, + { 0xA663, LOWER_CASE, 0xA662 }, + { 0xA664, UPPER_CASE, 0xA665 }, + { 0xA665, LOWER_CASE, 0xA664 }, + { 0xA666, UPPER_CASE, 0xA667 }, + { 0xA667, LOWER_CASE, 0xA666 }, + { 0xA668, UPPER_CASE, 0xA669 }, + { 0xA669, LOWER_CASE, 0xA668 }, + { 0xA66A, UPPER_CASE, 0xA66B }, + { 0xA66B, LOWER_CASE, 0xA66A }, + { 0xA66C, UPPER_CASE, 0xA66D }, + { 0xA66D, LOWER_CASE, 0xA66C }, + { 0xA680, UPPER_CASE, 0xA681 }, + { 0xA681, LOWER_CASE, 0xA680 }, + { 0xA682, UPPER_CASE, 0xA683 }, + { 0xA683, LOWER_CASE, 0xA682 }, + { 0xA684, UPPER_CASE, 0xA685 }, + { 0xA685, LOWER_CASE, 0xA684 }, + { 0xA686, UPPER_CASE, 0xA687 }, + { 0xA687, LOWER_CASE, 0xA686 }, + { 0xA688, UPPER_CASE, 0xA689 }, + { 0xA689, LOWER_CASE, 0xA688 }, + { 0xA68A, UPPER_CASE, 0xA68B }, + { 0xA68B, LOWER_CASE, 0xA68A }, + { 0xA68C, UPPER_CASE, 0xA68D }, + { 0xA68D, LOWER_CASE, 0xA68C }, + { 0xA68E, UPPER_CASE, 0xA68F }, + { 0xA68F, LOWER_CASE, 0xA68E }, + { 0xA690, UPPER_CASE, 0xA691 }, + { 0xA691, LOWER_CASE, 0xA690 }, + { 0xA692, UPPER_CASE, 0xA693 }, + { 0xA693, LOWER_CASE, 0xA692 }, + { 0xA694, UPPER_CASE, 0xA695 }, + { 0xA695, LOWER_CASE, 0xA694 }, + { 0xA696, UPPER_CASE, 0xA697 }, + { 0xA697, LOWER_CASE, 0xA696 }, + { 0xA698, UPPER_CASE, 0xA699 }, + { 0xA699, LOWER_CASE, 0xA698 }, + { 0xA69A, UPPER_CASE, 0xA69B }, + { 0xA69B, LOWER_CASE, 0xA69A }, + { 0xA722, UPPER_CASE, 0xA723 }, + { 0xA723, LOWER_CASE, 0xA722 }, + { 0xA724, UPPER_CASE, 0xA725 }, + { 0xA725, LOWER_CASE, 0xA724 }, + { 0xA726, UPPER_CASE, 0xA727 }, + { 0xA727, LOWER_CASE, 0xA726 }, + { 0xA728, UPPER_CASE, 0xA729 }, + { 0xA729, LOWER_CASE, 0xA728 }, + { 0xA72A, UPPER_CASE, 0xA72B }, + { 0xA72B, LOWER_CASE, 0xA72A }, + { 0xA72C, UPPER_CASE, 0xA72D }, + { 0xA72D, LOWER_CASE, 0xA72C }, + { 0xA72E, UPPER_CASE, 0xA72F }, + { 0xA72F, LOWER_CASE, 0xA72E }, + { 0xA732, UPPER_CASE, 0xA733 }, + { 0xA733, LOWER_CASE, 0xA732 }, + { 0xA734, UPPER_CASE, 0xA735 }, + { 0xA735, LOWER_CASE, 0xA734 }, + { 0xA736, UPPER_CASE, 0xA737 }, + { 0xA737, LOWER_CASE, 0xA736 }, + { 0xA738, UPPER_CASE, 0xA739 }, + { 0xA739, LOWER_CASE, 0xA738 }, + { 0xA73A, UPPER_CASE, 0xA73B }, + { 0xA73B, LOWER_CASE, 0xA73A }, + { 0xA73C, UPPER_CASE, 0xA73D }, + { 0xA73D, LOWER_CASE, 0xA73C }, + { 0xA73E, UPPER_CASE, 0xA73F }, + { 0xA73F, LOWER_CASE, 0xA73E }, + { 0xA740, UPPER_CASE, 0xA741 }, + { 0xA741, LOWER_CASE, 0xA740 }, + { 0xA742, UPPER_CASE, 0xA743 }, + { 0xA743, LOWER_CASE, 0xA742 }, + { 0xA744, UPPER_CASE, 0xA745 }, + { 0xA745, LOWER_CASE, 0xA744 }, + { 0xA746, UPPER_CASE, 0xA747 }, + { 0xA747, LOWER_CASE, 0xA746 }, + { 0xA748, UPPER_CASE, 0xA749 }, + { 0xA749, LOWER_CASE, 0xA748 }, + { 0xA74A, UPPER_CASE, 0xA74B }, + { 0xA74B, LOWER_CASE, 0xA74A }, + { 0xA74C, UPPER_CASE, 0xA74D }, + { 0xA74D, LOWER_CASE, 0xA74C }, + { 0xA74E, UPPER_CASE, 0xA74F }, + { 0xA74F, LOWER_CASE, 0xA74E }, + { 0xA750, UPPER_CASE, 0xA751 }, + { 0xA751, LOWER_CASE, 0xA750 }, + { 0xA752, UPPER_CASE, 0xA753 }, + { 0xA753, LOWER_CASE, 0xA752 }, + { 0xA754, UPPER_CASE, 0xA755 }, + { 0xA755, LOWER_CASE, 0xA754 }, + { 0xA756, UPPER_CASE, 0xA757 }, + { 0xA757, LOWER_CASE, 0xA756 }, + { 0xA758, UPPER_CASE, 0xA759 }, + { 0xA759, LOWER_CASE, 0xA758 }, + { 0xA75A, UPPER_CASE, 0xA75B }, + { 0xA75B, LOWER_CASE, 0xA75A }, + { 0xA75C, UPPER_CASE, 0xA75D }, + { 0xA75D, LOWER_CASE, 0xA75C }, + { 0xA75E, UPPER_CASE, 0xA75F }, + { 0xA75F, LOWER_CASE, 0xA75E }, + { 0xA760, UPPER_CASE, 0xA761 }, + { 0xA761, LOWER_CASE, 0xA760 }, + { 0xA762, UPPER_CASE, 0xA763 }, + { 0xA763, LOWER_CASE, 0xA762 }, + { 0xA764, UPPER_CASE, 0xA765 }, + { 0xA765, LOWER_CASE, 0xA764 }, + { 0xA766, UPPER_CASE, 0xA767 }, + { 0xA767, LOWER_CASE, 0xA766 }, + { 0xA768, UPPER_CASE, 0xA769 }, + { 0xA769, LOWER_CASE, 0xA768 }, + { 0xA76A, UPPER_CASE, 0xA76B }, + { 0xA76B, LOWER_CASE, 0xA76A }, + { 0xA76C, UPPER_CASE, 0xA76D }, + { 0xA76D, LOWER_CASE, 0xA76C }, + { 0xA76E, UPPER_CASE, 0xA76F }, + { 0xA76F, LOWER_CASE, 0xA76E }, + { 0xA779, UPPER_CASE, 0xA77A }, + { 0xA77A, LOWER_CASE, 0xA779 }, + { 0xA77B, UPPER_CASE, 0xA77C }, + { 0xA77C, LOWER_CASE, 0xA77B }, + { 0xA77D, UPPER_CASE, 0x1D79 }, + { 0xA77E, UPPER_CASE, 0xA77F }, + { 0xA77F, LOWER_CASE, 0xA77E }, + { 0xA780, UPPER_CASE, 0xA781 }, + { 0xA781, LOWER_CASE, 0xA780 }, + { 0xA782, UPPER_CASE, 0xA783 }, + { 0xA783, LOWER_CASE, 0xA782 }, + { 0xA784, UPPER_CASE, 0xA785 }, + { 0xA785, LOWER_CASE, 0xA784 }, + { 0xA786, UPPER_CASE, 0xA787 }, + { 0xA787, LOWER_CASE, 0xA786 }, + { 0xA78B, UPPER_CASE, 0xA78C }, + { 0xA78C, LOWER_CASE, 0xA78B }, + { 0xA78D, UPPER_CASE, 0x265 }, + { 0xA790, UPPER_CASE, 0xA791 }, + { 0xA791, LOWER_CASE, 0xA790 }, + { 0xA792, UPPER_CASE, 0xA793 }, + { 0xA793, LOWER_CASE, 0xA792 }, + { 0xA794, LOWER_CASE, 0xA7C4 }, + { 0xA796, UPPER_CASE, 0xA797 }, + { 0xA797, LOWER_CASE, 0xA796 }, + { 0xA798, UPPER_CASE, 0xA799 }, + { 0xA799, LOWER_CASE, 0xA798 }, + { 0xA79A, UPPER_CASE, 0xA79B }, + { 0xA79B, LOWER_CASE, 0xA79A }, + { 0xA79C, UPPER_CASE, 0xA79D }, + { 0xA79D, LOWER_CASE, 0xA79C }, + { 0xA79E, UPPER_CASE, 0xA79F }, + { 0xA79F, LOWER_CASE, 0xA79E }, + { 0xA7A0, UPPER_CASE, 0xA7A1 }, + { 0xA7A1, LOWER_CASE, 0xA7A0 }, + { 0xA7A2, UPPER_CASE, 0xA7A3 }, + { 0xA7A3, LOWER_CASE, 0xA7A2 }, + { 0xA7A4, UPPER_CASE, 0xA7A5 }, + { 0xA7A5, LOWER_CASE, 0xA7A4 }, + { 0xA7A6, UPPER_CASE, 0xA7A7 }, + { 0xA7A7, LOWER_CASE, 0xA7A6 }, + { 0xA7A8, UPPER_CASE, 0xA7A9 }, + { 0xA7A9, LOWER_CASE, 0xA7A8 }, + { 0xA7AA, UPPER_CASE, 0x266 }, + { 0xA7AB, UPPER_CASE, 0x25C }, + { 0xA7AC, UPPER_CASE, 0x261 }, + { 0xA7AD, UPPER_CASE, 0x26C }, + { 0xA7AE, UPPER_CASE, 0x26A }, + { 0xA7B0, UPPER_CASE, 0x29E }, + { 0xA7B1, UPPER_CASE, 0x287 }, + { 0xA7B2, UPPER_CASE, 0x29D }, + { 0xA7B3, UPPER_CASE, 0xAB53 }, + { 0xA7B4, UPPER_CASE, 0xA7B5 }, + { 0xA7B5, LOWER_CASE, 0xA7B4 }, + { 0xA7B6, UPPER_CASE, 0xA7B7 }, + { 0xA7B7, LOWER_CASE, 0xA7B6 }, + { 0xA7B8, UPPER_CASE, 0xA7B9 }, + { 0xA7B9, LOWER_CASE, 0xA7B8 }, + { 0xA7BA, UPPER_CASE, 0xA7BB }, + { 0xA7BB, LOWER_CASE, 0xA7BA }, + { 0xA7BC, UPPER_CASE, 0xA7BD }, + { 0xA7BD, LOWER_CASE, 0xA7BC }, + { 0xA7BE, UPPER_CASE, 0xA7BF }, + { 0xA7BF, LOWER_CASE, 0xA7BE }, + { 0xA7C0, UPPER_CASE, 0xA7C1 }, + { 0xA7C1, LOWER_CASE, 0xA7C0 }, + { 0xA7C2, UPPER_CASE, 0xA7C3 }, + { 0xA7C3, LOWER_CASE, 0xA7C2 }, + { 0xA7C4, UPPER_CASE, 0xA794 }, + { 0xA7C5, UPPER_CASE, 0x282 }, + { 0xA7C6, UPPER_CASE, 0x1D8E }, + { 0xA7C7, UPPER_CASE, 0xA7C8 }, + { 0xA7C8, LOWER_CASE, 0xA7C7 }, + { 0xA7C9, UPPER_CASE, 0xA7CA }, + { 0xA7CA, LOWER_CASE, 0xA7C9 }, + { 0xA7D0, UPPER_CASE, 0xA7D1 }, + { 0xA7D1, LOWER_CASE, 0xA7D0 }, + { 0xA7D6, UPPER_CASE, 0xA7D7 }, + { 0xA7D7, LOWER_CASE, 0xA7D6 }, + { 0xA7D8, UPPER_CASE, 0xA7D9 }, + { 0xA7D9, LOWER_CASE, 0xA7D8 }, + { 0xA7F5, UPPER_CASE, 0xA7F6 }, + { 0xA7F6, LOWER_CASE, 0xA7F5 }, + { 0xAB53, LOWER_CASE, 0xA7B3 }, + { 0xAB70, LOWER_CASE, 0x13A0 }, + { 0xAB71, LOWER_CASE, 0x13A1 }, + { 0xAB72, LOWER_CASE, 0x13A2 }, + { 0xAB73, LOWER_CASE, 0x13A3 }, + { 0xAB74, LOWER_CASE, 0x13A4 }, + { 0xAB75, LOWER_CASE, 0x13A5 }, + { 0xAB76, LOWER_CASE, 0x13A6 }, + { 0xAB77, LOWER_CASE, 0x13A7 }, + { 0xAB78, LOWER_CASE, 0x13A8 }, + { 0xAB79, LOWER_CASE, 0x13A9 }, + { 0xAB7A, LOWER_CASE, 0x13AA }, + { 0xAB7B, LOWER_CASE, 0x13AB }, + { 0xAB7C, LOWER_CASE, 0x13AC }, + { 0xAB7D, LOWER_CASE, 0x13AD }, + { 0xAB7E, LOWER_CASE, 0x13AE }, + { 0xAB7F, LOWER_CASE, 0x13AF }, + { 0xAB80, LOWER_CASE, 0x13B0 }, + { 0xAB81, LOWER_CASE, 0x13B1 }, + { 0xAB82, LOWER_CASE, 0x13B2 }, + { 0xAB83, LOWER_CASE, 0x13B3 }, + { 0xAB84, LOWER_CASE, 0x13B4 }, + { 0xAB85, LOWER_CASE, 0x13B5 }, + { 0xAB86, LOWER_CASE, 0x13B6 }, + { 0xAB87, LOWER_CASE, 0x13B7 }, + { 0xAB88, LOWER_CASE, 0x13B8 }, + { 0xAB89, LOWER_CASE, 0x13B9 }, + { 0xAB8A, LOWER_CASE, 0x13BA }, + { 0xAB8B, LOWER_CASE, 0x13BB }, + { 0xAB8C, LOWER_CASE, 0x13BC }, + { 0xAB8D, LOWER_CASE, 0x13BD }, + { 0xAB8E, LOWER_CASE, 0x13BE }, + { 0xAB8F, LOWER_CASE, 0x13BF }, + { 0xAB90, LOWER_CASE, 0x13C0 }, + { 0xAB91, LOWER_CASE, 0x13C1 }, + { 0xAB92, LOWER_CASE, 0x13C2 }, + { 0xAB93, LOWER_CASE, 0x13C3 }, + { 0xAB94, LOWER_CASE, 0x13C4 }, + { 0xAB95, LOWER_CASE, 0x13C5 }, + { 0xAB96, LOWER_CASE, 0x13C6 }, + { 0xAB97, LOWER_CASE, 0x13C7 }, + { 0xAB98, LOWER_CASE, 0x13C8 }, + { 0xAB99, LOWER_CASE, 0x13C9 }, + { 0xAB9A, LOWER_CASE, 0x13CA }, + { 0xAB9B, LOWER_CASE, 0x13CB }, + { 0xAB9C, LOWER_CASE, 0x13CC }, + { 0xAB9D, LOWER_CASE, 0x13CD }, + { 0xAB9E, LOWER_CASE, 0x13CE }, + { 0xAB9F, LOWER_CASE, 0x13CF }, + { 0xABA0, LOWER_CASE, 0x13D0 }, + { 0xABA1, LOWER_CASE, 0x13D1 }, + { 0xABA2, LOWER_CASE, 0x13D2 }, + { 0xABA3, LOWER_CASE, 0x13D3 }, + { 0xABA4, LOWER_CASE, 0x13D4 }, + { 0xABA5, LOWER_CASE, 0x13D5 }, + { 0xABA6, LOWER_CASE, 0x13D6 }, + { 0xABA7, LOWER_CASE, 0x13D7 }, + { 0xABA8, LOWER_CASE, 0x13D8 }, + { 0xABA9, LOWER_CASE, 0x13D9 }, + { 0xABAA, LOWER_CASE, 0x13DA }, + { 0xABAB, LOWER_CASE, 0x13DB }, + { 0xABAC, LOWER_CASE, 0x13DC }, + { 0xABAD, LOWER_CASE, 0x13DD }, + { 0xABAE, LOWER_CASE, 0x13DE }, + { 0xABAF, LOWER_CASE, 0x13DF }, + { 0xABB0, LOWER_CASE, 0x13E0 }, + { 0xABB1, LOWER_CASE, 0x13E1 }, + { 0xABB2, LOWER_CASE, 0x13E2 }, + { 0xABB3, LOWER_CASE, 0x13E3 }, + { 0xABB4, LOWER_CASE, 0x13E4 }, + { 0xABB5, LOWER_CASE, 0x13E5 }, + { 0xABB6, LOWER_CASE, 0x13E6 }, + { 0xABB7, LOWER_CASE, 0x13E7 }, + { 0xABB8, LOWER_CASE, 0x13E8 }, + { 0xABB9, LOWER_CASE, 0x13E9 }, + { 0xABBA, LOWER_CASE, 0x13EA }, + { 0xABBB, LOWER_CASE, 0x13EB }, + { 0xABBC, LOWER_CASE, 0x13EC }, + { 0xABBD, LOWER_CASE, 0x13ED }, + { 0xABBE, LOWER_CASE, 0x13EE }, + { 0xABBF, LOWER_CASE, 0x13EF }, + { 0xFF21, UPPER_CASE, 0xFF41 }, + { 0xFF22, UPPER_CASE, 0xFF42 }, + { 0xFF23, UPPER_CASE, 0xFF43 }, + { 0xFF24, UPPER_CASE, 0xFF44 }, + { 0xFF25, UPPER_CASE, 0xFF45 }, + { 0xFF26, UPPER_CASE, 0xFF46 }, + { 0xFF27, UPPER_CASE, 0xFF47 }, + { 0xFF28, UPPER_CASE, 0xFF48 }, + { 0xFF29, UPPER_CASE, 0xFF49 }, + { 0xFF2A, UPPER_CASE, 0xFF4A }, + { 0xFF2B, UPPER_CASE, 0xFF4B }, + { 0xFF2C, UPPER_CASE, 0xFF4C }, + { 0xFF2D, UPPER_CASE, 0xFF4D }, + { 0xFF2E, UPPER_CASE, 0xFF4E }, + { 0xFF2F, UPPER_CASE, 0xFF4F }, + { 0xFF30, UPPER_CASE, 0xFF50 }, + { 0xFF31, UPPER_CASE, 0xFF51 }, + { 0xFF32, UPPER_CASE, 0xFF52 }, + { 0xFF33, UPPER_CASE, 0xFF53 }, + { 0xFF34, UPPER_CASE, 0xFF54 }, + { 0xFF35, UPPER_CASE, 0xFF55 }, + { 0xFF36, UPPER_CASE, 0xFF56 }, + { 0xFF37, UPPER_CASE, 0xFF57 }, + { 0xFF38, UPPER_CASE, 0xFF58 }, + { 0xFF39, UPPER_CASE, 0xFF59 }, + { 0xFF3A, UPPER_CASE, 0xFF5A }, + { 0xFF41, LOWER_CASE, 0xFF21 }, + { 0xFF42, LOWER_CASE, 0xFF22 }, + { 0xFF43, LOWER_CASE, 0xFF23 }, + { 0xFF44, LOWER_CASE, 0xFF24 }, + { 0xFF45, LOWER_CASE, 0xFF25 }, + { 0xFF46, LOWER_CASE, 0xFF26 }, + { 0xFF47, LOWER_CASE, 0xFF27 }, + { 0xFF48, LOWER_CASE, 0xFF28 }, + { 0xFF49, LOWER_CASE, 0xFF29 }, + { 0xFF4A, LOWER_CASE, 0xFF2A }, + { 0xFF4B, LOWER_CASE, 0xFF2B }, + { 0xFF4C, LOWER_CASE, 0xFF2C }, + { 0xFF4D, LOWER_CASE, 0xFF2D }, + { 0xFF4E, LOWER_CASE, 0xFF2E }, + { 0xFF4F, LOWER_CASE, 0xFF2F }, + { 0xFF50, LOWER_CASE, 0xFF30 }, + { 0xFF51, LOWER_CASE, 0xFF31 }, + { 0xFF52, LOWER_CASE, 0xFF32 }, + { 0xFF53, LOWER_CASE, 0xFF33 }, + { 0xFF54, LOWER_CASE, 0xFF34 }, + { 0xFF55, LOWER_CASE, 0xFF35 }, + { 0xFF56, LOWER_CASE, 0xFF36 }, + { 0xFF57, LOWER_CASE, 0xFF37 }, + { 0xFF58, LOWER_CASE, 0xFF38 }, + { 0xFF59, LOWER_CASE, 0xFF39 }, + { 0xFF5A, LOWER_CASE, 0xFF3A }, +}; + +#define UNICODE_DATA_SIZE 2359 + +static int LIBC_CALLBACK UnicodeDataComp(const void *opposingCode, const void *elem) +{ + CHAR16_T code = ((UnicodeDataRec*)elem)->code; + + if (*((CHAR16_T*)opposingCode) < code) + { + return -1; + } + else if (*((CHAR16_T*)opposingCode) > code) + { + return 1; + } + else + { + return 0; + } +} + +CHAR16_T minipal_toupper_invariant(CHAR16_T code) +{ + UnicodeDataRec *record = (UnicodeDataRec *) bsearch(&code, UnicodeData, UNICODE_DATA_SIZE, + sizeof(UnicodeDataRec), UnicodeDataComp); + + if (!record || record->upperOrLower != LOWER_CASE) + return code; + + return record->opposingCode; +} + +CHAR16_T minipal_tolower_invariant(CHAR16_T code) +{ + UnicodeDataRec *record = (UnicodeDataRec *) bsearch(&code, UnicodeData, UNICODE_DATA_SIZE, + sizeof(UnicodeDataRec), UnicodeDataComp); + + if (!record || record->upperOrLower != UPPER_CASE) + return code; + + return record->opposingCode; +} diff --git a/src/shared/native/minipal/utf8.c b/src/shared/native/minipal/utf8.c new file mode 100644 index 0000000000..77a4e1407b --- /dev/null +++ b/src/shared/native/minipal/utf8.c @@ -0,0 +1,2150 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include + +#include +#include +#include +#include + +#define HIGH_SURROGATE_START 0xd800 +#define HIGH_SURROGATE_END 0xdbff +#define LOW_SURROGATE_START 0xdc00 +#define LOW_SURROGATE_END 0xdfff + +// Test if the wide character is a high surrogate +static bool IsHighSurrogate(const CHAR16_T c) +{ + return (c & 0xFC00) == HIGH_SURROGATE_START; +} + +// Test if the wide character is a low surrogate +static bool IsLowSurrogate(const CHAR16_T c) +{ + return (c & 0xFC00) == LOW_SURROGATE_START; +} + +// Test if the wide character is a surrogate half +static bool IsSurrogate(const CHAR16_T c) +{ + return (c & 0xF800) == HIGH_SURROGATE_START; +} + +typedef struct +{ + // Store our default string + unsigned char* byteStart; + CHAR16_T* charEnd; + const CHAR16_T strDefault[2]; + int strDefaultLength; + int fallbackCount; + int fallbackIndex; +} DecoderBuffer; + +static CHAR16_T DecoderReplacementFallbackBuffer_GetNextChar(DecoderBuffer* self) +{ + // We want it to get < 0 because == 0 means that the current/last character is a fallback + // and we need to detect recursion. We could have a flag but we already have this counter. + self->fallbackCount--; + self->fallbackIndex++; + + // Do we have anything left? 0 is now last fallback char, negative is nothing left + if (self->fallbackCount < 0) + return '\0'; + + // Need to get it out of the buffer. + // Make sure it didn't wrap from the fast count-- path + if (self->fallbackCount == INT_MAX) + { + self->fallbackCount = -1; + return '\0'; + } + + // Now make sure its in the expected range + assert(self->fallbackIndex < self->strDefaultLength && self->fallbackIndex >= 0); + + return self->strDefault[self->fallbackIndex]; +} + +// Fallback Methods +static bool DecoderReplacementFallbackBuffer_Fallback(DecoderBuffer* self) +{ + // We expect no previous fallback in our buffer + // We can't call recursively but others might (note, we don't test on last char!!!) + assert(self->fallbackCount < 1); + + // Go ahead and get our fallback + if (self->strDefaultLength == 0) + return false; + + self->fallbackCount = self->strDefaultLength; + self->fallbackIndex = -1; + + return true; +} + +// Fallback the current byte by sticking it into the remaining char buffer. +// This can only be called by our encodings (other have to use the public fallback methods), so +// we can use our DecoderNLS here too (except we don't). +// Returns true if we are successful, false if we can't fallback the character (no buffer space) +// So caller needs to throw buffer space if return false. +// Right now this has both bytes and bytes[], since we might have extra bytes, hence the +// array, and we might need the index, hence the byte* +// Don't touch ref chars unless we succeed +static bool DecoderReplacementFallbackBuffer_InternalFallback_Copy(DecoderBuffer* self, CHAR16_T** chars, CHAR16_T* pAllocatedBufferEnd) +{ + assert(self->byteStart != NULL); + + bool fallbackResult = DecoderReplacementFallbackBuffer_Fallback(self); + + // See if there's a fallback character and we have an output buffer then copy our string. + if (fallbackResult) + { + // Copy the chars to our output + CHAR16_T ch; + CHAR16_T* charTemp = *chars; + bool bHighSurrogate = false; + (void)bHighSurrogate; // unused in release build + while ((ch = DecoderReplacementFallbackBuffer_GetNextChar(self)) != 0) + { + // Make sure no mixed up surrogates + if (IsSurrogate(ch)) + { + if (IsHighSurrogate(ch)) + { + // High Surrogate + assert(!bHighSurrogate); + bHighSurrogate = true; + } + else + { + // Low surrogate + assert(bHighSurrogate); + bHighSurrogate = false; + } + } + + if (charTemp >= self->charEnd) + { + // No buffer space + return false; + } + + *(charTemp++) = ch; + if (charTemp > pAllocatedBufferEnd) + { + errno = MINIPAL_ERROR_INSUFFICIENT_BUFFER; + return false; + } + } + + // Need to make sure that bHighSurrogate isn't true + assert(!bHighSurrogate); + + // Now we aren't going to be false, so its OK to update chars + *chars = charTemp; + } + + return true; +} + +// Clear the buffer +static void DecoderReplacementFallbackBuffer_Reset(DecoderBuffer* self) +{ + self->fallbackCount = -1; + self->fallbackIndex = -1; + self->byteStart = NULL; +} + +typedef struct +{ + const CHAR16_T strDefault[3]; + int strDefaultLength; + CHAR16_T* charStart; + CHAR16_T* charEnd; + bool setEncoder; + bool bUsedEncoder; + bool bFallingBack; + int iRecursionCount; + int fallbackCount; + int fallbackIndex; +} EncoderBuffer; + +#define MAX_RECURSION 250 + +// Set the above values +// This can't be part of the constructor because EncoderFallbacks would have to know how to implement these. +static void EncoderReplacementFallbackBuffer_InternalInitialize(EncoderBuffer* self, CHAR16_T* charStart, CHAR16_T* charEnd, bool setEncoder) +{ + self->charStart = charStart; + self->charEnd = charEnd; + self->setEncoder = setEncoder; + self->bUsedEncoder = false; + self->bFallingBack = false; + self->iRecursionCount = 0; +} + +static CHAR16_T EncoderReplacementFallbackBuffer_InternalGetNextChar(EncoderBuffer* self) +{ + // We want it to get < 0 because == 0 means that the current/last character is a fallback + // and we need to detect recursion. We could have a flag but we already have this counter. + self->fallbackCount--; + self->fallbackIndex++; + + // Do we have anything left? 0 is now last fallback char, negative is nothing left + if (self->fallbackCount < 0) + return '\0'; + + // Need to get it out of the buffer. + // Make sure it didn't wrap from the fast count-- path + if (self->fallbackCount == INT_MAX) + { + self->fallbackCount = -1; + return '\0'; + } + + // Now make sure its in the expected range + assert(self->fallbackIndex < self->strDefaultLength && self->fallbackIndex >= 0); + + CHAR16_T ch = self->strDefault[self->fallbackIndex]; + self->bFallingBack = (ch != 0); + if (ch == 0) self->iRecursionCount = 0; + return ch; +} + +// Fallback Methods +static bool EncoderReplacementFallbackBuffer_Fallback(EncoderBuffer* self) +{ + // If we had a buffer already we're being recursive, throw, it's probably at the suspect + // character in our array. + assert(self->fallbackCount < 1); + + // Go ahead and get our fallback + // Divide by 2 because we aren't a surrogate pair + self->fallbackCount = self->strDefaultLength / 2; + self->fallbackIndex = -1; + + return self->fallbackCount != 0; +} + +static bool EncoderReplacementFallbackBuffer_Fallback_Unknown(EncoderBuffer* self) +{ + // If we had a buffer already we're being recursive, throw, it's probably at the suspect + // character in our array. + assert(self->fallbackCount < 1); + + // Go ahead and get our fallback + self->fallbackCount = self->strDefaultLength; + self->fallbackIndex = -1; + + return self->fallbackCount != 0; +} + +// Fallback the current character using the remaining buffer and encoder if necessary +// This can only be called by our encodings (other have to use the public fallback methods), so +// we can use our EncoderNLS here too. +// setEncoder is true if we're calling from a GetBytes method, false if we're calling from a GetByteCount +// +// Note that this could also change the contents of self->buffer.encoder, which is the same +// object that the caller is using, so the caller could mess up the encoder for us +// if they aren't careful. +static bool EncoderReplacementFallbackBuffer_InternalFallback(EncoderBuffer* self, CHAR16_T ch, CHAR16_T** chars) +{ + // Shouldn't have null charStart + assert(self->charStart != NULL); + + // See if it was a high surrogate + if (IsHighSurrogate(ch)) + { + // See if there's a low surrogate to go with it + if (*chars >= self->charEnd) + { + // Nothing left in input buffer + // No input, return 0 + } + else + { + // Might have a low surrogate + CHAR16_T cNext = **chars; + if (IsLowSurrogate(cNext)) + { + // If already falling back then fail + assert(!self->bFallingBack || self->iRecursionCount++ <= MAX_RECURSION); + + // Next is a surrogate, add it as surrogate pair, and increment chars + (*chars)++; + self->bFallingBack = EncoderReplacementFallbackBuffer_Fallback_Unknown(self); + return self->bFallingBack; + } + + // Next isn't a low surrogate, just fallback the high surrogate + } + } + + // If already falling back then fail + assert(!self->bFallingBack || self->iRecursionCount++ <= MAX_RECURSION); + + // Fall back our char + self->bFallingBack = EncoderReplacementFallbackBuffer_Fallback(self); + + return self->bFallingBack; +} + +static bool EncoderReplacementFallbackBuffer_MovePrevious(EncoderBuffer* self) +{ + // Back up one, only if we just processed the last character (or earlier) + if (self->fallbackCount >= -1 && self->fallbackIndex >= 0) + { + self->fallbackIndex--; + self->fallbackCount++; + return true; + } + + // Return false 'cause we couldn't do it. + return false; +} + +typedef struct +{ + union + { + DecoderBuffer decoder; + EncoderBuffer encoder; + } buffer; + + bool useFallback; + +#if BIGENDIAN + bool treatAsLE; +#endif +} UTF8Encoding; + +// These are bitmasks used to maintain the state in the decoder. They occupy the higher bits +// while the actual character is being built in the lower bits. They are shifted together +// with the actual bits of the character. + +// bits 30 & 31 are used for pending bits fixup +#define FinalByte (1 << 29) +#define SupplimentarySeq (1 << 28) +#define ThreeByteSeq (1 << 27) + +static bool InRange(int c, int begin, int end) +{ + return begin <= c && c <= end; +} + +// During GetChars we had an invalid byte sequence +// pSrc is backed up to the start of the bad sequence if we didn't have room to +// fall it back. Otherwise pSrc remains where it is. +static bool FallbackInvalidByteSequence_Copy(UTF8Encoding* self, unsigned char** pSrc, CHAR16_T** pTarget, CHAR16_T* pAllocatedBufferEnd) +{ + assert(self->useFallback); + + // Get our byte[] + unsigned char* pStart = *pSrc; + bool fallbackResult = DecoderReplacementFallbackBuffer_InternalFallback_Copy(&self->buffer.decoder, pTarget, pAllocatedBufferEnd); + + // Do the actual fallback + if (!fallbackResult) + { + // Oops, it failed, back up to pStart + *pSrc = pStart; + return false; + } + + // It worked + return true; +} + +static size_t GetCharCount(UTF8Encoding* self, unsigned char* bytes, size_t count) +{ + assert(bytes != NULL); + assert(count >= 0); + + // Initialize stuff + unsigned char *pSrc = bytes; + unsigned char *pEnd = pSrc + count; + size_t availableBytes; + int chc; + + // Start by assuming we have as many as count, charCount always includes the adjustment + // for the character being decoded + size_t charCount = count; + int ch = 0; + bool fallbackUsed = false; + + while (true) + { + // SLOWLOOP: does all range checks, handles all special cases, but it is slow + if (pSrc >= pEnd) break; + + // read next byte. The JIT optimization seems to be getting confused when + // compiling "ch = *pSrc++;", so rather use "ch = *pSrc; pSrc++;" instead + int cha = *pSrc; + + // no pending bits + if (ch == 0) goto ReadChar; + + pSrc++; + + // we are expecting to see trailing bytes like 10vvvvvv + if ((cha & 0xC0) != 0x80) + { + // This can be a valid starting byte for another UTF8 byte sequence, so let's put + // the current byte back, and try to see if this is a valid byte for another UTF8 byte sequence + pSrc--; + charCount += (ch >> 30); + goto InvalidByteSequence; + } + + // fold in the new byte + ch = (ch << 6) | (cha & 0x3F); + + if ((ch & FinalByte) == 0) + { + assert((ch & (SupplimentarySeq | ThreeByteSeq)) != 0); + + if ((ch & SupplimentarySeq) != 0) + { + if ((ch & (FinalByte >> 6)) != 0) + { + // this is 3rd byte (of 4 byte supplimentary) - nothing to do + continue; + } + + // 2nd byte, check for non-shortest form of supplimentary char and the valid + // supplimentary characters in range 0x010000 - 0x10FFFF at the same time + if (!InRange(ch & 0x1F0, 0x10, 0x100)) + { + goto InvalidByteSequence; + } + } + else + { + // Must be 2nd byte of a 3-byte sequence + // check for non-shortest form of 3 byte seq + if ((ch & (0x1F << 5)) == 0 || // non-shortest form + (ch & (0xF800 >> 6)) == (0xD800 >> 6)) // illegal individually encoded surrogate + { + goto InvalidByteSequence; + } + } + continue; + } + + // ready to punch + + // adjust for surrogates in non-shortest form + if ((ch & (SupplimentarySeq | 0x1F0000)) == SupplimentarySeq) charCount--; + + goto EncodeChar; + + InvalidByteSequence: + if (!self->useFallback) + { + errno = MINIPAL_ERROR_NO_UNICODE_TRANSLATION; + return 0; + } + + if (!fallbackUsed) + { + fallbackUsed = true; + self->buffer.decoder.byteStart = bytes; + self->buffer.decoder.charEnd = NULL; + } + charCount += self->buffer.decoder.strDefaultLength; + + ch = 0; + continue; + + ReadChar: + ch = *pSrc; + pSrc++; + + ProcessChar: + if (ch > 0x7F) + { + // If its > 0x7F, its start of a new multi-byte sequence + + // Long sequence, so unreserve our char. + charCount--; + + // bit 6 has to be non-zero for start of multibyte chars. + if ((ch & 0x40) == 0) goto InvalidByteSequence; + + // start a new long code + if ((ch & 0x20) != 0) + { + if ((ch & 0x10) != 0) + { + // 4 byte encoding - supplimentary character (2 surrogates) + + ch &= 0x0F; + + // check that bit 4 is zero and the valid supplimentary character + // range 0x000000 - 0x10FFFF at the same time + if (ch > 0x04) + { + ch |= 0xf0; + goto InvalidByteSequence; + } + + // Add bit flags so that when we check new characters & rotate we'll be flagged correctly. + // Final byte flag, count fix if we don't make final byte & supplimentary sequence flag. + ch |= (FinalByte >> 3 * 6) | // Final byte is 3 more bytes from now + (1 << 30) | // If it dies on next byte we'll need an extra char + (3 << (30 - 2 * 6)) | // If it dies on last byte we'll need to subtract a char + (SupplimentarySeq) | (SupplimentarySeq >> 6) | + (SupplimentarySeq >> 2 * 6) | (SupplimentarySeq >> 3 * 6); + + // Our character count will be 2 characters for these 4 bytes, so subtract another char + charCount--; + } + else + { + // 3 byte encoding + // Add bit flags so that when we check new characters & rotate we'll be flagged correctly. + ch = (ch & 0x0F) | ((FinalByte >> 2 * 6) | (1 << 30) | + (ThreeByteSeq) | (ThreeByteSeq >> 6) | (ThreeByteSeq >> 2 * 6)); + + // We'll expect 1 character for these 3 bytes, so subtract another char. + charCount--; + } + } + else + { + // 2 byte encoding + + ch &= 0x1F; + + // check for non-shortest form + if (ch <= 1) + { + ch |= 0xc0; + goto InvalidByteSequence; + } + + // Add bit flags so we'll be flagged correctly + ch |= (FinalByte >> 6); + } + continue; + } + + EncodeChar: + + availableBytes = (size_t)(pEnd - pSrc); + + // don't fall into the fast decoding loop if we don't have enough bytes + if (availableBytes <= 13) + { + // try to get over the remainder of the ascii characters fast though + unsigned char* pLocalEnd = pEnd; // hint to get pLocalEnd enregistered + while (pSrc < pLocalEnd) + { + ch = *pSrc; + pSrc++; + + if (ch > 0x7F) + goto ProcessChar; + } + // we are done + ch = 0; + break; + } + + // To compute the upper bound, assume that all characters are ASCII characters at this point, + // the boundary will be decreased for every non-ASCII character we encounter + // Also, we need 7 chars reserve for the unrolled ansi decoding loop and for decoding of multibyte sequences + unsigned char *pStop = pSrc + availableBytes - 7; + + while (pSrc < pStop) + { + ch = *pSrc; + pSrc++; + + if (ch > 0x7F) + { + goto LongCode; + } + + // get pSrc 2-byte aligned + if (((size_t)pSrc & 0x1) != 0) + { + ch = *pSrc; + pSrc++; + if (ch > 0x7F) + { + goto LongCode; + } + } + + // get pSrc 4-byte aligned + if (((size_t)pSrc & 0x2) != 0) + { + ch = *(unsigned short*)pSrc; + if ((ch & 0x8080) != 0) + { + goto LongCodeWithMask16; + } + pSrc += 2; + } + + + // Run 8 + 8 characters at a time! + while (pSrc < pStop) + { + ch = *(int*)pSrc; + int chb = *(int*)(pSrc + 4); + if (((ch | chb) & (int)0x80808080) != 0) + { + goto LongCodeWithMask32; + } + pSrc += 8; + + // This is a really small loop - unroll it + if (pSrc >= pStop) + break; + + ch = *(int*)pSrc; + chb = *(int*)(pSrc + 4); + if (((ch | chb) & (int)0x80808080) != 0) + { + goto LongCodeWithMask32; + } + pSrc += 8; + } + break; + + LongCodeWithMask32 : +#if BIGENDIAN + // be careful about the sign extension + if (!self->treatAsLE) ch = (int)(((unsigned int)ch) >> 16); + else +#endif + ch &= 0xFF; + + LongCodeWithMask16: +#if BIGENDIAN + if (!self->treatAsLE) ch = (int)(((unsigned int)ch) >> 8); + else +#endif + ch &= 0xFF; + + pSrc++; + if (ch <= 0x7F) + { + continue; + } + + LongCode: + chc = *pSrc; + pSrc++; + + if ( + // bit 6 has to be zero + (ch & 0x40) == 0 || + // we are expecting to see trailing bytes like 10vvvvvv + (chc & 0xC0) != 0x80) + { + goto BadLongCode; + } + + chc &= 0x3F; + + // start a new long code + if ((ch & 0x20) != 0) + { + // fold the first two bytes together + chc |= (ch & 0x0F) << 6; + + if ((ch & 0x10) != 0) + { + // 4 byte encoding - surrogate + ch = *pSrc; + if ( + // check that bit 4 is zero, the non-shortest form of surrogate + // and the valid surrogate range 0x000000 - 0x10FFFF at the same time + !InRange(chc >> 4, 0x01, 0x10) || + // we are expecting to see trailing bytes like 10vvvvvv + (ch & 0xC0) != 0x80) + { + goto BadLongCode; + } + + chc = (chc << 6) | (ch & 0x3F); + + ch = *(pSrc + 1); + // we are expecting to see trailing bytes like 10vvvvvv + if ((ch & 0xC0) != 0x80) + { + goto BadLongCode; + } + pSrc += 2; + + // extra byte + charCount--; + } + else + { + // 3 byte encoding + ch = *pSrc; + if ( + // check for non-shortest form of 3 byte seq + (chc & (0x1F << 5)) == 0 || + // Can't have surrogates here. + (chc & (0xF800 >> 6)) == (0xD800 >> 6) || + // we are expecting to see trailing bytes like 10vvvvvv + (ch & 0xC0) != 0x80) + { + goto BadLongCode; + } + pSrc++; + + // extra byte + charCount--; + } + } + else + { + // 2 byte encoding + + // check for non-shortest form + if ((ch & 0x1E) == 0) goto BadLongCode; + } + + // extra byte + charCount--; + } + + // no pending bits at this point + ch = 0; + continue; + + BadLongCode: + pSrc -= 2; + ch = 0; + continue; + } + + // May have a problem if we have to flush + if (ch != 0) + { + // We were already adjusting for these, so need to unadjust + charCount += (ch >> 30); + charCount += self->buffer.decoder.strDefaultLength; + } + + // Shouldn't have anything in fallback buffer for GetCharCount + // (don't have to check m_throwOnOverflow for count) + assert(!fallbackUsed || !self->useFallback || self->buffer.decoder.fallbackCount < 0); + + return charCount; +} + +#define ENSURE_BUFFER_INC \ + pTarget++; \ + if (pTarget > pAllocatedBufferEnd) \ + { \ + errno = MINIPAL_ERROR_INSUFFICIENT_BUFFER; \ + return 0; \ + } + +static size_t GetChars(UTF8Encoding* self, unsigned char* bytes, size_t byteCount, CHAR16_T* chars, size_t charCount) +{ + assert(chars != NULL); + assert(byteCount >= 0); + assert(charCount >= 0); + assert(bytes != NULL); + + unsigned char *pSrc = bytes; + CHAR16_T *pTarget = chars; + + unsigned char *pEnd = pSrc + byteCount; + CHAR16_T *pAllocatedBufferEnd = pTarget + charCount; + + int ch = 0; + int chc; + + bool fallbackUsed = false; + + while (true) + { + // SLOWLOOP: does all range checks, handles all special cases, but it is slow + + if (pSrc >= pEnd) break; + + // read next byte. The JIT optimization seems to be getting confused when + // compiling "ch = *pSrc++;", so rather use "ch = *pSrc; pSrc++;" instead + int cha = *pSrc; + + if (ch == 0) + { + // no pending bits + goto ReadChar; + } + + pSrc++; + + // we are expecting to see trailing bytes like 10vvvvvv + if ((cha & 0xC0) != 0x80) + { + // This can be a valid starting byte for another UTF8 byte sequence, so let's put + // the current byte back, and try to see if this is a valid byte for another UTF8 byte sequence + pSrc--; + goto InvalidByteSequence; + } + + // fold in the new byte + ch = (ch << 6) | (cha & 0x3F); + + if ((ch & FinalByte) == 0) + { + // Not at last byte yet + assert((ch & (SupplimentarySeq | ThreeByteSeq)) != 0); + + if ((ch & SupplimentarySeq) != 0) + { + // Its a 4-byte supplimentary sequence + if ((ch & (FinalByte >> 6)) != 0) + { + // this is 3rd byte of 4 byte sequence - nothing to do + continue; + } + + // 2nd byte of 4 bytes + // check for non-shortest form of surrogate and the valid surrogate + // range 0x000000 - 0x10FFFF at the same time + if (!InRange(ch & 0x1F0, 0x10, 0x100)) + { + goto InvalidByteSequence; + } + } + else + { + // Must be 2nd byte of a 3-byte sequence + // check for non-shortest form of 3 byte seq + if ((ch & (0x1F << 5)) == 0 || // non-shortest form + (ch & (0xF800 >> 6)) == (0xD800 >> 6)) // illegal individually encoded surrogate + { + goto InvalidByteSequence; + } + } + continue; + } + + // ready to punch + + // surrogate in shortest form? + // Might be possible to get rid of this? Already did non-shortest check for 4-byte sequence when reading 2nd byte? + if ((ch & (SupplimentarySeq | 0x1F0000)) > SupplimentarySeq) + { + // let the range check for the second char throw the exception + if (pTarget < pAllocatedBufferEnd) + { + *pTarget = (CHAR16_T)(((ch >> 10) & 0x7FF) + + (HIGH_SURROGATE_START - (0x10000 >> 10))); + + ENSURE_BUFFER_INC + + ch = (ch & 0x3FF) + + (int)(LOW_SURROGATE_START); + } + } + + goto EncodeChar; + + InvalidByteSequence: + if (!self->useFallback) + { + errno = MINIPAL_ERROR_NO_UNICODE_TRANSLATION; + return 0; + } + + // this code fragment should be close to the gotos referencing it + // Have to do fallback for invalid bytes + if (!fallbackUsed) + { + fallbackUsed = true; + self->buffer.decoder.byteStart = bytes; + self->buffer.decoder.charEnd = pAllocatedBufferEnd; + } + + // That'll back us up the appropriate # of bytes if we didn't get anywhere + if (!FallbackInvalidByteSequence_Copy(self, &pSrc, &pTarget, pAllocatedBufferEnd)) + { + if (errno == MINIPAL_ERROR_INSUFFICIENT_BUFFER) return 0; + + // Check if we ran out of buffer space + assert(pSrc >= bytes); + + DecoderReplacementFallbackBuffer_Reset(&self->buffer.decoder); + ch = 0; + break; + } + + assert(pSrc >= bytes); + + ch = 0; + continue; + + ReadChar: + ch = *pSrc; + pSrc++; + + ProcessChar: + if (ch > 0x7F) + { + // If its > 0x7F, its start of a new multi-byte sequence + + // bit 6 has to be non-zero + if ((ch & 0x40) == 0) goto InvalidByteSequence; + + // start a new long code + if ((ch & 0x20) != 0) + { + if ((ch & 0x10) != 0) + { + // 4 byte encoding - supplimentary character (2 surrogates) + + ch &= 0x0F; + + // check that bit 4 is zero and the valid supplimentary character + // range 0x000000 - 0x10FFFF at the same time + if (ch > 0x04) + { + ch |= 0xf0; + goto InvalidByteSequence; + } + + ch |= (FinalByte >> 3 * 6) | (1 << 30) | (3 << (30 - 2 * 6)) | + (SupplimentarySeq) | (SupplimentarySeq >> 6) | + (SupplimentarySeq >> 2 * 6) | (SupplimentarySeq >> 3 * 6); + } + else + { + // 3 byte encoding + ch = (ch & 0x0F) | ((FinalByte >> 2 * 6) | (1 << 30) | + (ThreeByteSeq) | (ThreeByteSeq >> 6) | (ThreeByteSeq >> 2 * 6)); + } + } + else + { + // 2 byte encoding + + ch &= 0x1F; + + // check for non-shortest form + if (ch <= 1) + { + ch |= 0xc0; + goto InvalidByteSequence; + } + + ch |= (FinalByte >> 6); + } + continue; + } + + EncodeChar: + // write the pending character + if (pTarget >= pAllocatedBufferEnd) + { + // Fix chars so we make sure to throw if we didn't output anything + ch &= 0x1fffff; + if (ch > 0x7f) + { + if (ch > 0x7ff) + { + if (ch >= LOW_SURROGATE_START && + ch <= LOW_SURROGATE_END) + { + pSrc--; // It was 4 bytes + pTarget--; // 1 was stored already, but we can't remember 1/2, so back up + } + else if (ch > 0xffff) + { + pSrc--; // It was 4 bytes, nothing was stored + } + pSrc--; // It was at least 3 bytes + } + pSrc--; // It was at least 2 bytes + } + pSrc--; + + assert(pSrc >= bytes); + + // Don't store ch in decoder, we already backed up to its start + ch = 0; + + // Didn't throw, just use this buffer size. + break; + } + *pTarget = (CHAR16_T)ch; + ENSURE_BUFFER_INC + + size_t availableChars = (size_t)(pAllocatedBufferEnd - pTarget); + size_t availableBytes = (size_t)(pEnd - pSrc); + + // don't fall into the fast decoding loop if we don't have enough bytes + // Test for availableChars is done because pStop would be <= pTarget. + if (availableBytes <= 13) + { + // we may need as many as 1 character per byte + if (availableChars < availableBytes) + { + // not enough output room. no pending bits at this point + ch = 0; + continue; + } + + // try to get over the remainder of the ascii characters fast though + unsigned char* pLocalEnd = pEnd; // hint to get pLocalEnd enregistered + while (pSrc < pLocalEnd) + { + ch = *pSrc; + pSrc++; + + if (ch > 0x7F) goto ProcessChar; + + *pTarget = (CHAR16_T)ch; + ENSURE_BUFFER_INC + } + // we are done + ch = 0; + break; + } + + // we may need as many as 1 character per byte, so reduce the byte count if necessary. + // If availableChars is too small, pStop will be before pTarget and we won't do fast loop. + if (availableChars < availableBytes) availableBytes = availableChars; + + // To compute the upper bound, assume that all characters are ASCII characters at this point, + // the boundary will be decreased for every non-ASCII character we encounter + // Also, we need 7 chars reserve for the unrolled ansi decoding loop and for decoding of multibyte sequences + CHAR16_T *pStop = pTarget + availableBytes - 7; + + while (pTarget < pStop) + { + ch = *pSrc; + pSrc++; + + if (ch > 0x7F) goto LongCode; + + *pTarget = (CHAR16_T)ch; + ENSURE_BUFFER_INC + + // get pSrc to be 2-byte aligned + if ((((size_t)pSrc) & 0x1) != 0) + { + ch = *pSrc; + pSrc++; + if (ch > 0x7F) goto LongCode; + + *pTarget = (CHAR16_T)ch; + ENSURE_BUFFER_INC + } + + // get pSrc to be 4-byte aligned + if ((((size_t)pSrc) & 0x2) != 0) + { + ch = *(unsigned short*)pSrc; + if ((ch & 0x8080) != 0) goto LongCodeWithMask16; + + + if (pTarget + 2 > pAllocatedBufferEnd) + { + errno = MINIPAL_ERROR_INSUFFICIENT_BUFFER; + return 0; + } + + // Unfortunately, this is endianness sensitive +#if BIGENDIAN + if (!self->treatAsLE) + { + *pTarget = (CHAR16_T)((ch >> 8) & 0x7F); + pSrc += 2; + *(pTarget + 1) = (CHAR16_T)(ch & 0x7F); + pTarget += 2; + } + else +#endif + { + *pTarget = (CHAR16_T)(ch & 0x7F); + pSrc += 2; + *(pTarget + 1) = (CHAR16_T)((ch >> 8) & 0x7F); + pTarget += 2; + } + } + + // Run 8 characters at a time! + while (pTarget < pStop) + { + ch = *(int*)pSrc; + int chb = *(int*)(pSrc + 4); + if (((ch | chb) & (int)0x80808080) != 0) goto LongCodeWithMask32; + + if (pTarget + 8 > pAllocatedBufferEnd) + { + errno = MINIPAL_ERROR_INSUFFICIENT_BUFFER; + return 0; + } + + // Unfortunately, this is endianness sensitive +#if BIGENDIAN + if (!self->treatAsLE) + { + *pTarget = (CHAR16_T)((ch >> 24) & 0x7F); + *(pTarget + 1) = (CHAR16_T)((ch >> 16) & 0x7F); + *(pTarget + 2) = (CHAR16_T)((ch >> 8) & 0x7F); + *(pTarget + 3) = (CHAR16_T)(ch & 0x7F); + pSrc += 8; + *(pTarget + 4) = (CHAR16_T)((chb >> 24) & 0x7F); + *(pTarget + 5) = (CHAR16_T)((chb >> 16) & 0x7F); + *(pTarget + 6) = (CHAR16_T)((chb >> 8) & 0x7F); + *(pTarget + 7) = (CHAR16_T)(chb & 0x7F); + pTarget += 8; + } + else +#endif + { + *pTarget = (CHAR16_T)(ch & 0x7F); + *(pTarget + 1) = (CHAR16_T)((ch >> 8) & 0x7F); + *(pTarget + 2) = (CHAR16_T)((ch >> 16) & 0x7F); + *(pTarget + 3) = (CHAR16_T)((ch >> 24) & 0x7F); + pSrc += 8; + *(pTarget + 4) = (CHAR16_T)(chb & 0x7F); + *(pTarget + 5) = (CHAR16_T)((chb >> 8) & 0x7F); + *(pTarget + 6) = (CHAR16_T)((chb >> 16) & 0x7F); + *(pTarget + 7) = (CHAR16_T)((chb >> 24) & 0x7F); + pTarget += 8; + } + } + break; + + LongCodeWithMask32 : +#if BIGENDIAN + // be careful about the sign extension + if (!self->treatAsLE) ch = (int)(((unsigned int)ch) >> 16); + else +#endif + ch &= 0xFF; + + LongCodeWithMask16: +#if BIGENDIAN + if (!self->treatAsLE) ch = (int)(((unsigned int)ch) >> 8); + else +#endif + ch &= 0xFF; + + pSrc++; + if (ch <= 0x7F) + { + *pTarget = (CHAR16_T)ch; + ENSURE_BUFFER_INC + continue; + } + + LongCode: + chc = *pSrc; + pSrc++; + + if ( + // bit 6 has to be zero + (ch & 0x40) == 0 || + // we are expecting to see trailing bytes like 10vvvvvv + (chc & 0xC0) != 0x80) + { + goto BadLongCode; + } + + chc &= 0x3F; + + // start a new long code + if ((ch & 0x20) != 0) + { + + // fold the first two bytes together + chc |= (ch & 0x0F) << 6; + + if ((ch & 0x10) != 0) + { + // 4 byte encoding - surrogate + ch = *pSrc; + if ( + // check that bit 4 is zero, the non-shortest form of surrogate + // and the valid surrogate range 0x000000 - 0x10FFFF at the same time + !InRange(chc >> 4, 0x01, 0x10) || + // we are expecting to see trailing bytes like 10vvvvvv + (ch & 0xC0) != 0x80) + { + goto BadLongCode; + } + + chc = (chc << 6) | (ch & 0x3F); + + ch = *(pSrc + 1); + // we are expecting to see trailing bytes like 10vvvvvv + if ((ch & 0xC0) != 0x80) goto BadLongCode; + + pSrc += 2; + + ch = (chc << 6) | (ch & 0x3F); + + *pTarget = (CHAR16_T)(((ch >> 10) & 0x7FF) + + (HIGH_SURROGATE_START - (0x10000 >> 10))); + ENSURE_BUFFER_INC + + ch = (ch & 0x3FF) + (LOW_SURROGATE_START); + + // extra byte, we're already planning 2 chars for 2 of these bytes, + // but the big loop is testing the target against pStop, so we need + // to subtract 2 more or we risk overrunning the input. Subtract + // one here and one below. + pStop--; + } + else + { + // 3 byte encoding + ch = *pSrc; + if ( + // check for non-shortest form of 3 byte seq + (chc & (0x1F << 5)) == 0 || + // Can't have surrogates here. + (chc & (0xF800 >> 6)) == (0xD800 >> 6) || + // we are expecting to see trailing bytes like 10vvvvvv + (ch & 0xC0) != 0x80) + { + goto BadLongCode; + } + pSrc++; + + ch = (chc << 6) | (ch & 0x3F); + + // extra byte, we're only expecting 1 char for each of these 3 bytes, + // but the loop is testing the target (not source) against pStop, so + // we need to subtract 2 more or we risk overrunning the input. + // Subtract 1 here and one more below + pStop--; + } + } + else + { + // 2 byte encoding + + ch &= 0x1F; + + // check for non-shortest form + if (ch <= 1) goto BadLongCode; + + ch = (ch << 6) | chc; + } + + *pTarget = (CHAR16_T)ch; + ENSURE_BUFFER_INC + + // extra byte, we're only expecting 1 char for each of these 2 bytes, + // but the loop is testing the target (not source) against pStop. + // subtract an extra count from pStop so that we don't overrun the input. + pStop--; + } + + assert(pTarget <= pAllocatedBufferEnd); + + // no pending bits at this point + ch = 0; + continue; + + BadLongCode: + pSrc -= 2; + ch = 0; + continue; + } + + if (ch != 0) + { + // This'll back us up the appropriate # of bytes if we didn't get anywhere + if (!self->useFallback) + { + assert(pSrc >= bytes || pTarget == chars); + + // Ran out of buffer space + // Need to throw an exception? + if (pTarget == chars) + { + errno = MINIPAL_ERROR_INSUFFICIENT_BUFFER; + return 0; + } + } + assert(pSrc >= bytes); + ch = 0; + } + + // Shouldn't have anything in fallback buffer for GetChars + // (don't have to check m_throwOnOverflow for chars) + assert(!fallbackUsed || self->buffer.decoder.fallbackCount < 0); + + if (pSrc < pEnd) + { + errno = MINIPAL_ERROR_INSUFFICIENT_BUFFER; + return 0; + } + + return (size_t)(pTarget - chars); +} + +static size_t GetBytes(UTF8Encoding* self, CHAR16_T* chars, size_t charCount, unsigned char* bytes, size_t byteCount) +{ + assert(chars != NULL); + assert(byteCount >= 0); + assert(charCount >= 0); + assert(bytes != NULL); + + // For fallback we may need a fallback buffer. + // We wait to initialize it though in case we don't have any broken input unicode + bool fallbackUsed = false; + CHAR16_T *pSrc = chars; + unsigned char *pTarget = bytes; + + CHAR16_T *pEnd = pSrc + charCount; + unsigned char *pAllocatedBufferEnd = pTarget + byteCount; + + int ch = 0; + int chd; + + // assume that JIT will enregister pSrc, pTarget and ch + + while (true) + { + // SLOWLOOP: does all range checks, handles all special cases, but it is slow + + if (pSrc >= pEnd) + { + if (ch == 0) + { + // Check if there's anything left to get out of the fallback buffer + ch = fallbackUsed ? EncoderReplacementFallbackBuffer_InternalGetNextChar(&self->buffer.encoder) : 0; + if (ch > 0) goto ProcessChar; + } + else + { + // Case of leftover surrogates in the fallback buffer + if (fallbackUsed && self->buffer.encoder.bFallingBack) + { + assert(ch >= 0xD800 && ch <= 0xDBFF); + + int cha = ch; + + ch = EncoderReplacementFallbackBuffer_InternalGetNextChar(&self->buffer.encoder); + + if (InRange(ch, LOW_SURROGATE_START, LOW_SURROGATE_END)) + { + ch = ch + (cha << 10) + (0x10000 - LOW_SURROGATE_START - (HIGH_SURROGATE_START << 10)); + goto EncodeChar; + } + else if (ch > 0) + { + goto ProcessChar; + } + + break; + } + } + + // attempt to encode the partial surrogate (will fail or ignore) + if (ch > 0) goto EncodeChar; + + // We're done + break; + } + + if (ch > 0) + { + // We have a high surrogate left over from a previous loop. + assert(ch >= 0xD800 && ch <= 0xDBFF); + + // use separate helper variables for local contexts so that the jit optimizations + // won't get confused about the variable lifetimes + int cha = *pSrc; + + // In previous byte, we encountered a high surrogate, so we are expecting a low surrogate here. + if (InRange(cha, LOW_SURROGATE_START, LOW_SURROGATE_END)) + { + ch = cha + (ch << 10) + + (0x10000 + - LOW_SURROGATE_START + - (HIGH_SURROGATE_START << 10)); + + pSrc++; + } + // else ch is still high surrogate and encoding will fail + + // attempt to encode the surrogate or partial surrogate + goto EncodeChar; + } + + // If we've used a fallback, then we have to check for it + if (fallbackUsed) + { + ch = EncoderReplacementFallbackBuffer_InternalGetNextChar(&self->buffer.encoder); + if (ch > 0) goto ProcessChar; + } + + // read next char. The JIT optimization seems to be getting confused when + // compiling "ch = *pSrc++;", so rather use "ch = *pSrc; pSrc++;" instead + ch = *pSrc; + pSrc++; + + ProcessChar: + if (InRange(ch, HIGH_SURROGATE_START, HIGH_SURROGATE_END)) continue; + + // either good char or partial surrogate + + EncodeChar: + // throw exception on partial surrogate if necessary + if (InRange(ch, HIGH_SURROGATE_START, LOW_SURROGATE_END)) + { + // Lone surrogates aren't allowed, we have to do fallback for them + // Have to make a fallback buffer if we don't have one + if (!fallbackUsed) + { + // wait on fallbacks if we can + // For fallback we may need a fallback buffer + fallbackUsed = true; + + // Set our internal fallback interesting things. + EncoderReplacementFallbackBuffer_InternalInitialize(&self->buffer.encoder, chars, pEnd, true); + } + + // Do our fallback. Actually we already know its a mixed up surrogate, + // so the ref pSrc isn't gonna do anything. + EncoderReplacementFallbackBuffer_InternalFallback(&self->buffer.encoder, (CHAR16_T)ch, &pSrc); + + // Ignore it if we don't throw + ch = 0; + continue; + } + + // Count bytes needed + int bytesNeeded = 1; + if (ch > 0x7F) + { + if (ch > 0x7FF) + { + if (ch > 0xFFFF) + { + bytesNeeded++; // 4 bytes (surrogate pair) + } + bytesNeeded++; // 3 bytes (800-FFFF) + } + bytesNeeded++; // 2 bytes (80-7FF) + } + + if (pTarget > pAllocatedBufferEnd - bytesNeeded) + { + // Left over surrogate from last time will cause pSrc == chars, so we'll throw + if (fallbackUsed && self->buffer.encoder.bFallingBack) + { + EncoderReplacementFallbackBuffer_MovePrevious(&self->buffer.encoder); // Didn't use this fallback char + if (ch > 0xFFFF) + EncoderReplacementFallbackBuffer_MovePrevious(&self->buffer.encoder); // Was surrogate, didn't use 2nd part either + } + else + { + pSrc--; // Didn't use this char + if (ch > 0xFFFF) + pSrc--; // Was surrogate, didn't use 2nd part either + } + + assert(pSrc >= chars || pTarget == bytes); + + if (pTarget == bytes) // Throw if we must + { + errno = MINIPAL_ERROR_INSUFFICIENT_BUFFER; + return 0; + } + ch = 0; // Nothing left over (we backed up to start of pair if supplimentary) + break; + } + + if (ch <= 0x7F) + { + *pTarget = (unsigned char)ch; + } + else + { + // use separate helper variables for local contexts so that the jit optimizations + // won't get confused about the variable lifetimes + int chb; + if (ch <= 0x7FF) + { + // 2 unsigned char encoding + chb = (unsigned char)(0xC0 | (ch >> 6)); + } + else + { + if (ch <= 0xFFFF) + { + chb = (unsigned char)(0xE0 | (ch >> 12)); + } + else + { + *pTarget = (unsigned char)(0xF0 | (ch >> 18)); + ENSURE_BUFFER_INC + + chb = 0x80 | ((ch >> 12) & 0x3F); + } + *pTarget = (unsigned char)chb; + ENSURE_BUFFER_INC + + chb = 0x80 | ((ch >> 6) & 0x3F); + } + *pTarget = (unsigned char)chb; + ENSURE_BUFFER_INC + + *pTarget = (unsigned char)0x80 | (ch & 0x3F); + } + + ENSURE_BUFFER_INC + + // If still have fallback don't do fast loop + if (fallbackUsed && (ch = EncoderReplacementFallbackBuffer_InternalGetNextChar(&self->buffer.encoder)) != 0) + goto ProcessChar; + + size_t availableChars = (size_t)(pEnd - pSrc); + size_t availableBytes = (size_t)(pAllocatedBufferEnd - pTarget); + + // don't fall into the fast decoding loop if we don't have enough characters + // Note that if we don't have enough bytes, pStop will prevent us from entering the fast loop. + if (availableChars <= 13) + { + // we are hoping for 1 unsigned char per char + if (availableBytes < availableChars) + { + // not enough output room. no pending bits at this point + ch = 0; + continue; + } + + // try to get over the remainder of the ascii characters fast though + CHAR16_T* pLocalEnd = pEnd; // hint to get pLocalEnd enregistered + while (pSrc < pLocalEnd) + { + ch = *pSrc; + pSrc++; + + // Not ASCII, need more than 1 unsigned char per char + if (ch > 0x7F) goto ProcessChar; + + *pTarget = (unsigned char)ch; + ENSURE_BUFFER_INC + } + // we are done, let ch be 0 to clear encoder + ch = 0; + break; + } + + // we need at least 1 unsigned char per character, but Convert might allow us to convert + // only part of the input, so try as much as we can. Reduce charCount if necessary + if (availableBytes < availableChars) + { + availableChars = availableBytes; + } + + // FASTLOOP: + // - optimistic range checks + // - fallbacks to the slow loop for all special cases, exception throwing, etc. + + // To compute the upper bound, assume that all characters are ASCII characters at this point, + // the boundary will be decreased for every non-ASCII character we encounter + // Also, we need 5 chars reserve for the unrolled ansi decoding loop and for decoding of surrogates + // If there aren't enough bytes for the output, then pStop will be <= pSrc and will bypass the loop. + CHAR16_T *pStop = pSrc + availableChars - 5; + + while (pSrc < pStop) + { + ch = *pSrc; + pSrc++; + + if (ch > 0x7F) goto LongCode; + + *pTarget = (unsigned char)ch; + ENSURE_BUFFER_INC + + // get pSrc aligned + if (((size_t)pSrc & 0x2) != 0) + { + ch = *pSrc; + pSrc++; + if (ch > 0x7F) goto LongCode; + + *pTarget = (unsigned char)ch; + ENSURE_BUFFER_INC + } + + // Run 4 characters at a time! + while (pSrc < pStop) + { + ch = *(int*)pSrc; + int chc = *(int*)(pSrc + 2); + + if (((ch | chc) & (int)0xFF80FF80) != 0) goto LongCodeWithMask; + + if (pTarget + 4 > pAllocatedBufferEnd) + { + errno = MINIPAL_ERROR_INSUFFICIENT_BUFFER; + return 0; + } + + // Unfortunately, this is endianness sensitive +#if BIGENDIAN + if (!self->treatAsLE) + { + *pTarget = (unsigned char)(ch >> 16); + *(pTarget + 1) = (unsigned char)ch; + pSrc += 4; + *(pTarget + 2) = (unsigned char)(chc >> 16); + *(pTarget + 3) = (unsigned char)chc; + pTarget += 4; + } + else +#endif + { + *pTarget = (unsigned char)ch; + *(pTarget + 1) = (unsigned char)(ch >> 16); + pSrc += 4; + *(pTarget + 2) = (unsigned char)chc; + *(pTarget + 3) = (unsigned char)(chc >> 16); + pTarget += 4; + } + } + continue; + + LongCodeWithMask: +#if BIGENDIAN + // be careful about the sign extension + if (!self->treatAsLE) ch = (int)(((unsigned int)ch) >> 16); + else +#endif + ch = (CHAR16_T)ch; + pSrc++; + + if (ch > 0x7F) goto LongCode; + + *pTarget = (unsigned char)ch; + ENSURE_BUFFER_INC + continue; + + LongCode: + // use separate helper variables for slow and fast loop so that the jit optimizations + // won't get confused about the variable lifetimes + if (ch <= 0x7FF) + { + // 2 unsigned char encoding + chd = 0xC0 | (ch >> 6); + } + else + { + if (!InRange(ch, HIGH_SURROGATE_START, LOW_SURROGATE_END)) + { + // 3 unsigned char encoding + chd = 0xE0 | (ch >> 12); + } + else + { + // 4 unsigned char encoding - high surrogate + low surrogate + if (ch > HIGH_SURROGATE_END) + { + // low without high -> bad, try again in slow loop + pSrc -= 1; + break; + } + + chd = *pSrc; + pSrc++; + + if (!InRange(chd, LOW_SURROGATE_START, LOW_SURROGATE_END)) + { + // high not followed by low -> bad, try again in slow loop + pSrc -= 2; + break; + } + + ch = chd + (ch << 10) + + (0x10000 + - LOW_SURROGATE_START + - (HIGH_SURROGATE_START << 10)); + + *pTarget = (unsigned char)(0xF0 | (ch >> 18)); + // pStop - this unsigned char is compensated by the second surrogate character + // 2 input chars require 4 output bytes. 2 have been anticipated already + // and 2 more will be accounted for by the 2 pStop-- calls below. + ENSURE_BUFFER_INC + + chd = 0x80 | ((ch >> 12) & 0x3F); + } + *pTarget = (unsigned char)chd; + pStop--; // 3 unsigned char sequence for 1 char, so need pStop-- and the one below too. + ENSURE_BUFFER_INC + + chd = 0x80 | ((ch >> 6) & 0x3F); + } + *pTarget = (unsigned char)chd; + pStop--; // 2 unsigned char sequence for 1 char so need pStop--. + ENSURE_BUFFER_INC + + *pTarget = (unsigned char)(0x80 | (ch & 0x3F)); + // pStop - this unsigned char is already included + ENSURE_BUFFER_INC + } + + assert(pTarget <= pAllocatedBufferEnd); + + // no pending char at this point + ch = 0; + } + + if (pSrc < pEnd) + { + errno = MINIPAL_ERROR_INSUFFICIENT_BUFFER; + return 0; + } + + return (size_t)(pTarget - bytes); +} + +static size_t GetByteCount(UTF8Encoding* self, CHAR16_T *chars, size_t count) +{ + // For fallback we may need a fallback buffer. + // We wait to initialize it though in case we don't have any broken input unicode + bool fallbackUsed = false; + CHAR16_T *pSrc = chars; + CHAR16_T *pEnd = pSrc + count; + + // Start by assuming we have as many as count + size_t byteCount = count; + + int ch = 0; + + while (true) + { + // SLOWLOOP: does all range checks, handles all special cases, but it is slow + if (pSrc >= pEnd) + { + + if (ch == 0) + { + // Unroll any fallback that happens at the end + ch = fallbackUsed ? EncoderReplacementFallbackBuffer_InternalGetNextChar(&self->buffer.encoder) : 0; + if (ch > 0) + { + byteCount++; + goto ProcessChar; + } + } + else + { + // Case of surrogates in the fallback. + if (fallbackUsed && self->buffer.encoder.bFallingBack) + { + assert(ch >= 0xD800 && ch <= 0xDBFF); + + ch = EncoderReplacementFallbackBuffer_InternalGetNextChar(&self->buffer.encoder); + byteCount++; + + if (InRange(ch, LOW_SURROGATE_START, LOW_SURROGATE_END)) + { + ch = 0xfffd; + byteCount++; + goto EncodeChar; + } + else if (ch > 0) + { + goto ProcessChar; + } + else + { + byteCount--; // ignore last one. + break; + } + } + } + + if (ch <= 0) + { + break; + } + + // attempt to encode the partial surrogate (will fallback or ignore it), it'll also subtract 1. + byteCount++; + goto EncodeChar; + } + + if (ch > 0) + { + assert(ch >= 0xD800 && ch <= 0xDBFF); + + // use separate helper variables for local contexts so that the jit optimizations + // won't get confused about the variable lifetimes + int cha = *pSrc; + + // count the pending surrogate + byteCount++; + + // In previous byte, we encountered a high surrogate, so we are expecting a low surrogate here. + if (InRange(cha, LOW_SURROGATE_START, LOW_SURROGATE_END)) + { + // Don't need a real # because we're just counting, anything > 0x7ff ('cept surrogate) will do. + ch = 0xfffd; + // ch = cha + (ch << 10) + + // (0x10000 + // - LOW_SURROGATE_START + // - (HIGH_SURROGATE_START << 10) ); + + // Use this next char + pSrc++; + } + // else ch is still high surrogate and encoding will fail (so don't add count) + + // attempt to encode the surrogate or partial surrogate + goto EncodeChar; + } + + // If we've used a fallback, then we have to check for it + if (fallbackUsed) + { + ch = EncoderReplacementFallbackBuffer_InternalGetNextChar(&self->buffer.encoder); + if (ch > 0) + { + // We have an extra byte we weren't expecting. + byteCount++; + goto ProcessChar; + } + } + + // read next char. The JIT optimization seems to be getting confused when + // compiling "ch = *pSrc++;", so rather use "ch = *pSrc; pSrc++;" instead + ch = *pSrc; + pSrc++; + + ProcessChar: + if (InRange(ch, HIGH_SURROGATE_START, HIGH_SURROGATE_END)) + { + // we will count this surrogate next time around + byteCount--; + continue; + } + // either good char or partial surrogate + + EncodeChar: + // throw exception on partial surrogate if necessary + if (InRange(ch, HIGH_SURROGATE_START, LOW_SURROGATE_END)) + { + // Lone surrogates aren't allowed + // Have to make a fallback buffer if we don't have one + if (!fallbackUsed) + { + // wait on fallbacks if we can + // For fallback we may need a fallback buffer + fallbackUsed = true; + + // Set our internal fallback interesting things. + EncoderReplacementFallbackBuffer_InternalInitialize(&self->buffer.encoder, chars, chars + count, false); + } + + // Do our fallback. Actually we already know its a mixed up surrogate, + // so the ref pSrc isn't gonna do anything. + EncoderReplacementFallbackBuffer_InternalFallback(&self->buffer.encoder, (CHAR16_T)ch, &pSrc); + + // Ignore it if we don't throw (we had preallocated this ch) + byteCount--; + ch = 0; + continue; + } + + // Count them + if (ch > 0x7F) + { + if (ch > 0x7FF) + { + // the extra surrogate byte was compensated by the second surrogate character + // (2 surrogates make 4 bytes. We've already counted 2 bytes, 1 per char) + byteCount++; + } + byteCount++; + } + +#if WIN64 + // check for overflow + if (byteCount < 0) + { + break; + } +#endif + + // If still have fallback don't do fast loop + if (fallbackUsed && (ch = EncoderReplacementFallbackBuffer_InternalGetNextChar(&self->buffer.encoder)) != 0) + { + // We're reserving 1 byte for each char by default + byteCount++; + goto ProcessChar; + } + + size_t availableChars = (size_t)(pEnd - pSrc); + + // don't fall into the fast decoding loop if we don't have enough characters + if (availableChars <= 13) + { + // try to get over the remainder of the ascii characters fast though + CHAR16_T* pLocalEnd = pEnd; // hint to get pLocalEnd enregistered + while (pSrc < pLocalEnd) + { + ch = *pSrc; + pSrc++; + if (ch > 0x7F) goto ProcessChar; + } + + // we are done + break; + } + +#if WIN64 + // make sure that we won't get a silent overflow inside the fast loop + // (Fall out to slow loop if we have this many characters) + availableChars &= 0x0FFFFFFF; +#endif + + // To compute the upper bound, assume that all characters are ASCII characters at this point, + // the boundary will be decreased for every non-ASCII character we encounter + // Also, we need 3 + 4 chars reserve for the unrolled ansi decoding loop and for decoding of surrogates + CHAR16_T *pStop = pSrc + availableChars - (3 + 4); + + while (pSrc < pStop) + { + ch = *pSrc; + pSrc++; + + if (ch > 0x7F) // Not ASCII + { + if (ch > 0x7FF) // Not 2 Byte + { + if ((ch & 0xF800) == 0xD800) // See if its a Surrogate + goto LongCode; + byteCount++; + } + byteCount++; + } + + // get pSrc aligned + if (((size_t)pSrc & 0x2) != 0) + { + ch = *pSrc; + pSrc++; + if (ch > 0x7F) // Not ASCII + { + if (ch > 0x7FF) // Not 2 Byte + { + if ((ch & 0xF800) == 0xD800) // See if its a Surrogate + goto LongCode; + byteCount++; + } + byteCount++; + } + } + + // Run 2 * 4 characters at a time! + while (pSrc < pStop) + { + ch = *(int*)pSrc; + int chc = *(int*)(pSrc + 2); + if (((ch | chc) & (int)0xFF80FF80) != 0) // See if not ASCII + { + if (((ch | chc) & (int)0xF800F800) != 0) // See if not 2 Byte + { + goto LongCodeWithMask; + } + + + if ((ch & (int)0xFF800000) != 0) // Actually 0x07800780 is all we care about (4 bits) + byteCount++; + if ((ch & (int)0xFF80) != 0) + byteCount++; + if ((chc & (int)0xFF800000) != 0) + byteCount++; + if ((chc & (int)0xFF80) != 0) + byteCount++; + } + pSrc += 4; + + ch = *(int*)pSrc; + chc = *(int*)(pSrc + 2); + if (((ch | chc) & (int)0xFF80FF80) != 0) // See if not ASCII + { + if (((ch | chc) & (int)0xF800F800) != 0) // See if not 2 Byte + { + goto LongCodeWithMask; + } + + if ((ch & (int)0xFF800000) != 0) + byteCount++; + if ((ch & (int)0xFF80) != 0) + byteCount++; + if ((chc & (int)0xFF800000) != 0) + byteCount++; + if ((chc & (int)0xFF80) != 0) + byteCount++; + } + pSrc += 4; + } + break; + + LongCodeWithMask: +#if BIGENDIAN + // be careful about the sign extension + if (!self->treatAsLE) ch = (int)(((unsigned int)ch) >> 16); + else +#endif + ch = (CHAR16_T)ch; + + pSrc++; + + if (ch <= 0x7F) + { + continue; + } + + LongCode: + // use separate helper variables for slow and fast loop so that the jit optimizations + // won't get confused about the variable lifetimes + if (ch > 0x7FF) + { + if (InRange(ch, HIGH_SURROGATE_START, LOW_SURROGATE_END)) + { + // 4 byte encoding - high surrogate + low surrogate + + int chd = *pSrc; + if ( + ch > HIGH_SURROGATE_END || + !InRange(chd, LOW_SURROGATE_START, LOW_SURROGATE_END)) + { + // Back up and drop out to slow loop to figure out error + pSrc--; + break; + } + pSrc++; + + // byteCount - this byte is compensated by the second surrogate character + } + byteCount++; + } + byteCount++; + + // byteCount - the last byte is already included + } + + // no pending char at this point + ch = 0; + } + +#if WIN64 + // check for overflow + assert(byteCount >= 0); +#endif + assert(!fallbackUsed || self->buffer.encoder.fallbackCount < 0); + + return byteCount; +} + +size_t minipal_get_length_utf8_to_utf16(const char* source, size_t sourceLength, unsigned int flags) +{ + errno = 0; + + if (sourceLength == 0) + return 0; + + UTF8Encoding enc = + { + .buffer = { .decoder = { .fallbackCount = -1, .fallbackIndex = -1, .strDefault = { 0xFFFD, 0 }, .strDefaultLength = 1 } }, + .useFallback = !(flags & MINIPAL_MB_NO_REPLACE_INVALID_CHARS), +#if BIGENDIAN + .treatAsLE = (flags & MINIPAL_TREAT_AS_LITTLE_ENDIAN) +#endif + }; + + return GetCharCount(&enc, (unsigned char*)source, sourceLength); +} + +size_t minipal_get_length_utf16_to_utf8(const CHAR16_T* source, size_t sourceLength, unsigned int flags) +{ + errno = 0; + + if (sourceLength == 0) + return 0; + + UTF8Encoding enc = + { + // repeat replacement char (0xFFFD) twice for a surrogate pair + .buffer = { .encoder = { .fallbackCount = -1, .fallbackIndex = -1, .strDefault = { 0xFFFD, 0xFFFD, 0 }, .strDefaultLength = 2 } }, + .useFallback = true, +#if BIGENDIAN + .treatAsLE = (flags & MINIPAL_TREAT_AS_LITTLE_ENDIAN) +#endif + }; + +#if !BIGENDIAN + (void)flags; // unused +#endif + + return GetByteCount(&enc, (CHAR16_T*)source, sourceLength); +} + +size_t minipal_convert_utf8_to_utf16(const char* source, size_t sourceLength, CHAR16_T* destination, size_t destinationLength, unsigned int flags) +{ + size_t ret; + errno = 0; + + if (sourceLength == 0) + return 0; + + UTF8Encoding enc = + { + .buffer = { .decoder = { .fallbackCount = -1, .fallbackIndex = -1, .strDefault = { 0xFFFD, 0 }, .strDefaultLength = 1 } }, + .useFallback = !(flags & MINIPAL_MB_NO_REPLACE_INVALID_CHARS), +#if BIGENDIAN + .treatAsLE = (flags & MINIPAL_TREAT_AS_LITTLE_ENDIAN) +#endif + }; + + ret = GetChars(&enc, (unsigned char*)source, sourceLength, destination, destinationLength); + if (errno) ret = 0; + + return ret; +} + +size_t minipal_convert_utf16_to_utf8(const CHAR16_T* source, size_t sourceLength, char* destination, size_t destinationLength, unsigned int flags) +{ + size_t ret; + errno = 0; + + if (sourceLength == 0) + return 0; + + UTF8Encoding enc = + { + // repeat replacement char (0xFFFD) twice for a surrogate pair + .buffer = { .encoder = { .fallbackCount = -1, .fallbackIndex = -1, .strDefault = { 0xFFFD, 0xFFFD, 0 }, .strDefaultLength = 2 } }, + .useFallback = true, +#if BIGENDIAN + .treatAsLE = (flags & MINIPAL_TREAT_AS_LITTLE_ENDIAN) +#endif + }; + +#if !BIGENDIAN + (void)flags; // unused +#endif + + ret = GetBytes(&enc, (CHAR16_T*)source, sourceLength, (unsigned char*)destination, destinationLength); + if (errno) ret = 0; + + return ret; +} diff --git a/src/shared/native/minipal/utf8.h b/src/shared/native/minipal/utf8.h new file mode 100644 index 0000000000..009f0f0c17 --- /dev/null +++ b/src/shared/native/minipal/utf8.h @@ -0,0 +1,69 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_UTF8_H +#define HAVE_MINIPAL_UTF8_H + +#include +#include +#include + +#define MINIPAL_MB_NO_REPLACE_INVALID_CHARS 0x00000008 +#define MINIPAL_TREAT_AS_LITTLE_ENDIAN 0x00000016 +#define MINIPAL_ERROR_INSUFFICIENT_BUFFER 122L +#define MINIPAL_ERROR_NO_UNICODE_TRANSLATION 1113L + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/** + * Get length of destination needed for UTF-8 to UTF-16 (UCS-2) conversion + * + * @param source The source string in UTF-8 format. + * @param sourceLength Length of the source string. + * @param flags Flags to alter the behavior of converter. Supported flags are MINIPAL_MB_NO_REPLACE_INVALID_CHARS and MINIPAL_TREAT_AS_LITTLE_ENDIAN. + * @return Length of UTF-16 buffer required by the conversion. + */ +size_t minipal_get_length_utf8_to_utf16(const char* source, size_t sourceLength, unsigned int flags); + +/** + * Get length of destination needed for UTF-16 (UCS-2) to UTF-8 conversion + * + * @param source The source string in UTF-16 format. + * @param sourceLength Length of the source string. + * @param flags Flags to alter the behavior of converter. Supported flags are MINIPAL_MB_NO_REPLACE_INVALID_CHARS and MINIPAL_TREAT_AS_LITTLE_ENDIAN. + * @return Length of UTF-8 buffer required by the conversion. + */ +size_t minipal_get_length_utf16_to_utf8(const CHAR16_T* source, size_t sourceLength, unsigned int flags); + +/** + * Convert a string from UTF-8 to UTF-16 (UCS-2) with preallocated memory + * + * @param source The source string in UTF-8 format. + * @param sourceLength Length of the source string. + * @param destination Pointer to the destination UTF-16 string. It can be NULL to query number of items required by the conversion. + * @param destinationLength Length of the destination string. + * @param flags Flags to alter the behavior of converter. Supported flags are MINIPAL_MB_NO_REPLACE_INVALID_CHARS and MINIPAL_TREAT_AS_LITTLE_ENDIAN. + * @return Number of items written by the conversion. + */ +size_t minipal_convert_utf8_to_utf16(const char* source, size_t sourceLength, CHAR16_T* destination, size_t destinationLength, unsigned int flags); + +/** + * Convert a string from UTF-16 (UCS-2) to UTF-8 with preallocated memory + * + * @param source The source string in UTF-16 format. + * @param sourceLength Length of the source string. + * @param destination Pointer to the destination UTF-8 string. It can be NULL to query number of items required by the conversion. + * @param destinationLength Length of the destination string. + * @param flags Flags to alter the behavior of converter. Supported flags are MINIPAL_MB_NO_REPLACE_INVALID_CHARS and MINIPAL_TREAT_AS_LITTLE_ENDIAN. + * @return Number of items written by the conversion. + */ +size_t minipal_convert_utf16_to_utf8(const CHAR16_T* source, size_t sourceLength, char* destination, size_t destinationLength, unsigned int flags); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif /* HAVE_MINIPAL_UTF8_H */ diff --git a/src/shared/native/minipal/utils.h b/src/shared/native/minipal/utils.h new file mode 100644 index 0000000000..768de9e48b --- /dev/null +++ b/src/shared/native/minipal/utils.h @@ -0,0 +1,99 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef HAVE_MINIPAL_UTILS_H +#define HAVE_MINIPAL_UTILS_H + +#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0])) + +// Number of characters in a string literal. Excludes terminating NULL. +#define STRING_LENGTH(str) (ARRAY_SIZE(str) - 1) + +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif + +#ifdef __cplusplus +# ifndef __has_cpp_attribute +# define __has_cpp_attribute(x) 0 +# endif +# if __has_cpp_attribute(fallthrough) +# define FALLTHROUGH [[fallthrough]] +# else +# define FALLTHROUGH +# endif +#elif __has_attribute(fallthrough) +# define FALLTHROUGH __attribute__((fallthrough)) +#else +# define FALLTHROUGH +#endif + +#if defined(_MSC_VER) +#define LIBC_CALLBACK __cdecl +#else +#define LIBC_CALLBACK +#endif + +#if defined(_MSC_VER) +# if defined(__SANITIZE_ADDRESS__) +# define HAS_ADDRESS_SANITIZER +# define DISABLE_ASAN __declspec(no_sanitize_address) +# else +# define DISABLE_ASAN +# endif +#elif defined(__has_feature) +# if __has_feature(address_sanitizer) +# define HAS_ADDRESS_SANITIZER +# define DISABLE_ASAN __attribute__((no_sanitize("address"))) +# else +# define DISABLE_ASAN +# endif +#else +# define DISABLE_ASAN +#endif + +#if defined(_MSC_VER) +# ifdef SANITIZER_SHARED_RUNTIME +# define SANITIZER_CALLBACK_CALLCONV __declspec(dllexport no_sanitize_address) __cdecl +# define SANITIZER_INTERFACE_CALLCONV __declspec(dllimport) __cdecl +# else +# define SANITIZER_CALLBACK_CALLCONV __declspec(no_sanitize_address) __cdecl +# define SANITIZER_INTERFACE_CALLCONV __cdecl +# endif +#else +# ifdef SANITIZER_SHARED_RUNTIME +# define SANITIZER_CALLBACK_CALLCONV __attribute__((no_address_safety_analysis)) __attribute__((visibility("default"))) +# else +# define SANITIZER_CALLBACK_CALLCONV __attribute__((no_address_safety_analysis)) +# endif +# define SANITIZER_INTERFACE_CALLCONV +#endif + +#if defined(HAS_ADDRESS_SANITIZER) +# ifdef __cplusplus + extern "C" + { +# endif + void SANITIZER_INTERFACE_CALLCONV __asan_handle_no_return(void); +# ifdef __cplusplus + } +# endif +#elif defined(__llvm__) +# pragma clang diagnostic push +# ifdef COMPILER_SUPPORTS_W_RESERVED_IDENTIFIER +# pragma clang diagnostic ignored "-Wreserved-identifier" +# endif + // Stub out a dummy implmentation when asan isn't enabled. + inline void __asan_handle_no_return(void); + inline void __asan_handle_no_return(void){} +# pragma clang diagnostic pop +#else + // Use a macro for GCC since __asan_handle_no_return is always available as a built-in on GCC + #define __asan_handle_no_return() +#endif + +#endif // HAVE_MINIPAL_UTILS_H diff --git a/src/shared/pal/CMakeLists.txt b/src/shared/pal/CMakeLists.txt index 59f43049ad..9d94bc06d4 100644 --- a/src/shared/pal/CMakeLists.txt +++ b/src/shared/pal/CMakeLists.txt @@ -1,12 +1,11 @@ project(COREPAL) +include(../clrfeatures.cmake) + include_directories(${COREPAL_SOURCE_DIR}/inc) include_directories(${COREPAL_SOURCE_DIR}/src) +include_directories(${COREPAL_SOURCE_DIR}/../inc) add_compile_options(-fexceptions) -add_definitions(-DUSE_STL) - -remove_definitions(-DUNICODE) -remove_definitions(-D_UNICODE) add_subdirectory(src) diff --git a/src/shared/pal/inc/mbusafecrt.h b/src/shared/pal/inc/mbusafecrt.h index c2a12fc8c3..418629c52b 100644 --- a/src/shared/pal/inc/mbusafecrt.h +++ b/src/shared/pal/inc/mbusafecrt.h @@ -30,14 +30,6 @@ typedef int errno_t; // define the return value for success #define SAFECRT_SUCCESS 0 -#ifndef THROW_DECL -#if defined(_MSC_VER) || defined(__llvm__) || !defined(__cplusplus) -#define THROW_DECL -#else -#define THROW_DECL throw() -#endif // !_MSC_VER -#endif // !THROW_DECL - #ifdef __cplusplus extern "C" { #endif @@ -56,15 +48,9 @@ extern errno_t wcscpy_s( WCHAR* outDest, size_t inDestBufferSize, const WCHAR* i extern errno_t strncpy_s( char* outDest, size_t inDestBufferSize, const char* inSrc, size_t inCount ); extern errno_t wcsncpy_s( WCHAR* outDest, size_t inDestBufferSize, const WCHAR* inSrc, size_t inCount ); +extern errno_t wcsncpy_s( WCHAR* outDest, size_t inDestBufferSize, const WCHAR* inSrc, size_t inCount ); -extern char* strtok_s( char* inString, const char* inControl, char** ioContext ); -extern WCHAR* wcstok_s( WCHAR* inString, const WCHAR* inControl, WCHAR** ioContext ); - -// strnlen is not required unless the source string is completely untrusted (e.g. anonymous input on a website) -#ifndef SUPPRESS_STRNLEN - extern size_t PAL_strnlen( const char* inString, size_t inMaxSize ); - extern size_t PAL_wcsnlen( const WCHAR* inString, size_t inMaxSize ); -#endif +extern size_t PAL_wcsnlen( const WCHAR* inString, size_t inMaxSize ); extern errno_t _itoa_s( int inValue, char* outBuffer, size_t inDestBufferSize, int inRadix ); extern errno_t _itow_s( int inValue, WCHAR* outBuffer, size_t inDestBufferSize, int inRadix ); @@ -81,7 +67,6 @@ extern errno_t _makepath_s( char* outDest, size_t inDestBufferSize, const char* extern errno_t _wmakepath_s( WCHAR* outDest, size_t inDestBufferSize, const WCHAR* inDrive, const WCHAR* inDirectory, const WCHAR* inFilename, const WCHAR* inExtension ); extern errno_t _splitpath_s( const char* inPath, char* outDrive, size_t inDriveSize, char* outDirectory, size_t inDirectorySize, char* outFilename, size_t inFilenameSize, char* outExtension, size_t inExtensionSize ); -extern errno_t _wsplitpath_s( const WCHAR* inPath, WCHAR* outDrive, size_t inDriveSize, WCHAR* outDirectory, size_t inDirectorySize, WCHAR* outFilename, size_t inFilenameSize, WCHAR* outExtension, size_t inExtensionSize ); extern int sprintf_s( char *string, size_t sizeInBytes, const char *format, ... ); extern int swprintf_s( WCHAR *string, size_t sizeInWords, const WCHAR *format, ... ); @@ -98,7 +83,7 @@ extern int _vsnwprintf_s( WCHAR* string, size_t sizeInWords, size_t count, const extern int sscanf_s( const char *string, const char *format, ... ); extern int swscanf_s( const WCHAR *string, const WCHAR *format, ... ); -extern errno_t memcpy_s( void * dst, size_t sizeInBytes, const void * src, size_t count ) THROW_DECL; +extern errno_t memcpy_s( void * dst, size_t sizeInBytes, const void * src, size_t count ); extern errno_t memmove_s( void * dst, size_t sizeInBytes, const void * src, size_t count ); extern errno_t _wcslwr_s(char16_t *string, size_t sz); diff --git a/src/shared/pal/inc/pal.h b/src/shared/pal/inc/pal.h index cbdc93434b..56ace9321b 100644 --- a/src/shared/pal/inc/pal.h +++ b/src/shared/pal/inc/pal.h @@ -28,14 +28,11 @@ Module Name: If you want to add a PAL_ wrapper function to a native function in here, you also need to edit palinternal.h and win32pal.h. - - --*/ #ifndef __PAL_H__ #define __PAL_H__ -#ifdef PAL_STDCPP_COMPAT #include #include #include @@ -44,11 +41,28 @@ Module Name: #include #include #include +#include +#include #include #include #include #include #include +#include +#if defined(__has_include) + +#if __has_include() +#include +#endif // __has_include(alloca.h) +#endif // defined(__has_include) + +#ifdef __cplusplus +extern "C++" +{ + +#include + +} #endif #ifdef __cplusplus @@ -71,51 +85,18 @@ extern "C" { #include #include +#include // Native system libray handle. // On Unix systems, NATIVE_LIBRARY_HANDLE type represents a library handle not registered with the PAL. typedef PVOID NATIVE_LIBRARY_HANDLE; -/******************* Processor-specific glue *****************************/ - -#ifndef _MSC_VER - -#if defined(__i686__) && !defined(_M_IX86) -#define _M_IX86 600 -#elif defined(__i586__) && !defined(_M_IX86) -#define _M_IX86 500 -#elif defined(__i486__) && !defined(_M_IX86) -#define _M_IX86 400 -#elif defined(__i386__) && !defined(_M_IX86) -#define _M_IX86 300 -#elif defined(__x86_64__) && !defined(_M_AMD64) -#define _M_AMD64 100 -#elif defined(__arm__) && !defined(_M_ARM) -#define _M_ARM 7 -#elif defined(__aarch64__) && !defined(_M_ARM64) -#define _M_ARM64 1 -#elif defined(__s390x__) && !defined(_M_S390X) -#define _M_S390X 1 -#elif defined(__riscv) && (__riscv_xlen == 64) && !defined(_M_RISCV64) -#define _M_RISCV64 1 -#endif - -#if defined(_M_IX86) && !defined(HOST_X86) -#define HOST_X86 -#elif defined(_M_AMD64) && !defined(HOST_AMD64) -#define HOST_AMD64 -#elif defined(_M_ARM) && !defined(HOST_ARM) -#define HOST_ARM -#elif defined(_M_ARM64) && !defined(HOST_ARM64) -#define HOST_ARM64 -#elif defined(_M_S390X) && !defined(HOST_S390X) -#define HOST_S390X -#elif defined(_M_RISCV64) && !defined(HOST_RISCV64) -#define HOST_RISCV64 +#if defined(HOST_ARM64) +// Flag to check if atomics feature is available on +// the machine +extern bool g_arm64_atomics_present; #endif -#endif // !_MSC_VER - /******************* ABI-specific glue *******************************/ #define MAX_PATH 260 @@ -143,20 +124,6 @@ typedef PVOID NATIVE_LIBRARY_HANDLE; #define LANG_ENGLISH 0x09 /******************* Compiler-specific glue *******************************/ -#ifndef THROW_DECL -#if defined(_MSC_VER) || !defined(__cplusplus) -#define THROW_DECL -#else -#define THROW_DECL throw() -#endif // !_MSC_VER -#endif // !THROW_DECL - -#ifdef __sun -#define MATH_THROW_DECL -#else -#define MATH_THROW_DECL THROW_DECL -#endif - #if defined(_MSC_VER) #define DECLSPEC_ALIGN(x) __declspec(align(x)) #else @@ -192,105 +159,15 @@ typedef PVOID NATIVE_LIBRARY_HANDLE; #ifndef NOOPT_ATTRIBUTE #if defined(__llvm__) #define NOOPT_ATTRIBUTE optnone -#elif defined(__GNUC__) +#else #define NOOPT_ATTRIBUTE optimize("O0") #endif #endif -#ifndef NODEBUG_ATTRIBUTE -#if defined(__llvm__) -#define NODEBUG_ATTRIBUTE __nodebug__ -#elif defined(__GNUC__) -#define NODEBUG_ATTRIBUTE __artificial__ -#endif -#endif - #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) (0) #endif -#ifndef FALLTHROUGH -#if __has_cpp_attribute(fallthrough) -#define FALLTHROUGH [[fallthrough]] -#else // __has_cpp_attribute(fallthrough) -#define FALLTHROUGH -#endif // __has_cpp_attribute(fallthrough) -#endif // FALLTHROUGH - -#ifndef PAL_STDCPP_COMPAT - -#if __GNUC__ - -typedef __builtin_va_list va_list; - -/* We should consider if the va_arg definition here is actually necessary. - Could we use the standard va_arg definition? */ - -#define va_start __builtin_va_start -#define va_arg __builtin_va_arg - -#define va_copy __builtin_va_copy -#define va_end __builtin_va_end - -#define VOID void - -#else // __GNUC__ - -typedef char * va_list; - -#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) ) - -#if _MSC_VER >= 1400 - -#ifdef __cplusplus -#define _ADDRESSOF(v) ( &reinterpret_cast(v) ) -#else -#define _ADDRESSOF(v) ( &(v) ) -#endif - -#define _crt_va_start(ap,v) ( ap = (va_list)_ADDRESSOF(v) + _INTSIZEOF(v) ) -#define _crt_va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) ) -#define _crt_va_end(ap) ( ap = (va_list)0 ) - -#define va_start _crt_va_start -#define va_arg _crt_va_arg -#define va_end _crt_va_end - -#else // _MSC_VER - -#define va_start(ap,v) (ap = (va_list) (&(v)) + _INTSIZEOF(v)) -#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) ) -#define va_end(ap) - -#endif // _MSC_VER - -#define va_copy(dest,src) (dest = src) - -#endif // __GNUC__ - -#define CHAR_BIT 8 - -#define SCHAR_MIN (-128) -#define SCHAR_MAX 127 -#define UCHAR_MAX 0xff - -#define SHRT_MIN (-32768) -#define SHRT_MAX 32767 -#define USHRT_MAX 0xffff - -#define INT_MIN (-2147483647 - 1) -#define INT_MAX 2147483647 -#define UINT_MAX 0xffffffff - -#define LONG_MIN (-2147483647L - 1) -#define LONG_MAX 2147483647L -#define ULONG_MAX 0xffffffffUL - -#define FLT_MAX 3.402823466e+38F -#define DBL_MAX 1.7976931348623157e+308 - -#endif // !PAL_STDCPP_COMPAT - /******************* PAL-Specific Entrypoints *****************************/ #define IsDebuggerPresent PAL_IsDebuggerPresent @@ -300,44 +177,6 @@ BOOL PALAPI PAL_IsDebuggerPresent(); -/* minimum signed 64 bit value */ -#define _I64_MIN (I64(-9223372036854775807) - 1) -/* maximum signed 64 bit value */ -#define _I64_MAX I64(9223372036854775807) -/* maximum unsigned 64 bit value */ -#define _UI64_MAX UI64(0xffffffffffffffff) - -#define _I8_MAX SCHAR_MAX -#define _I8_MIN SCHAR_MIN -#define _I16_MAX SHRT_MAX -#define _I16_MIN SHRT_MIN -#define _I32_MAX INT_MAX -#define _I32_MIN INT_MIN -#define _UI8_MAX UCHAR_MAX -#define _UI8_MIN UCHAR_MIN -#define _UI16_MAX USHRT_MAX -#define _UI16_MIN USHRT_MIN -#define _UI32_MAX UINT_MAX -#define _UI32_MIN UINT_MIN - -#undef NULL - -#if defined(__cplusplus) -#define NULL 0 -#else -#define NULL ((PVOID)0) -#endif - -#if defined(PAL_STDCPP_COMPAT) && !defined(__cplusplus) -#define nullptr NULL -#endif // defined(PAL_STDCPP_COMPAT) && !defined(__cplusplus) - -#ifndef PAL_STDCPP_COMPAT - -typedef __int64 time_t; -#define _TIME_T_DEFINED -#endif // !PAL_STDCPP_COMPAT - #define DLL_PROCESS_ATTACH 1 #define DLL_THREAD_ATTACH 2 #define DLL_THREAD_DETACH 3 @@ -393,6 +232,7 @@ PAL_UnregisterForRuntimeStartup( IN PVOID pUnregisterToken); static const unsigned int MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH = MAX_PATH; + PALIMPORT VOID PALAPI @@ -403,6 +243,7 @@ PAL_GetTransportName( IN DWORD id, IN const char *applicationGroupId, IN const char *suffix); + PALIMPORT VOID PALAPI @@ -425,26 +266,6 @@ PALAPI PAL_UnregisterModule( IN HINSTANCE hInstance); -PALIMPORT -BOOL -PALAPI -PAL_GetPALDirectoryW( - OUT LPWSTR lpDirectoryName, - IN OUT UINT* cchDirectoryName); - -PALIMPORT -BOOL -PALAPI -PAL_GetPALDirectoryA( - OUT LPSTR lpDirectoryName, - IN OUT UINT* cchDirectoryName); - -#ifdef UNICODE -#define PAL_GetPALDirectory PAL_GetPALDirectoryW -#else -#define PAL_GetPALDirectory PAL_GetPALDirectoryA -#endif - PALIMPORT VOID PALAPI @@ -564,34 +385,6 @@ CopyFileW( #define CopyFile CopyFileA #endif -PALIMPORT -BOOL -PALAPI -DeleteFileW( - IN LPCWSTR lpFileName); - -#ifdef UNICODE -#define DeleteFile DeleteFileW -#else -#define DeleteFile DeleteFileA -#endif - -#define MOVEFILE_REPLACE_EXISTING 0x00000001 -#define MOVEFILE_COPY_ALLOWED 0x00000002 - -PALIMPORT -BOOL -PALAPI -MoveFileExW( - IN LPCWSTR lpExistingFileName, - IN LPCWSTR lpNewFileName, - IN DWORD dwFlags); - -#ifdef UNICODE -#define MoveFileEx MoveFileExW -#else -#define MoveFileEx MoveFileExA -#endif PALIMPORT BOOL PALAPI @@ -604,19 +397,6 @@ RemoveDirectoryA( #define RemoveDirectory RemoveDirectoryA #endif -typedef struct _BY_HANDLE_FILE_INFORMATION { - DWORD dwFileAttributes; - FILETIME ftCreationTime; - FILETIME ftLastAccessTime; - FILETIME ftLastWriteTime; - DWORD dwVolumeSerialNumber; - DWORD nFileSizeHigh; - DWORD nFileSizeLow; - DWORD nNumberOfLinks; - DWORD nFileIndexHigh; - DWORD nFileIndexLow; -} BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION, *LPBY_HANDLE_FILE_INFORMATION; - typedef struct _WIN32_FIND_DATAA { DWORD dwFileAttributes; FILETIME ftCreationTime; @@ -773,12 +553,6 @@ PALAPI GetStdHandle( IN DWORD nStdHandle); -PALIMPORT -BOOL -PALAPI -SetEndOfFile( - IN HANDLE hFile); - PALIMPORT DWORD PALAPI @@ -976,6 +750,7 @@ typedef struct _PROCESS_INFORMATION { DWORD dwProcessId; DWORD dwThreadId_PAL_Undefined; } PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION; + PALIMPORT BOOL PALAPI @@ -1152,7 +927,27 @@ typedef struct _KNONVOLATILE_CONTEXT_POINTERS { } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS; + +// +// Context Frame +// +// +// The flags field within this record controls the contents of a CONTEXT +// record. +// +// If the context record is used as an input parameter, then for each +// portion of the context record controlled by a flag whose value is +// set, it is assumed that such portion of the context record contains +// valid context. If the context record is being used to modify a threads +// context, then only that portion of the threads context is modified. +// +// If the context record is used as an output parameter to capture the +// context of a thread, then only those portions of the thread's context +// corresponding to set flags will be returned. +// + #elif defined(HOST_AMD64) + // copied from winnt.h #define CONTEXT_AMD64 0x100000 @@ -1174,11 +969,33 @@ typedef struct _KNONVOLATILE_CONTEXT_POINTERS { #define CONTEXT_EXCEPTION_REQUEST 0x40000000 #define CONTEXT_EXCEPTION_REPORTING 0x80000000 +#define XSTATE_GSSE (2) +#define XSTATE_AVX (XSTATE_GSSE) +#define XSTATE_AVX512_KMASK (5) +#define XSTATE_AVX512_ZMM_H (6) +#define XSTATE_AVX512_ZMM (7) + +#define XSTATE_MASK_GSSE (UI64(1) << (XSTATE_GSSE)) +#define XSTATE_MASK_AVX (XSTATE_MASK_GSSE) +#define XSTATE_MASK_AVX512 ((UI64(1) << (XSTATE_AVX512_KMASK)) | \ + (UI64(1) << (XSTATE_AVX512_ZMM_H)) | \ + (UI64(1) << (XSTATE_AVX512_ZMM))) + typedef struct DECLSPEC_ALIGN(16) _M128A { ULONGLONG Low; LONGLONG High; } M128A, *PM128A; +typedef struct DECLSPEC_ALIGN(16) _M256 { + M128A Low; + M128A High; +} M256, *PM256; + +typedef struct DECLSPEC_ALIGN(16) _M512 { + M256 Low; + M256 High; +} M512, *PM512; + typedef struct _XMM_SAVE_AREA32 { WORD ControlWord; WORD StatusWord; @@ -1198,42 +1015,15 @@ typedef struct _XMM_SAVE_AREA32 { BYTE Reserved4[96]; } XMM_SAVE_AREA32, *PXMM_SAVE_AREA32; -#define LEGACY_SAVE_AREA_LENGTH sizeof(XMM_SAVE_AREA32) +typedef struct DECLSPEC_ALIGN(16) _CONTEXT { -// -// Context Frame -// -// This frame has a several purposes: 1) it is used as an argument to -// NtContinue, 2) is is used to constuct a call frame for APC delivery, -// and 3) it is used in the user level thread creation routines. -// -// -// The flags field within this record controls the contents of a CONTEXT -// record. -// -// If the context record is used as an input parameter, then for each -// portion of the context record controlled by a flag whose value is -// set, it is assumed that that portion of the context record contains -// valid context. If the context record is being used to modify a threads -// context, then only that portion of the threads context is modified. -// -// If the context record is used as an output parameter to capture the -// context of a thread, then only those portions of the thread's context -// corresponding to set flags will be returned. -// -// CONTEXT_CONTROL specifies SegSs, Rsp, SegCs, Rip, and EFlags. -// -// CONTEXT_INTEGER specifies Rax, Rcx, Rdx, Rbx, Rbp, Rsi, Rdi, and R8-R15. -// -// CONTEXT_SEGMENTS specifies SegDs, SegEs, SegFs, and SegGs. -// -// CONTEXT_DEBUG_REGISTERS specifies Dr0-Dr3 and Dr6-Dr7. -// -// CONTEXT_MMX_REGISTERS specifies the floating point and extended registers -// Mm0/St0-Mm7/St7 and Xmm0-Xmm15). -// + _CONTEXT() = default; + _CONTEXT(const _CONTEXT& ctx) + { + *this = ctx; + } -typedef struct DECLSPEC_ALIGN(16) _CONTEXT { + _CONTEXT& operator=(const _CONTEXT& ctx); // // Register parameter home addresses. @@ -1350,6 +1140,82 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT { DWORD64 LastBranchFromRip; DWORD64 LastExceptionToRip; DWORD64 LastExceptionFromRip; + + // XSTATE + DWORD64 XStateFeaturesMask; + DWORD64 XStateReserved0; + + // XSTATE_AVX + struct { + M128A Ymm0H; + M128A Ymm1H; + M128A Ymm2H; + M128A Ymm3H; + M128A Ymm4H; + M128A Ymm5H; + M128A Ymm6H; + M128A Ymm7H; + M128A Ymm8H; + M128A Ymm9H; + M128A Ymm10H; + M128A Ymm11H; + M128A Ymm12H; + M128A Ymm13H; + M128A Ymm14H; + M128A Ymm15H; + }; + + // XSTATE_AVX512_KMASK + struct { + DWORD64 KMask0; + DWORD64 KMask1; + DWORD64 KMask2; + DWORD64 KMask3; + DWORD64 KMask4; + DWORD64 KMask5; + DWORD64 KMask6; + DWORD64 KMask7; + }; + + // XSTATE_AVX512_ZMM_H + struct { + M256 Zmm0H; + M256 Zmm1H; + M256 Zmm2H; + M256 Zmm3H; + M256 Zmm4H; + M256 Zmm5H; + M256 Zmm6H; + M256 Zmm7H; + M256 Zmm8H; + M256 Zmm9H; + M256 Zmm10H; + M256 Zmm11H; + M256 Zmm12H; + M256 Zmm13H; + M256 Zmm14H; + M256 Zmm15H; + }; + + // XSTATE_AVX512_ZMM + struct { + M512 Zmm16; + M512 Zmm17; + M512 Zmm18; + M512 Zmm19; + M512 Zmm20; + M512 Zmm21; + M512 Zmm22; + M512 Zmm23; + M512 Zmm24; + M512 Zmm25; + M512 Zmm26; + M512 Zmm27; + M512 Zmm28; + M512 Zmm29; + M512 Zmm30; + M512 Zmm31; + }; } CONTEXT, *PCONTEXT, *LPCONTEXT; // @@ -1446,37 +1312,6 @@ typedef struct _NEON128 { LONGLONG High; } NEON128, *PNEON128; -// -// Context Frame -// -// This frame has a several purposes: 1) it is used as an argument to -// NtContinue, 2) it is used to constuct a call frame for APC delivery, -// and 3) it is used in the user level thread creation routines. -// -// -// The flags field within this record controls the contents of a CONTEXT -// record. -// -// If the context record is used as an input parameter, then for each -// portion of the context record controlled by a flag whose value is -// set, it is assumed that that portion of the context record contains -// valid context. If the context record is being used to modify a threads -// context, then only that portion of the threads context is modified. -// -// If the context record is used as an output parameter to capture the -// context of a thread, then only those portions of the thread's context -// corresponding to set flags will be returned. -// -// CONTEXT_CONTROL specifies Sp, Lr, Pc, and Cpsr -// -// CONTEXT_INTEGER specifies R0-R12 -// -// CONTEXT_FLOATING_POINT specifies Q0-Q15 / D0-D31 / S0-S31 -// -// CONTEXT_DEBUG_REGISTERS specifies up to 16 of DBGBVR, DBGBCR, DBGWVR, -// DBGWCR. -// - typedef struct DECLSPEC_ALIGN(8) _CONTEXT { // @@ -1601,6 +1436,12 @@ typedef struct _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY { #define CONTEXT_EXCEPTION_REQUEST 0x40000000L #define CONTEXT_EXCEPTION_REPORTING 0x80000000L +#define CONTEXT_ARM64_XSTATE (CONTEXT_ARM64 | 0x20L) +#define CONTEXT_XSTATE CONTEXT_ARM64_XSTATE + +#define XSTATE_ARM64_SVE (2) +#define XSTATE_MASK_ARM64_SVE (UI64(1) << (XSTATE_ARM64_SVE)) + // // This flag is set by the unwinder if it has unwound to a call // site, and cleared whenever it unwinds through a trap frame. @@ -1628,37 +1469,6 @@ typedef struct _IMAGE_ARM_RUNTIME_FUNCTION_ENTRY { #define ARM64_MAX_BREAKPOINTS 8 #define ARM64_MAX_WATCHPOINTS 2 -// -// Context Frame -// -// This frame has a several purposes: 1) it is used as an argument to -// NtContinue, 2) it is used to constuct a call frame for APC delivery, -// and 3) it is used in the user level thread creation routines. -// -// -// The flags field within this record controls the contents of a CONTEXT -// record. -// -// If the context record is used as an input parameter, then for each -// portion of the context record controlled by a flag whose value is -// set, it is assumed that that portion of the context record contains -// valid context. If the context record is being used to modify a threads -// context, then only that portion of the threads context is modified. -// -// If the context record is used as an output parameter to capture the -// context of a thread, then only those portions of the thread's context -// corresponding to set flags will be returned. -// -// CONTEXT_CONTROL specifies Sp, Lr, Pc, and Cpsr -// -// CONTEXT_INTEGER specifies R0-R12 -// -// CONTEXT_FLOATING_POINT specifies Q0-Q15 / D0-D31 / S0-S31 -// -// CONTEXT_DEBUG_REGISTERS specifies up to 16 of DBGBVR, DBGBCR, DBGWVR, -// DBGWCR. -// - typedef struct _NEON128 { ULONGLONG Low; LONGLONG High; @@ -1732,7 +1542,18 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT { /* +0x338 */ DWORD64 Bvr[ARM64_MAX_BREAKPOINTS]; /* +0x378 */ DWORD Wcr[ARM64_MAX_WATCHPOINTS]; /* +0x380 */ DWORD64 Wvr[ARM64_MAX_WATCHPOINTS]; - /* +0x390 */ + + /* +0x390 */ DWORD64 XStateFeaturesMask; + + // + // Sve Registers + // + // TODO-SVE: Support Vector register sizes >128bit + // For 128bit, Z and V registers fully overlap, so there is no need to load/store both. + /* +0x398 */ DWORD Vl; + /* +0x39c */ DWORD Ffr; + /* +0x3a0 */ DWORD P[16]; + /* +0x3e0 */ } CONTEXT, *PCONTEXT, *LPCONTEXT; @@ -1766,16 +1587,43 @@ typedef struct _KNONVOLATILE_CONTEXT_POINTERS { } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS; -#elif defined(HOST_RISCV64) +typedef struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY { + DWORD BeginAddress; + union { + DWORD UnwindData; + struct { + DWORD Flag : 2; + DWORD FunctionLength : 11; + DWORD RegF : 3; + DWORD RegI : 4; + DWORD H : 1; + DWORD CR : 2; + DWORD FrameSize : 9; + }; + }; +} IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY, * PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY; + +typedef union IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY_XDATA { + ULONG HeaderData; + struct { + ULONG FunctionLength : 18; // in words (2 bytes) + ULONG Version : 2; + ULONG ExceptionDataPresent : 1; + ULONG EpilogInHeader : 1; + ULONG EpilogCount : 5; // number of epilogs or byte index of the first unwind code for the one only epilog + ULONG CodeWords : 5; // number of dwords with unwind codes + }; +} IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY_XDATA; -// Please refer to src/coreclr/pal/src/arch/riscv64/asmconstants.h -#define CONTEXT_RISCV64 0x01000000L +#elif defined(HOST_LOONGARCH64) -#define CONTEXT_CONTROL (CONTEXT_RISCV64 | 0x1) -#define CONTEXT_INTEGER (CONTEXT_RISCV64 | 0x2) -#define CONTEXT_FLOATING_POINT (CONTEXT_RISCV64 | 0x4) -#define CONTEXT_DEBUG_REGISTERS (CONTEXT_RISCV64 | 0x8) +// Please refer to src/coreclr/pal/src/arch/loongarch64/asmconstants.h +#define CONTEXT_LOONGARCH64 0x00800000 +#define CONTEXT_CONTROL (CONTEXT_LOONGARCH64 | 0x1) +#define CONTEXT_INTEGER (CONTEXT_LOONGARCH64 | 0x2) +#define CONTEXT_FLOATING_POINT (CONTEXT_LOONGARCH64 | 0x4) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_LOONGARCH64 | 0x8) #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) #define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS) @@ -1798,12 +1646,12 @@ typedef struct _KNONVOLATILE_CONTEXT_POINTERS { // // Specify the number of breakpoints and watchpoints that the OS -// will track. Architecturally, RISCV64 supports up to 16. In practice, +// will track. Architecturally, LOONGARCH64 supports up to 16. In practice, // however, almost no one implements more than 4 of each. // -#define RISCV64_MAX_BREAKPOINTS 8 -#define RISCV64_MAX_WATCHPOINTS 2 +#define LOONGARCH64_MAX_BREAKPOINTS 8 +#define LOONGARCH64_MAX_WATCHPOINTS 2 typedef struct DECLSPEC_ALIGN(16) _CONTEXT { @@ -1818,22 +1666,29 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT { // DWORD64 R0; DWORD64 Ra; - DWORD64 Sp; - DWORD64 Gp; DWORD64 Tp; - DWORD64 T0; - DWORD64 T1; - DWORD64 T2; - DWORD64 Fp; - DWORD64 S1; - DWORD64 A0; - DWORD64 A1; + DWORD64 Sp; + DWORD64 A0;//DWORD64 V0; + DWORD64 A1;//DWORD64 V1; DWORD64 A2; DWORD64 A3; DWORD64 A4; DWORD64 A5; DWORD64 A6; DWORD64 A7; + DWORD64 T0; + DWORD64 T1; + DWORD64 T2; + DWORD64 T3; + DWORD64 T4; + DWORD64 T5; + DWORD64 T6; + DWORD64 T7; + DWORD64 T8; + DWORD64 X0; + DWORD64 Fp; + DWORD64 S0; + DWORD64 S1; DWORD64 S2; DWORD64 S3; DWORD64 S4; @@ -1841,13 +1696,127 @@ typedef struct DECLSPEC_ALIGN(16) _CONTEXT { DWORD64 S6; DWORD64 S7; DWORD64 S8; - DWORD64 S9; - DWORD64 S10; - DWORD64 S11; - DWORD64 T3; - DWORD64 T4; - DWORD64 T5; - DWORD64 T6; + DWORD64 Pc; + + // + // Floating Point Registers: FPR64/LSX/LASX. + // + ULONGLONG F[4*32]; + DWORD64 Fcc; + DWORD Fcsr; +} CONTEXT, *PCONTEXT, *LPCONTEXT; + +// +// Nonvolatile context pointer record. +// + +typedef struct _KNONVOLATILE_CONTEXT_POINTERS { + + PDWORD64 S0; + PDWORD64 S1; + PDWORD64 S2; + PDWORD64 S3; + PDWORD64 S4; + PDWORD64 S5; + PDWORD64 S6; + PDWORD64 S7; + PDWORD64 S8; + PDWORD64 Fp; + PDWORD64 Tp; + PDWORD64 Ra; + + PDWORD64 F24; + PDWORD64 F25; + PDWORD64 F26; + PDWORD64 F27; + PDWORD64 F28; + PDWORD64 F29; + PDWORD64 F30; + PDWORD64 F31; +} KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS; + +#elif defined(HOST_RISCV64) + +// Please refer to src/coreclr/pal/src/arch/riscv64/asmconstants.h +#define CONTEXT_RISCV64 0x01000000L + +#define CONTEXT_CONTROL (CONTEXT_RISCV64 | 0x1) +#define CONTEXT_INTEGER (CONTEXT_RISCV64 | 0x2) +#define CONTEXT_FLOATING_POINT (CONTEXT_RISCV64 | 0x4) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_RISCV64 | 0x8) + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) + +#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS) + +#define CONTEXT_EXCEPTION_ACTIVE 0x8000000 +#define CONTEXT_SERVICE_ACTIVE 0x10000000 +#define CONTEXT_EXCEPTION_REQUEST 0x40000000 +#define CONTEXT_EXCEPTION_REPORTING 0x80000000 + +// +// This flag is set by the unwinder if it has unwound to a call +// site, and cleared whenever it unwinds through a trap frame. +// It is used by language-specific exception handlers to help +// differentiate exception scopes during dispatching. +// + +#define CONTEXT_UNWOUND_TO_CALL 0x20000000 + +// begin_ntoshvp + +// +// Specify the number of breakpoints and watchpoints that the OS +// will track. Architecturally, RISCV64 supports up to 16. In practice, +// however, almost no one implements more than 4 of each. +// + +#define RISCV64_MAX_BREAKPOINTS 8 +#define RISCV64_MAX_WATCHPOINTS 2 + +typedef struct DECLSPEC_ALIGN(16) _CONTEXT { + + // + // Control flags. + // + + /* +0x000 */ DWORD ContextFlags; + + // + // Integer registers. + // + DWORD64 R0; + DWORD64 Ra; + DWORD64 Sp; + DWORD64 Gp; + DWORD64 Tp; + DWORD64 T0; + DWORD64 T1; + DWORD64 T2; + DWORD64 Fp; + DWORD64 S1; + DWORD64 A0; + DWORD64 A1; + DWORD64 A2; + DWORD64 A3; + DWORD64 A4; + DWORD64 A5; + DWORD64 A6; + DWORD64 A7; + DWORD64 S2; + DWORD64 S3; + DWORD64 S4; + DWORD64 S5; + DWORD64 S6; + DWORD64 S7; + DWORD64 S8; + DWORD64 S9; + DWORD64 S10; + DWORD64 S11; + DWORD64 T3; + DWORD64 T4; + DWORD64 T5; + DWORD64 T6; DWORD64 Pc; // @@ -2000,6 +1969,153 @@ typedef struct _KNONVOLATILE_CONTEXT_POINTERS { } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS; +#elif defined(HOST_POWERPC64) + +// There is no context for ppc64le defined in winnt.h, +// so we re-use the amd64 values. +#define CONTEXT_PPC64 0x100000 + +#define CONTEXT_CONTROL (CONTEXT_PPC64 | 0x1L) +#define CONTEXT_INTEGER (CONTEXT_PPC64 | 0x2L) +#define CONTEXT_FLOATING_POINT (CONTEXT_PPC64 | 0x4L) + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) + +#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) + +#define CONTEXT_EXCEPTION_ACTIVE 0x8000000 +#define CONTEXT_SERVICE_ACTIVE 0x10000000 +#define CONTEXT_EXCEPTION_REQUEST 0x40000000 +#define CONTEXT_EXCEPTION_REPORTING 0x80000000 + +typedef struct DECLSPEC_ALIGN(16) _CONTEXT { + + // + // Control flags. + // + + DWORD ContextFlags; + + // + // Integer Registers + // + + DWORD64 R0; + DWORD64 R1; + DWORD64 R2; + DWORD64 R3; + DWORD64 R4; + DWORD64 R5; + DWORD64 R6; + DWORD64 R7; + DWORD64 R8; + DWORD64 R9; + DWORD64 R10; + DWORD64 R11; + DWORD64 R12; + DWORD64 R13; + DWORD64 R14; + DWORD64 R15; + DWORD64 R16; + DWORD64 R17; + DWORD64 R18; + DWORD64 R19; + DWORD64 R20; + DWORD64 R21; + DWORD64 R22; + DWORD64 R23; + DWORD64 R24; + DWORD64 R25; + DWORD64 R26; + DWORD64 R27; + DWORD64 R28; + DWORD64 R29; + DWORD64 R30; + DWORD64 R31; + + // + // Floaring Point Registers + // + + DWORD64 F0; + DWORD64 F1; + DWORD64 F2; + DWORD64 F3; + DWORD64 F4; + DWORD64 F5; + DWORD64 F6; + DWORD64 F7; + DWORD64 F8; + DWORD64 F9; + DWORD64 F10; + DWORD64 F11; + DWORD64 F12; + DWORD64 F13; + DWORD64 F14; + DWORD64 F15; + DWORD64 F16; + DWORD64 F17; + DWORD64 F18; + DWORD64 F19; + DWORD64 F20; + DWORD64 F21; + DWORD64 F22; + DWORD64 F23; + DWORD64 F24; + DWORD64 F25; + DWORD64 F26; + DWORD64 F27; + DWORD64 F28; + DWORD64 F29; + DWORD64 F30; + DWORD64 F31; + DWORD64 Fpscr; + + // + // Control Registers + // + + DWORD64 Nip; + DWORD64 Msr; + DWORD64 Ctr; + DWORD64 Link; + + DWORD Xer; + DWORD Ccr; + + +} CONTEXT, *PCONTEXT, *LPCONTEXT; + +// +// Nonvolatile context pointer record. +// + +typedef struct _KNONVOLATILE_CONTEXT_POINTERS { + PDWORD64 R14; + PDWORD64 R15; + PDWORD64 R16; + PDWORD64 R17; + PDWORD64 R18; + PDWORD64 R19; + PDWORD64 R20; + PDWORD64 R21; + PDWORD64 R22; + PDWORD64 R23; + PDWORD64 R24; + PDWORD64 R25; + PDWORD64 R26; + PDWORD64 R27; + PDWORD64 R28; + PDWORD64 R29; + PDWORD64 R30; + PDWORD64 R31; + + // + // Need to add Floating point non-volatile registers. + // + +} KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS; + #else #error Unknown architecture for defining CONTEXT. #endif @@ -2018,7 +2134,7 @@ GetThreadTimes( #if defined(__APPLE__) && defined(__i386__) #define PAL_CS_NATIVE_DATA_SIZE 76 -#elif defined(__APPLE__) && defined(__x86_64__) +#elif defined(__APPLE__) && defined(HOST_AMD64) #define PAL_CS_NATIVE_DATA_SIZE 120 #elif defined(__APPLE__) && defined(HOST_ARM64) #define PAL_CS_NATIVE_DATA_SIZE 120 @@ -2026,16 +2142,20 @@ GetThreadTimes( #define PAL_CS_NATIVE_DATA_SIZE 12 #elif defined(__FreeBSD__) && defined(__x86_64__) #define PAL_CS_NATIVE_DATA_SIZE 24 +#elif defined(__FreeBSD__) && defined(HOST_ARM64) +#define PAL_CS_NATIVE_DATA_SIZE 24 #elif defined(__linux__) && defined(HOST_ARM) #define PAL_CS_NATIVE_DATA_SIZE 80 #elif defined(__linux__) && defined(HOST_ARM64) -#define PAL_CS_NATIVE_DATA_SIZE 116 +#define PAL_CS_NATIVE_DATA_SIZE 104 #elif defined(__linux__) && defined(__i386__) #define PAL_CS_NATIVE_DATA_SIZE 76 #elif defined(__linux__) && defined(__x86_64__) #define PAL_CS_NATIVE_DATA_SIZE 96 #elif defined(__linux__) && defined(HOST_S390X) #define PAL_CS_NATIVE_DATA_SIZE 96 +#elif defined(__linux__) && defined(HOST_POWERPC64) +#define PAL_CS_NATIVE_DATA_SIZE 96 #elif defined(__NetBSD__) && defined(__amd64__) #define PAL_CS_NATIVE_DATA_SIZE 96 #elif defined(__NetBSD__) && defined(__earm__) @@ -2044,10 +2164,11 @@ GetThreadTimes( #define PAL_CS_NATIVE_DATA_SIZE 56 #elif defined(__sun) && defined(__x86_64__) #define PAL_CS_NATIVE_DATA_SIZE 48 +#elif defined(__linux__) && defined(__loongarch64) +#define PAL_CS_NATIVE_DATA_SIZE 96 #elif defined(__linux__) && defined(__riscv) && __riscv_xlen == 64 #define PAL_CS_NATIVE_DATA_SIZE 96 #else -#warning #error PAL_CS_NATIVE_DATA_SIZE is not defined for this architecture #endif @@ -2074,18 +2195,7 @@ typedef struct _CRITICAL_SECTION { PALIMPORT VOID PALAPI EnterCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection); PALIMPORT VOID PALAPI LeaveCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection); PALIMPORT VOID PALAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection); -PALIMPORT BOOL PALAPI InitializeCriticalSectionEx(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags); PALIMPORT VOID PALAPI DeleteCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection); -PALIMPORT BOOL PALAPI TryEnterCriticalSection(IN OUT LPCRITICAL_SECTION lpCriticalSection); - -#define SEM_FAILCRITICALERRORS 0x0001 -#define SEM_NOOPENFILEERRORBOX 0x8000 - -PALIMPORT -UINT -PALAPI -SetErrorMode( - IN UINT uMode); #define PAGE_NOACCESS 0x01 #define PAGE_READONLY 0x02 @@ -2099,7 +2209,6 @@ SetErrorMode( #define MEM_RESERVE 0x2000 #define MEM_DECOMMIT 0x4000 #define MEM_RELEASE 0x8000 -#define MEM_RESET 0x80000 #define MEM_FREE 0x10000 #define MEM_PRIVATE 0x20000 #define MEM_MAPPED 0x40000 @@ -2147,16 +2256,6 @@ CreateFileMappingW( #define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS #define FILE_MAP_COPY SECTION_QUERY -PALIMPORT -HANDLE -PALAPI -OpenFileMappingW( - IN DWORD dwDesiredAccess, - IN BOOL bInheritHandle, - IN LPCWSTR lpName); - -#define OpenFileMapping OpenFileMappingW - typedef INT_PTR (PALAPI_NOEXPORT *FARPROC)(); PALIMPORT @@ -2293,24 +2392,6 @@ VirtualProtect( IN DWORD flNewProtect, OUT PDWORD lpflOldProtect); -typedef struct _MEMORYSTATUSEX { - DWORD dwLength; - DWORD dwMemoryLoad; - DWORDLONG ullTotalPhys; - DWORDLONG ullAvailPhys; - DWORDLONG ullTotalPageFile; - DWORDLONG ullAvailPageFile; - DWORDLONG ullTotalVirtual; - DWORDLONG ullAvailVirtual; - DWORDLONG ullAvailExtendedVirtual; -} MEMORYSTATUSEX, *LPMEMORYSTATUSEX; - -PALIMPORT -BOOL -PALAPI -GlobalMemoryStatusEx( - IN OUT LPMEMORYSTATUSEX lpBuffer); - typedef struct _MEMORY_BASIC_INFORMATION { PVOID BaseAddress; PVOID AllocationBase_PAL_Undefined; @@ -2429,13 +2510,17 @@ enum { // // A function table entry is generated for each frame function. // +#if defined(HOST_ARM64) +typedef IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY RUNTIME_FUNCTION, *PRUNTIME_FUNCTION; +#else // HOST_ARM64 typedef struct _RUNTIME_FUNCTION { DWORD BeginAddress; -#ifdef TARGET_AMD64 +#ifdef HOST_AMD64 DWORD EndAddress; #endif DWORD UnwindData; } RUNTIME_FUNCTION, *PRUNTIME_FUNCTION; +#endif // HOST_ARM64 #define STANDARD_RIGHTS_REQUIRED (0x000F0000L) #define SYNCHRONIZE (0x00100000L) @@ -2557,6 +2642,17 @@ PALAPI CloseHandle( IN OUT HANDLE hObject); + + +PALIMPORT +VOID +PALAPI +DECLSPEC_NORETURN +RaiseFailFastException( + IN PEXCEPTION_RECORD pExceptionRecord, + IN PCONTEXT pContextRecord, + IN DWORD dwFlags); + PALIMPORT DWORD PALAPI @@ -2642,7 +2738,7 @@ BitScanForward64( // intrinsic, which returns the number of leading 0-bits in x starting at the most significant // bit position (the result is undefined when x = 0). // -// The same is true for BitScanReverse, except that the GCC function is __builtin_clzl. +// The same is true for BitScanReverse, except that the GCC function is __builtin_clz. EXTERN_C PALIMPORT @@ -2653,12 +2749,12 @@ BitScanReverse( IN OUT PDWORD Index, IN UINT qwMask) { - // The result of __builtin_clzl is undefined when qwMask is zero, + // The result of __builtin_clz is undefined when qwMask is zero, // but it's still OK to call the intrinsic in that case (just don't use the output). // Unconditionally calling the intrinsic in this way allows the compiler to // emit branchless code for this function when possible (depending on how the // intrinsic is implemented for the target platform). - int lzcount = __builtin_clzl(qwMask); + int lzcount = __builtin_clz(qwMask); *Index = (DWORD)(31 - lzcount); return qwMask != 0; } @@ -2684,7 +2780,7 @@ BitScanReverse64( FORCEINLINE void PAL_InterlockedOperationBarrier() { -#if defined(HOST_ARM64) || defined(HOST_RISCV64) +#if (defined(HOST_ARM64) && !defined(LSE_INSTRUCTIONS_ENABLED_BY_DEFAULT) && !defined(__clang__)) || defined(HOST_LOONGARCH64) || defined(HOST_RISCV64) // On arm64, most of the __sync* functions generate a code sequence like: // loop: // ldaxr (load acquire exclusive) @@ -2700,6 +2796,90 @@ FORCEINLINE void PAL_InterlockedOperationBarrier() #endif } +#if defined(HOST_ARM64) + +#if defined(LSE_INSTRUCTIONS_ENABLED_BY_DEFAULT) + +#define Define_InterlockMethod(RETURN_TYPE, METHOD_DECL, METHOD_INVOC, INTRINSIC_NAME) \ +EXTERN_C PALIMPORT inline RETURN_TYPE PALAPI METHOD_DECL \ +{ \ + return INTRINSIC_NAME; \ +} \ + +#else // !LSE_INSTRUCTIONS_ENABLED_BY_DEFAULT + +#define Define_InterlockMethod(RETURN_TYPE, METHOD_DECL, METHOD_INVOC, INTRINSIC_NAME) \ +/* Function multiversioning will never inline a method that is \ + marked such. However, just to make sure that we don't see \ + surprises, explicitely mark them as noinline. */ \ +EXTERN_C PALIMPORT inline RETURN_TYPE PALAPI \ +__attribute__((target("+lse"))) __attribute__((noinline)) \ +Lse_##METHOD_DECL \ +{ \ + return INTRINSIC_NAME; \ +} \ + \ +EXTERN_C PALIMPORT inline RETURN_TYPE PALAPI METHOD_DECL \ +{ \ + if (g_arm64_atomics_present) \ + { \ + return Lse_##METHOD_INVOC; \ + } \ + else \ + { \ + RETURN_TYPE result = INTRINSIC_NAME; \ + PAL_InterlockedOperationBarrier(); \ + return result; \ + } \ +} \ + +#endif // LSE_INSTRUCTIONS_ENABLED_BY_DEFAULT +#else // !HOST_ARM64 + +#define Define_InterlockMethod(RETURN_TYPE, METHOD_DECL, METHOD_INVOC, INTRINSIC_NAME) \ +EXTERN_C PALIMPORT inline RETURN_TYPE PALAPI METHOD_DECL \ +{ \ + RETURN_TYPE result = INTRINSIC_NAME; \ + PAL_InterlockedOperationBarrier(); \ + return result; \ +} \ + +#endif // HOST_ARM64 + +/*++ +Function: +InterlockedAdd + +The InterlockedAdd function adds the value of the specified variable +with another specified value. The function prevents more than one thread +from using the same variable simultaneously. + +Parameters + +lpAddend +[in/out] Pointer to the variable to add. + +lpAddend +[in] The value to add. + +Return Values + +The return value is the resulting added value. +--*/ +Define_InterlockMethod( + LONG, + InterlockedAdd( IN OUT LONG volatile *lpAddend, IN LONG value), + InterlockedAdd(lpAddend, value), + __sync_add_and_fetch(lpAddend, value) +) + +Define_InterlockMethod( + LONGLONG, + InterlockedAdd64(IN OUT LONGLONG volatile *lpAddend, IN LONGLONG value), + InterlockedAdd64(lpAddend, value), + __sync_add_and_fetch(lpAddend, value) +) + /*++ Function: InterlockedIncrement @@ -2719,31 +2899,19 @@ Return Values The return value is the resulting incremented value. --*/ -EXTERN_C -PALIMPORT -inline -LONG -PALAPI -InterlockedIncrement( - IN OUT LONG volatile *lpAddend) -{ - LONG result = __sync_add_and_fetch(lpAddend, (LONG)1); - PAL_InterlockedOperationBarrier(); - return result; -} - -EXTERN_C -PALIMPORT -inline -LONGLONG -PALAPI -InterlockedIncrement64( - IN OUT LONGLONG volatile *lpAddend) -{ - LONGLONG result = __sync_add_and_fetch(lpAddend, (LONGLONG)1); - PAL_InterlockedOperationBarrier(); - return result; -} +Define_InterlockMethod( + LONG, + InterlockedIncrement(IN OUT LONG volatile *lpAddend), + InterlockedIncrement(lpAddend), + __sync_add_and_fetch(lpAddend, (LONG)1) +) + +Define_InterlockMethod( + LONGLONG, + InterlockedIncrement64(IN OUT LONGLONG volatile *lpAddend), + InterlockedIncrement64(lpAddend), + __sync_add_and_fetch(lpAddend, (LONGLONG)1) +) /*++ Function: @@ -2764,34 +2932,21 @@ Return Values The return value is the resulting decremented value. --*/ -EXTERN_C -PALIMPORT -inline -LONG -PALAPI -InterlockedDecrement( - IN OUT LONG volatile *lpAddend) -{ - LONG result = __sync_sub_and_fetch(lpAddend, (LONG)1); - PAL_InterlockedOperationBarrier(); - return result; -} +Define_InterlockMethod( + LONG, + InterlockedDecrement(IN OUT LONG volatile *lpAddend), + InterlockedDecrement(lpAddend), + __sync_sub_and_fetch(lpAddend, (LONG)1) +) -#define InterlockedDecrementAcquire InterlockedDecrement #define InterlockedDecrementRelease InterlockedDecrement -EXTERN_C -PALIMPORT -inline -LONGLONG -PALAPI -InterlockedDecrement64( - IN OUT LONGLONG volatile *lpAddend) -{ - LONGLONG result = __sync_sub_and_fetch(lpAddend, (LONGLONG)1); - PAL_InterlockedOperationBarrier(); - return result; -} +Define_InterlockMethod( + LONGLONG, + InterlockedDecrement64(IN OUT LONGLONG volatile *lpAddend), + InterlockedDecrement64(lpAddend), + __sync_sub_and_fetch(lpAddend, (LONGLONG)1) +) /*++ Function: @@ -2814,34 +2969,41 @@ Return Values The function returns the initial value pointed to by Target. --*/ -EXTERN_C -PALIMPORT -inline -LONG -PALAPI -InterlockedExchange( - IN OUT LONG volatile *Target, - IN LONG Value) -{ - LONG result = __atomic_exchange_n(Target, Value, __ATOMIC_ACQ_REL); - PAL_InterlockedOperationBarrier(); - return result; -} +Define_InterlockMethod( + LONG, + InterlockedExchange(IN OUT LONG volatile *Target, LONG Value), + InterlockedExchange(Target, Value), + __atomic_exchange_n(Target, Value, __ATOMIC_ACQ_REL) +) -EXTERN_C -PALIMPORT -inline -LONGLONG -PALAPI -InterlockedExchange64( - IN OUT LONGLONG volatile *Target, - IN LONGLONG Value) +#if defined(HOST_X86) + +// 64-bit __atomic_exchange_n is not expanded as a compiler intrinsic on Linux x86. +// Use inline implementation instead. + +inline LONGLONG InterlockedExchange64(LONGLONG volatile * Target, LONGLONG Value) { - LONGLONG result = __atomic_exchange_n(Target, Value, __ATOMIC_ACQ_REL); - PAL_InterlockedOperationBarrier(); - return result; + LONGLONG Old; + + do { + Old = *Target; + } while (__sync_val_compare_and_swap(Target, Old, Value) != Old); + + return Old; } +#else + +Define_InterlockMethod( + LONGLONG, + InterlockedExchange64(IN OUT LONGLONG volatile *Target, IN LONGLONG Value), + InterlockedExchange64(Target, Value), + __atomic_exchange_n(Target, Value, __ATOMIC_ACQ_REL) +) + +#endif + + /*++ Function: InterlockedCompareExchange @@ -2865,47 +3027,28 @@ Return Values The return value is the initial value of the destination. --*/ -EXTERN_C -PALIMPORT -inline -LONG -PALAPI -InterlockedCompareExchange( - IN OUT LONG volatile *Destination, - IN LONG Exchange, - IN LONG Comperand) -{ - LONG result = - __sync_val_compare_and_swap( - Destination, /* The pointer to a variable whose value is to be compared with. */ - Comperand, /* The value to be compared */ - Exchange /* The value to be stored */); - PAL_InterlockedOperationBarrier(); - return result; -} +Define_InterlockMethod( + LONG, + InterlockedCompareExchange(IN OUT LONG volatile *Destination, IN LONG Exchange, IN LONG Comperand), + InterlockedCompareExchange(Destination, Exchange, Comperand), + __sync_val_compare_and_swap( + Destination, /* The pointer to a variable whose value is to be compared with. */ + Comperand, /* The value to be compared */ + Exchange /* The value to be stored */) +) #define InterlockedCompareExchangeAcquire InterlockedCompareExchange #define InterlockedCompareExchangeRelease InterlockedCompareExchange -// See the 32-bit variant in interlock2.s -EXTERN_C -PALIMPORT -inline -LONGLONG -PALAPI -InterlockedCompareExchange64( - IN OUT LONGLONG volatile *Destination, - IN LONGLONG Exchange, - IN LONGLONG Comperand) -{ - LONGLONG result = - __sync_val_compare_and_swap( - Destination, /* The pointer to a variable whose value is to be compared with. */ - Comperand, /* The value to be compared */ - Exchange /* The value to be stored */); - PAL_InterlockedOperationBarrier(); - return result; -} +Define_InterlockMethod( + LONGLONG, + InterlockedCompareExchange64(IN OUT LONGLONG volatile *Destination, IN LONGLONG Exchange, IN LONGLONG Comperand), + InterlockedCompareExchange64(Destination, Exchange, Comperand), + __sync_val_compare_and_swap( + Destination, /* The pointer to a variable whose value is to be compared with. */ + Comperand, /* The value to be compared */ + Exchange /* The value to be stored */) +) /*++ Function: @@ -2917,92 +3060,40 @@ to the variable that 'Addend' points to. Parameters lpAddend -[in/out] Pointer to the variable to to added. +[in/out] Pointer to the variable to added. Return Values The return value is the original value that 'Addend' pointed to. --*/ -EXTERN_C -PALIMPORT -inline -LONG -PALAPI -InterlockedExchangeAdd( - IN OUT LONG volatile *Addend, - IN LONG Value) -{ - LONG result = __sync_fetch_and_add(Addend, Value); - PAL_InterlockedOperationBarrier(); - return result; -} - -EXTERN_C -PALIMPORT -inline -LONGLONG -PALAPI -InterlockedExchangeAdd64( - IN OUT LONGLONG volatile *Addend, - IN LONGLONG Value) -{ - LONGLONG result = __sync_fetch_and_add(Addend, Value); - PAL_InterlockedOperationBarrier(); - return result; -} - -EXTERN_C -PALIMPORT -inline -LONG -PALAPI -InterlockedAnd( - IN OUT LONG volatile *Destination, - IN LONG Value) -{ - LONG result = __sync_fetch_and_and(Destination, Value); - PAL_InterlockedOperationBarrier(); - return result; -} - -EXTERN_C -PALIMPORT -inline -LONG -PALAPI -InterlockedOr( - IN OUT LONG volatile *Destination, - IN LONG Value) -{ - LONG result = __sync_fetch_and_or(Destination, Value); - PAL_InterlockedOperationBarrier(); - return result; -} - -EXTERN_C -PALIMPORT -inline -UCHAR -PALAPI -InterlockedBitTestAndReset( - IN OUT LONG volatile *Base, - IN LONG Bit) -{ - return (InterlockedAnd(Base, ~(1 << Bit)) & (1 << Bit)) != 0; -} - -EXTERN_C -PALIMPORT -inline -UCHAR -PALAPI -InterlockedBitTestAndSet( - IN OUT LONG volatile *Base, - IN LONG Bit) -{ - return (InterlockedOr(Base, (1 << Bit)) & (1 << Bit)) != 0; -} +Define_InterlockMethod( + LONG, + InterlockedExchangeAdd(IN OUT LONG volatile *Addend, IN LONG Value), + InterlockedExchangeAdd(Addend, Value), + __sync_fetch_and_add(Addend, Value) +) + +Define_InterlockMethod( + LONGLONG, + InterlockedExchangeAdd64(IN OUT LONGLONG volatile *Addend, IN LONGLONG Value), + InterlockedExchangeAdd64(Addend, Value), + __sync_fetch_and_add(Addend, Value) +) + +Define_InterlockMethod( + LONG, + InterlockedAnd(IN OUT LONG volatile *Destination, IN LONG Value), + InterlockedAnd(Destination, Value), + __sync_fetch_and_and(Destination, Value) +) + +Define_InterlockMethod( + LONG, + InterlockedOr(IN OUT LONG volatile *Destination, IN LONG Value), + InterlockedOr(Destination, Value), + __sync_fetch_and_or(Destination, Value) +) #if defined(HOST_64BIT) #define InterlockedExchangePointer(Target, Value) \ @@ -3048,6 +3139,8 @@ YieldProcessor() "nop"); #elif defined(HOST_ARM) || defined(HOST_ARM64) __asm__ __volatile__( "yield"); +#elif defined(HOST_LOONGARCH64) + __asm__ volatile( "dbar 0; \n"); #elif defined(HOST_RISCV64) // TODO-RISCV64-CQ: When Zihintpause is supported, replace with `pause` instruction. __asm__ __volatile__(".word 0x0100000f"); @@ -3162,9 +3255,6 @@ typedef POSVERSIONINFOEXA POSVERSIONINFOEX; typedef LPOSVERSIONINFOEXA LPOSVERSIONINFOEX; #endif -#define IMAGE_FILE_MACHINE_I386 0x014c -#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // ARM64 Little-Endian - typedef struct _SYSTEM_INFO { WORD wProcessorArchitecture_PAL_Undefined; WORD wReserved_PAL_Undefined; // NOTE: diff from winbase.h - no obsolete dwOemId union @@ -3188,96 +3278,8 @@ GetSystemInfo( #if defined FEATURE_PAL_ANSI #include "palprivate.h" #endif //FEATURE_PAL_ANSI - /******************* C Runtime Entrypoints *******************************/ -/* Some C runtime functions needs to be reimplemented by the PAL. - To avoid name collisions, those functions have been renamed using - defines */ -#ifndef PAL_STDCPP_COMPAT -#define exit PAL_exit -#define printf PAL_printf -#define vprintf PAL_vprintf -#define wprintf PAL_wprintf -#define wcstod PAL_wcstod -#define wcstoul PAL_wcstoul -#define wcscat PAL_wcscat -#define wcscpy PAL_wcscpy -#define wcslen PAL_wcslen -#define wcsncmp PAL_wcsncmp -#define wcschr PAL_wcschr -#define wcsrchr PAL_wcsrchr -#define wcsstr PAL_wcsstr -#define swscanf PAL_swscanf -#define wcspbrk PAL_wcspbrk -#define wcscmp PAL_wcscmp -#define wcsncpy PAL_wcsncpy -#define wcscspn PAL_wcscspn -#define iswprint PAL_iswprint -#define realloc PAL_realloc -#define fopen PAL_fopen -#define strtok PAL_strtok -#define strtoul PAL_strtoul -#define strtoull PAL_strtoull -#define fprintf PAL_fprintf -#define fwprintf PAL_fwprintf -#define vfprintf PAL_vfprintf -#define vfwprintf PAL_vfwprintf -#define rand PAL_rand -#define time PAL_time -#define getenv PAL_getenv -#define fgets PAL_fgets -#define qsort PAL_qsort -#define bsearch PAL_bsearch -#define ferror PAL_ferror -#define fread PAL_fread -#define fwrite PAL_fwrite -#define ftell PAL_ftell -#define fclose PAL_fclose -#define fflush PAL_fflush -#define fputs PAL_fputs -#define fseek PAL_fseek -#define fgetpos PAL_fgetpos -#define fsetpos PAL_fsetpos -#define setvbuf PAL_setvbuf -#define acos PAL_acos -#define asin PAL_asin -#define atan2 PAL_atan2 -#define exp PAL_exp -#define ilogb PAL_ilogb -#define log PAL_log -#define log10 PAL_log10 -#define pow PAL_pow -#define sincos PAL_sincos -#define acosf PAL_acosf -#define asinf PAL_asinf -#define atan2f PAL_atan2f -#define expf PAL_expf -#define ilogbf PAL_ilogbf -#define logf PAL_logf -#define log10f PAL_log10f -#define powf PAL_powf -#define sincosf PAL_sincosf -#define malloc PAL_malloc -#define free PAL_free -#define _strdup PAL__strdup -#define _open PAL__open -#define _pread PAL__pread -#define _close PAL__close -#define _wcstoui64 PAL__wcstoui64 -#define _flushall PAL__flushall -#define strnlen PAL_strnlen -#define wcsnlen PAL_wcsnlen - -#ifdef HOST_AMD64 -#define _mm_getcsr PAL__mm_getcsr -#define _mm_setcsr PAL__mm_setcsr -#endif // HOST_AMD64 - -#else // !PAL_STDCPP_COMPAT -#define _strdup strdup -#endif // !PAL_STDCPP_COMPAT - #ifndef _CONST_RETURN #ifdef __cplusplus #define _CONST_RETURN const @@ -3290,91 +3292,15 @@ GetSystemInfo( /* For backwards compatibility */ #define _WConst_return _CONST_RETURN -#define EOF (-1) - -typedef int errno_t; - -#if defined(__WINT_TYPE__) -typedef __WINT_TYPE__ wint_t; -#else -typedef unsigned int wint_t; -#endif - -#ifndef PAL_STDCPP_COMPAT - -#if defined(_DEBUG) - -/*++ -Function: -PAL_memcpy - -Overlapping buffer-safe version of memcpy. -See MSDN doc for memcpy ---*/ -EXTERN_C -PALIMPORT -DLLEXPORT -void *PAL_memcpy (void *dest, const void * src, size_t count); - -PALIMPORT void * __cdecl memcpy(void *, const void *, size_t) THROW_DECL; - -#define memcpy PAL_memcpy -#define IS_PAL_memcpy 1 -#define TEST_PAL_DEFERRED(def) IS_##def -#define IS_REDEFINED_IN_PAL(def) TEST_PAL_DEFERRED(def) -#else //defined(_DEBUG) -PALIMPORT void * __cdecl memcpy(void *, const void *, size_t); -#endif //defined(_DEBUG) -PALIMPORT int __cdecl memcmp(const void *, const void *, size_t); -PALIMPORT void * __cdecl memset(void *, int, size_t); -PALIMPORT void * __cdecl memmove(void *, const void *, size_t); -PALIMPORT void * __cdecl memchr(const void *, int, size_t); -PALIMPORT long long int __cdecl atoll(const char *) MATH_THROW_DECL; -PALIMPORT size_t __cdecl strlen(const char *); -PALIMPORT int __cdecl strcmp(const char*, const char *); -PALIMPORT int __cdecl strncmp(const char*, const char *, size_t); -PALIMPORT int __cdecl _strnicmp(const char *, const char *, size_t); -PALIMPORT char * __cdecl strcat(char *, const char *); -PALIMPORT char * __cdecl strncat(char *, const char *, size_t); -PALIMPORT char * __cdecl strcpy(char *, const char *); -PALIMPORT char * __cdecl strncpy(char *, const char *, size_t); -PALIMPORT char * __cdecl strchr(const char *, int); -PALIMPORT char * __cdecl strrchr(const char *, int); -PALIMPORT char * __cdecl strpbrk(const char *, const char *); -PALIMPORT char * __cdecl strstr(const char *, const char *); -PALIMPORT char * __cdecl strtok(char *, const char *); -PALIMPORT size_t __cdecl strspn(const char *, const char *); -PALIMPORT size_t __cdecl strcspn(const char *, const char *); -PALIMPORT int __cdecl atoi(const char *); -PALIMPORT ULONG __cdecl strtoul(const char *, char **, int); -PALIMPORT ULONGLONG __cdecl strtoull(const char *, char **, int); -PALIMPORT double __cdecl atof(const char *); -PALIMPORT double __cdecl strtod(const char *, char **); -PALIMPORT int __cdecl isprint(int); -PALIMPORT int __cdecl isspace(int); -PALIMPORT int __cdecl isalpha(int); -PALIMPORT int __cdecl isalnum(int); -PALIMPORT int __cdecl isdigit(int); -PALIMPORT int __cdecl isxdigit(int); -PALIMPORT int __cdecl isupper(int); -PALIMPORT int __cdecl islower(int); -PALIMPORT int __cdecl tolower(int); -PALIMPORT int __cdecl toupper(int); -PALIMPORT int __cdecl iswalpha(wint_t); -PALIMPORT int __cdecl iswdigit(wint_t); -PALIMPORT int __cdecl iswupper(wint_t); -PALIMPORT int __cdecl iswspace(wint_t); -PALIMPORT int __cdecl iswxdigit(wint_t); -PALIMPORT wint_t __cdecl towupper(wint_t); -PALIMPORT wint_t __cdecl towlower(wint_t); -#endif // PAL_STDCPP_COMPAT - /* _TRUNCATE */ #if !defined(_TRUNCATE) #define _TRUNCATE ((size_t)-1) #endif -PALIMPORT DLLEXPORT errno_t __cdecl memcpy_s(void *, size_t, const void *, size_t) THROW_DECL; +// errno_t is only defined when the Secure CRT Extensions library is available (which no standard library that we build with implements anyway) +typedef int errno_t; + +PALIMPORT DLLEXPORT errno_t __cdecl memcpy_s(void *, size_t, const void *, size_t); PALIMPORT errno_t __cdecl memmove_s(void *, size_t, const void *, size_t); PALIMPORT DLLEXPORT int __cdecl _stricmp(const char *, const char *); PALIMPORT DLLEXPORT int __cdecl vsprintf_s(char *, size_t, const char *, va_list); @@ -3387,11 +3313,14 @@ PALIMPORT DLLEXPORT int __cdecl _vsnprintf_s(char *, size_t, size_t, const char PALIMPORT DLLEXPORT int __cdecl _vsnwprintf_s(WCHAR *, size_t, size_t, const WCHAR *, va_list); PALIMPORT DLLEXPORT int __cdecl _snwprintf_s(WCHAR *, size_t, size_t, const WCHAR *, ...); PALIMPORT DLLEXPORT int __cdecl _snprintf_s(char *, size_t, size_t, const char *, ...); +PALIMPORT DLLEXPORT int __cdecl vsprintf_s(char *, size_t, const char *, va_list); PALIMPORT DLLEXPORT int __cdecl sprintf_s(char *, size_t, const char *, ... ); PALIMPORT DLLEXPORT int __cdecl swprintf_s(WCHAR *, size_t, const WCHAR *, ... ); PALIMPORT int __cdecl _snwprintf_s(WCHAR *, size_t, size_t, const WCHAR *, ...); PALIMPORT int __cdecl vswprintf_s( WCHAR *, size_t, const WCHAR *, va_list); PALIMPORT DLLEXPORT int __cdecl sscanf_s(const char *, const char *, ...); +PALIMPORT DLLEXPORT int __cdecl swscanf_s(const WCHAR *string, const WCHAR *format,...); + PALIMPORT DLLEXPORT errno_t __cdecl _itow_s(int, WCHAR *, size_t, int); PALIMPORT DLLEXPORT size_t __cdecl PAL_wcslen(const WCHAR *); @@ -3404,18 +3333,33 @@ PALIMPORT DLLEXPORT const WCHAR * __cdecl PAL_wcschr(const WCHAR *, WCHAR); PALIMPORT DLLEXPORT const WCHAR * __cdecl PAL_wcsrchr(const WCHAR *, WCHAR); PALIMPORT WCHAR _WConst_return * __cdecl PAL_wcspbrk(const WCHAR *, const WCHAR *); PALIMPORT DLLEXPORT WCHAR _WConst_return * __cdecl PAL_wcsstr(const WCHAR *, const WCHAR *); -PALIMPORT DLLEXPORT size_t __cdecl PAL_wcscspn(const WCHAR *, const WCHAR *); -PALIMPORT int __cdecl PAL_swprintf(WCHAR *, const WCHAR *, ...); -PALIMPORT int __cdecl PAL_vswprintf(WCHAR *, const WCHAR *, va_list); -PALIMPORT int __cdecl PAL_swscanf(const WCHAR *, const WCHAR *, ...); PALIMPORT DLLEXPORT ULONG __cdecl PAL_wcstoul(const WCHAR *, WCHAR **, int); -PALIMPORT double __cdecl PAL_wcstod(const WCHAR *, WCHAR **); -PALIMPORT int __cdecl PAL_iswprint(WCHAR); +PALIMPORT DLLEXPORT ULONGLONG __cdecl PAL__wcstoui64(const WCHAR *, WCHAR **, int); +PALIMPORT DLLEXPORT double __cdecl PAL_wcstod(const WCHAR *, WCHAR **); PALIMPORT errno_t __cdecl _wcslwr_s(WCHAR *, size_t sz); -PALIMPORT DLLEXPORT ULONGLONG _wcstoui64(const WCHAR *, WCHAR **, int); PALIMPORT DLLEXPORT errno_t __cdecl _i64tow_s(long long, WCHAR *, size_t, int); PALIMPORT int __cdecl _wtoi(const WCHAR *); +PALIMPORT FILE * __cdecl _wfopen(const WCHAR *, const WCHAR *); + +inline int _stricmp(const char* a, const char* b) +{ + return strcasecmp(a, b); +} + +inline int _strnicmp(const char* a, const char* b, size_t c) +{ + return strncasecmp(a, b, c); +} + +inline char* _strdup(const char* a) +{ + return strdup(a); +} + +// Define the MSVC implementation of the alloca concept. +// As this allocates on the current stack frame, use a macro instead of an inline function. +#define _alloca(x) alloca(x) #ifdef __cplusplus extern "C++" { @@ -3430,15 +3374,7 @@ inline WCHAR *PAL_wcsstr(WCHAR* S, const WCHAR* P) } #endif -#if defined(__llvm__) -#define HAS_ROTL __has_builtin(_rotl) -#define HAS_ROTR __has_builtin(_rotr) -#else -#define HAS_ROTL 0 -#define HAS_ROTR 0 -#endif - -#if !HAS_ROTL +#if !__has_builtin(_rotl) && !defined(_rotl) /*++ Function: _rotl @@ -3456,14 +3392,9 @@ unsigned int __cdecl _rotl(unsigned int value, int shift) retval = (value << shift) | (value >> (sizeof(int) * CHAR_BIT - shift)); return retval; } -#endif // !HAS_ROTL +#endif // !__has_builtin(_rotl) -// On 64 bit unix, make the long an int. -#ifdef HOST_64BIT -#define _lrotl _rotl -#endif // HOST_64BIT - -#if !HAS_ROTR +#if !__has_builtin(_rotr) && !defined(_rotr) /*++ Function: @@ -3483,173 +3414,103 @@ unsigned int __cdecl _rotr(unsigned int value, int shift) return retval; } -#endif // !HAS_ROTR - -PALIMPORT int __cdecl abs(int); - -// clang complains if this is declared with __int64 -PALIMPORT long long __cdecl llabs(long long); - -#ifndef PAL_STDCPP_COMPAT - -#ifdef __cplusplus -extern "C++" { - -inline __int64 abs(__int64 _X) { - return llabs(_X); -} - -} -#endif - -PALIMPORT DLLEXPORT void * __cdecl malloc(size_t); -PALIMPORT DLLEXPORT void __cdecl free(void *); -PALIMPORT DLLEXPORT void * __cdecl realloc(void *, size_t); -PALIMPORT char * __cdecl _strdup(const char *); - -#if defined(_MSC_VER) -#define alloca _alloca -#else -#define _alloca alloca -#endif //_MSC_VER - -#define alloca __builtin_alloca - -#define max(a, b) (((a) > (b)) ? (a) : (b)) -#define min(a, b) (((a) < (b)) ? (a) : (b)) - -PALIMPORT DLLEXPORT void __cdecl qsort(void *, size_t, size_t, int(__cdecl *)(const void *, const void *)); -PALIMPORT DLLEXPORT void * __cdecl bsearch(const void *, const void *, size_t, size_t, - int(__cdecl *)(const void *, const void *)); - -PALIMPORT time_t __cdecl time(time_t *); - -#endif // !PAL_STDCPP_COMPAT - -PALIMPORT DLLEXPORT int __cdecl _open(const char *szPath, int nFlags, ...); -PALIMPORT DLLEXPORT size_t __cdecl _pread(int fd, void *buf, size_t nbytes, ULONG64 offset); -PALIMPORT DLLEXPORT int __cdecl _close(int); -PALIMPORT DLLEXPORT int __cdecl _flushall(); - -#ifdef PAL_STDCPP_COMPAT - -struct _PAL_FILE; -typedef struct _PAL_FILE PAL_FILE; - -#else // PAL_STDCPP_COMPAT +#endif // !__has_builtin(_rotr) -struct _FILE; -typedef struct _FILE FILE; -typedef struct _FILE PAL_FILE; - -#define SEEK_SET 0 -#define SEEK_CUR 1 -#define SEEK_END 2 - -/* Locale categories */ -#define LC_ALL 0 -#define LC_COLLATE 1 -#define LC_CTYPE 2 -#define LC_MONETARY 3 -#define LC_NUMERIC 4 -#define LC_TIME 5 - -#define _IOFBF 0 /* setvbuf should set fully buffered */ -#define _IOLBF 1 /* setvbuf should set line buffered */ -#define _IONBF 2 /* setvbuf should set unbuffered */ - -#endif // PAL_STDCPP_COMPAT - -PALIMPORT int __cdecl PAL_fclose(PAL_FILE *); -PALIMPORT DLLEXPORT int __cdecl PAL_fflush(PAL_FILE *); -PALIMPORT size_t __cdecl PAL_fwrite(const void *, size_t, size_t, PAL_FILE *); -PALIMPORT size_t __cdecl PAL_fread(void *, size_t, size_t, PAL_FILE *); -PALIMPORT char * __cdecl PAL_fgets(char *, int, PAL_FILE *); -PALIMPORT int __cdecl PAL_fputs(const char *, PAL_FILE *); -PALIMPORT DLLEXPORT int __cdecl PAL_fprintf(PAL_FILE *, const char *, ...); -PALIMPORT int __cdecl PAL_vfprintf(PAL_FILE *, const char *, va_list); -PALIMPORT int __cdecl PAL_fseek(PAL_FILE *, LONG, int); -PALIMPORT LONG __cdecl PAL_ftell(PAL_FILE *); -PALIMPORT int __cdecl PAL_ferror(PAL_FILE *); -PALIMPORT PAL_FILE * __cdecl PAL_fopen(const char *, const char *); -PALIMPORT int __cdecl PAL_setvbuf(PAL_FILE *stream, char *, int, size_t); -PALIMPORT DLLEXPORT int __cdecl PAL_fwprintf(PAL_FILE *, const WCHAR *, ...); -PALIMPORT int __cdecl PAL_vfwprintf(PAL_FILE *, const WCHAR *, va_list); -PALIMPORT int __cdecl PAL_wprintf(const WCHAR*, ...); - -PALIMPORT int __cdecl _getw(PAL_FILE *); -PALIMPORT int __cdecl _putw(int, PAL_FILE *); -PALIMPORT PAL_FILE * __cdecl _fdopen(int, const char *); -PALIMPORT PAL_FILE * __cdecl _wfopen(const WCHAR *, const WCHAR *); - -/* Maximum value that can be returned by the rand function. */ - -#ifndef PAL_STDCPP_COMPAT -#define RAND_MAX 0x7fff -#endif // !PAL_STDCPP_COMPAT - -PALIMPORT int __cdecl rand(void); -PALIMPORT void __cdecl srand(unsigned int); - -PALIMPORT DLLEXPORT int __cdecl printf(const char *, ...); -PALIMPORT int __cdecl vprintf(const char *, va_list); - -#ifdef _MSC_VER -#define PAL_get_caller _MSC_VER -#else -#define PAL_get_caller 0 -#endif - -PALIMPORT DLLEXPORT PAL_FILE * __cdecl PAL_get_stdout(int caller); -PALIMPORT PAL_FILE * __cdecl PAL_get_stdin(int caller); -PALIMPORT DLLEXPORT PAL_FILE * __cdecl PAL_get_stderr(int caller); -PALIMPORT DLLEXPORT int * __cdecl PAL_errno(int caller); - -#ifdef PAL_STDCPP_COMPAT -#define PAL_stdout (PAL_get_stdout(PAL_get_caller)) -#define PAL_stdin (PAL_get_stdin(PAL_get_caller)) -#define PAL_stderr (PAL_get_stderr(PAL_get_caller)) -#define PAL_errno (*PAL_errno(PAL_get_caller)) -#else // PAL_STDCPP_COMPAT -#define stdout (PAL_get_stdout(PAL_get_caller)) -#define stdin (PAL_get_stdin(PAL_get_caller)) -#define stderr (PAL_get_stderr(PAL_get_caller)) -#define errno (*PAL_errno(PAL_get_caller)) -#endif // PAL_STDCPP_COMPAT - -PALIMPORT DLLEXPORT char * __cdecl getenv(const char *); +PALIMPORT DLLEXPORT char * __cdecl PAL_getenv(const char *); PALIMPORT DLLEXPORT int __cdecl _putenv(const char *); #define ERANGE 34 -/******************* PAL functions for SIMD extensions *****************/ -PALIMPORT -unsigned int _mm_getcsr(void); +#ifdef __cplusplus -PALIMPORT -void _mm_setcsr(unsigned int i); +#define HardwareExceptionHolder +extern "C++" { +#define PAL_TRY(__ParamType, __paramDef, __paramRef) \ +{ \ + __ParamType __param = __paramRef; \ + auto tryBlock = [](__ParamType __paramDef) \ + { +// Start of an exception handler. If an exception raised by the RaiseException +// occurs in the try block and the disposition is EXCEPTION_EXECUTE_HANDLER, +// the handler code is executed. If the disposition is EXCEPTION_CONTINUE_SEARCH, +// the exception is rethrown. The EXCEPTION_CONTINUE_EXECUTION disposition is +// not supported. +#define PAL_EXCEPT(dispositionExpression) \ + }; \ + const bool isFinally = false; \ + auto finallyBlock = []() {}; \ + EXCEPTION_DISPOSITION disposition = EXCEPTION_CONTINUE_EXECUTION; \ + auto exceptionFilter = [&disposition, &__param](PAL_SEHException& ex) \ + { \ + (void)__param; \ + disposition = dispositionExpression; \ + _ASSERTE(disposition != EXCEPTION_CONTINUE_EXECUTION); \ + return disposition; \ + }; \ + try \ + { \ + tryBlock(__param); \ + } \ + catch (PAL_SEHException& ex) \ + { \ + if (disposition == EXCEPTION_CONTINUE_EXECUTION) \ + { \ + exceptionFilter(ex); \ + } \ + if (disposition == EXCEPTION_CONTINUE_SEARCH) \ + { \ + throw; \ + } \ + ex.SecondPassDone(); + +// Start of an exception handler. It works the same way as the PAL_EXCEPT except +// that the disposition is obtained by calling the specified filter. +#define PAL_EXCEPT_FILTER(filter) PAL_EXCEPT(filter(&ex.ExceptionPointers, __param)) + +// Start of a finally block. The finally block is executed both when the try block +// finishes or when an exception is raised using the RaiseException in it. +#define PAL_FINALLY \ + }; \ + const bool isFinally = true; \ + auto finallyBlock = [&]() \ + { -/******************* PAL functions for CPU capability detection *******/ +// End of an except or a finally block. +#define PAL_ENDTRY \ + }; \ + if (isFinally) \ + { \ + try \ + { \ + HardwareExceptionHolder \ + tryBlock(__param); \ + } \ + catch (...) \ + { \ + finallyBlock(); \ + throw; \ + } \ + finallyBlock(); \ + } \ +} -#ifdef __cplusplus +} // extern "C++" #define PAL_CPP_THROW(type, obj) { throw obj; } #define PAL_CPP_RETHROW { throw; } -#define PAL_CPP_TRY try { +#define PAL_CPP_TRY try { HardwareExceptionHolder #define PAL_CPP_CATCH_EXCEPTION(ident) } catch (Exception *ident) { #define PAL_CPP_CATCH_EXCEPTION_NOARG } catch (Exception *) { #define PAL_CPP_CATCH_DERIVED(type, ident) } catch (type *ident) { +#define PAL_CPP_CATCH_NON_DERIVED(type, ident) } catch (type ident) { +#define PAL_CPP_CATCH_NON_DERIVED_NOARG(type) } catch (type) { #define PAL_CPP_CATCH_ALL } catch (...) { \ try { throw; } \ catch (...) {} #define PAL_CPP_ENDTRY } -#ifdef _MSC_VER -#pragma warning(disable:4611) // interaction between '_setjmp' and C++ object destruction is non-portable -#endif - #define PAL_TRY_FOR_DLLMAIN(ParamType, paramDef, paramRef, _reason) PAL_TRY(ParamType, paramDef, paramRef) #endif // __cplusplus diff --git a/src/shared/pal/inc/pal_assert.h b/src/shared/pal/inc/pal_assert.h index 2953473343..a4b49c1dda 100644 --- a/src/shared/pal/inc/pal_assert.h +++ b/src/shared/pal/inc/pal_assert.h @@ -31,6 +31,7 @@ extern "C" { #endif // __cplusplus +#ifndef _ASSERTE #if defined(_DEBUG) #define _ASSERTE(e) do { \ if (!(e)) { \ @@ -48,6 +49,7 @@ extern "C" { #else // !DEBUG #define _ASSERTE(e) ((void)0) #endif +#endif // _ASSERTE #ifndef assert #define assert(e) _ASSERTE(e) diff --git a/src/shared/pal/inc/pal_endian.h b/src/shared/pal/inc/pal_endian.h index 6822b004dd..ddfdeab472 100644 --- a/src/shared/pal/inc/pal_endian.h +++ b/src/shared/pal/inc/pal_endian.h @@ -16,7 +16,7 @@ extern "C++" { inline UINT16 SWAP16(UINT16 x) { - return (x >> 8) | (x << 8); + return (UINT16)((x >> 8) | (x << 8)); } inline UINT32 SWAP32(UINT32 x) @@ -102,6 +102,11 @@ inline void SwapGuid(GUID *pGuid) #define ALIGN_ACCESS ((1< + #ifdef __cplusplus extern "C" { #endif @@ -31,8 +25,6 @@ extern "C" { #define EXTERN_C #endif // __cplusplus -#ifndef _MSC_VER - // Note: Win32-hosted GCC predefines __stdcall and __cdecl, but Unix- // hosted GCC does not. @@ -64,13 +56,15 @@ extern "C" { #define _cdecl #define CDECL -// On ARM __fastcall is ignored and causes a compile error -#if !defined(PAL_STDCPP_COMPAT) || defined(__arm__) -# undef __fastcall -# undef _fastcall -# define __fastcall -# define _fastcall -#endif // !defined(PAL_STDCPP_COMPAT) || defined(__arm__) +// Some platforms (such as FreeBSD) define the __fastcall macro +// on all targets, even when using it will fail. +// Undefine it here so we can use it on all platforms without error. +#ifdef __fastcall +#undef __fastcall +#endif + +#define __fastcall +#define _fastcall #endif // !defined(__i386__) @@ -86,26 +80,14 @@ extern "C" { #define __forceinline inline -#endif // !_MSC_VER - -#ifdef _MSC_VER - -#if defined(PAL_IMPLEMENTATION) #define PALIMPORT -#else -#define PALIMPORT __declspec(dllimport) -#endif -#define DLLEXPORT __declspec(dllexport) -#define PAL_NORETURN __declspec(noreturn) - -#else -#define PALIMPORT +#ifndef DLLEXPORT #define DLLEXPORT __attribute__((visibility("default"))) -#define PAL_NORETURN __attribute__((noreturn)) - #endif +#define PAL_NORETURN __attribute__((noreturn)) + #define PALAPI DLLEXPORT __cdecl #define PALAPI_NOEXPORT __cdecl #define PALAPIV __cdecl @@ -143,19 +125,6 @@ extern "C" { // Misc. type helpers //////////////////////////////////////////////////////////////////////// -#ifdef _MSC_VER - -// MSVC's way of declaring large integer constants -// If you define these in one step, without the _HELPER macros, you -// get extra whitespace when composing these with other concatenating macros. -#define I64_HELPER(x) x ## i64 -#define I64(x) I64_HELPER(x) - -#define UI64_HELPER(x) x ## ui64 -#define UI64(x) UI64_HELPER(x) - -#else // _MSC_VER - // GCC's way of declaring large integer constants // If you define these in one step, without the _HELPER macros, you // get extra whitespace when composing these with other concatenating macros. @@ -165,80 +134,21 @@ extern "C" { #define UI64_HELPER(x) x ## ULL #define UI64(x) UI64_HELPER(x) -#endif // _MSC_VER - //////////////////////////////////////////////////////////////////////// // Misc. types //////////////////////////////////////////////////////////////////////// -#ifndef _MSC_VER - -// A bunch of source files (e.g. most of the ndp tree) include pal.h -// but are written to be LLP64, not LP64. (LP64 => long = 64 bits -// LLP64 => longs = 32 bits, long long = 64 bits) -// -// To handle this difference, we #define long to be int (and thus 32 bits) when -// compiling those files. (See the bottom of this file or search for -// #define long to see where we do this.) -// -// But this fix is more complicated than it seems, because we also use the -// preprocessor to #define __int64 to long for LP64 architectures (__int64 -// isn't a builtin in gcc). We don't want __int64 to be an int (by cascading -// macro rules). So we play this little trick below where we add -// __cppmungestrip before "long", which is what we're really #defining __int64 -// to. The preprocessor sees __cppmungestriplong as something different than -// long, so it doesn't replace it with int. The during the cppmunge phase, we -// remove the __cppmungestrip part, leaving long for the compiler to see. -// -// Note that we can't just use a typedef to define __int64 as long before -// #defining long because typedefed types can't be signedness-agnostic (i.e. -// they must be either signed or unsigned) and we want to be able to use -// __int64 as though it were intrinsic - -#ifdef HOST_64BIT -#define __int64 long -#else // HOST_64BIT -#define __int64 long long -#endif // HOST_64BIT - -#define __int32 int -#define __int16 short int -#define __int8 char // assumes char is signed - -#endif // _MSC_VER - -#ifndef PAL_STDCPP_COMPAT -// Defined in gnu's types.h. For non PAL_IMPLEMENTATION system -// includes are not included, so we need to define them. -#ifndef PAL_IMPLEMENTATION - -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -typedef __int32 int32_t; -typedef unsigned __int32 uint32_t; -typedef __int16 int16_t; -typedef unsigned __int16 uint16_t; -typedef __int8 int8_t; -typedef unsigned __int8 uint8_t; - -#endif // PAL_IMPLEMENTATION - -#ifndef _MSC_VER - #if HOST_64BIT typedef long double LONG_DOUBLE; #endif -#endif // _MSC_VER -#endif // !PAL_STDCPP_COMPAT - typedef void VOID; typedef int LONG; // NOTE: diff from windows.h, for LP64 compat typedef unsigned int ULONG; // NOTE: diff from windows.h, for LP64 compat -typedef __int64 LONGLONG; -typedef unsigned __int64 ULONGLONG; +typedef int64_t LONGLONG; +typedef uint64_t ULONGLONG; typedef ULONGLONG DWORD64; typedef DWORD64 *PDWORD64; typedef LONGLONG *PLONG64; @@ -284,327 +194,58 @@ typedef unsigned int *PUINT; typedef BYTE BOOLEAN; typedef BOOLEAN *PBOOLEAN; -typedef unsigned __int8 UINT8; -typedef signed __int8 INT8; -typedef unsigned __int16 UINT16; -typedef signed __int16 INT16; -typedef unsigned __int32 UINT32, *PUINT32; -typedef signed __int32 INT32, *PINT32; -typedef unsigned __int64 UINT64, *PUINT64; -typedef signed __int64 INT64, *PINT64; - -typedef unsigned __int32 ULONG32, *PULONG32; -typedef signed __int32 LONG32, *PLONG32; -typedef unsigned __int64 ULONG64; -typedef signed __int64 LONG64; - -#if defined(HOST_X86) && _MSC_VER >= 1300 -#define _W64 __w64 -#else -#define _W64 -#endif - -#ifdef HOST_64BIT - -#define _atoi64 (__int64)atoll - -typedef __int64 INT_PTR, *PINT_PTR; -typedef unsigned __int64 UINT_PTR, *PUINT_PTR; -typedef __int64 LONG_PTR, *PLONG_PTR; -typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; -typedef unsigned __int64 DWORD_PTR, *PDWORD_PTR; - -/* maximum signed 64 bit value */ -#define LONG_PTR_MAX I64(9223372036854775807) -/* maximum unsigned 64 bit value */ -#define ULONG_PTR_MAX UI64(0xffffffffffffffff) - -#ifndef SIZE_MAX -#define SIZE_MAX _UI64_MAX -#endif - -#define __int3264 __int64 - -#if !defined(HOST_64BIT) -__inline -unsigned long -HandleToULong( - const void *h - ) -{ - return((unsigned long) (ULONG_PTR) h ); -} - -__inline -long -HandleToLong( - const void *h - ) -{ - return((long) (LONG_PTR) h ); -} - -__inline -void * -ULongToHandle( - const unsigned long h - ) -{ - return((void *) (UINT_PTR) h ); -} - - -__inline -void * -LongToHandle( - const long h - ) -{ - return((void *) (INT_PTR) h ); -} - - -__inline -unsigned long -PtrToUlong( - const void *p - ) -{ - return((unsigned long) (ULONG_PTR) p ); -} - -__inline -unsigned int -PtrToUint( - const void *p - ) -{ - return((unsigned int) (UINT_PTR) p ); -} +typedef uint8_t UINT8; +typedef int8_t INT8; +typedef uint16_t UINT16; +typedef int16_t INT16; +typedef uint32_t UINT32, *PUINT32; +typedef int32_t INT32, *PINT32; +typedef uint64_t UINT64, *PUINT64; +typedef int64_t INT64, *PINT64; -__inline -unsigned short -PtrToUshort( - const void *p - ) -{ - return((unsigned short) (unsigned long) (ULONG_PTR) p ); -} - -__inline -long -PtrToLong( - const void *p - ) -{ - return((long) (LONG_PTR) p ); -} +typedef uint32_t ULONG32, *PULONG32; +typedef int32_t LONG32, *PLONG32; +typedef uint64_t ULONG64; +typedef int64_t LONG64; -__inline -int -PtrToInt( - const void *p - ) -{ - return((int) (INT_PTR) p ); -} +typedef intptr_t INT_PTR, *PINT_PTR; +typedef uintptr_t UINT_PTR, *PUINT_PTR; -__inline -short -PtrToShort( - const void *p - ) -{ - return((short) (long) (LONG_PTR) p ); -} - -__inline -void * -IntToPtr( - const int i - ) -// Caution: IntToPtr() sign-extends the int value. -{ - return( (void *)(INT_PTR)i ); -} - -__inline -void * -UIntToPtr( - const unsigned int ui - ) -// Caution: UIntToPtr() zero-extends the unsigned int value. -{ - return( (void *)(UINT_PTR)ui ); -} - -__inline -void * -LongToPtr( - const long l - ) -// Caution: LongToPtr() sign-extends the long value. -{ - return( (void *)(LONG_PTR)l ); -} - -__inline -void * -ULongToPtr( - const unsigned long ul - ) -// Caution: ULongToPtr() zero-extends the unsigned long value. -{ - return( (void *)(ULONG_PTR)ul ); -} - -__inline -void * -ShortToPtr( - const short s - ) -// Caution: ShortToPtr() sign-extends the short value. -{ - return( (void *)(INT_PTR)s ); -} - -__inline -void * -UShortToPtr( - const unsigned short us - ) -// Caution: UShortToPtr() zero-extends the unsigned short value. -{ - return( (void *)(UINT_PTR)us ); -} - -#else // !defined(HOST_64BIT) -#define HandleToULong( h ) ((ULONG)(ULONG_PTR)(h) ) -#define HandleToLong( h ) ((LONG)(LONG_PTR) (h) ) -#define ULongToHandle( ul ) ((HANDLE)(ULONG_PTR) (ul) ) -#define LongToHandle( h ) ((HANDLE)(LONG_PTR) (h) ) -#define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) ) -#define PtrToLong( p ) ((LONG)(LONG_PTR) (p) ) -#define PtrToUint( p ) ((UINT)(UINT_PTR) (p) ) -#define PtrToInt( p ) ((INT)(INT_PTR) (p) ) -#define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) ) -#define PtrToShort( p ) ((short)(LONG_PTR)(p) ) -#define IntToPtr( i ) ((VOID *)(INT_PTR)((int)(i))) -#define UIntToPtr( ui ) ((VOID *)(UINT_PTR)((unsigned int)(ui))) -#define LongToPtr( l ) ((VOID *)(LONG_PTR)((long)(l))) -#define ULongToPtr( ul ) ((VOID *)(ULONG_PTR)((unsigned long)(ul))) -#define ShortToPtr( s ) ((VOID *)(INT_PTR)((short)(s))) -#define UShortToPtr( us ) ((VOID *)(UINT_PTR)((unsigned short)(s))) -#endif // !defined(HOST_64BIT) +#ifdef HOST_64BIT +#define _atoi64 (int64_t)atoll +typedef int64_t LONG_PTR, *PLONG_PTR; +typedef uint64_t ULONG_PTR, *PULONG_PTR; +typedef uint64_t DWORD_PTR, *PDWORD_PTR; #else -typedef _W64 __int32 INT_PTR; -typedef _W64 unsigned __int32 UINT_PTR; - -typedef _W64 __int32 LONG_PTR; -typedef _W64 unsigned __int32 ULONG_PTR, *PULONG_PTR; -typedef _W64 unsigned __int32 DWORD_PTR, *PDWORD_PTR; - -/* maximum signed 32 bit value */ -#define LONG_PTR_MAX 2147483647L -/* maximum unsigned 32 bit value */ -#define ULONG_PTR_MAX 0xffffffffUL - -#ifndef SIZE_MAX -#define SIZE_MAX UINT_MAX -#endif - -#define __int3264 __int32 - -#define HandleToULong( h ) ((ULONG)(ULONG_PTR)(h) ) -#define HandleToLong( h ) ((LONG)(LONG_PTR) (h) ) -#define ULongToHandle( ul ) ((HANDLE)(ULONG_PTR) (ul) ) -#define LongToHandle( h ) ((HANDLE)(LONG_PTR) (h) ) -#define PtrToUlong( p ) ((ULONG)(ULONG_PTR) (p) ) -#define PtrToLong( p ) ((LONG)(LONG_PTR) (p) ) -#define PtrToUint( p ) ((UINT)(UINT_PTR) (p) ) -#define PtrToInt( p ) ((INT)(INT_PTR) (p) ) -#define PtrToUshort( p ) ((unsigned short)(ULONG_PTR)(p) ) -#define PtrToShort( p ) ((short)(LONG_PTR)(p) ) -#define IntToPtr( i ) ((VOID *)(INT_PTR)((int)i)) -#define UIntToPtr( ui ) ((VOID *)(UINT_PTR)((unsigned int)ui)) -#define LongToPtr( l ) ((VOID *)(LONG_PTR)((long)l)) -#define ULongToPtr( ul ) ((VOID *)(ULONG_PTR)((unsigned long)ul)) -#define ShortToPtr( s ) ((VOID *)(INT_PTR)((short)s)) -#define UShortToPtr( us ) ((VOID *)(UINT_PTR)((unsigned short)s)) +typedef int32_t LONG_PTR, *PLONG_PTR; +typedef uint32_t ULONG_PTR, *PULONG_PTR; +typedef uint32_t DWORD_PTR, *PDWORD_PTR; #endif -#define HandleToUlong(h) HandleToULong(h) -#define UlongToHandle(ul) ULongToHandle(ul) -#define UlongToPtr(ul) ULongToPtr(ul) -#define UintToPtr(ui) UIntToPtr(ui) - -typedef ULONG_PTR SIZE_T, *PSIZE_T; -typedef LONG_PTR SSIZE_T, *PSSIZE_T; +typedef uintptr_t SIZE_T; +typedef intptr_t SSIZE_T; #ifndef SIZE_T_MAX -#define SIZE_T_MAX ULONG_PTR_MAX +#define SIZE_T_MAX UINTPTR_MAX #endif // SIZE_T_MAX #ifndef SSIZE_T_MAX -#define SSIZE_T_MAX LONG_PTR_MAX +#define SSIZE_T_MAX INTPTR_MAX #endif #ifndef SSIZE_T_MIN -#define SSIZE_T_MIN (ssize_t)I64(0x8000000000000000) +#define SSIZE_T_MIN INTPTR_MIN #endif -#ifndef PAL_STDCPP_COMPAT -#if defined(__APPLE_CC__) || defined(__linux__) -#ifdef HOST_64BIT -typedef unsigned long size_t; -typedef long ptrdiff_t; -#else // !HOST_64BIT -typedef unsigned int size_t; -typedef int ptrdiff_t; -#endif // !HOST_64BIT -#else -typedef ULONG_PTR size_t; -typedef LONG_PTR ptrdiff_t; -#endif -#endif // !PAL_STDCPP_COMPAT -#define _SIZE_T_DEFINED - typedef LONG_PTR LPARAM; -#define _PTRDIFF_T_DEFINED -#ifdef _MINGW_ -// We need to define _PTRDIFF_T to make sure ptrdiff_t doesn't get defined -// again by system headers - but only for MinGW. -#define _PTRDIFF_T -#endif - typedef char16_t WCHAR; -#ifndef PAL_STDCPP_COMPAT - -#if defined(__linux__) -#ifdef HOST_64BIT -typedef long int intptr_t; -typedef unsigned long int uintptr_t; -#else // !HOST_64BIT -typedef int intptr_t; -typedef unsigned int uintptr_t; -#endif // !HOST_64BIT -#else -typedef INT_PTR intptr_t; -typedef UINT_PTR uintptr_t; -#endif - -#endif // PAL_STDCPP_COMPAT - -#define _INTPTR_T_DEFINED -#define _UINTPTR_T_DEFINED - typedef DWORD LCID; typedef PDWORD PLCID; typedef WORD LANGID; diff --git a/src/shared/pal/inc/palprivate.h b/src/shared/pal/inc/palprivate.h index 4299acc69c..f90786287f 100644 --- a/src/shared/pal/inc/palprivate.h +++ b/src/shared/pal/inc/palprivate.h @@ -35,14 +35,6 @@ PALAPI DeleteFileA( IN LPCSTR lpFileName); -PALIMPORT -BOOL -PALAPI -MoveFileExA( - IN LPCSTR lpExistingFileName, - IN LPCSTR lpNewFileName, - IN DWORD dwFlags); - PALIMPORT BOOL PALAPI @@ -103,13 +95,6 @@ GetTempPathA( IN DWORD nBufferLength, OUT LPSTR lpBuffer); -PALIMPORT -DWORD -PALAPI -GetCurrentDirectoryA( - IN DWORD nBufferLength, - OUT LPSTR lpBuffer); - PALIMPORT BOOL PALAPI @@ -172,15 +157,6 @@ CompareFileTime( IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2); -/* These are from the file in windows. - They are needed for _open_osfhandle.*/ -#define _O_RDONLY 0x0000 -#define _O_APPEND 0x0008 -#define _O_TEXT 0x4000 -#define _O_BINARY 0x8000 - -PALIMPORT int __cdecl _open_osfhandle(INT_PTR, int); - #ifdef __cplusplus } #endif diff --git a/src/shared/pal/inc/rt/aclapi.h b/src/shared/pal/inc/rt/aclapi.h deleted file mode 100644 index ac30dcf6e4..0000000000 --- a/src/shared/pal/inc/rt/aclapi.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: aclapi.h -// -// =========================================================================== -// dummy aclapi.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/commdlg.h b/src/shared/pal/inc/rt/commdlg.h deleted file mode 100644 index 5e7ec20577..0000000000 --- a/src/shared/pal/inc/rt/commdlg.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: commdlg.h -// -// =========================================================================== -// dummy commdlg.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/conio.h b/src/shared/pal/inc/rt/conio.h deleted file mode 100644 index 9dd9c0a06d..0000000000 --- a/src/shared/pal/inc/rt/conio.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: conio.h -// -// =========================================================================== -// dummy conio.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/assert.h b/src/shared/pal/inc/rt/cpp/assert.h deleted file mode 100644 index 7493b151d6..0000000000 --- a/src/shared/pal/inc/rt/cpp/assert.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: assert.h -// -// =========================================================================== -// dummy assert.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/cstdlib b/src/shared/pal/inc/rt/cpp/cstdlib deleted file mode 100644 index 1cfd40828a..0000000000 --- a/src/shared/pal/inc/rt/cpp/cstdlib +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// -// clrosdev -// -// =========================================================================== -// File: cstdlib -// -// =========================================================================== -// dummy cstdlib for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/ctype.h b/src/shared/pal/inc/rt/cpp/ctype.h deleted file mode 100644 index cb41fcd88e..0000000000 --- a/src/shared/pal/inc/rt/cpp/ctype.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: ctype.h -// -// =========================================================================== -// dummy ctype.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/emmintrin.h b/src/shared/pal/inc/rt/cpp/emmintrin.h deleted file mode 100644 index f2e8e0c1fd..0000000000 --- a/src/shared/pal/inc/rt/cpp/emmintrin.h +++ /dev/null @@ -1,128 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// From llvm-3.9/clang-3.9.1 emmintrin.h: - -/*===---- emmintrin.h - SSE2 intrinsics ------------------------------------=== - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - *===-----------------------------------------------------------------------=== - */ - -#include "palrt.h" -#ifdef __GNUC__ -#ifndef __EMMINTRIN_H -#define __IMMINTRIN_H - -typedef long long __m128i __attribute__((__vector_size__(16))); - -typedef unsigned long long __v2du __attribute__ ((__vector_size__ (16))); -typedef short __v8hi __attribute__((__vector_size__(16))); -typedef char __v16qi __attribute__((__vector_size__(16))); - - -/* Define the default attribute for the functions in this file. */ -#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, NODEBUG_ATTRIBUTE)) - -/// \brief Performs a bitwise OR of two 128-bit integer vectors. -/// -/// \headerfile -/// -/// This intrinsic corresponds to the \c VPOR / POR instruction. -/// -/// \param __a -/// A 128-bit integer vector containing one of the source operands. -/// \param __b -/// A 128-bit integer vector containing one of the source operands. -/// \returns A 128-bit integer vector containing the bitwise OR of the values -/// in both operands. -static __inline__ __m128i __DEFAULT_FN_ATTRS -_mm_or_si128(__m128i __a, __m128i __b) -{ - return (__m128i)((__v2du)__a | (__v2du)__b); -} - -/// \brief Compares each of the corresponding 16-bit values of the 128-bit -/// integer vectors for equality. Each comparison yields 0h for false, FFFFh -/// for true. -/// -/// \headerfile -/// -/// This intrinsic corresponds to the \c VPCMPEQW / PCMPEQW instruction. -/// -/// \param __a -/// A 128-bit integer vector. -/// \param __b -/// A 128-bit integer vector. -/// \returns A 128-bit integer vector containing the comparison results. -static __inline__ __m128i __DEFAULT_FN_ATTRS -_mm_cmpeq_epi16(__m128i __a, __m128i __b) -{ - return (__m128i)((__v8hi)__a == (__v8hi)__b); -} - -/// \brief Moves packed integer values from an unaligned 128-bit memory location -/// to elements in a 128-bit integer vector. -/// -/// \headerfile -/// -/// This intrinsic corresponds to the \c VMOVDQU / MOVDQU instruction. -/// -/// \param __p -/// A pointer to a memory location containing integer values. -/// \returns A 128-bit integer vector containing the moved values. -static __inline__ __m128i __DEFAULT_FN_ATTRS -_mm_loadu_si128(__m128i const *__p) -{ - struct __loadu_si128 { - __m128i __v; - } __attribute__((__packed__, __may_alias__)); - return ((struct __loadu_si128*)__p)->__v; -} - -/// \brief Initializes all values in a 128-bit vector of [8 x i16] with the -/// specified 16-bit value. -/// -/// \headerfile -/// -/// This intrinsic is a utility function and does not correspond to a specific -/// instruction. -/// -/// \param __w -/// A 16-bit value used to initialize the elements of the destination integer -/// vector. -/// \returns An initialized 128-bit vector of [8 x i16] with all elements -/// containing the value provided in the operand. -static __inline__ __m128i __DEFAULT_FN_ATTRS -_mm_set1_epi16(short __w) -{ - return (__m128i)(__v8hi){ __w, __w, __w, __w, __w, __w, __w, __w }; -} - -static __inline__ int __DEFAULT_FN_ATTRS -_mm_movemask_epi8(__m128i __a) -{ - return __builtin_ia32_pmovmskb128((__v16qi)__a); -} - -#undef __DEFAULT_FN_ATTRS - -#endif /* __EMMINTRIN_H */ -#endif // __GNUC__ diff --git a/src/shared/pal/inc/rt/cpp/fcntl.h b/src/shared/pal/inc/rt/cpp/fcntl.h deleted file mode 100644 index 556145a9f0..0000000000 --- a/src/shared/pal/inc/rt/cpp/fcntl.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: fcntl.h -// -// =========================================================================== -// dummy fcntl.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/float.h b/src/shared/pal/inc/rt/cpp/float.h deleted file mode 100644 index a1dc803380..0000000000 --- a/src/shared/pal/inc/rt/cpp/float.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: float.h -// -// =========================================================================== -// dummy float.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/io.h b/src/shared/pal/inc/rt/cpp/io.h deleted file mode 100644 index 64f3a52df7..0000000000 --- a/src/shared/pal/inc/rt/cpp/io.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: io.h -// -// =========================================================================== -// dummy io.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/limits.h b/src/shared/pal/inc/rt/cpp/limits.h deleted file mode 100644 index bd667f14ea..0000000000 --- a/src/shared/pal/inc/rt/cpp/limits.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: limits.h -// -// =========================================================================== -// dummy limits.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/malloc.h b/src/shared/pal/inc/rt/cpp/malloc.h deleted file mode 100644 index 255a2c7f2f..0000000000 --- a/src/shared/pal/inc/rt/cpp/malloc.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: malloc.h -// -// =========================================================================== -// dummy malloc.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/math.h b/src/shared/pal/inc/rt/cpp/math.h deleted file mode 100644 index e42c1852c1..0000000000 --- a/src/shared/pal/inc/rt/cpp/math.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: math.h -// -// =========================================================================== -// dummy math.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/memory.h b/src/shared/pal/inc/rt/cpp/memory.h deleted file mode 100644 index bcc0d7d9c5..0000000000 --- a/src/shared/pal/inc/rt/cpp/memory.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: memory.h -// -// =========================================================================== -// dummy memory.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/stdarg.h b/src/shared/pal/inc/rt/cpp/stdarg.h deleted file mode 100644 index 59d0d046d5..0000000000 --- a/src/shared/pal/inc/rt/cpp/stdarg.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: stdarg.h -// -// =========================================================================== -// dummy stdarg.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/stddef.h b/src/shared/pal/inc/rt/cpp/stddef.h deleted file mode 100644 index b347dbf414..0000000000 --- a/src/shared/pal/inc/rt/cpp/stddef.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: stddef.h -// -// =========================================================================== -// dummy stddef.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/stdio.h b/src/shared/pal/inc/rt/cpp/stdio.h deleted file mode 100644 index 33c1912bb2..0000000000 --- a/src/shared/pal/inc/rt/cpp/stdio.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: stdio.h -// -// =========================================================================== -// dummy stdio.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/stdlib.h b/src/shared/pal/inc/rt/cpp/stdlib.h deleted file mode 100644 index d2d49357b8..0000000000 --- a/src/shared/pal/inc/rt/cpp/stdlib.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: stdlib.h -// -// =========================================================================== -// dummy stdlib.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/string.h b/src/shared/pal/inc/rt/cpp/string.h deleted file mode 100644 index b66d883338..0000000000 --- a/src/shared/pal/inc/rt/cpp/string.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: string.h -// -// =========================================================================== -// dummy string.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/time.h b/src/shared/pal/inc/rt/cpp/time.h deleted file mode 100644 index 00c83f99d3..0000000000 --- a/src/shared/pal/inc/rt/cpp/time.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: time.h -// -// =========================================================================== -// dummy time.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/wchar.h b/src/shared/pal/inc/rt/cpp/wchar.h deleted file mode 100644 index 5497d729e4..0000000000 --- a/src/shared/pal/inc/rt/cpp/wchar.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: wchar.h -// -// =========================================================================== -// dummy wchar.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/cpp/xmmintrin.h b/src/shared/pal/inc/rt/cpp/xmmintrin.h deleted file mode 100644 index 826d2d7886..0000000000 --- a/src/shared/pal/inc/rt/cpp/xmmintrin.h +++ /dev/null @@ -1,117 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// From llvm-3.9/clang-3.9.1 xmmintrin.h: - -/*===---- xmmintrin.h - SSE intrinsics -------------------------------------=== -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -* -*===-----------------------------------------------------------------------=== -*/ - -#ifdef __GNUC__ - -typedef float __m128 __attribute__((__vector_size__(16))); - -/* Define the default attributes for the functions in this file. */ -#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, NODEBUG_ATTRIBUTE)) - -/// \brief Loads a 128-bit floating-point vector of [4 x float] from an aligned -/// memory location. -/// -/// \headerfile -/// -/// This intrinsic corresponds to the \c VMOVAPS / MOVAPS instruction. -/// -/// \param __p -/// A pointer to a 128-bit memory location. The address of the memory -/// location has to be 128-bit aligned. -/// \returns A 128-bit vector of [4 x float] containing the loaded valus. -static __inline__ __m128 __DEFAULT_FN_ATTRS -_mm_load_ps(const float *__p) -{ - return *(__m128*)__p; -} - -/// \brief Loads a 128-bit floating-point vector of [4 x float] from an -/// unaligned memory location. -/// -/// \headerfile -/// -/// This intrinsic corresponds to the \c VMOVUPS / MOVUPS instruction. -/// -/// \param __p -/// A pointer to a 128-bit memory location. The address of the memory -/// location does not have to be aligned. -/// \returns A 128-bit vector of [4 x float] containing the loaded values. -static __inline__ __m128 __DEFAULT_FN_ATTRS -_mm_loadu_ps(const float *__p) -{ - struct __loadu_ps - { - __m128 __v; - } __attribute__((__packed__, __may_alias__)); - return ((struct __loadu_ps*)__p)->__v; -} - -/// \brief Stores float values from a 128-bit vector of [4 x float] to an -/// unaligned memory location. -/// -/// \headerfile -/// -/// This intrinsic corresponds to the \c VMOVUPS / MOVUPS instruction. -/// -/// \param __p -/// A pointer to a 128-bit memory location. The address of the memory -/// location does not have to be aligned. -/// \param __a -/// A 128-bit vector of [4 x float] containing the values to be stored. -static __inline__ void __DEFAULT_FN_ATTRS -_mm_storeu_ps(float *__p, __m128 __a) -{ - struct __storeu_ps - { - __m128 __v; - } __attribute__((__packed__, __may_alias__)); - ((struct __storeu_ps*)__p)->__v = __a; -} - -/// \brief Stores the lower 32 bits of a 128-bit vector of [4 x float] into -/// four contiguous elements in an aligned memory location. -/// -/// \headerfile -/// -/// This intrinsic corresponds to \c VMOVAPS / MOVAPS + \c shuffling -/// instruction. -/// -/// \param __p -/// A pointer to a 128-bit memory location. -/// \param __a -/// A 128-bit vector of [4 x float] whose lower 32 bits are stored to each -/// of the four contiguous elements pointed by __p. -static __inline__ void __DEFAULT_FN_ATTRS -_mm_store_ps(float *__p, __m128 __a) -{ - *(__m128*)__p = __a; -} - -#undef __DEFAULT_FN_ATTRS - -#endif // __GNUC__ diff --git a/src/shared/pal/inc/rt/dbghelp.h b/src/shared/pal/inc/rt/dbghelp.h deleted file mode 100644 index 1d231d34fc..0000000000 --- a/src/shared/pal/inc/rt/dbghelp.h +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ BUILD Version: 0000 Increment this if a change has global effects - - - -Module Name: - - dbghelp.h - -Abstract: - - This module defines the prototypes and constants required for the image - help routines. - - Contains debugging support routines that are redistributable. - -Revision History: - ---*/ - -#ifndef _DBGHELP_ -#define _DBGHELP_ - -#if _MSC_VER > 1020 -#pragma once -#endif - -// -// options that are set/returned by SymSetOptions() & SymGetOptions() -// these are used as a mask -// -#define SYMOPT_LOAD_LINES 0x00000010 - -#endif // _DBGHELP_ diff --git a/src/shared/pal/inc/rt/htmlhelp.h b/src/shared/pal/inc/rt/htmlhelp.h deleted file mode 100644 index 5a3142f742..0000000000 --- a/src/shared/pal/inc/rt/htmlhelp.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: htmlhelp.h -// -// =========================================================================== -// dummy htmlhelp.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/new.h b/src/shared/pal/inc/rt/new.h deleted file mode 100644 index 1cb42afc67..0000000000 --- a/src/shared/pal/inc/rt/new.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: new.h -// -// =========================================================================== -// dummy new.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/ntimage.h b/src/shared/pal/inc/rt/ntimage.h index a1ac7c2f99..3c7de05234 100644 --- a/src/shared/pal/inc/rt/ntimage.h +++ b/src/shared/pal/inc/rt/ntimage.h @@ -407,7 +407,7 @@ typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS; #define IMAGE_FIRST_SECTION( ntheader ) ((PIMAGE_SECTION_HEADER) \ ((ULONG_PTR)ntheader + \ - FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + \ + offsetof( IMAGE_NT_HEADERS, OptionalHeader ) + \ VAL16(((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader) \ )) @@ -475,22 +475,6 @@ typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS; #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13 // Delay Load Import Descriptors #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14 // COM Runtime descriptor -#ifdef _MSC_VER -// -// Non-COFF Object file header -// - -typedef struct ANON_OBJECT_HEADER { - USHORT Sig1; // Must be IMAGE_FILE_MACHINE_UNKNOWN - USHORT Sig2; // Must be 0xffff - USHORT Version; // >= 1 (implies the CLSID field is present) - USHORT Machine; - ULONG TimeDateStamp; - CLSID ClassID; // Used to invoke CoCreateInstance - ULONG SizeOfData; // Size of data that follows the header -} ANON_OBJECT_HEADER; -#endif - // // Section header format. // @@ -1041,7 +1025,6 @@ typedef IMAGE_RELOCATION UNALIGNED *PIMAGE_RELOCATION; // RISCV64 relocation types // #define IMAGE_REL_RISCV64_PC 0x0003 -#define IMAGE_REL_RISCV64_JALR 0x0004 // // CEF relocation types. diff --git a/src/shared/pal/inc/rt/oaidl.h b/src/shared/pal/inc/rt/oaidl.h deleted file mode 100644 index 3c75bc0535..0000000000 --- a/src/shared/pal/inc/rt/oaidl.h +++ /dev/null @@ -1,110 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: oaidl.h -// -// =========================================================================== - -#ifndef __OAIDL_H__ -#define __OAIDL_H__ - -#include "rpc.h" -#include "rpcndr.h" - -#include "unknwn.h" - -typedef struct tagEXCEPINFO { - WORD wCode; - WORD wReserved; - BSTR bstrSource; - BSTR bstrDescription; - BSTR bstrHelpFile; - DWORD dwHelpContext; - PVOID pvReserved; - HRESULT (__stdcall *pfnDeferredFillIn)(struct tagEXCEPINFO *); - SCODE scode; -} EXCEPINFO, * LPEXCEPINFO; - -typedef interface IErrorInfo IErrorInfo; -typedef /* [unique] */ IErrorInfo *LPERRORINFO; - -EXTERN_C const IID IID_IErrorInfo; - - interface - IErrorInfo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetGUID( - /* [out] */ GUID *pGUID) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSource( - /* [out] */ BSTR *pBstrSource) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDescription( - /* [out] */ BSTR *pBstrDescription) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetHelpFile( - /* [out] */ BSTR *pBstrHelpFile) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetHelpContext( - /* [out] */ DWORD *pdwHelpContext) = 0; - - }; - -typedef interface ICreateErrorInfo ICreateErrorInfo; - -EXTERN_C const IID IID_ICreateErrorInfo; - -typedef /* [unique] */ ICreateErrorInfo *LPCREATEERRORINFO; - - interface - ICreateErrorInfo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SetGUID( - /* [in] */ REFGUID rguid) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSource( - /* [in] */ LPOLESTR szSource) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetDescription( - /* [in] */ LPOLESTR szDescription) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetHelpFile( - /* [in] */ LPOLESTR szHelpFile) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetHelpContext( - /* [in] */ DWORD dwHelpContext) = 0; - - }; - -STDAPI -SetErrorInfo(ULONG dwReserved, IErrorInfo FAR* perrinfo); - -STDAPI -GetErrorInfo(ULONG dwReserved, IErrorInfo FAR* FAR* pperrinfo); - -STDAPI -CreateErrorInfo(ICreateErrorInfo FAR* FAR* pperrinfo); - - -typedef interface ISupportErrorInfo ISupportErrorInfo; - -typedef /* [unique] */ ISupportErrorInfo *LPSUPPORTERRORINFO; - -EXTERN_C const IID IID_ISupportErrorInfo; - - - interface - ISupportErrorInfo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE InterfaceSupportsErrorInfo( - /* [in] */ REFIID riid) = 0; - - }; - -#endif //__OAIDL_H__ diff --git a/src/shared/pal/inc/rt/ole2.h b/src/shared/pal/inc/rt/ole2.h index f51d41e04b..260e051b43 100644 --- a/src/shared/pal/inc/rt/ole2.h +++ b/src/shared/pal/inc/rt/ole2.h @@ -7,5 +7,4 @@ #include "objidl.h" #include "servprov.h" -#include "oaidl.h" diff --git a/src/shared/pal/inc/rt/oleauto.h b/src/shared/pal/inc/rt/oleauto.h index 15db2c3912..663faf6be5 100644 --- a/src/shared/pal/inc/rt/oleauto.h +++ b/src/shared/pal/inc/rt/oleauto.h @@ -11,7 +11,6 @@ #ifndef _OLEAUTO_H_ #define _OLEAUTO_H_ -#include "oaidl.h" #ifndef BEGIN_INTERFACE #define BEGIN_INTERFACE diff --git a/src/shared/pal/inc/rt/palrt.h b/src/shared/pal/inc/rt/palrt.h index 033e523c35..df14db6c0a 100644 --- a/src/shared/pal/inc/rt/palrt.h +++ b/src/shared/pal/inc/rt/palrt.h @@ -135,18 +135,6 @@ typedef enum tagEFaultRepRetVal #include "pal.h" -#ifndef PAL_STDCPP_COMPAT -#ifdef __cplusplus -#ifndef __PLACEMENT_NEW_INLINE -#define __PLACEMENT_NEW_INLINE -inline void *__cdecl operator new(size_t, void *_P) -{ - return (_P); -} -#endif // __PLACEMENT_NEW_INLINE -#endif // __cplusplus -#endif // !PAL_STDCPP_COMPAT - #include #define NTAPI __cdecl @@ -156,25 +144,12 @@ inline void *__cdecl operator new(size_t, void *_P) #define _WINNT_ -// C++ standard, 18.1.5 - offsetof requires a POD (plain old data) struct or -// union. Since offsetof is a macro, gcc doesn't actually check for improper -// use of offsetof, it keys off of the -> from NULL (which is also invalid for -// non-POD types by 18.1.5) -// -// As we have numerous examples of this behavior in our codebase, -// making an offsetof which doesn't use 0. - -// PAL_safe_offsetof is a version of offsetof that protects against an -// overridden operator& - -#define FIELD_OFFSET(type, field) __builtin_offsetof(type, field) #ifndef offsetof #define offsetof(type, field) __builtin_offsetof(type, field) #endif -#define PAL_safe_offsetof(type, field) __builtin_offsetof(type, field) #define CONTAINING_RECORD(address, type, field) \ - ((type *)((LONG_PTR)(address) - FIELD_OFFSET(type, field))) + ((type *)((LONG_PTR)(address) - offsetof(type, field))) #define ARGUMENT_PRESENT(ArgumentPointer) (\ (CHAR *)(ArgumentPointer) != (CHAR *)(NULL) ) @@ -293,9 +268,7 @@ typedef union _ULARGE_INTEGER { DWORD HighPart; #endif } -#ifndef PAL_STDCPP_COMPAT u -#endif // PAL_STDCPP_COMPAT ; ULONGLONG QuadPart; } ULARGE_INTEGER, *PULARGE_INTEGER; @@ -611,9 +584,6 @@ STDAPI CreateStreamOnHGlobal(PVOID hGlobal, BOOL fDeleteOnRelease, interface ISt #define STGM_NOSNAPSHOT 0x00200000L -STDAPI IIDFromString(LPOLESTR lpsz, IID* lpiid); -STDAPI_(int) StringFromGUID2(REFGUID rguid, LPOLESTR lpsz, int cchMax); - /******************* CRYPT **************************************/ #define PUBLICKEYBLOB 0x6 @@ -653,49 +623,6 @@ typedef unsigned int ALG_ID; // 1 null termination #define LOCALE_NAME_MAX_LENGTH 85 -#define CSTR_LESS_THAN 1 -#define CSTR_EQUAL 2 -#define CSTR_GREATER_THAN 3 - -/******************* shlwapi ************************************/ - -// note: diff in NULL handing and calling convetion -#define StrCpyW PAL_wcscpy -#define StrCatW PAL_wcscat -#define StrChrW (WCHAR*)PAL_wcschr -#define StrCmpW PAL_wcscmp -#define StrCmpIW _wcsicmp -#define StrCmpNW PAL_wcsncmp -#define StrCmpNIW _wcsnicmp - -STDAPI_(LPWSTR) StrNCatW(LPWSTR lpFront, LPCWSTR lpBack, int cchMax); -STDAPI_(int) StrToIntW(LPCWSTR lpSrc); -STDAPI_(LPWSTR) StrStrIW(LPCWSTR lpFirst, LPCWSTR lpSrch); -STDAPI_(LPWSTR) StrRChrW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch); -STDAPI_(LPWSTR) StrCatBuffW(LPWSTR pszDest, LPCWSTR pszSrc, int cchDestBuffSize); - -#define lstrcmpW PAL_wcscmp -#define lstrcmpiW _wcsicmp - -#ifdef UNICODE -#define StrCpy StrCpyW -#define StrCat StrCatW -#define StrNCat StrNCatW -#define StrChr StrChrW -#define StrCmp StrCmpW -#define StrCmpN StrCmpNW -#define StrCmpI StrCmpIW -#define StrCmpNI StrCmpNIW - -#define StrToInt StrToIntW -#define StrStrI StrStrIW -#define StrRChr StrRChrW -#define StrCatBuff StrCatBuffW - -#define lstrcmp lstrcmpW -#define lstrcmpi lstrcmpiW -#endif - #ifdef __cplusplus /* @@ -712,11 +639,9 @@ STDAPI_(LPWSTR) StrCatBuffW(LPWSTR pszDest, LPCWSTR pszSrc, int cchDestBuffSize) /* The wrappers below are simple implementations that may not be as robust as complete functions in the Secure CRT library. -Remember to fix the errcode defintion in safecrt.h. +Remember to fix the errcode definition in safecrt.h. */ -#define swscanf_s swscanf - #define _wfopen_s _wfopen_unsafe #define fopen_s _fopen_unsafe @@ -749,9 +674,9 @@ inline int __cdecl _vscprintf_unsafe(const char *_Format, va_list _ArgList) } } -inline errno_t __cdecl _wfopen_unsafe(PAL_FILE * *ff, const WCHAR *fileName, const WCHAR *mode) +inline errno_t __cdecl _wfopen_unsafe(FILE * *ff, const WCHAR *fileName, const WCHAR *mode) { - PAL_FILE *result = _wfopen(fileName, mode); + FILE *result = _wfopen(fileName, mode); if(result == 0) { return 1; } else { @@ -760,9 +685,9 @@ inline errno_t __cdecl _wfopen_unsafe(PAL_FILE * *ff, const WCHAR *fileName, con } } -inline errno_t __cdecl _fopen_unsafe(PAL_FILE * *ff, const char *fileName, const char *mode) +inline errno_t __cdecl _fopen_unsafe(FILE * *ff, const char *fileName, const char *mode) { - PAL_FILE *result = PAL_fopen(fileName, mode); + FILE *result = fopen(fileName, mode); if(result == 0) { return 1; } else { @@ -774,44 +699,6 @@ inline errno_t __cdecl _fopen_unsafe(PAL_FILE * *ff, const char *fileName, const } #endif /* __cplusplus */ -STDAPI_(BOOL) PathAppendW(LPWSTR pszPath, LPCWSTR pszMore); -STDAPI_(int) PathCommonPrefixW(LPCWSTR pszFile1, LPCWSTR pszFile2, LPWSTR pszPath); -PALIMPORT LPWSTR PALAPI PathFindFileNameW(LPCWSTR pPath); -STDAPI_(int) PathGetDriveNumberW(LPCWSTR lpsz); -STDAPI_(BOOL) PathIsRelativeW(LPCWSTR lpszPath); -STDAPI_(BOOL) PathIsUNCW(LPCWSTR pszPath); -STDAPI_(LPWSTR) PathAddBackslashW(LPWSTR lpszPath); -STDAPI_(LPWSTR) PathRemoveBackslashW(LPWSTR lpszPath); -STDAPI_(void) PathRemoveExtensionW(LPWSTR pszPath); -STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile); -STDAPI_(BOOL) PathCanonicalizeW(LPWSTR lpszDst, LPCWSTR lpszSrc); -STDAPI_(BOOL) PathRelativePathToW(LPWSTR pszPath, LPCWSTR pszFrom, DWORD dwAttrFrom, LPCWSTR pszTo, DWORD dwAttrTo); -STDAPI_(BOOL) PathRenameExtensionW(LPWSTR pszPath, LPCWSTR pszExt); -STDAPI_(BOOL) PathRemoveFileSpecW(LPWSTR pFile); -STDAPI_(void) PathStripPathW (LPWSTR pszPath); - -#ifdef UNICODE -#define PathAppend PathAppendW -#define PathCommonPrefix PathCommonPrefixW -#define PathFindFileName PathFindFileNameW -#define PathIsRelative PathIsRelativeW -#define PathGetDriveNumber PathGetDriveNumberW -#define PathIsUNC PathIsUNCW -#define PathAddBackslash PathAddBackslashW -#define PathRemoveBackslash PathRemoveBackslashW -#define PathRemoveExtension PathRemoveExtensionW -#define PathCombine PathCombineW -#define PathSkipRoot PathSkipRootW -#define PathFindExtension PathFindExtensionW -#define PathCanonicalize PathCanonicalizeW -#define PathRelativePathTo PathRelativePathToW -#define PathRemoveFileSpec PathRemoveFileSpecW -#define PathRenameExtension PathRenameExtensionW -#define PathStripPath PathStripPathW - - -#endif // UNICODE - /******************* misc ***************************************/ #ifdef __cplusplus @@ -838,22 +725,13 @@ typename std::remove_reference::type&& move( T&& t ); typedef DWORD OLE_COLOR; -#define PF_COMPARE_EXCHANGE_DOUBLE 2 - -typedef VOID (NTAPI * WAITORTIMERCALLBACKFUNC) (PVOID, BOOLEAN ); - typedef HANDLE HWND; -#define IS_TEXT_UNICODE_SIGNATURE 0x0008 -#define IS_TEXT_UNICODE_UNICODE_MASK 0x000F - typedef struct _LIST_ENTRY { struct _LIST_ENTRY *Flink; struct _LIST_ENTRY *Blink; } LIST_ENTRY, *PLIST_ENTRY; -typedef VOID (NTAPI *WAITORTIMERCALLBACK)(PVOID, BOOLEAN); - // PORTABILITY_ASSERT and PORTABILITY_WARNING macros are meant to be used to // mark places in the code that needs attention for portability. The usual // usage pattern is: @@ -936,23 +814,6 @@ typedef VOID (NTAPI *WAITORTIMERCALLBACK)(PVOID, BOOLEAN); #define IMAGE_COR20_HEADER_FIELD(obj, f) ((obj).f) #endif -// copied from winnt.h -#define PROCESSOR_ARCHITECTURE_INTEL 0 -#define PROCESSOR_ARCHITECTURE_MIPS 1 -#define PROCESSOR_ARCHITECTURE_ALPHA 2 -#define PROCESSOR_ARCHITECTURE_PPC 3 -#define PROCESSOR_ARCHITECTURE_SHX 4 -#define PROCESSOR_ARCHITECTURE_ARM 5 -#define PROCESSOR_ARCHITECTURE_IA64 6 -#define PROCESSOR_ARCHITECTURE_ALPHA64 7 -#define PROCESSOR_ARCHITECTURE_MSIL 8 -#define PROCESSOR_ARCHITECTURE_AMD64 9 -#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10 -#define PROCESSOR_ARCHITECTURE_NEUTRAL 11 -#define PROCESSOR_ARCHITECTURE_ARM64 12 - -#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF - // // JIT Debugging Info. This structure is defined to have constant size in // both the emulated and native environment. @@ -960,7 +821,6 @@ typedef VOID (NTAPI *WAITORTIMERCALLBACK)(PVOID, BOOLEAN); typedef struct _JIT_DEBUG_INFO { DWORD dwSize; - DWORD dwProcessorArchitecture; DWORD dwThreadID; DWORD dwReserved0; ULONG64 lpExceptionAddress; @@ -978,44 +838,6 @@ typedef JIT_DEBUG_INFO JIT_DEBUG_INFO64, *LPJIT_DEBUG_INFO64; #define RT_RCDATA MAKEINTRESOURCE(10) #define RT_VERSION MAKEINTRESOURCE(16) -/******************* SAFEARRAY ************************/ - -#define FADF_VARIANT ( 0x800 ) - -typedef struct tagSAFEARRAYBOUND - { - ULONG cElements; - LONG lLbound; - } SAFEARRAYBOUND; - -typedef struct tagSAFEARRAYBOUND *LPSAFEARRAYBOUND; - -typedef struct tagSAFEARRAY - { - USHORT cDims; - USHORT fFeatures; - ULONG cbElements; - ULONG cLocks; - PVOID pvData; - SAFEARRAYBOUND rgsabound[ 1 ]; - } SAFEARRAY; - -typedef SAFEARRAY *LPSAFEARRAY; - - -STDAPI_(SAFEARRAY *) SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements); -STDAPI_(UINT) SafeArrayGetDim(SAFEARRAY * psa); -STDAPI SafeArrayGetElement(SAFEARRAY * psa, LONG * rgIndices, void * pv); -STDAPI SafeArrayGetLBound(SAFEARRAY * psa, UINT nDim, LONG * plLbound); -STDAPI SafeArrayGetUBound(SAFEARRAY * psa, UINT nDim, LONG * plUbound); -STDAPI SafeArrayGetVartype(SAFEARRAY * psa, VARTYPE * pvt); -STDAPI SafeArrayPutElement(SAFEARRAY * psa, LONG * rgIndices, void * pv); -STDAPI SafeArrayDestroy(SAFEARRAY * psa); - -EXTERN_C void * _stdcall _lfind(const void *, const void *, unsigned int *, unsigned int, - int (__cdecl *)(const void *, const void *)); - - /******************* clean this up ************************/ @@ -1024,11 +846,6 @@ interface ITypeInfo; interface ITypeLib; interface IMoniker; -typedef VOID (WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)( - DWORD dwErrorCode, - DWORD dwNumberOfBytesTransfered, - LPOVERLAPPED lpOverlapped); - // // Debug APIs // @@ -1167,7 +984,7 @@ typedef struct _DISPATCHER_CONTEXT { DWORD Reserved; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; -#elif defined(HOST_ARM64) || defined(HOST_RISCV64) +#elif defined(HOST_ARM64) || defined(HOST_LOONGARCH64) || defined(HOST_RISCV64) typedef struct _DISPATCHER_CONTEXT { ULONG64 ControlPc; @@ -1223,14 +1040,20 @@ typedef struct _DISPATCHER_CONTEXT { DWORD Reserved; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; +#elif defined(HOST_POWERPC64) + +typedef struct _DISPATCHER_CONTEXT { + // PPC64LE does not build the VM or JIT at this point, + // so we only provide a dummy definition. + DWORD Reserved; +} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; + #else #error Unknown architecture for defining DISPATCHER_CONTEXT. #endif -// #endif // !defined(TARGET_OSX) - typedef DISPATCHER_CONTEXT *PDISPATCHER_CONTEXT; #define ExceptionContinueSearch EXCEPTION_CONTINUE_SEARCH @@ -1260,26 +1083,6 @@ typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)( ); typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER; -/******************* ntdef ************************************/ - -#ifndef ANYSIZE_ARRAY -#define ANYSIZE_ARRAY 1 // winnt -#endif - -/******************* winnt ************************************/ - -typedef struct LIST_ENTRY32 { - ULONG Flink; - ULONG Blink; -} LIST_ENTRY32; -typedef LIST_ENTRY32 *PLIST_ENTRY32; - -typedef struct LIST_ENTRY64 { - ULONGLONG Flink; - ULONGLONG Blink; -} LIST_ENTRY64; -typedef LIST_ENTRY64 *PLIST_ENTRY64; - /******************** PAL RT APIs *******************************/ typedef struct _HSATELLITE *HSATELLITE; diff --git a/src/shared/pal/inc/rt/process.h b/src/shared/pal/inc/rt/process.h deleted file mode 100644 index 38db0009d6..0000000000 --- a/src/shared/pal/inc/rt/process.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: process.h -// -// =========================================================================== -// dummy process.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/richedit.h b/src/shared/pal/inc/rt/richedit.h deleted file mode 100644 index d445296c50..0000000000 --- a/src/shared/pal/inc/rt/richedit.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: richedit.h -// -// =========================================================================== -// dummy richedit.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/safecrt.h b/src/shared/pal/inc/rt/safecrt.h index e7b5119045..7cb5153f6b 100644 --- a/src/shared/pal/inc/rt/safecrt.h +++ b/src/shared/pal/inc/rt/safecrt.h @@ -86,15 +86,6 @@ #endif #endif -/* NULL */ -#if !defined(NULL) -#if !defined(__cplusplus) -#define NULL 0 -#else -#define NULL ((void *)0) -#endif -#endif - /* _W64 */ #if !defined(_W64) #if !defined(__midl) && (defined(HOST_X86) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -104,16 +95,6 @@ #endif #endif -/* uintptr_t */ -#if !defined(_UINTPTR_T_DEFINED) -#if defined(HOST_64BIT) -typedef unsigned __int64 uintptr_t; -#else -typedef _W64 unsigned int uintptr_t; -#endif -#define _UINTPTR_T_DEFINED -#endif - #ifdef __GNUC__ #define SAFECRT_DEPRECATED __attribute__((deprecated)) #else @@ -370,7 +351,6 @@ void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionNam #define _tcsncat_s strncat_s #define _tcsset_s _strset_s #define _tcsnset_s _strnset_s -#define _tcstok_s strtok_s #define _vsntprintf_s _vsnprintf_s #elif defined(_UNICODE) || defined(UNICODE) @@ -381,11 +361,8 @@ void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionNam #define _tcsncat_s wcsncat_s #define _tcsset_s _wcsset_s #define _tcsnset_s _wcsnset_s -#define _tcstok_s wcstok_s #define _tmakepath_s _wmakepath_s -#define _tsplitpath_s _wsplitpath_s #define _stprintf_s swprintf_s -#define _vsntprintf_s _vsnwprintf_s #define _tscanf_s wscanf_s #define _tsscanf_s swscanf_s @@ -1120,205 +1097,6 @@ errno_t __cdecl _wcsnset_s(WCHAR *_Dst, size_t _SizeInWords, WCHAR _Value, size_ #endif -/* strtok_s */ -/* - * strtok_s, wcstok_s ; - * uses _Context to keep track of the position in the string. - */ -_SAFECRT__EXTERN_C -char * __cdecl strtok_s(char *_String, const char *_Control, char **_Context); - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -char * __cdecl strtok_s(char *_String, const char *_Control, char **_Context) -{ - unsigned char *str; - const unsigned char *ctl = (const unsigned char *)_Control; - unsigned char map[32]; - int count; - - /* validation section */ - _SAFECRT__VALIDATE_POINTER_ERROR_RETURN(_Context, EINVAL, nullptr); - _SAFECRT__VALIDATE_POINTER_ERROR_RETURN(_Control, EINVAL, nullptr); - _SAFECRT__VALIDATE_CONDITION_ERROR_RETURN(_String != nullptr || *_Context != nullptr, EINVAL, nullptr); - - /* Clear control map */ - for (count = 0; count < 32; count++) - { - map[count] = 0; - } - - /* Set bits in delimiter table */ - do { - map[*ctl >> 3] |= (1 << (*ctl & 7)); - } while (*ctl++); - - /* If string is nullptr, set str to the saved - * pointer (i.e., continue breaking tokens out of the string - * from the last strtok call) */ - if (_String != nullptr) - { - str = (unsigned char *)_String; - } - else - { - str = (unsigned char *)*_Context; - } - - /* Find beginning of token (skip over leading delimiters). Note that - * there is no token iff this loop sets str to point to the terminal - * null (*str == 0) */ - while ((map[*str >> 3] & (1 << (*str & 7))) && *str != 0) - { - str++; - } - - _String = (char *)str; - - /* Find the end of the token. If it is not the end of the string, - * put a null there. */ - for ( ; *str != 0 ; str++ ) - { - if (map[*str >> 3] & (1 << (*str & 7))) - { - *str++ = 0; - break; - } - } - - /* Update context */ - *_Context = (char *)str; - - /* Determine if a token has been found. */ - if (_String == (char *)str) - { - return nullptr; - } - else - { - return _String; - } -} -#endif - -/* wcstok_s */ -_SAFECRT__EXTERN_C -WCHAR * __cdecl wcstok_s(WCHAR *_String, const WCHAR *_Control, WCHAR **_Context); - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -WCHAR * __cdecl wcstok_s(WCHAR *_String, const WCHAR *_Control, WCHAR **_Context) -{ - WCHAR *token; - const WCHAR *ctl; - - /* validation section */ - _SAFECRT__VALIDATE_POINTER_ERROR_RETURN(_Context, EINVAL, nullptr); - _SAFECRT__VALIDATE_POINTER_ERROR_RETURN(_Control, EINVAL, nullptr); - _SAFECRT__VALIDATE_CONDITION_ERROR_RETURN(_String != nullptr || *_Context != nullptr, EINVAL, nullptr); - - /* If string==nullptr, continue with previous string */ - if (!_String) - { - _String = *_Context; - } - - /* Find beginning of token (skip over leading delimiters). Note that - * there is no token iff this loop sets string to point to the terminal null. */ - for ( ; *_String != 0 ; _String++) - { - for (ctl = _Control; *ctl != 0 && *ctl != *_String; ctl++) - ; - if (*ctl == 0) - { - break; - } - } - - token = _String; - - /* Find the end of the token. If it is not the end of the string, - * put a null there. */ - for ( ; *_String != 0 ; _String++) - { - for (ctl = _Control; *ctl != 0 && *ctl != *_String; ctl++) - ; - if (*ctl != 0) - { - *_String++ = 0; - break; - } - } - - /* Update the context */ - *_Context = _String; - - /* Determine if a token has been found. */ - if (token == _String) - { - return nullptr; - } - else - { - return token; - } -} -#endif - -#ifndef PAL_STDCPP_COMPAT -/* strnlen */ -/* - * strnlen, wcsnlen ; - * returns inMaxSize if the null character is not found. - */ -_SAFECRT__EXTERN_C -size_t __cdecl strnlen(const char* inString, size_t inMaxSize); - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -size_t __cdecl strnlen(const char* inString, size_t inMaxSize) -{ - size_t n; - - /* Note that we do not check if s == nullptr, because we do not - * return errno_t... - */ - - for (n = 0; n < inMaxSize && *inString; n++, inString++) - ; - - return n; -} - -#endif - -/* wcsnlen */ -_SAFECRT__EXTERN_C -size_t __cdecl wcsnlen(const WCHAR *inString, size_t inMaxSize); - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -size_t __cdecl wcsnlen(const WCHAR *inString, size_t inMaxSize) -{ - size_t n; - - /* Note that we do not check if s == nullptr, because we do not - * return errno_t... - */ - - for (n = 0; n < inMaxSize && *inString; n++, inString++) - ; - - return n; -} - -#endif -#endif // PAL_STDCPP_COMPAT - /* _wmakepath_s */ _SAFECRT__EXTERN_C errno_t __cdecl _wmakepath_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Drive, const WCHAR *_Dir, const WCHAR *_Filename, const WCHAR *_Ext); @@ -1371,13 +1149,13 @@ errno_t __cdecl _wmakepath_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Dri } while (*p != 0); p = p - 1; - if (*p != L'/' && *p != L'\\') + if (*p != L'/') { if(++written >= _SizeInWords) { goto error_return; } - *d++ = L'\\'; + *d++ = L'/'; } } @@ -1433,228 +1211,10 @@ errno_t __cdecl _wmakepath_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Dri } #endif -/* _wsplitpath_s */ -_SAFECRT__EXTERN_C -errno_t __cdecl _wsplitpath_s( - const WCHAR *_Path, - WCHAR *_Drive, size_t _DriveSize, - WCHAR *_Dir, size_t _DirSize, - WCHAR *_Filename, size_t _FilenameSize, - WCHAR *_Ext, size_t _ExtSize -); - -/* no C++ overload for _wsplitpath_s */ - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -errno_t __cdecl _wsplitpath_s( - const WCHAR *_Path, - WCHAR *_Drive, size_t _DriveSize, - WCHAR *_Dir, size_t _DirSize, - WCHAR *_Filename, size_t _FilenameSize, - WCHAR *_Ext, size_t _ExtSize -) -{ - const WCHAR *tmp; - const WCHAR *last_slash; - const WCHAR *dot; - int drive_set = 0; - size_t length = 0; - int bEinval = 0; - - /* validation section */ - _SAFECRT__VALIDATE_POINTER(_Path); - if ((_Drive == nullptr && _DriveSize != 0) || (_Drive != nullptr && _DriveSize == 0)) - { - goto error_einval; - } - if ((_Dir == nullptr && _DirSize != 0) || (_Dir != nullptr && _DirSize == 0)) - { - goto error_einval; - } - if ((_Filename == nullptr && _FilenameSize != 0) || (_Filename != nullptr && _FilenameSize == 0)) - { - goto error_einval; - } - if ((_Ext == nullptr && _ExtSize != 0) || (_Ext != nullptr && _ExtSize == 0)) - { - goto error_einval; - } - - /* check if _Path begins with the longpath prefix */ - if (_Path[0] == L'\\' && _Path[1] == L'\\' && _Path[2] == L'?' && _Path[3] == L'\\') - { - _Path += 4; - } - - /* extract drive letter and ':', if any */ - if (!drive_set) - { - size_t skip = _MAX_DRIVE - 2; - tmp = _Path; - while (skip > 0 && *tmp != 0) - { - skip--; - tmp++; - } - if (*tmp == L':') - { - if (_Drive != nullptr) - { - if (_DriveSize < _MAX_DRIVE) - { - goto error_erange; - } - wcsncpy_s(_Drive, _DriveSize, _Path, _MAX_DRIVE - 1); - } - _Path = tmp + 1; - } - else - { - if (_Drive != nullptr) - { - _SAFECRT__RESET_STRING(_Drive, _DriveSize); - } - } - } - - /* extract path string, if any. _Path now points to the first character - * of the path, if any, or the filename or extension, if no path was - * specified. Scan ahead for the last occurrence, if any, of a '/' or - * '\' path separator character. If none is found, there is no path. - * We will also note the last '.' character found, if any, to aid in - * handling the extension. - */ - last_slash = nullptr; - dot = nullptr; - tmp = _Path; - for (; *tmp != 0; ++tmp) - { - { - if (*tmp == L'/' || *tmp == L'\\') - { - /* point to one beyond for later copy */ - last_slash = tmp + 1; - } - else if (*tmp == L'.') - { - dot = tmp; - } - } - } - - if (last_slash != nullptr) - { - /* found a path - copy up through last_slash or max characters - * allowed, whichever is smaller - */ - if (_Dir != nullptr) { - length = (size_t)(last_slash - _Path); - if (_DirSize <= length) - { - goto error_erange; - } - wcsncpy_s(_Dir, _DirSize, _Path, length); - } - _Path = last_slash; - } - else - { - /* there is no path */ - if (_Dir != nullptr) - { - _SAFECRT__RESET_STRING(_Dir, _DirSize); - } - } - - /* extract file name and extension, if any. Path now points to the - * first character of the file name, if any, or the extension if no - * file name was given. Dot points to the '.' beginning the extension, - * if any. - */ - if (dot != nullptr && (dot >= _Path)) - { - /* found the marker for an extension - copy the file name up to the '.' */ - if (_Filename) - { - length = (size_t)(dot - _Path); - if (_FilenameSize <= length) - { - goto error_erange; - } - wcsncpy_s(_Filename, _FilenameSize, _Path, length); - } - /* now we can get the extension - remember that tmp still points - * to the terminating nullptr character of path. - */ - if (_Ext) - { - length = (size_t)(tmp - dot); - if (_ExtSize <= length) - { - goto error_erange; - } - wcsncpy_s(_Ext, _ExtSize, dot, length); - } - } - else - { - /* found no extension, give empty extension and copy rest of - * string into fname. - */ - if (_Filename) - { - length = (size_t)(tmp - _Path); - if (_FilenameSize <= length) - { - goto error_erange; - } - wcsncpy_s(_Filename, _FilenameSize, _Path, length); - } - if (_Ext) - { - _SAFECRT__RESET_STRING(_Ext, _ExtSize); - } - } - - return 0; - -error_einval: - bEinval = 1; - -error_erange: - if (_Drive != nullptr && _DriveSize > 0) - { - _SAFECRT__RESET_STRING(_Drive, _DriveSize); - } - if (_Dir != nullptr && _DirSize > 0) - { - _SAFECRT__RESET_STRING(_Dir, _DirSize); - } - if (_Filename != nullptr && _FilenameSize > 0) - { - _SAFECRT__RESET_STRING(_Filename, _FilenameSize); - } - if (_Ext != nullptr && _ExtSize > 0) - { - _SAFECRT__RESET_STRING(_Ext, _ExtSize); - } - - if (bEinval) - { - _SAFECRT__RETURN_EINVAL; - } - - _SAFECRT__RETURN_BUFFER_TOO_SMALL(_Strings, _StringSizes); - /* should never happen, but compiler can't tell */ - return EINVAL; -} -#endif /* vsprintf_s */ /* - * swprintf_s, vsprintf_s, vswprintf_s format a string and copy it into _Dst; + * swprintf_s, vsprintf_s format a string and copy it into _Dst; * need safecrt.lib and msvcrt.dll; * will call _SAFECRT_INVALID_PARAMETER if there is not enough space in _Dst; * will call _SAFECRT_INVALID_PARAMETER if the format string is malformed; @@ -1709,7 +1269,7 @@ int __cdecl vswprintf_s(WCHAR (&_Dst)[_SizeInWords], const WCHAR *_Format, va_li /* _vsnprintf_s */ /* - * _snwprintf_s, _vsnprintf_s, _vsnwprintf_s format a string and copy at max _Count characters into _Dst; + * _vsnprintf_s formats a string and copy at max _Count characters into _Dst; * need safecrt.lib and msvcrt.dll; * string _Dst will always be null-terminated; * will call _SAFECRT_INVALID_PARAMETER if there is not enough space in _Dst; diff --git a/src/shared/pal/inc/rt/sal.h b/src/shared/pal/inc/rt/sal.h index 198b46d4a4..9d461e8050 100644 --- a/src/shared/pal/inc/rt/sal.h +++ b/src/shared/pal/inc/rt/sal.h @@ -127,7 +127,7 @@ _Success_(return != FALSE) BOOL PathCanonicalizeA(_Out_writes_(MAX_PATH) LPSTR pszBuf, LPCSTR pszPath) : pszBuf is only guaranteed to be NULL-terminated when TRUE is returned, - and FALSE indiates failure. In common practice, callers check for zero + and FALSE indicates failure. In common practice, callers check for zero vs. non-zero returns, so it is preferable to express the success criteria in terms of zero/non-zero, not checked for exactly TRUE. @@ -260,7 +260,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default}; // Only applicable with functions that have _Success_ or _Return_type_succss_. #define _Always_(annos) _Always_impl_(annos _SAL_nop_impl_) -// Usable on a function defintion. Asserts that a function declaration is +// Usable on a function definition. Asserts that a function declaration is // in scope, and its annotations are to be used. There are no other annotations // allowed on the function definition. #define _Use_decl_annotations_ _Use_decl_anno_impl_ @@ -838,7 +838,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default}; // 'out' with buffer size -// e.g. void GetIndeces( _Out_cap_(cIndeces) int* rgIndeces, size_t cIndices ); +// e.g. void GetIndices( _Out_cap_(cIndices) int* rgIndices, size_t cIndices ); // buffer capacity is described by another parameter #define _Out_cap_(size) _SAL1_1_Source_(_Out_cap_, (size), _Pre_cap_(size) _Post_valid_impl_) #define _Out_opt_cap_(size) _SAL1_1_Source_(_Out_opt_cap_, (size), _Pre_opt_cap_(size) _Post_valid_impl_) @@ -921,7 +921,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default}; // 'inout' buffers with initialized elements before and after the call -// e.g. void ModifyIndices( _Inout_count_(cIndices) int* rgIndeces, size_t cIndices ); +// e.g. void ModifyIndices( _Inout_count_(cIndices) int* rgIndices, size_t cIndices ); #define _Inout_count_(size) _SAL1_1_Source_(_Inout_count_, (size), _Prepost_count_(size)) #define _Inout_opt_count_(size) _SAL1_1_Source_(_Inout_opt_count_, (size), _Prepost_opt_count_(size)) #define _Inout_bytecount_(size) _SAL1_1_Source_(_Inout_bytecount_, (size), _Prepost_bytecount_(size)) @@ -933,7 +933,7 @@ enum __SAL_YesNo {_SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default}; #define _Inout_opt_bytecount_c_(size) _SAL1_1_Source_(_Inout_opt_bytecount_c_, (size), _Prepost_opt_bytecount_c_(size)) // nullterminated 'inout' buffers with initialized elements before and after the call -// e.g. void ModifyIndices( _Inout_count_(cIndices) int* rgIndeces, size_t cIndices ); +// e.g. void ModifyIndices( _Inout_count_(cIndices) int* rgIndices, size_t cIndices ); #define _Inout_z_count_(size) _SAL1_1_Source_(_Inout_z_count_, (size), _Prepost_z_ _Prepost_count_(size)) #define _Inout_opt_z_count_(size) _SAL1_1_Source_(_Inout_opt_z_count_, (size), _Prepost_z_ _Prepost_opt_count_(size)) #define _Inout_z_bytecount_(size) _SAL1_1_Source_(_Inout_z_bytecount_, (size), _Prepost_z_ _Prepost_bytecount_(size)) @@ -2399,24 +2399,19 @@ extern "C" { #define _SA_SPECSTRIZE( x ) #x /* - __null p __notnull p __maybenull p - Annotates a pointer p. States that pointer p is null. Commonly used - in the negated form __notnull or the possibly null form __maybenull. + Annotates a pointer p. States that pointer p is never null or maybe null. */ -#ifndef PAL_STDCPP_COMPAT - #define __null _Null_impl_ #define __notnull _Notnull_impl_ #define __maybenull _Maybenull_impl_ -#endif // !PAL_STDCPP_COMPAT /* __readonly l __notreadonly l - __mabyereadonly l + __maybereadonly l Annotates a location l. States that location l is not modified after this point. If the annotation is placed on the precondition state of @@ -2598,11 +2593,8 @@ extern "C" { #else // ][ -#ifndef PAL_STDCPP_COMPAT - #define __null #define __notnull #define __deref -#endif // !PAL_STDCPP_COMPAT #define __maybenull #define __readonly #define __notreadonly @@ -2862,6 +2854,10 @@ of each annotation, see the advanced annotations section. #define __useHeader _Use_decl_anno_impl_ #define __on_failure(annotes) _On_failure_impl_(annotes _SAL_nop_impl_) +#ifndef __has_cpp_attribute +#define __has_cpp_attribute(x) (0) +#endif + #ifndef __fallthrough // [ #if __has_cpp_attribute(fallthrough) #define __fallthrough [[fallthrough]] diff --git a/src/shared/pal/inc/rt/shellapi.h b/src/shared/pal/inc/rt/shellapi.h deleted file mode 100644 index 8e1d58806e..0000000000 --- a/src/shared/pal/inc/rt/shellapi.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: shellapi.h -// -// =========================================================================== -// dummy shellapi.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/shlobj.h b/src/shared/pal/inc/rt/shlobj.h deleted file mode 100644 index edbd420993..0000000000 --- a/src/shared/pal/inc/rt/shlobj.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: shlobj.h -// -// =========================================================================== -// dummy shlobj.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/shlwapi.h b/src/shared/pal/inc/rt/shlwapi.h deleted file mode 100644 index 029a173259..0000000000 --- a/src/shared/pal/inc/rt/shlwapi.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: shlwapi.h -// -// =========================================================================== -// dummy shlwapi.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/specstrings.h b/src/shared/pal/inc/rt/specstrings.h index 749b20ff46..1cccb42e15 100644 --- a/src/shared/pal/inc/rt/specstrings.h +++ b/src/shared/pal/inc/rt/specstrings.h @@ -217,7 +217,7 @@ __ANNOTATION(SAL_failureDefault(enum __SAL_failureKind)); #define __analysis_hint(hint) _SA_annotes1(SAL_analysisHint, hint) // For "breakpoint": doesn't return as far as analysis is concerned. #define __analysis_noreturn __declspec(noreturn) -/* Internal defintions */ +/* Internal definitions */ #define __inner_data_source(src_raw) _SA_annotes1(SAL_untrusted_data_source,src_raw) #define __inner_this_data_source(src_raw) _SA_annotes1(SAL_untrusted_data_source_this,src_raw) #define __inner_out_validated(typ_raw) _Post_ _SA_annotes1(SAL_validated,typ_raw) @@ -250,7 +250,7 @@ __ANNOTATION(SAL_failureDefault(enum __SAL_failureKind)); #define __analysis_assert(e) #define __analysis_hint(hint) #define __analysis_noreturn -/* Internal defintions */ +/* Internal definitions */ #define __inner_data_source(src_raw) #define __inner_this_data_source(src_raw) #define __inner_out_validated(typ_raw) @@ -309,11 +309,9 @@ __ANNOTATION(SAL_failureDefault(enum __SAL_failureKind)); __byte_readableTo((expr) ? (size) : (size) * 2) #define __post_invalid _Post_ __notvalid /* integer related macros */ -#ifndef PAL_STDCPP_COMPAT #define __allocator __inner_allocator #define __deallocate(kind) _Pre_ __notnull __post_invalid #define __deallocate_opt(kind) _Pre_ __maybenull __post_invalid -#endif #define __bound __inner_bound #define __range(lb,ub) __inner_range(lb,ub) #define __in_bound _Pre_ __inner_bound @@ -469,8 +467,8 @@ __inner_analysis_assume_nullterminated_dec #ifdef _PREFIX_ /************************************************************************** -* Defintion of __pfx_assume and __pfx_assert. Thse should be the only -* defintions of these functions. +* Definition of __pfx_assume and __pfx_assert. Thse should be the only +* definitions of these functions. ***************************************************************************/ #if __cplusplus extern "C" void __pfx_assert(bool, const char *); @@ -480,7 +478,7 @@ void __pfx_assert(int, const char *); void __pfx_assume(int, const char *); #endif /************************************************************************** -* Redefintion of __analysis_assume and __analysis_assert for PREFIX build +* Redefinition of __analysis_assume and __analysis_assert for PREFIX build **************************************************************************/ #undef __analysis_assume #undef __analysis_assert diff --git a/src/shared/pal/inc/rt/specstrings_strict.h b/src/shared/pal/inc/rt/specstrings_strict.h index 816ba80298..d066f76b3c 100644 --- a/src/shared/pal/inc/rt/specstrings_strict.h +++ b/src/shared/pal/inc/rt/specstrings_strict.h @@ -630,7 +630,6 @@ #define __callback __allowed(on_function) #define __format_string __allowed(on_parameter_or_return) #define __blocksOn(resource) __allowed(on_function) -#define __fallthrough __allowed(as_statement) #define __range(lb,ub) __allowed(on_return) #define __in_range(lb,ub) _SAL_VERSION_CHECK(__in_range) #define __out_range(lb,ub) _SAL_VERSION_CHECK(__out_range) @@ -656,7 +655,6 @@ /*************************************************************************** * Expert Macros ***************************************************************************/ -#define __null __allowed(on_typedecl) #define __notnull __allowed(on_typedecl) #define __maybenull __allowed(on_typedecl) #define __exceptthat __allowed(on_typedecl) @@ -874,7 +872,7 @@ * EMF - Windows Enhanced Metafile * GIF - Graphics Interchange Format * MIME_TYPE - MIME type from header tokens -* MAIL_MONIKER - MAIL information refered by URL moniker +* MAIL_MONIKER - MAIL information referred by URL moniker * HTML - HyperText Markup Language * WMPHOTO - Windows media photo * OE_VCARD - Outlook Express virtual card @@ -1005,7 +1003,7 @@ * Macros deprecated with strict level greater then 1. **************************************************************************/ #if (__SPECSTRINGS_STRICT_LEVEL > 1) -/* Must come before macro defintions */ +/* Must come before macro definitions */ #pragma deprecated(__in_nz) #pragma deprecated(__in_ecount_nz) #pragma deprecated(__in_bcount_nz) @@ -1137,7 +1135,7 @@ /************************************************************************** * This should go away. It's only for __success which we should split into. -* __success and __typdecl_sucess +* __success and __typdecl_success ***************************************************************************/ #define __$allowed_on_function_or_typedecl /* empty */ #if (__SPECSTRINGS_STRICT_LEVEL == 1) || (__SPECSTRINGS_STRICT_LEVEL == 2) diff --git a/src/shared/pal/inc/rt/specstrings_undef.h b/src/shared/pal/inc/rt/specstrings_undef.h index b0e1848c5e..884ad919bc 100644 --- a/src/shared/pal/inc/rt/specstrings_undef.h +++ b/src/shared/pal/inc/rt/specstrings_undef.h @@ -5,10 +5,8 @@ */ -#ifndef PAL_STDCPP_COMPAT #undef __in #undef __out -#endif // !PAL_STDCPP_COMPAT #undef _At_ #undef _Deref_out_ @@ -261,7 +259,6 @@ #undef __encoded_array #undef __encoded_pointer #undef __exceptthat -#undef __fallthrough #undef __field_bcount #undef __field_bcount_full #undef __field_bcount_full_opt @@ -388,7 +385,6 @@ #undef __notnull #undef __notreadonly #undef __notvalid -#undef __null #undef __nullnullterminated #undef __nullterminated #undef __out_awcount diff --git a/src/shared/pal/inc/rt/urlmon.h b/src/shared/pal/inc/rt/urlmon.h deleted file mode 100644 index 1fcfec2e6f..0000000000 --- a/src/shared/pal/inc/rt/urlmon.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: urlmon.h -// -// =========================================================================== -// dummy urlmon.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/verrsrc.h b/src/shared/pal/inc/rt/verrsrc.h deleted file mode 100644 index 0bd7103324..0000000000 --- a/src/shared/pal/inc/rt/verrsrc.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: verrsrc.h -// -// =========================================================================== -// dummy verrsrc.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/wininet.h b/src/shared/pal/inc/rt/wininet.h deleted file mode 100644 index c3ad9fab0d..0000000000 --- a/src/shared/pal/inc/rt/wininet.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: wininet.h -// -// =========================================================================== -// dummy wininet.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/winnls.h b/src/shared/pal/inc/rt/winnls.h deleted file mode 100644 index 93775e4509..0000000000 --- a/src/shared/pal/inc/rt/winnls.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: winnls.h -// -// =========================================================================== -// dummy winnls.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/winresrc.h b/src/shared/pal/inc/rt/winresrc.h index b0843d15f1..88af2984da 100644 --- a/src/shared/pal/inc/rt/winresrc.h +++ b/src/shared/pal/inc/rt/winresrc.h @@ -10,5 +10,4 @@ // winresrc.h for PAL // Included in .rc files. -#include "winver.h" #include "palrt.h" diff --git a/src/shared/pal/inc/rt/winuser.h b/src/shared/pal/inc/rt/winuser.h deleted file mode 100644 index 9be850e80b..0000000000 --- a/src/shared/pal/inc/rt/winuser.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: winuser.h -// -// =========================================================================== -// dummy winuser.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/rt/wtsapi32.h b/src/shared/pal/inc/rt/wtsapi32.h deleted file mode 100644 index 0613f91d1a..0000000000 --- a/src/shared/pal/inc/rt/wtsapi32.h +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: wtsapi32.h -// -// =========================================================================== -// dummy wtsapi32.h for PAL - -#include "palrt.h" diff --git a/src/shared/pal/inc/strsafe.h b/src/shared/pal/inc/strsafe.h index 82c36db3c0..b833526e61 100644 --- a/src/shared/pal/inc/strsafe.h +++ b/src/shared/pal/inc/strsafe.h @@ -27,15 +27,6 @@ #include // for memset #include // for va_start, etc. -#ifndef _SIZE_T_DEFINED -#ifdef HOST_64BIT -typedef unsigned __int64 size_t; -#else -typedef __w64 unsigned int size_t; -#endif // !HOST_64BIT -#define _SIZE_T_DEFINED -#endif // !_SIZE_T_DEFINED - #ifndef SUCCEEDED #define SUCCEEDED(hr) ((HRESULT)(hr) >= 0) #endif @@ -110,22 +101,6 @@ typedef __w64 unsigned int size_t; #ifdef STRSAFE_INLINE STRSAFEAPI StringCopyWorkerA(char* pszDest, size_t cchDest, const char* pszSrc); STRSAFEAPI StringCopyWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc); -STRSAFEAPI StringCopyExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCopyExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCopyNWorkerA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc); -STRSAFEAPI StringCopyNWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchSrc); -STRSAFEAPI StringCopyNExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, size_t cchSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCopyNExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, const WCHAR* pszSrc, size_t cchSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCatWorkerA(char* pszDest, size_t cchDest, const char* pszSrc); -STRSAFEAPI StringCatWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc); -STRSAFEAPI StringCatExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCatExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCatNWorkerA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend); -STRSAFEAPI StringCatNWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchMaxAppend); -STRSAFEAPI StringCatNExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, size_t cchMaxAppend, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCatNExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, const WCHAR* pszSrc, size_t cchMaxAppend, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringLengthWorkerA(const char* psz, size_t cchMax, size_t* pcch); -STRSAFEAPI StringLengthWorkerW(const WCHAR* psz, size_t cchMax, size_t* pcch); #endif // STRSAFE_INLINE #ifndef STRSAFE_NO_CCH_FUNCTIONS @@ -177,7 +152,7 @@ Return Value: resultant dest string was null terminated failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all hresult falure cases + code for all hresult failure cases STRSAFE_E_INSUFFICIENT_BUFFER / HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER @@ -235,3342 +210,63 @@ STRSAFEAPI StringCchCopyW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc) #endif // STRSAFE_INLINE #endif // !STRSAFE_NO_CCH_FUNCTIONS -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchCopyEx(TCHAR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - LPTSTR* ppszDestEnd, - size_t* pcchRemaining, - DWORD dwFlags); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcpy' with - some additional parameters. In addition to functionality provided by - StringCchCopy, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = (_tcslen(pszSrc) + 1) to hold all of - the source including the null terminator - - pszSrc - source string which must be null terminated - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STRSAFE_E_INSUFFICIENT_BUFFER - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - S_OK - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the copy operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCchCopyExA(char* pszDest, size_t cchDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCchCopyExW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -#ifdef UNICODE -#define StringCchCopyEx StringCchCopyExW -#else -#define StringCchCopyEx StringCchCopyExA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCchCopyExA(char* pszDest, size_t cchDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); - - hr = StringCopyExWorkerA(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, pcchRemaining, dwFlags); - } - - return hr; -} - -STRSAFEAPI StringCchCopyExW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(WCHAR) since cchDest < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2 - cbDest = cchDest * sizeof(WCHAR); - - hr = StringCopyExWorkerW(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, pcchRemaining, dwFlags); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CCH_FUNCTIONS - -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchCopyN(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - size_t cchSrc); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy'. - The size of the destination buffer (in characters) is a parameter and - this function will not write past the end of this buffer and it will - ALWAYS null terminate the destination buffer (unless it is zero length). - - This routine is meant as a replacement for strncpy, but it does behave - differently. This function will not pad the destination buffer with extra - null termination characters if cchSrc is greater than the length of pszSrc. - - This function returns a hresult, and not a pointer. It returns a S_OK - if the entire string or the first cchSrc characters were copied without - truncation and the resultant destination string was null terminated, otherwise - it will return a failure code. In failure cases as much of pszSrc will be - copied to pszDest as possible, and pszDest will be null terminated. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = (_tcslen(src) + 1) to hold all of the - source including the null terminator - - pszSrc - source string - - cchSrc - maximum number of characters to copy from source string - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See StringCchCopyNEx if you require - the handling of NULL values. - -Return Value: - - S_OK - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all hresult falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the copy operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function. - ---*/ - -STRSAFEAPI StringCchCopyNA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc); -STRSAFEAPI StringCchCopyNW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchSrc); -#ifdef UNICODE -#define StringCchCopyN StringCchCopyNW -#else -#define StringCchCopyN StringCchCopyNA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCchCopyNA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc) -{ - HRESULT hr; - - if ((cchDest > STRSAFE_MAX_CCH) || - (cchSrc > STRSAFE_MAX_CCH)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCopyNWorkerA(pszDest, cchDest, pszSrc, cchSrc); - } - - return hr; -} - -STRSAFEAPI StringCchCopyNW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchSrc) -{ - HRESULT hr; - - if ((cchDest > STRSAFE_MAX_CCH) || - (cchSrc > STRSAFE_MAX_CCH)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCopyNWorkerW(pszDest, cchDest, pszSrc, cchSrc); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CCH_FUNCTIONS - -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchCopyNEx(TCHAR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - size_t cchSrc, - LPTSTR* ppszDestEnd, - size_t* pcchRemaining, - DWORD dwFlags); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' with - some additional parameters. In addition to functionality provided by - StringCchCopyN, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination - string including the null terminator. The flags parameter allows - additional controls. - - This routine is meant as a replacement for strncpy, but it does behave - differently. This function will not pad the destination buffer with extra - null termination characters if cchSrc is greater than the length of pszSrc. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = (_tcslen(pszSrc) + 1) to hold all of - the source including the null terminator - - pszSrc - source string - - cchSrc - maximum number of characters to copy from the source - string - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STRSAFE_E_INSUFFICIENT_BUFFER - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - S_OK - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the copy operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCchCopyNExA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCchCopyNExW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -#ifdef UNICODE -#define StringCchCopyNEx StringCchCopyNExW -#else -#define StringCchCopyNEx StringCchCopyNExA -#endif // !UNICODE - +// these are the worker functions that actually do the work #ifdef STRSAFE_INLINE -STRSAFEAPI StringCchCopyNExA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +STRSAFEAPI StringCopyWorkerA(char* pszDest, size_t cchDest, const char* pszSrc) { - HRESULT hr; + HRESULT hr = S_OK; - if ((cchDest > STRSAFE_MAX_CCH) || - (cchSrc > STRSAFE_MAX_CCH)) + if (cchDest == 0) { + // can not null terminate a zero-byte dest buffer hr = STRSAFE_E_INVALID_PARAMETER; } else { - size_t cbDest; + while (cchDest && (*pszSrc != '\0')) + { + *pszDest++ = *pszSrc++; + cchDest--; + } - // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); + if (cchDest == 0) + { + // we are going to truncate pszDest + pszDest--; + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } - hr = StringCopyNExWorkerA(pszDest, cchDest, cbDest, pszSrc, cchSrc, ppszDestEnd, pcchRemaining, dwFlags); + *pszDest= '\0'; } return hr; } -STRSAFEAPI StringCchCopyNExW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) +STRSAFEAPI StringCopyWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc) { - HRESULT hr; + HRESULT hr = S_OK; - if ((cchDest > STRSAFE_MAX_CCH) || - (cchSrc > STRSAFE_MAX_CCH)) + if (cchDest == 0) { + // can not null terminate a zero-byte dest buffer hr = STRSAFE_E_INVALID_PARAMETER; } else { - size_t cbDest; - - // safe to multiply cchDest * sizeof(WCHAR) since cchDest < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2 - cbDest = cchDest * sizeof(WCHAR); - - hr = StringCopyNExWorkerW(pszDest, cchDest, cbDest, pszSrc, cchSrc, ppszDestEnd, pcchRemaining, dwFlags); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CCH_FUNCTIONS + while (cchDest && (*pszSrc != L'\0')) + { + *pszDest++ = *pszSrc++; + cchDest--; + } + if (cchDest == 0) + { + // we are going to truncate pszDest + pszDest--; + hr = STRSAFE_E_INSUFFICIENT_BUFFER; + } -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchCat(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat'. - The size of the destination buffer (in characters) is a parameter and this - function will not write past the end of this buffer and it will ALWAYS - null terminate the destination buffer (unless it is zero length). - - This function returns a hresult, and not a pointer. It returns a S_OK - if the string was concatenated without truncation and null terminated, otherwise - it will return a failure code. In failure cases as much of pszSrc will be - appended to pszDest as possible, and pszDest will be null terminated. - -Arguments: - - pszDest - destination string which must be null terminated - - cchDest - size of destination buffer in characters. - length must be = (_tcslen(pszDest) + _tcslen(pszSrc) + 1) - to hold all of the combine string plus the null - terminator - - pszSrc - source string which must be null terminated - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See StringCchCatEx if you require - the handling of NULL values. - -Return Value: - - S_OK - if there was source data and it was all concatenated and the - resultant dest string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCchCatA(char* pszDest, size_t cchDest, const char* pszSrc); -STRSAFEAPI StringCchCatW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc); -#ifdef UNICODE -#define StringCchCat StringCchCatW -#else -#define StringCchCat StringCchCatA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCchCatA(char* pszDest, size_t cchDest, const char* pszSrc) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCatWorkerA(pszDest, cchDest, pszSrc); - } - - return hr; -} - -STRSAFEAPI StringCchCatW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCatWorkerW(pszDest, cchDest, pszSrc); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CCH_FUNCTIONS - - -#ifndef STRSAFE_NO_CB_FUNCTIONS -/*++ - -STDAPI StringCbCat(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat'. - The size of the destination buffer (in bytes) is a parameter and this - function will not write past the end of this buffer and it will ALWAYS - null terminate the destination buffer (unless it is zero length). - - This function returns a hresult, and not a pointer. It returns a S_OK - if the string was concatenated without truncation and null terminated, otherwise - it will return a failure code. In failure cases as much of pszSrc will be - appended to pszDest as possible, and pszDest will be null terminated. - -Arguments: - - pszDest - destination string which must be null terminated - - cbDest - size of destination buffer in bytes. - length must be = ((_tcslen(pszDest) + _tcslen(pszSrc) + 1) * sizeof(TCHAR) - to hold all of the combine string plus the null - terminator - - pszSrc - source string which must be null terminated - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See StringCbCatEx if you require - the handling of NULL values. - -Return Value: - - S_OK - if there was source data and it was all concatenated and the - resultant dest string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCbCatA(char* pszDest, size_t cbDest, const char* pszSrc); -STRSAFEAPI StringCbCatW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszSrc); -#ifdef UNICODE -#define StringCbCat StringCbCatW -#else -#define StringCbCat StringCbCatA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCbCatA(char* pszDest, size_t cbDest, const char* pszSrc) -{ - HRESULT hr; - size_t cchDest; - - cchDest = cbDest / sizeof(char); - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCatWorkerA(pszDest, cchDest, pszSrc); - } - - return hr; -} - -STRSAFEAPI StringCbCatW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszSrc) -{ - HRESULT hr; - size_t cchDest; - - cchDest = cbDest / sizeof(WCHAR); - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCatWorkerW(pszDest, cchDest, pszSrc); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CB_FUNCTIONS - - -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchCatEx(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - LPTSTR* ppszDestEnd, - size_t* pcchRemaining, - DWORD dwFlags); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat' with - some additional parameters. In addition to functionality provided by - StringCchCat, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string which must be null terminated - - cchDest - size of destination buffer in characters - length must be (_tcslen(pszDest) + _tcslen(pszSrc) + 1) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string which must be null terminated - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function appended any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcat - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any pre-existing - or truncated string - - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any pre-existing or - truncated string - - STRSAFE_NO_TRUNCATION - if the function returns STRSAFE_E_INSUFFICIENT_BUFFER, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - S_OK - if there was source data and it was all concatenated and the - resultant dest string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCchCatExA(char* pszDest, size_t cchDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCchCatExW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -#ifdef UNICODE -#define StringCchCatEx StringCchCatExW -#else -#define StringCchCatEx StringCchCatExA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCchCatExA(char* pszDest, size_t cchDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); - - hr = StringCatExWorkerA(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, pcchRemaining, dwFlags); - } - - return hr; -} - -STRSAFEAPI StringCchCatExW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(WCHAR) since cchDest < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2 - cbDest = cchDest * sizeof(WCHAR); - - hr = StringCatExWorkerW(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, pcchRemaining, dwFlags); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CCH_FUNCTIONS - - -#ifndef STRSAFE_NO_CB_FUNCTIONS -/*++ - -STDAPI StringCbCatEx(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc, - LPTSTR* ppszDestEnd, - size_t* pcbRemaining, - DWORD dwFlags); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat' with - some additional parameters. In addition to functionality provided by - StringCbCat, this routine also returns a pointer to the end of the - destination string and the number of bytes left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string which must be null terminated - - cbDest - size of destination buffer in bytes. - length must be ((_tcslen(pszDest) + _tcslen(pszSrc) + 1) * sizeof(TCHAR) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string which must be null terminated - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function appended any data, the result will point to the - null termination character - - pcbRemaining - if pcbRemaining is non-null, the function will return - the number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcat - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any pre-existing - or truncated string - - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any pre-existing or - truncated string - - STRSAFE_NO_TRUNCATION - if the function returns STRSAFE_E_INSUFFICIENT_BUFFER, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - S_OK - if there was source data and it was all concatenated and the - resultant dest string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCbCatExA(char* pszDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); -STRSAFEAPI StringCbCatExW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); -#ifdef UNICODE -#define StringCbCatEx StringCbCatExW -#else -#define StringCbCatEx StringCbCatExA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCbCatExA(char* pszDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) -{ - HRESULT hr; - size_t cchDest; - size_t cchRemaining = 0; - - cchDest = cbDest / sizeof(char); - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCatExWorkerA(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, &cchRemaining, dwFlags); - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1 - *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - } - } - - return hr; -} - -STRSAFEAPI StringCbCatExW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) -{ - HRESULT hr; - size_t cchDest; - size_t cchRemaining = 0; - - cchDest = cbDest / sizeof(WCHAR); - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCatExWorkerW(pszDest, cchDest, cbDest, pszSrc, ppszDestEnd, &cchRemaining, dwFlags); - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(WCHAR) since cchRemaining < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2 - *pcbRemaining = (cchRemaining * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR)); - } - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CB_FUNCTIONS - - -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchCatN(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - size_t cchMaxAppend); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat'. - The size of the destination buffer (in characters) is a parameter as well as - the maximum number of characters to append, excluding the null terminator. - This function will not write past the end of the destination buffer and it will - ALWAYS null terminate pszDest (unless it is zero length). - - This function returns a hresult, and not a pointer. It returns a S_OK - if all of pszSrc or the first cchMaxAppend characters were appended to the - destination string and it was null terminated, otherwise it will return a - failure code. In failure cases as much of pszSrc will be appended to pszDest - as possible, and pszDest will be null terminated. - -Arguments: - - pszDest - destination string which must be null terminated - - cchDest - size of destination buffer in characters. - length must be (_tcslen(pszDest) + min(cchMaxAppend, _tcslen(pszSrc)) + 1) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string - - cchMaxAppend - maximum number of characters to append - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See StringCchCatNEx if you require - the handling of NULL values. - -Return Value: - - S_OK - if all of pszSrc or the first cchMaxAppend characters were - concatenated to pszDest and the resultant dest string was - null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCchCatNA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend); -STRSAFEAPI StringCchCatNW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchMaxAppend); -#ifdef UNICODE -#define StringCchCatN StringCchCatNW -#else -#define StringCchCatN StringCchCatNA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCchCatNA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCatNWorkerA(pszDest, cchDest, pszSrc, cchMaxAppend); - } - - return hr; -} - -STRSAFEAPI StringCchCatNW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchMaxAppend) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringCatNWorkerW(pszDest, cchDest, pszSrc, cchMaxAppend); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CCH_FUNCTIONS - - -#ifndef STRSAFE_NO_CB_FUNCTIONS -/*++ - -STDAPI StringCbCatN(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc, - size_t cbMaxAppend); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat'. - The size of the destination buffer (in bytes) is a parameter as well as - the maximum number of bytes to append, excluding the null terminator. - This function will not write past the end of the destination buffer and it will - ALWAYS null terminate pszDest (unless it is zero length). - - This function returns a hresult, and not a pointer. It returns a S_OK - if all of pszSrc or the first cbMaxAppend bytes were appended to the - destination string and it was null terminated, otherwise it will return a - failure code. In failure cases as much of pszSrc will be appended to pszDest - as possible, and pszDest will be null terminated. - -Arguments: - - pszDest - destination string which must be null terminated - - cbDest - size of destination buffer in bytes. - length must be ((_tcslen(pszDest) + min(cbMaxAppend / sizeof(TCHAR), _tcslen(pszSrc)) + 1) * sizeof(TCHAR) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string - - cbMaxAppend - maximum number of bytes to append - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See StringCbCatNEx if you require - the handling of NULL values. - -Return Value: - - S_OK - if all of pszSrc or the first cbMaxAppend bytes were - concatenated to pszDest and the resultant dest string was - null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCbCatNA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbMaxAppend); -STRSAFEAPI StringCbCatNW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszSrc, size_t cbMaxAppend); -#ifdef UNICODE -#define StringCbCatN StringCbCatNW -#else -#define StringCbCatN StringCbCatNA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCbCatNA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbMaxAppend) -{ - HRESULT hr; - size_t cchDest; - - cchDest = cbDest / sizeof(char); - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cchMaxAppend; - - cchMaxAppend = cbMaxAppend / sizeof(char); - - hr = StringCatNWorkerA(pszDest, cchDest, pszSrc, cchMaxAppend); - } - - return hr; -} - -STRSAFEAPI StringCbCatNW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszSrc, size_t cbMaxAppend) -{ - HRESULT hr; - size_t cchDest; - - cchDest = cbDest / sizeof(WCHAR); - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cchMaxAppend; - - cchMaxAppend = cbMaxAppend / sizeof(WCHAR); - - hr = StringCatNWorkerW(pszDest, cchDest, pszSrc, cchMaxAppend); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CB_FUNCTIONS - - -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchCatNEx(LPTSTR pszDest, - size_t cchDest, - LPCTSTR pszSrc, - size_t cchMaxAppend, - LPTSTR* ppszDestEnd, - size_t* pcchRemaining, - DWORD dwFlags); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat', with - some additional parameters. In addition to functionality provided by - StringCchCatN, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string which must be null terminated - - cchDest - size of destination buffer in characters. - length must be (_tcslen(pszDest) + min(cchMaxAppend, _tcslen(pszSrc)) + 1) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string - - cchMaxAppend - maximum number of characters to append - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function appended any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")) - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any pre-existing - or truncated string - - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any pre-existing or - truncated string - - STRSAFE_NO_TRUNCATION - if the function returns STRSAFE_E_INSUFFICIENT_BUFFER, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - S_OK - if all of pszSrc or the first cchMaxAppend characters were - concatenated to pszDest and the resultant dest string was - null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCchCatNExA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -STRSAFEAPI StringCchCatNExW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchMaxAppend, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags); -#ifdef UNICODE -#define StringCchCatNEx StringCchCatNExW -#else -#define StringCchCatNEx StringCchCatNExA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCchCatNExA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); - - hr = StringCatNExWorkerA(pszDest, cchDest, cbDest, pszSrc, cchMaxAppend, ppszDestEnd, pcchRemaining, dwFlags); - } - - return hr; -} - -STRSAFEAPI StringCchCatNExW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchMaxAppend, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr; - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(WCHAR) since cchDest < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2 - cbDest = cchDest * sizeof(WCHAR); - - hr = StringCatNExWorkerW(pszDest, cchDest, cbDest, pszSrc, cchMaxAppend, ppszDestEnd, pcchRemaining, dwFlags); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CCH_FUNCTIONS - - -#ifndef STRSAFE_NO_CB_FUNCTIONS -/*++ - -STDAPI StringCbCatNEx(LPTSTR pszDest, - size_t cbDest, - LPCTSTR pszSrc, - size_t cbMaxAppend - LPTSTR* ppszDestEnd, - size_t* pcchRemaining, - DWORD dwFlags); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat', with - some additional parameters. In addition to functionality provided by - StringCbCatN, this routine also returns a pointer to the end of the - destination string and the number of bytes left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string which must be null terminated - - cbDest - size of destination buffer in bytes. - length must be ((_tcslen(pszDest) + min(cbMaxAppend / sizeof(TCHAR), _tcslen(pszSrc)) + 1) * sizeof(TCHAR) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string - - cbMaxAppend - maximum number of bytes to append - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function appended any data, the result will point to the - null termination character - - pcbRemaining - if pcbRemaining is non-null, the function will return the - number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")) - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any pre-existing - or truncated string - - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any pre-existing or - truncated string - - STRSAFE_NO_TRUNCATION - if the function returns STRSAFE_E_INSUFFICIENT_BUFFER, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - S_OK - if all of pszSrc or the first cbMaxAppend bytes were - concatenated to pszDest and the resultant dest string was - null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all falure cases - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function - ---*/ - -STRSAFEAPI StringCbCatNExA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbMaxAppend, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); -STRSAFEAPI StringCbCatNExW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszSrc, size_t cbMaxAppend, WCHAR** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags); -#ifdef UNICODE -#define StringCbCatNEx StringCbCatNExW -#else -#define StringCbCatNEx StringCbCatNExA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCbCatNExA(char* pszDest, size_t cbDest, const char* pszSrc, size_t cbMaxAppend, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) -{ - HRESULT hr; - size_t cchDest; - size_t cchRemaining = 0; - - cchDest = cbDest / sizeof(char); - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cchMaxAppend; - - cchMaxAppend = cbMaxAppend / sizeof(char); - - hr = StringCatNExWorkerA(pszDest, cchDest, cbDest, pszSrc, cchMaxAppend, ppszDestEnd, &cchRemaining, dwFlags); - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1 - *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - } - } - - return hr; -} - -STRSAFEAPI StringCbCatNExW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszSrc, size_t cbMaxAppend, WCHAR** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags) -{ - HRESULT hr; - size_t cchDest; - size_t cchRemaining = 0; - - cchDest = cbDest / sizeof(WCHAR); - - if (cchDest > STRSAFE_MAX_CCH) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cchMaxAppend; - - cchMaxAppend = cbMaxAppend / sizeof(WCHAR); - - hr = StringCatNExWorkerW(pszDest, cchDest, cbDest, pszSrc, cchMaxAppend, ppszDestEnd, &cchRemaining, dwFlags); - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(WCHAR) since cchRemaining < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2 - *pcbRemaining = (cchRemaining * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR)); - } - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CB_FUNCTIONS - - -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchGets(LPTSTR pszDest, - size_t cchDest); - -Routine Description: - - This routine is a safer version of the C built-in function 'gets'. - The size of the destination buffer (in characters) is a parameter and - this function will not write past the end of this buffer and it will - ALWAYS null terminate the destination buffer (unless it is zero length). - - This routine is not a replacement for fgets. That function does not replace - newline characters with a null terminator. - - This function returns a hresult, and not a pointer. It returns a S_OK - if any characters were read from stdin and copied to pszDest and pszDest was - null terminated, otherwise it will return a failure code. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - -Notes: - pszDest should not be NULL. See StringCchGetsEx if you require the handling - of NULL values. - - cchDest must be > 1 for this function to succeed. - -Return Value: - - S_OK - data was read from stdin and copied, and the resultant dest - string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all hresult falure cases - - STRSAFE_E_END_OF_FILE - - this return value indicates an error or end-of-file condition, - use feof or ferror to determine which one has occurred. - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that there was insufficient - space in the destination buffer to copy any data - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function. - ---*/ - -#endif // !STRSAFE_NO_CCH_FUNCTIONS - -#ifndef STRSAFE_NO_CB_FUNCTIONS -/*++ - -STDAPI StringCbGets(LPTSTR pszDest, - size_t cbDest); - -Routine Description: - - This routine is a safer version of the C built-in function 'gets'. - The size of the destination buffer (in bytes) is a parameter and - this function will not write past the end of this buffer and it will - ALWAYS null terminate the destination buffer (unless it is zero length). - - This routine is not a replacement for fgets. That function does not replace - newline characters with a null terminator. - - This function returns a hresult, and not a pointer. It returns a S_OK - if any characters were read from stdin and copied to pszDest and pszDest was - null terminated, otherwise it will return a failure code. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes. - -Notes: - pszDest should not be NULL. See StringCbGetsEx if you require the handling - of NULL values. - - cbDest must be > sizeof(TCHAR) for this function to succeed. - -Return Value: - - S_OK - data was read from stdin and copied, and the resultant dest - string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all hresult falure cases - - STRSAFE_E_END_OF_FILE - - this return value indicates an error or end-of-file condition, - use feof or ferror to determine which one has occurred. - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that there was insufficient - space in the destination buffer to copy any data - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function. - ---*/ - -#endif // !STRSAFE_NO_CB_FUNCTIONS - -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchGetsEx(LPTSTR pszDest, - size_t cchDest, - LPTSTR* ppszDestEnd, - size_t* pcchRemaining, - DWORD dwFlags); - -Routine Description: - - This routine is a safer version of the C built-in function 'gets' with - some additional parameters. In addition to functionality provided by - StringCchGets, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. - -Notes: - pszDest should not be NULL unless the STRSAFE_IGNORE_NULLS flag is specified. - If STRSAFE_IGNORE_NULLS is passed and pszDest is NULL, an error may still be - returned even though NULLS are ignored - - cchDest must be > 1 for this function to succeed. - -Return Value: - - S_OK - data was read from stdin and copied, and the resultant dest - string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all hresult falure cases - - STRSAFE_E_END_OF_FILE - - this return value indicates an error or end-of-file condition, - use feof or ferror to determine which one has occurred. - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that there was insufficient - space in the destination buffer to copy any data - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function. - ---*/ - -#endif // !STRSAFE_NO_CCH_FUNCTIONS - -#ifndef STRSAFE_NO_CB_FUNCTIONS -/*++ - -STDAPI StringCbGetsEx(LPTSTR pszDest, - size_t cbDest, - LPTSTR* ppszDestEnd, - size_t* pcbRemaining, - DWORD dwFlags); - -Routine Description: - - This routine is a safer version of the C built-in function 'gets' with - some additional parameters. In addition to functionality provided by - StringCbGets, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes. - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcbRemaining - if pbRemaining is non-null, the function will return the - number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. - -Notes: - pszDest should not be NULL unless the STRSAFE_IGNORE_NULLS flag is specified. - If STRSAFE_IGNORE_NULLS is passed and pszDest is NULL, an error may still be - returned even though NULLS are ignored - - cbDest must be > sizeof(TCHAR) for this function to succeed - -Return Value: - - S_OK - data was read from stdin and copied, and the resultant dest - string was null terminated - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all hresult falure cases - - STRSAFE_E_END_OF_FILE - - this return value indicates an error or end-of-file condition, - use feof or ferror to determine which one has occurred. - - STRSAFE_E_INSUFFICIENT_BUFFER / - HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER - - this return value is an indication that there was insufficient - space in the destination buffer to copy any data - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function. - ---*/ - -#endif // !STRSAFE_NO_CB_FUNCTIONS - -#ifndef STRSAFE_NO_CCH_FUNCTIONS -/*++ - -STDAPI StringCchLength(LPCTSTR psz, - size_t cchMax, - size_t* pcch); - -Routine Description: - - This routine is a safer version of the C built-in function 'strlen'. - It is used to make sure a string is not larger than a given length, and - it optionally returns the current length in characters not including - the null terminator. - - This function returns a hresult, and not a pointer. It returns a S_OK - if the string is non-null and the length including the null terminator is - less than or equal to cchMax characters. - -Arguments: - - psz - string to check the length of - - cchMax - maximum number of characters including the null terminator - that psz is allowed to contain - - pcch - if the function succeeds and pcch is non-null, the current length - in characters of psz excluding the null terminator will be returned. - This out parameter is equivalent to the return value of strlen(psz) - -Notes: - psz can be null but the function will fail - - cchMax should be greater than zero or the function will fail - -Return Value: - - S_OK - psz is non-null and the length including the null terminator is - less than or equal to cchMax characters - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all hresult falure cases - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function. - ---*/ - -STRSAFEAPI StringCchLengthA(const char* psz, size_t cchMax, size_t* pcch); -STRSAFEAPI StringCchLengthW(const WCHAR* psz, size_t cchMax, size_t* pcch); -#ifdef UNICODE -#define StringCchLength StringCchLengthW -#else -#define StringCchLength StringCchLengthA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCchLengthA(const char* psz, size_t cchMax, size_t* pcch) -{ - HRESULT hr; - - if ((psz == NULL) || (cchMax > STRSAFE_MAX_CCH)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringLengthWorkerA(psz, cchMax, pcch); - } - - return hr; -} - -STRSAFEAPI StringCchLengthW(const WCHAR* psz, size_t cchMax, size_t* pcch) -{ - HRESULT hr; - - if ((psz == NULL) || (cchMax > STRSAFE_MAX_CCH)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringLengthWorkerW(psz, cchMax, pcch); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CCH_FUNCTIONS - - -#ifndef STRSAFE_NO_CB_FUNCTIONS -/*++ - -STDAPI StringCbLength(LPCTSTR psz, - size_t cbMax, - size_t* pcb); - -Routine Description: - - This routine is a safer version of the C built-in function 'strlen'. - It is used to make sure a string is not larger than a given length, and - it optionally returns the current length in bytes not including - the null terminator. - - This function returns a hresult, and not a pointer. It returns a S_OK - if the string is non-null and the length including the null terminator is - less than or equal to cbMax bytes. - -Arguments: - - psz - string to check the length of - - cbMax - maximum number of bytes including the null terminator - that psz is allowed to contain - - pcb - if the function succeeds and pcb is non-null, the current length - in bytes of psz excluding the null terminator will be returned. - This out parameter is equivalent to the return value of strlen(psz) * sizeof(TCHAR) - -Notes: - psz can be null but the function will fail - - cbMax should be greater than or equal to sizeof(TCHAR) or the function will fail - -Return Value: - - S_OK - psz is non-null and the length including the null terminator is - less than or equal to cbMax bytes - - failure - you can use the macro HRESULT_CODE() to get a win32 error - code for all hresult falure cases - - It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the - return value of this function. - ---*/ - -STRSAFEAPI StringCbLengthA(const char* psz, size_t cchMax, size_t* pcch); -STRSAFEAPI StringCbLengthW(const WCHAR* psz, size_t cchMax, size_t* pcch); -#ifdef UNICODE -#define StringCbLength StringCbLengthW -#else -#define StringCbLength StringCbLengthA -#endif // !UNICODE - -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCbLengthA(const char* psz, size_t cbMax, size_t* pcb) -{ - HRESULT hr; - size_t cchMax; - size_t cch = 0; - - cchMax = cbMax / sizeof(char); - - if ((psz == NULL) || (cchMax > STRSAFE_MAX_CCH)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringLengthWorkerA(psz, cchMax, &cch); - } - - if (SUCCEEDED(hr) && pcb) - { - // safe to multiply cch * sizeof(char) since cch < STRSAFE_MAX_CCH and sizeof(char) is 1 - *pcb = cch * sizeof(char); - } - - return hr; -} - -STRSAFEAPI StringCbLengthW(const WCHAR* psz, size_t cbMax, size_t* pcb) -{ - HRESULT hr; - size_t cchMax; - size_t cch = 0; - - cchMax = cbMax / sizeof(WCHAR); - - if ((psz == NULL) || (cchMax > STRSAFE_MAX_CCH)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = StringLengthWorkerW(psz, cchMax, &cch); - } - - if (SUCCEEDED(hr) && pcb) - { - // safe to multiply cch * sizeof(WCHAR) since cch < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2 - *pcb = cch * sizeof(WCHAR); - } - - return hr; -} -#endif // STRSAFE_INLINE -#endif // !STRSAFE_NO_CB_FUNCTIONS - - -// these are the worker functions that actually do the work -#ifdef STRSAFE_INLINE -STRSAFEAPI StringCopyWorkerA(char* pszDest, size_t cchDest, const char* pszSrc) -{ - HRESULT hr = S_OK; - - if (cchDest == 0) - { - // can not null terminate a zero-byte dest buffer - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - while (cchDest && (*pszSrc != '\0')) - { - *pszDest++ = *pszSrc++; - cchDest--; - } - - if (cchDest == 0) - { - // we are going to truncate pszDest - pszDest--; - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - - *pszDest= '\0'; - } - - return hr; -} - -STRSAFEAPI StringCopyWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc) -{ - HRESULT hr = S_OK; - - if (cchDest == 0) - { - // can not null terminate a zero-byte dest buffer - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - while (cchDest && (*pszSrc != L'\0')) - { - *pszDest++ = *pszSrc++; - cchDest--; - } - - if (cchDest == 0) - { - // we are going to truncate pszDest - pszDest--; - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - - *pszDest= L'\0'; - } - - return hr; -} - -STRSAFEAPI StringCopyExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr = S_OK; - char* pszDestEnd = pszDest; - size_t cchRemaining = 0; - - // ASSERT(cbDest == (cchDest * sizeof(char)) || - // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); - - // only accept valid flags - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (pszDest == NULL) - { - if ((cchDest != 0) || (cbDest != 0)) - { - // NULL pszDest and non-zero cchDest/cbDest is invalid - hr = STRSAFE_E_INVALID_PARAMETER; - } - } - - if (pszSrc == NULL) - { - pszSrc = ""; - } - } - - if (SUCCEEDED(hr)) - { - if (cchDest == 0) - { - pszDestEnd = pszDest; - cchRemaining = 0; - - // only fail if there was actually src data to copy - if (*pszSrc != '\0') - { - if (pszDest == NULL) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - } - } - else - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - while (cchRemaining && (*pszSrc != '\0')) - { - *pszDestEnd++= *pszSrc++; - cchRemaining--; - } - - if (cchRemaining > 0) - { - if (dwFlags & STRSAFE_FILL_BEHIND_NULL) - { - memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(char)) + (cbDest % sizeof(char))); - } - } - else - { - // we are going to truncate pszDest - pszDestEnd--; - cchRemaining++; - - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - - *pszDestEnd = '\0'; - } - } - } - - if (FAILED(hr)) - { - if (pszDest) - { - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - } - else if (cchDest > 0) - { - pszDestEnd = pszDest + cchDest - 1; - cchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = '\0'; - } - } - - if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) - { - if (cchDest > 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDestEnd = '\0'; - } - } - } - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - - return hr; -} - -STRSAFEAPI StringCopyExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr = S_OK; - WCHAR* pszDestEnd = pszDest; - size_t cchRemaining = 0; - - // ASSERT(cbDest == (cchDest * sizeof(WCHAR)) || - // cbDest == (cchDest * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR))); - - // only accept valid flags - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (pszDest == NULL) - { - if ((cchDest != 0) || (cbDest != 0)) - { - // NULL pszDest and non-zero cchDest/cbDest is invalid - hr = STRSAFE_E_INVALID_PARAMETER; - } - } - - if (pszSrc == NULL) - { - pszSrc = u""; - } - } - - if (SUCCEEDED(hr)) - { - if (cchDest == 0) - { - pszDestEnd = pszDest; - cchRemaining = 0; - - // only fail if there was actually src data to copy - if (*pszSrc != u'\0') - { - if (pszDest == NULL) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - } - } - else - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - while (cchRemaining && (*pszSrc != u'\0')) - { - *pszDestEnd++= *pszSrc++; - cchRemaining--; - } - - if (cchRemaining > 0) - { - if (dwFlags & STRSAFE_FILL_BEHIND_NULL) - { - memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR))); - } - } - else - { - // we are going to truncate pszDest - pszDestEnd--; - cchRemaining++; - - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - - *pszDestEnd = u'\0'; - } - } - } - - if (FAILED(hr)) - { - if (pszDest) - { - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - } - else if (cchDest > 0) - { - pszDestEnd = pszDest + cchDest - 1; - cchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = L'\0'; - } - } - - if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) - { - if (cchDest > 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDestEnd = L'\0'; - } - } - } - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - - return hr; -} - -STRSAFEAPI StringCopyNWorkerA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchSrc) -{ - HRESULT hr = S_OK; - - if (cchDest == 0) - { - // can not null terminate a zero-byte dest buffer - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - while (cchDest && cchSrc && (*pszSrc != '\0')) - { - *pszDest++= *pszSrc++; - cchDest--; - cchSrc--; - } - - if (cchDest == 0) - { - // we are going to truncate pszDest - pszDest--; - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - - *pszDest= '\0'; - } - - return hr; -} - -STRSAFEAPI StringCopyNWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchSrc) -{ - HRESULT hr = S_OK; - - if (cchDest == 0) - { - // can not null terminate a zero-byte dest buffer - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - while (cchDest && cchSrc && (*pszSrc != L'\0')) - { - *pszDest++= *pszSrc++; - cchDest--; - cchSrc--; - } - - if (cchDest == 0) - { - // we are going to truncate pszDest - pszDest--; - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - - *pszDest= L'\0'; - } - - return hr; -} - -STRSAFEAPI StringCopyNExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, size_t cchSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr = S_OK; - char* pszDestEnd = pszDest; - size_t cchRemaining = 0; - - // ASSERT(cbDest == (cchDest * sizeof(char)) || - // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); - - // only accept valid flags - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (pszDest == NULL) - { - if ((cchDest != 0) || (cbDest != 0)) - { - // NULL pszDest and non-zero cchDest/cbDest is invalid - hr = STRSAFE_E_INVALID_PARAMETER; - } - } - - if (pszSrc == NULL) - { - pszSrc = ""; - } - } - - if (SUCCEEDED(hr)) - { - if (cchDest == 0) - { - pszDestEnd = pszDest; - cchRemaining = 0; - - // only fail if there was actually src data to copy - if (*pszSrc != '\0') - { - if (pszDest == NULL) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - } - } - else - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - while (cchRemaining && cchSrc && (*pszSrc != '\0')) - { - *pszDestEnd++= *pszSrc++; - cchRemaining--; - cchSrc--; - } - - if (cchRemaining > 0) - { - if (dwFlags & STRSAFE_FILL_BEHIND_NULL) - { - memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(char)) + (cbDest % sizeof(char))); - } - } - else - { - // we are going to truncate pszDest - pszDestEnd--; - cchRemaining++; - - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - - *pszDestEnd = '\0'; - } - } - } - - if (FAILED(hr)) - { - if (pszDest) - { - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - } - else if (cchDest > 0) - { - pszDestEnd = pszDest + cchDest - 1; - cchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = '\0'; - } - } - - if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) - { - if (cchDest > 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDestEnd = '\0'; - } - } - } - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - - return hr; -} - -STRSAFEAPI StringCopyNExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, const WCHAR* pszSrc, size_t cchSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr = S_OK; - WCHAR* pszDestEnd = pszDest; - size_t cchRemaining = 0; - - // ASSERT(cbDest == (cchDest * sizeof(WCHAR)) || - // cbDest == (cchDest * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR))); - - // only accept valid flags - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (pszDest == NULL) - { - if ((cchDest != 0) || (cbDest != 0)) - { - // NULL pszDest and non-zero cchDest/cbDest is invalid - hr = STRSAFE_E_INVALID_PARAMETER; - } - } - - if (pszSrc == NULL) - { - pszSrc = u""; - } - } - - if (SUCCEEDED(hr)) - { - if (cchDest == 0) - { - pszDestEnd = pszDest; - cchRemaining = 0; - - // only fail if there was actually src data to copy - if (*pszSrc != L'\0') - { - if (pszDest == NULL) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - } - } - else - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - while (cchRemaining && cchSrc && (*pszSrc != L'\0')) - { - *pszDestEnd++= *pszSrc++; - cchRemaining--; - cchSrc--; - } - - if (cchRemaining > 0) - { - if (dwFlags & STRSAFE_FILL_BEHIND_NULL) - { - memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR))); - } - } - else - { - // we are going to truncate pszDest - pszDestEnd--; - cchRemaining++; - - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - - *pszDestEnd = L'\0'; - } - } - } - - if (FAILED(hr)) - { - if (pszDest) - { - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - } - else if (cchDest > 0) - { - pszDestEnd = pszDest + cchDest - 1; - cchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = L'\0'; - } - } - - if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)) - { - if (cchDest > 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDestEnd = L'\0'; - } - } - } - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - - return hr; -} - -STRSAFEAPI StringCatWorkerA(char* pszDest, size_t cchDest, const char* pszSrc) -{ - HRESULT hr; - size_t cchDestCurrent; - - hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - hr = StringCopyWorkerA(pszDest + cchDestCurrent, - cchDest - cchDestCurrent, - pszSrc); - } - - return hr; -} - -STRSAFEAPI StringCatWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc) -{ - HRESULT hr; - size_t cchDestCurrent; - - hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - hr = StringCopyWorkerW(pszDest + cchDestCurrent, - cchDest - cchDestCurrent, - pszSrc); - } - - return hr; -} - -STRSAFEAPI StringCatExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr = S_OK; - char* pszDestEnd = pszDest; - size_t cchRemaining = 0; - - // ASSERT(cbDest == (cchDest * sizeof(char)) || - // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); - - // only accept valid flags - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cchDestCurrent; - - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (pszDest == NULL) - { - if ((cchDest == 0) && (cbDest == 0)) - { - cchDestCurrent = 0; - } - else - { - // NULL pszDest and non-zero cchDest/cbDest is invalid - hr = STRSAFE_E_INVALID_PARAMETER; - } - } - else - { - hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - pszDestEnd = pszDest + cchDestCurrent; - cchRemaining = cchDest - cchDestCurrent; - } - } - - if (pszSrc == NULL) - { - pszSrc = ""; - } - } - else - { - hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - pszDestEnd = pszDest + cchDestCurrent; - cchRemaining = cchDest - cchDestCurrent; - } - } - - if (SUCCEEDED(hr)) - { - if (cchDest == 0) - { - // only fail if there was actually src data to append - if (*pszSrc != '\0') - { - if (pszDest == NULL) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - } - } - else - { - // we handle the STRSAFE_FILL_ON_FAILURE and STRSAFE_NULL_ON_FAILURE cases below, so do not pass - // those flags through - hr = StringCopyExWorkerA(pszDestEnd, - cchRemaining, - (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)), - pszSrc, - &pszDestEnd, - &cchRemaining, - dwFlags & (~(STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE))); - } - } - } - - if (FAILED(hr)) - { - if (pszDest) - { - // STRSAFE_NO_TRUNCATION is taken care of by StringCopyExWorkerA() - - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - } - else - if (cchDest > 0) - { - pszDestEnd = pszDest + cchDest - 1; - cchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = '\0'; - } - } - - if (dwFlags & STRSAFE_NULL_ON_FAILURE) - { - if (cchDest > 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDestEnd = '\0'; - } - } - } - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - - return hr; -} - -STRSAFEAPI StringCatExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, const WCHAR* pszSrc, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr = S_OK; - WCHAR* pszDestEnd = pszDest; - size_t cchRemaining = 0; - - // ASSERT(cbDest == (cchDest * sizeof(WCHAR)) || - // cbDest == (cchDest * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR))); - - // only accept valid flags - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - size_t cchDestCurrent; - - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (pszDest == NULL) - { - if ((cchDest == 0) && (cbDest == 0)) - { - cchDestCurrent = 0; - } - else - { - // NULL pszDest and non-zero cchDest/cbDest is invalid - hr = STRSAFE_E_INVALID_PARAMETER; - } - } - else - { - hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - pszDestEnd = pszDest + cchDestCurrent; - cchRemaining = cchDest - cchDestCurrent; - } - } - - if (pszSrc == NULL) - { - pszSrc = u""; - } - } - else - { - hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - pszDestEnd = pszDest + cchDestCurrent; - cchRemaining = cchDest - cchDestCurrent; - } - } - - if (SUCCEEDED(hr)) - { - if (cchDest == 0) - { - // only fail if there was actually src data to append - if (*pszSrc != L'\0') - { - if (pszDest == NULL) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - } - } - else - { - // we handle the STRSAFE_FILL_ON_FAILURE and STRSAFE_NULL_ON_FAILURE cases below, so do not pass - // those flags through - hr = StringCopyExWorkerW(pszDestEnd, - cchRemaining, - (cchRemaining * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR)), - pszSrc, - &pszDestEnd, - &cchRemaining, - dwFlags & (~(STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE))); - } - } - } - - if (FAILED(hr)) - { - if (pszDest) - { - // STRSAFE_NO_TRUNCATION is taken care of by StringCopyExWorkerW() - - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - } - else if (cchDest > 0) - { - pszDestEnd = pszDest + cchDest - 1; - cchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = L'\0'; - } - } - - if (dwFlags & STRSAFE_NULL_ON_FAILURE) - { - if (cchDest > 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDestEnd = L'\0'; - } - } - } - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - - return hr; -} - -STRSAFEAPI StringCatNWorkerA(char* pszDest, size_t cchDest, const char* pszSrc, size_t cchMaxAppend) -{ - HRESULT hr; - size_t cchDestCurrent; - - hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - hr = StringCopyNWorkerA(pszDest + cchDestCurrent, - cchDest - cchDestCurrent, - pszSrc, - cchMaxAppend); - } - - return hr; -} - -STRSAFEAPI StringCatNWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchMaxAppend) -{ - HRESULT hr; - size_t cchDestCurrent; - - hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - hr = StringCopyNWorkerW(pszDest + cchDestCurrent, - cchDest - cchDestCurrent, - pszSrc, - cchMaxAppend); - } - - return hr; -} - -STRSAFEAPI StringCatNExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, size_t cchMaxAppend, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr = S_OK; - char* pszDestEnd = pszDest; - size_t cchRemaining = 0; - size_t cchDestCurrent = 0; - - // ASSERT(cbDest == (cchDest * sizeof(char)) || - // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char))); - - // only accept valid flags - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (pszDest == NULL) - { - if ((cchDest == 0) && (cbDest == 0)) - { - cchDestCurrent = 0; - } - else - { - // NULL pszDest and non-zero cchDest/cbDest is invalid - hr = STRSAFE_E_INVALID_PARAMETER; - } - } - else - { - hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - pszDestEnd = pszDest + cchDestCurrent; - cchRemaining = cchDest - cchDestCurrent; - } - } - - if (pszSrc == NULL) - { - pszSrc = ""; - } - } - else - { - hr = StringLengthWorkerA(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - pszDestEnd = pszDest + cchDestCurrent; - cchRemaining = cchDest - cchDestCurrent; - } - } - - if (SUCCEEDED(hr)) - { - if (cchDest == 0) - { - // only fail if there was actually src data to append - if (*pszSrc != '\0') - { - if (pszDest == NULL) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - } - } - else - { - // we handle the STRSAFE_FILL_ON_FAILURE and STRSAFE_NULL_ON_FAILURE cases below, so do not pass - // those flags through - hr = StringCopyNExWorkerA(pszDestEnd, - cchRemaining, - (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)), - pszSrc, - cchMaxAppend, - &pszDestEnd, - &cchRemaining, - dwFlags & (~(STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE))); - } - } - } - - if (FAILED(hr)) - { - if (pszDest) - { - // STRSAFE_NO_TRUNCATION is taken care of by StringCopyNExWorkerA() - - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - } - else if (cchDest > 0) - { - pszDestEnd = pszDest + cchDest - 1; - cchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = '\0'; - } - } - - if (dwFlags & (STRSAFE_NULL_ON_FAILURE)) - { - if (cchDest > 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDestEnd = '\0'; - } - } - } - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - - return hr; -} - -STRSAFEAPI StringCatNExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, const WCHAR* pszSrc, size_t cchMaxAppend, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags) -{ - HRESULT hr = S_OK; - WCHAR* pszDestEnd = pszDest; - size_t cchRemaining = 0; - size_t cchDestCurrent = 0; - - - // ASSERT(cbDest == (cchDest * sizeof(WCHAR)) || - // cbDest == (cchDest * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR))); - - // only accept valid flags - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (pszDest == NULL) - { - if ((cchDest == 0) && (cbDest == 0)) - { - cchDestCurrent = 0; - } - else - { - // NULL pszDest and non-zero cchDest/cbDest is invalid - hr = STRSAFE_E_INVALID_PARAMETER; - } - } - else - { - hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - pszDestEnd = pszDest + cchDestCurrent; - cchRemaining = cchDest - cchDestCurrent; - } - } - - if (pszSrc == NULL) - { - pszSrc = u""; - } - } - else - { - hr = StringLengthWorkerW(pszDest, cchDest, &cchDestCurrent); - - if (SUCCEEDED(hr)) - { - pszDestEnd = pszDest + cchDestCurrent; - cchRemaining = cchDest - cchDestCurrent; - } - } - - if (SUCCEEDED(hr)) - { - if (cchDest == 0) - { - // only fail if there was actually src data to append - if (*pszSrc != L'\0') - { - if (pszDest == NULL) - { - hr = STRSAFE_E_INVALID_PARAMETER; - } - else - { - hr = STRSAFE_E_INSUFFICIENT_BUFFER; - } - } - } - else - { - // we handle the STRSAFE_FILL_ON_FAILURE and STRSAFE_NULL_ON_FAILURE cases below, so do not pass - // those flags through - hr = StringCopyNExWorkerW(pszDestEnd, - cchRemaining, - (cchRemaining * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR)), - pszSrc, - cchMaxAppend, - &pszDestEnd, - &cchRemaining, - dwFlags & (~(STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE))); - } - } - } - - if (FAILED(hr)) - { - if (pszDest) - { - // STRSAFE_NO_TRUNCATION is taken care of by StringCopyNExWorkerW() - - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - } - else if (cchDest > 0) - { - pszDestEnd = pszDest + cchDest - 1; - cchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = L'\0'; - } - } - - if (dwFlags & (STRSAFE_NULL_ON_FAILURE)) - { - if (cchDest > 0) - { - pszDestEnd = pszDest; - cchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDestEnd = L'\0'; - } - } - } - } - - if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - - return hr; -} - -STRSAFEAPI StringLengthWorkerA(const char* psz, size_t cchMax, size_t* pcch) -{ - HRESULT hr = S_OK; - size_t cchMaxPrev = cchMax; - - while (cchMax && (*psz != '\0')) - { - psz++; - cchMax--; - } - - if (cchMax == 0) - { - // the string is longer than cchMax - hr = STRSAFE_E_INVALID_PARAMETER; - } - - if (SUCCEEDED(hr) && pcch) - { - *pcch = cchMaxPrev - cchMax; - } - - return hr; -} - -STRSAFEAPI StringLengthWorkerW(const WCHAR* psz, size_t cchMax, size_t* pcch) -{ - HRESULT hr = S_OK; - size_t cchMaxPrev = cchMax; - - while (cchMax && (*psz != L'\0')) - { - psz++; - cchMax--; - } - - if (cchMax == 0) - { - // the string is longer than cchMax - hr = STRSAFE_E_INVALID_PARAMETER; - } - - if (SUCCEEDED(hr) && pcch) - { - *pcch = cchMaxPrev - cchMax; + *pszDest= L'\0'; } return hr; diff --git a/src/shared/pal/inc/unixasmmacros.inc b/src/shared/pal/inc/unixasmmacros.inc index 593d6089a4..120b26543e 100644 --- a/src/shared/pal/inc/unixasmmacros.inc +++ b/src/shared/pal/inc/unixasmmacros.inc @@ -3,6 +3,11 @@ #define INVALIDGCVALUE 0xCCCCCCCD +// Enforce subsections via symbols to workaround bugs in Xcode 15 linker. +#if defined(__APPLE__) +.subsections_via_symbols +#endif + #if defined(__APPLE__) #define C_FUNC(name) _##name #define EXTERNAL_C_FUNC(name) C_FUNC(name) @@ -19,7 +24,7 @@ #if defined(__APPLE__) #define C_PLTFUNC(name) _##name -#elif defined(HOST_ARM64) +#elif defined(HOST_ARM64) || defined(HOST_POWERPC64) #define C_PLTFUNC(name) name #else #define C_PLTFUNC(name) name@PLT @@ -43,8 +48,12 @@ #include "unixasmmacrosarm.inc" #elif defined(HOST_ARM64) #include "unixasmmacrosarm64.inc" -#elif defined(HOST_RISCV64) -#include "unixasmmacrosriscv64.inc" #elif defined(HOST_S390X) #include "unixasmmacross390x.inc" +#elif defined(HOST_LOONGARCH64) +#include "unixasmmacrosloongarch64.inc" +#elif defined(HOST_RISCV64) +#include "unixasmmacrosriscv64.inc" +#elif defined(HOST_POWERPC64) +#include "unixasmmacrosppc64le.inc" #endif diff --git a/src/shared/pal/inc/unixasmmacrosamd64.inc b/src/shared/pal/inc/unixasmmacrosamd64.inc index 9a656ddf1b..bc6d770a51 100644 --- a/src/shared/pal/inc/unixasmmacrosamd64.inc +++ b/src/shared/pal/inc/unixasmmacrosamd64.inc @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +#define C_VAR(Name) rip + C_FUNC(Name) + .macro NESTED_ENTRY Name, Section, Handler LEAF_ENTRY \Name, \Section .ifnc \Handler, NoHandler @@ -27,7 +29,7 @@ .macro PATCH_LABEL Name .global C_FUNC(\Name) -C_FUNC(\Name): + C_FUNC(\Name) = . .endm .macro LEAF_ENTRY Name, Section @@ -52,6 +54,8 @@ C_FUNC(\Name): C_FUNC(\Name\()_End): .global C_FUNC(\Name\()_End) LEAF_END \Name, \Section + // make sure this symbol gets its own address + nop .endm .macro NOP_6_BYTE diff --git a/src/shared/pal/inc/unixasmmacrosarm.inc b/src/shared/pal/inc/unixasmmacrosarm.inc index d323ccc49f..f5eb32656c 100644 --- a/src/shared/pal/inc/unixasmmacrosarm.inc +++ b/src/shared/pal/inc/unixasmmacrosarm.inc @@ -40,6 +40,8 @@ C_FUNC(\Name): .global C_FUNC(\Name\()_End) C_FUNC(\Name\()_End): LEAF_END \Name, \Section + // make sure this symbol gets its own address + nop .endm .macro PREPARE_EXTERNAL_VAR Name, HelperReg diff --git a/src/shared/pal/inc/unixasmmacrosarm64.inc b/src/shared/pal/inc/unixasmmacrosarm64.inc index 9545afb9f8..976cc825f2 100644 --- a/src/shared/pal/inc/unixasmmacrosarm64.inc +++ b/src/shared/pal/inc/unixasmmacrosarm64.inc @@ -44,6 +44,8 @@ C_FUNC(\Name): C_FUNC(\Name\()_End): .global C_FUNC(\Name\()_End) LEAF_END \Name, \Section + // make sure this symbol gets its own address + nop .endm .macro PREPARE_EXTERNAL_VAR Name, HelperReg @@ -357,3 +359,20 @@ $__RedirectionStubEndFuncName #endif .endm + +//----------------------------------------------------------------------------- +// Macro used to check (in debug builds only) whether the stack is 16-bytes aligned (a requirement before calling +// out into C++/OS code). Invoke this directly after your prolog (if the stack frame size is fixed) or directly +// before a call (if you have a frame pointer and a dynamic stack). A breakpoint will be invoked if the stack +// is misaligned. +// +.macro CHECK_STACK_ALIGNMENT + +#ifdef _DEBUG + add x9, sp, xzr + tst x9, #15 + beq 0f + EMIT_BREAKPOINT +0: +#endif +.endm diff --git a/src/shared/pal/inc/unixasmmacrosloongarch64.inc b/src/shared/pal/inc/unixasmmacrosloongarch64.inc new file mode 100644 index 0000000000..2ff98d29ec --- /dev/null +++ b/src/shared/pal/inc/unixasmmacrosloongarch64.inc @@ -0,0 +1,500 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +.macro NESTED_ENTRY Name, Section, Handler + LEAF_ENTRY \Name, \Section + .ifnc \Handler, NoHandler + .cfi_personality 0x1c, C_FUNC(\Handler) // 0x1c == DW_EH_PE_pcrel | DW_EH_PE_sdata8 + .endif +.endm + +.macro NESTED_END Name, Section + LEAF_END \Name, \Section +.endm + +.macro PATCH_LABEL Name + .global C_FUNC(\Name) +C_FUNC(\Name): +.endm + +.macro LEAF_ENTRY Name, Section + .global C_FUNC(\Name) + .type \Name, %function +C_FUNC(\Name): + .cfi_startproc +.endm + +.macro LEAF_END Name, Section + .size \Name, .-\Name + .cfi_endproc +.endm + +.macro LEAF_END_MARKED Name, Section +C_FUNC(\Name\()_End): + .global C_FUNC(\Name\()_End) + LEAF_END \Name, \Section + // make sure this symbol gets its own address + nop +.endm + +.macro PREPARE_EXTERNAL_VAR Name, HelperReg + la.local \HelperReg, \Name +.endm + +.macro PROLOG_STACK_ALLOC Size + addi.d $sp, $sp, -\Size + //.cfi_adjust_cfa_offset \Size + .cfi_def_cfa 3,\Size +.endm + +.macro EPILOG_STACK_FREE Size + addi.d $sp, $sp, \Size + //.cfi_adjust_cfa_offset -\Size + .cfi_def_cfa 3,-\Size +.endm + +.macro EPILOG_STACK_RESTORE + ori $sp, $fp, 0 + .cfi_restore 3 +.endm + +////NOTE: reg must be the number and GPR type !!! +.macro PROLOG_SAVE_REG reg, ofs + st.d $r\reg, $sp, \ofs + .cfi_rel_offset \reg, \ofs +.endm + +////NOTE: reg1 and reg2 must be the number and GPR type !!! +.macro PROLOG_SAVE_REG_PAIR reg1, reg2, ofs, __def_cfa_save=0 +//#ifdef FEATURE_LOONGSONISA +// //NOTE:The offset of gssq/gslq must be 16-bytes aligned. +// // here ofs must be 16-bytes aligned. +// gssq \reg2, \reg1, \ofs(sp) +//#else + st.d $r\reg1, $sp, \ofs + st.d $r\reg2, $sp, \ofs+8 +//#endif + + .cfi_rel_offset \reg1, \ofs + .cfi_rel_offset \reg2, \ofs + 8 + .if (\__def_cfa_save == 1) + ori $fp, $sp, 0 + .cfi_def_cfa_register 22 + .endif +.endm + +////NOTE: reg1 and reg2 must be the number and GPR type !!! +.macro PROLOG_SAVE_REG_PAIR_INDEXED reg1, reg2, ssize, __def_cfa_save=1 + addi.d $sp, $sp, -\ssize + //.cfi_adjust_cfa_offset \ssize + .cfi_def_cfa 3,\ssize + + st.d $r\reg1, $sp, 0 + st.d $r\reg2, $sp, 8 + + .cfi_rel_offset \reg1, 0 + .cfi_rel_offset \reg2, 8 + .if (\__def_cfa_save == 1) + ori $fp, $sp, 0 + .cfi_def_cfa_register 22 + .endif +.endm + +.macro EPILOG_RESTORE_REG reg, ofs + ld.d $r\reg, $sp, \ofs + .cfi_restore \reg + .cfi_def_cfa_register 3 +.endm + +.macro EPILOG_RESTORE_REG_PAIR reg1, reg2, ofs +//#ifdef FEATURE_LOONGSONISA +// gslq \reg2, \reg1, \ofs(sp) +//#else + ld.d $r\reg2, $sp, \ofs+8 + ld.d $r\reg1, $sp, \ofs +//#endif + .cfi_restore \reg2 + .cfi_restore \reg1 +.endm + +.macro EPILOG_RESTORE_REG_PAIR_INDEXED reg1, reg2, ssize +//#ifdef FEATURE_LOONGSONISA +// gslq \reg2, \reg1, 0(sp) +//#else + ld.d $r\reg2, $sp, 8 + ld.d $r\reg1, $sp, 0 +//#endif + .cfi_restore \reg2 + .cfi_restore \reg1 + + addi.d $sp, $sp, \ssize + //.cfi_adjust_cfa_offset -\ssize + .cfi_def_cfa 3,-\ssize +.endm + +.macro EPILOG_RETURN + jirl $r0, $ra, 0 +.endm + +.macro EMIT_BREAKPOINT + break 0 +.endm + +.macro EPILOG_BRANCH Target + b \Target +.endm + +.macro EPILOG_BRANCH_REG reg + jirl $r0, \reg, 0 +.endm + +//----------------------------------------------------------------------------- +// The Following sets of SAVE_*_REGISTERS expect the memory to be reserved and +// base address to be passed in $reg +// + +// Reserve 64 bytes of memory before calling SAVE_CALLEESAVED_REGISTERS +.macro SAVE_CALLEESAVED_REGISTERS reg, ofs + + PROLOG_SAVE_REG_PAIR 23, 24, \ofs + 16 + PROLOG_SAVE_REG_PAIR 25, 26, \ofs + 32 + PROLOG_SAVE_REG_PAIR 27, 28, \ofs + 48 + PROLOG_SAVE_REG_PAIR 29, 30, \ofs + 64 + PROLOG_SAVE_REG_PAIR 31, 2, \ofs + 80 + +.endm + +// Reserve 64 bytes of memory before calling SAVE_ARGUMENT_REGISTERS +.macro SAVE_ARGUMENT_REGISTERS reg, ofs + +//#ifdef FEATURE_LOONGSONISA +// //NOTE:The offset of gssq/gslq must be 16-bytes aligned. +// // here ofs must be 16-bytes aligned. +// gssq a1, a0, \ofs(\reg) +// gssq a3, a2, \ofs+16(\reg) +// gssq a5, a4, \ofs+32(\reg) +// gssq a7, a6, \ofs+48(\reg) +//#else + st.d $a0, \reg, \ofs + st.d $a1, \reg, \ofs+8 + st.d $a2, \reg, \ofs+16 + st.d $a3, \reg, \ofs+24 + st.d $a4, \reg, \ofs+32 + st.d $a5, \reg, \ofs+40 + st.d $a6, \reg, \ofs+48 + st.d $a7, \reg, \ofs+56 +//#endif + +.endm + +// Reserve 64 bytes of memory before calling SAVE_FLOAT_ARGUMENT_REGISTERS +.macro SAVE_FLOAT_ARGUMENT_REGISTERS reg, ofs + +//#ifdef FEATURE_LOONGSONISA +// //NOTE:The offset of gssqc1/gslqc1 must be 16-bytes aligned. +// // here ofs must be 16-bytes aligned. +// gssqc1 $f13, $f12, \ofs(\reg) +// gssqc1 $f15, $f14, \ofs+16(\reg) +// gssqc1 $f17, $f16, \ofs+32(\reg) +// gssqc1 $f19, $f18, \ofs+48(\reg) +//#else + fst.d $f0, \reg, \ofs + fst.d $f1, \reg, \ofs+8 + fst.d $f2, \reg, \ofs+16 + fst.d $f3, \reg, \ofs+24 + fst.d $f4, \reg, \ofs+32 + fst.d $f5, \reg, \ofs+40 + fst.d $f6, \reg, \ofs+48 + fst.d $f7, \reg, \ofs+56 +//#endif + +.endm + +// Reserve 64 bytes of memory before calling SAVE_FLOAT_CALLEESAVED_REGISTERS +.macro SAVE_FLOAT_CALLEESAVED_REGISTERS reg, ofs + +//#ifdef FEATURE_LOONGSONISA +// //NOTE:The offset of gssqc1/gslqc1 must be 16-bytes aligned. +// // here ofs must be 16-bytes aligned. +// gssqc1 $f25, $f24, \ofs(\reg) +// gssqc1 $f27, $f26, \ofs+16(\reg) +// gssqc1 $f29, $f28, \ofs+32(\reg) +// gssqc1 $f31, $f30, \ofs+48(\reg) +//#else + fst.d $f24, \reg, \ofs + fst.d $f25, \reg, \ofs+8 + fst.d $f26, \reg, \ofs+16 + fst.d $f27, \reg, \ofs+24 + fst.d $f28, \reg, \ofs+32 + fst.d $f29, \reg, \ofs+40 + fst.d $f30, \reg, \ofs+48 + fst.d $f31, \reg, \ofs+56 +//#endif + +.endm + +.macro RESTORE_CALLEESAVED_REGISTERS reg, ofs + + EPILOG_RESTORE_REG_PAIR 31, 2 \ofs + 80 + + EPILOG_RESTORE_REG_PAIR 29, 30, \ofs + 64 + EPILOG_RESTORE_REG_PAIR 27, 28, \ofs + 48 + EPILOG_RESTORE_REG_PAIR 25, 26, \ofs + 32 + EPILOG_RESTORE_REG_PAIR 23, 24, \ofs + 16 +.endm + +.macro RESTORE_ARGUMENT_REGISTERS reg, ofs + +//#ifdef FEATURE_LOONGSONISA +// //NOTE:The offset of gssq/gslq must be 16-bytes aligned. +// // here ofs must be 16-bytes aligned. +// gslq a7, a6, \ofs+48(\reg) +// gslq a5, a4, \ofs+32(\reg) +// gslq a3, a2, \ofs+16(\reg) +// gslq a1, a0, \ofs(\reg) +//#else + ld.d $a7, \reg, \ofs+56 + ld.d $a6, \reg, \ofs+48 + ld.d $a5, \reg, \ofs+40 + ld.d $a4, \reg, \ofs+32 + ld.d $a3, \reg, \ofs+24 + ld.d $a2, \reg, \ofs+16 + ld.d $a1, \reg, \ofs+8 + ld.d $a0, \reg, \ofs +//#endif + +.endm + +.macro RESTORE_FLOAT_ARGUMENT_REGISTERS reg, ofs + +//#ifdef FEATURE_LOONGSONISA +// gslqc1 $f19, $f18, \ofs+48(\reg) +// gslqc1 $f17, $f16, \ofs+32(\reg) +// gslqc1 $f15, $f14, \ofs+16(\reg) +// gslqc1 $f13, $f12, \ofs(\reg) +//#else + fld.d $f7, \reg, \ofs+56 + fld.d $f6, \reg, \ofs+48 + fld.d $f5, \reg, \ofs+40 + fld.d $f4, \reg, \ofs+32 + fld.d $f3, \reg, \ofs+24 + fld.d $f2, \reg, \ofs+16 + fld.d $f1, \reg, \ofs+8 + fld.d $f0, \reg, \ofs +//#endif + +.endm + +.macro RESTORE_FLOAT_CALLEESAVED_REGISTERS reg, ofs + +//#ifdef FEATURE_LOONGSONISA +// //NOTE:The offset of gssqc1/gslqc1 must be 16-bytes aligned. +// // here ofs must be 16-bytes aligned. +// gslqc1 $f25, $f24, \ofs(\reg) +// gslqc1 $f27, $f26, \ofs+16(\reg) +// gslqc1 $f29, $f28, \ofs+32(\reg) +// gslqc1 $f31, $f30, \ofs+48(\reg) +//#else + fld.d $f24, $r\reg, \ofs + fld.d $f25, $r\reg, \ofs+8 + fld.d $f26, $r\reg, \ofs+16 + fld.d $f27, $r\reg, \ofs+24 + fld.d $f28, $r\reg, \ofs+32 + fld.d $f29, $r\reg, \ofs+40 + fld.d $f30, $r\reg, \ofs+48 + fld.d $f31, $r\reg, \ofs+56 +//#endif + +.endm + +//----------------------------------------------------------------------------- +// Define the prolog for a TransitionBlock-based method. This macro should be called first in the method and +// comprises the entire prolog.The locals must be 8 byte aligned +// +// Save_argument_registers: +// GPR_a7 +// GPR_a6 +// GPR_a5 +// GPR_a4 +// GPR_a3 +// GPR_a2 +// GPR_a1 +// GPR_a0 +// +// General Registers: +// GPR_tp +// GPR_s8 +// GPR_s7 +// GPR_s6 +// GPR_s5 +// GPR_s4 +// GPR_s3 +// GPR_s2 +// GPR_s1 +// GPR_s0 +// GPR_ra +// GPR_fp +// +// Float Point: +// FPR_f31 / fs7 +// FPR_f30 / fs6 +// FPR_f29 / fs5 +// FPR_f28 / fs4 +// FPR_f27 / fs3 +// FPR_f26 / fs2 +// FPR_f25 / fs1 +// FPR_f24 / fs0 +// Extra: +// +.macro PROLOG_WITH_TRANSITION_BLOCK extraParameters = 0, extraLocals = 0, SaveFPRegs = 1 + + __PWTB_SaveFPArgs = \SaveFPRegs + + __PWTB_FloatArgumentRegisters = \extraLocals + + .if ((__PWTB_FloatArgumentRegisters % 16) != 0) + __PWTB_FloatArgumentRegisters = __PWTB_FloatArgumentRegisters + 8 + .endif + + __PWTB_TransitionBlock = __PWTB_FloatArgumentRegisters + + .if (__PWTB_SaveFPArgs == 1) + __PWTB_TransitionBlock = __PWTB_TransitionBlock + SIZEOF__FloatArgumentRegisters + .endif + + + __PWTB_CalleeSavedRegisters = __PWTB_TransitionBlock + __PWTB_ArgumentRegisters = __PWTB_TransitionBlock + 96 + + // Including fp, ra, s0-s8, tp, and (a0-a7)arguments. (1+1+9+1)*8 + 8*8. + __PWTB_StackAlloc = __PWTB_TransitionBlock + 96 + 64 + PROLOG_STACK_ALLOC __PWTB_StackAlloc + // $fp,$ra + PROLOG_SAVE_REG_PAIR 22, 1, __PWTB_CalleeSavedRegisters, 1 + + // First, Spill argument registers. + SAVE_ARGUMENT_REGISTERS $sp, __PWTB_ArgumentRegisters + + // Then, Spill callee saved registers. $sp=$r3. + SAVE_CALLEESAVED_REGISTERS 3, __PWTB_CalleeSavedRegisters + + // saving is f12-19. + .if (__PWTB_SaveFPArgs == 1) + SAVE_FLOAT_ARGUMENT_REGISTERS $sp, __PWTB_FloatArgumentRegisters + .endif + +.endm + +.macro EPILOG_WITH_TRANSITION_BLOCK_RETURN + + RESTORE_CALLEESAVED_REGISTERS 3, __PWTB_CalleeSavedRegisters + + EPILOG_RESTORE_REG_PAIR 22, 1, __PWTB_CalleeSavedRegisters + + EPILOG_STACK_FREE __PWTB_StackAlloc + + jirl $r0, $ra, 0 + +.endm + + +//----------------------------------------------------------------------------- +// Provides a matching epilog to PROLOG_WITH_TRANSITION_BLOCK and ends by preparing for tail-calling. +// Since this is a tail call argument registers are restored. +// +.macro EPILOG_WITH_TRANSITION_BLOCK_TAILCALL + + .if (__PWTB_SaveFPArgs == 1) + RESTORE_FLOAT_ARGUMENT_REGISTERS $sp, __PWTB_FloatArgumentRegisters + .endif + + RESTORE_CALLEESAVED_REGISTERS 3, __PWTB_CalleeSavedRegisters + + RESTORE_ARGUMENT_REGISTERS $sp, __PWTB_ArgumentRegisters + + EPILOG_RESTORE_REG_PAIR 22, 1, __PWTB_CalleeSavedRegisters + + EPILOG_STACK_FREE __PWTB_StackAlloc + +.endm + +// ------------------------------------------------------------------ +// Macro to generate Redirection Stubs +// +// $reason : reason for redirection +// Eg. GCThreadControl +// NOTE: If you edit this macro, make sure you update GetCONTEXTFromRedirectedStubStackFrame. +// This function is used by both the personality routine and the debugger to retrieve the original CONTEXT. +.macro GenerateRedirectedHandledJITCaseStub reason + +#if NOTYET + GBLS __RedirectionStubFuncName + GBLS __RedirectionStubEndFuncName + GBLS __RedirectionFuncName +__RedirectionStubFuncName SETS "RedirectedHandledJITCaseFor":CC:"$reason":CC:"_Stub" +__RedirectionStubEndFuncName SETS "RedirectedHandledJITCaseFor":CC:"$reason":CC:"_StubEnd" +__RedirectionFuncName SETS "|?RedirectedHandledJITCaseFor":CC:"$reason":CC:"@Thread@@CAXXZ|" + + IMPORT $__RedirectionFuncName + + NESTED_ENTRY $__RedirectionStubFuncName + addi.d $sp, $sp, -32 // stack slot for CONTEXT * and padding + PROLOG_SAVE_REG_PAIR 22, 1, 16, 1 + + //REDIRECTSTUB_SP_OFFSET_CONTEXT is defined in asmconstants.h and is used in GetCONTEXTFromRedirectedStubStackFrame + //If CONTEXT is not saved at 0 offset from SP it must be changed as well. + ASSERT REDIRECTSTUB_SP_OFFSET_CONTEXT == 0 + + // Stack alignment. This check is necessary as this function can be + // entered before complete execution of the prolog of another function. + andi $t4, $fp, 0xf + sub.d $sp, $sp, $t4 + + + // + // Save a copy of the redirect CONTEXT*. + // This is needed for the debugger to unwind the stack. + // + bl GetCurrentSavedRedirectContext + + st.d $v0, $sp, 0 + + // + // Fetch the interrupted pc and save it as our return address. + // + ld.d $a1, $a0, CONTEXT_PC + st.d $a1, $fp, 8 + + // + // Call target, which will do whatever we needed to do in the context + // of the target thread, and will RtlRestoreContext when it is done. + // + bl $__RedirectionFuncName + + EMIT_BREAKPOINT // Unreachable + +// Put a label here to tell the debugger where the end of this function is. +$__RedirectionStubEndFuncName + EXPORT $__RedirectionStubEndFuncName + + NESTED_END +#else + EMIT_BREAKPOINT +#endif +.endm + +//----------------------------------------------------------------------------- +// Macro used to check (in debug builds only) whether the stack is 16-bytes aligned (a requirement before calling +// out into C++/OS code). Invoke this directly after your prolog (if the stack frame size is fixed) or directly +// before a call (if you have a frame pointer and a dynamic stack). A breakpoint will be invoked if the stack +// is misaligned. +// +.macro CHECK_STACK_ALIGNMENT + +#ifdef _DEBUG + andi $t4, $sp, 0xf + beq $t4, $r0, 0f + EMIT_BREAKPOINT +0: +#endif +.endm diff --git a/src/shared/pal/inc/unixasmmacrosppc64le.inc b/src/shared/pal/inc/unixasmmacrosppc64le.inc new file mode 100644 index 0000000000..6fdc3ee3ee --- /dev/null +++ b/src/shared/pal/inc/unixasmmacrosppc64le.inc @@ -0,0 +1,36 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +.macro NESTED_ENTRY Name, Section, Handler + LEAF_ENTRY \Name, \Section + .ifnc \Handler, NoHandler + .personality C_FUNC(\Handler) + .endif +.endm + +.macro NESTED_END Name, Section + LEAF_END \Name, \Section +.endm + +.macro PATCH_LABEL Name + .global C_FUNC(\Name) +C_FUNC(\Name): +.endm + +.macro LEAF_ENTRY Name, Section + .global C_FUNC(\Name) + .type \Name, %function +C_FUNC(\Name): + .cfi_startproc +.endm + +.macro LEAF_END Name, Section + .size \Name, .-\Name + .cfi_endproc +.endm + +.macro LEAF_END_MARKED Name, Section +C_FUNC(\Name\()_End): + .global C_FUNC(\Name\()_End) + LEAF_END \Name, \Section +.endm diff --git a/src/shared/pal/inc/unixasmmacrosriscv64.inc b/src/shared/pal/inc/unixasmmacrosriscv64.inc index 56da9af150..af7e5336ec 100644 --- a/src/shared/pal/inc/unixasmmacrosriscv64.inc +++ b/src/shared/pal/inc/unixasmmacrosriscv64.inc @@ -256,7 +256,11 @@ C_FUNC(\Name\()_End): __PWTB_FloatArgumentRegisters = \extraLocals - .if ((__PWTB_FloatArgumentRegisters % 16) != 0) + // Note, stack (see __PWTB_StackAlloc variable) must be 16 byte aligned, + // SIZEOF__FloatArgumentRegisters (0x40) is 16 byte aligned, that mean initial + // __PWTB_FloatArgumentRegisters value must be not 16 byte aligned and + // after add (120 + 64) provide 16 byte aligned result. + .if ((__PWTB_FloatArgumentRegisters % 16) == 0) __PWTB_FloatArgumentRegisters = __PWTB_FloatArgumentRegisters + 8 .endif @@ -289,8 +293,14 @@ C_FUNC(\Name\()_End): .endm .macro EPILOG_WITH_TRANSITION_BLOCK_RETURN -// TODO RISCV NYI - sw ra, 0(zero) + + RESTORE_CALLEESAVED_REGISTERS sp, __PWTB_CalleeSavedRegisters + + EPILOG_RESTORE_REG_PAIR fp, ra, __PWTB_CalleeSavedRegisters + + EPILOG_STACK_FREE __PWTB_StackAlloc + + ret .endm diff --git a/src/shared/pal/inc/unixasmmacross390x.inc b/src/shared/pal/inc/unixasmmacross390x.inc index ae6a894ad7..e4d7928708 100644 --- a/src/shared/pal/inc/unixasmmacross390x.inc +++ b/src/shared/pal/inc/unixasmmacross390x.inc @@ -34,4 +34,3 @@ C_FUNC(\Name\()_End): .global C_FUNC(\Name\()_End) LEAF_END \Name, \Section .endm - diff --git a/src/shared/pal/inc/unixasmmacrosx86.inc b/src/shared/pal/inc/unixasmmacrosx86.inc index 87cbddd6ed..7bc994a779 100644 --- a/src/shared/pal/inc/unixasmmacrosx86.inc +++ b/src/shared/pal/inc/unixasmmacrosx86.inc @@ -33,6 +33,8 @@ C_FUNC(\Name): C_FUNC(\Name\()_End): .global C_FUNC(\Name\()_End) LEAF_END \Name, \Section + // make sure this symbol gets its own address + nop .endm .macro PROLOG_BEG diff --git a/src/shared/pal/prebuilt/idl/cordebug_i.cpp b/src/shared/pal/prebuilt/idl/cordebug_i.cpp index c509c3c16c..811cd6512f 100644 --- a/src/shared/pal/prebuilt/idl/cordebug_i.cpp +++ b/src/shared/pal/prebuilt/idl/cordebug_i.cpp @@ -315,6 +315,8 @@ MIDL_DEFINE_GUID(IID, IID_ICorDebugFunction3,0x09B70F28,0xE465,0x482D,0x99,0xE0, MIDL_DEFINE_GUID(IID, IID_ICorDebugFunction4,0x72965963,0x34fd,0x46e9,0x94,0x34,0xb8,0x17,0xfe,0x6e,0x7f,0x43); +MIDL_DEFINE_GUID(IID, IID_ICorDebugFunction5,0x9D4DAB7B,0x3401,0x4F37,0xBD,0x08,0xCA,0x09,0xF3,0xFD,0xF1,0x0F); + MIDL_DEFINE_GUID(IID, IID_ICorDebugCode,0xCC7BCAF4,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D); @@ -472,6 +474,9 @@ MIDL_DEFINE_GUID(IID, IID_ICorDebugExceptionObjectCallStackEnum,0xED775530,0x4DC MIDL_DEFINE_GUID(IID, IID_ICorDebugExceptionObjectValue,0xAE4CA65D,0x59DD,0x42A2,0x83,0xA5,0x57,0xE8,0xA0,0x8D,0x87,0x19); +MIDL_DEFINE_GUID(IID, IID_ICorDebugExceptionObjectValue2,0xe3b2f332,0xcc46,0x4f1e,0xab,0x4e,0x54,0x00,0xe3,0x32,0x19,0x5e); + + MIDL_DEFINE_GUID(IID, LIBID_CORDBLib,0x53D13620,0xF417,0x11d1,0x97,0x62,0xA6,0x38,0x26,0xA4,0xF2,0x55); diff --git a/src/shared/pal/prebuilt/idl/corprof_i.cpp b/src/shared/pal/prebuilt/idl/corprof_i.cpp index 07b78a4fb3..bbe6d40b49 100644 --- a/src/shared/pal/prebuilt/idl/corprof_i.cpp +++ b/src/shared/pal/prebuilt/idl/corprof_i.cpp @@ -144,7 +144,13 @@ MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo11,0x06398876,0x8987,0x4154,0xB6,0x21, MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo12,0x27b24ccd,0x1cb1,0x47c5,0x96,0xee,0x98,0x19,0x0d,0xc3,0x09,0x59); -MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo13,0x19C4179D,0xF92C,0x4D25,0x9F,0x20,0x5F,0xEB,0xFB,0xBD,0x29,0x78); +MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo13,0x6E6C7EE2,0x0701,0x4EC2,0x9D,0x29,0x2E,0x87,0x33,0xB6,0x69,0x34); + + +MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo14,0xF460E352,0xD76D,0x4FE9,0x83,0x5F,0xF6,0xAF,0x9D,0x6E,0x86,0x2D); + + +MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo15,0xB446462D,0xBD22,0x41DD,0x87,0x2D,0xDC,0x71,0x4C,0x49,0xEB,0x56); MIDL_DEFINE_GUID(IID, IID_ICorProfilerMethodEnum,0xFCCEE788,0x0088,0x454B,0xA8,0x11,0xC9,0x9F,0x29,0x8D,0x19,0x42); diff --git a/src/shared/pal/prebuilt/idl/metahost_i.cpp b/src/shared/pal/prebuilt/idl/metahost_i.cpp index 285aa87928..27b3a1ab50 100644 --- a/src/shared/pal/prebuilt/idl/metahost_i.cpp +++ b/src/shared/pal/prebuilt/idl/metahost_i.cpp @@ -5,9 +5,9 @@ /* link this file in with the server and any clients */ - /* File created by MIDL compiler version 8.01.0622 */ + /* File created by MIDL compiler version 8.01.0628 */ /* Compiler settings for metahost.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628 protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: diff --git a/src/shared/pal/prebuilt/idl/sospriv_i.cpp b/src/shared/pal/prebuilt/idl/sospriv_i.cpp index f070ae5816..579be51d35 100644 --- a/src/shared/pal/prebuilt/idl/sospriv_i.cpp +++ b/src/shared/pal/prebuilt/idl/sospriv_i.cpp @@ -121,6 +121,12 @@ MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface13,0x3176a8ed,0x597b,0x4f54,0xa7,0x1f, MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface14,0x9aa22aca,0x6dc6,0x4a0c,0xb4,0xe0,0x70,0xd2,0x41,0x6b,0x98,0x37); + +MIDL_DEFINE_GUID(IID, IID_ISOSMethodEnum,0x3c0fe725,0xc324,0x4a4f,0x81,0x00,0xd3,0x99,0x58,0x8a,0x66,0x2e); + + +MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface15,0x7ed81261,0x52a9,0x4a23,0xa3,0x58,0xc3,0x31,0x3d,0xea,0x30,0xa8); + #undef MIDL_DEFINE_GUID #ifdef __cplusplus diff --git a/src/shared/pal/prebuilt/inc/cordebug.h b/src/shared/pal/prebuilt/inc/cordebug.h index 0d4d04e81b..78b86c69ee 100644 --- a/src/shared/pal/prebuilt/inc/cordebug.h +++ b/src/shared/pal/prebuilt/inc/cordebug.h @@ -1,12 +1,11 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. + /* this ALWAYS GENERATED file contains the definitions for the interfaces */ - /* File created by MIDL compiler version 8.01.0622 */ + /* File created by MIDL compiler version 8.01.0628 */ /* Compiler settings for cordebug.idl: - Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0622 + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628 protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: @@ -42,951 +41,973 @@ #pragma once #endif +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + /* Forward Declarations */ #ifndef __ICorDebugDataTarget_FWD_DEFINED__ #define __ICorDebugDataTarget_FWD_DEFINED__ typedef interface ICorDebugDataTarget ICorDebugDataTarget; -#endif /* __ICorDebugDataTarget_FWD_DEFINED__ */ +#endif /* __ICorDebugDataTarget_FWD_DEFINED__ */ #ifndef __ICorDebugStaticFieldSymbol_FWD_DEFINED__ #define __ICorDebugStaticFieldSymbol_FWD_DEFINED__ typedef interface ICorDebugStaticFieldSymbol ICorDebugStaticFieldSymbol; -#endif /* __ICorDebugStaticFieldSymbol_FWD_DEFINED__ */ +#endif /* __ICorDebugStaticFieldSymbol_FWD_DEFINED__ */ #ifndef __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ #define __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ typedef interface ICorDebugInstanceFieldSymbol ICorDebugInstanceFieldSymbol; -#endif /* __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ */ +#endif /* __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ */ #ifndef __ICorDebugVariableSymbol_FWD_DEFINED__ #define __ICorDebugVariableSymbol_FWD_DEFINED__ typedef interface ICorDebugVariableSymbol ICorDebugVariableSymbol; -#endif /* __ICorDebugVariableSymbol_FWD_DEFINED__ */ +#endif /* __ICorDebugVariableSymbol_FWD_DEFINED__ */ #ifndef __ICorDebugMemoryBuffer_FWD_DEFINED__ #define __ICorDebugMemoryBuffer_FWD_DEFINED__ typedef interface ICorDebugMemoryBuffer ICorDebugMemoryBuffer; -#endif /* __ICorDebugMemoryBuffer_FWD_DEFINED__ */ +#endif /* __ICorDebugMemoryBuffer_FWD_DEFINED__ */ #ifndef __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ #define __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ typedef interface ICorDebugMergedAssemblyRecord ICorDebugMergedAssemblyRecord; -#endif /* __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ */ +#endif /* __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ */ #ifndef __ICorDebugSymbolProvider_FWD_DEFINED__ #define __ICorDebugSymbolProvider_FWD_DEFINED__ typedef interface ICorDebugSymbolProvider ICorDebugSymbolProvider; -#endif /* __ICorDebugSymbolProvider_FWD_DEFINED__ */ +#endif /* __ICorDebugSymbolProvider_FWD_DEFINED__ */ #ifndef __ICorDebugSymbolProvider2_FWD_DEFINED__ #define __ICorDebugSymbolProvider2_FWD_DEFINED__ typedef interface ICorDebugSymbolProvider2 ICorDebugSymbolProvider2; -#endif /* __ICorDebugSymbolProvider2_FWD_DEFINED__ */ +#endif /* __ICorDebugSymbolProvider2_FWD_DEFINED__ */ #ifndef __ICorDebugVirtualUnwinder_FWD_DEFINED__ #define __ICorDebugVirtualUnwinder_FWD_DEFINED__ typedef interface ICorDebugVirtualUnwinder ICorDebugVirtualUnwinder; -#endif /* __ICorDebugVirtualUnwinder_FWD_DEFINED__ */ +#endif /* __ICorDebugVirtualUnwinder_FWD_DEFINED__ */ #ifndef __ICorDebugDataTarget2_FWD_DEFINED__ #define __ICorDebugDataTarget2_FWD_DEFINED__ typedef interface ICorDebugDataTarget2 ICorDebugDataTarget2; -#endif /* __ICorDebugDataTarget2_FWD_DEFINED__ */ +#endif /* __ICorDebugDataTarget2_FWD_DEFINED__ */ #ifndef __ICorDebugLoadedModule_FWD_DEFINED__ #define __ICorDebugLoadedModule_FWD_DEFINED__ typedef interface ICorDebugLoadedModule ICorDebugLoadedModule; -#endif /* __ICorDebugLoadedModule_FWD_DEFINED__ */ +#endif /* __ICorDebugLoadedModule_FWD_DEFINED__ */ #ifndef __ICorDebugDataTarget3_FWD_DEFINED__ #define __ICorDebugDataTarget3_FWD_DEFINED__ typedef interface ICorDebugDataTarget3 ICorDebugDataTarget3; -#endif /* __ICorDebugDataTarget3_FWD_DEFINED__ */ +#endif /* __ICorDebugDataTarget3_FWD_DEFINED__ */ #ifndef __ICorDebugDataTarget4_FWD_DEFINED__ #define __ICorDebugDataTarget4_FWD_DEFINED__ typedef interface ICorDebugDataTarget4 ICorDebugDataTarget4; -#endif /* __ICorDebugDataTarget4_FWD_DEFINED__ */ +#endif /* __ICorDebugDataTarget4_FWD_DEFINED__ */ #ifndef __ICorDebugMutableDataTarget_FWD_DEFINED__ #define __ICorDebugMutableDataTarget_FWD_DEFINED__ typedef interface ICorDebugMutableDataTarget ICorDebugMutableDataTarget; -#endif /* __ICorDebugMutableDataTarget_FWD_DEFINED__ */ +#endif /* __ICorDebugMutableDataTarget_FWD_DEFINED__ */ #ifndef __ICorDebugMetaDataLocator_FWD_DEFINED__ #define __ICorDebugMetaDataLocator_FWD_DEFINED__ typedef interface ICorDebugMetaDataLocator ICorDebugMetaDataLocator; -#endif /* __ICorDebugMetaDataLocator_FWD_DEFINED__ */ +#endif /* __ICorDebugMetaDataLocator_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback_FWD_DEFINED__ #define __ICorDebugManagedCallback_FWD_DEFINED__ typedef interface ICorDebugManagedCallback ICorDebugManagedCallback; -#endif /* __ICorDebugManagedCallback_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback3_FWD_DEFINED__ #define __ICorDebugManagedCallback3_FWD_DEFINED__ typedef interface ICorDebugManagedCallback3 ICorDebugManagedCallback3; -#endif /* __ICorDebugManagedCallback3_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback3_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback4_FWD_DEFINED__ #define __ICorDebugManagedCallback4_FWD_DEFINED__ typedef interface ICorDebugManagedCallback4 ICorDebugManagedCallback4; -#endif /* __ICorDebugManagedCallback4_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback4_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback2_FWD_DEFINED__ #define __ICorDebugManagedCallback2_FWD_DEFINED__ typedef interface ICorDebugManagedCallback2 ICorDebugManagedCallback2; -#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */ #ifndef __ICorDebugUnmanagedCallback_FWD_DEFINED__ #define __ICorDebugUnmanagedCallback_FWD_DEFINED__ typedef interface ICorDebugUnmanagedCallback ICorDebugUnmanagedCallback; -#endif /* __ICorDebugUnmanagedCallback_FWD_DEFINED__ */ +#endif /* __ICorDebugUnmanagedCallback_FWD_DEFINED__ */ #ifndef __ICorDebug_FWD_DEFINED__ #define __ICorDebug_FWD_DEFINED__ typedef interface ICorDebug ICorDebug; -#endif /* __ICorDebug_FWD_DEFINED__ */ +#endif /* __ICorDebug_FWD_DEFINED__ */ #ifndef __ICorDebugRemoteTarget_FWD_DEFINED__ #define __ICorDebugRemoteTarget_FWD_DEFINED__ typedef interface ICorDebugRemoteTarget ICorDebugRemoteTarget; -#endif /* __ICorDebugRemoteTarget_FWD_DEFINED__ */ +#endif /* __ICorDebugRemoteTarget_FWD_DEFINED__ */ #ifndef __ICorDebugRemote_FWD_DEFINED__ #define __ICorDebugRemote_FWD_DEFINED__ typedef interface ICorDebugRemote ICorDebugRemote; -#endif /* __ICorDebugRemote_FWD_DEFINED__ */ +#endif /* __ICorDebugRemote_FWD_DEFINED__ */ #ifndef __ICorDebug2_FWD_DEFINED__ #define __ICorDebug2_FWD_DEFINED__ typedef interface ICorDebug2 ICorDebug2; -#endif /* __ICorDebug2_FWD_DEFINED__ */ +#endif /* __ICorDebug2_FWD_DEFINED__ */ #ifndef __ICorDebugController_FWD_DEFINED__ #define __ICorDebugController_FWD_DEFINED__ typedef interface ICorDebugController ICorDebugController; -#endif /* __ICorDebugController_FWD_DEFINED__ */ +#endif /* __ICorDebugController_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain_FWD_DEFINED__ #define __ICorDebugAppDomain_FWD_DEFINED__ typedef interface ICorDebugAppDomain ICorDebugAppDomain; -#endif /* __ICorDebugAppDomain_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain2_FWD_DEFINED__ #define __ICorDebugAppDomain2_FWD_DEFINED__ typedef interface ICorDebugAppDomain2 ICorDebugAppDomain2; -#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */ #ifndef __ICorDebugEnum_FWD_DEFINED__ #define __ICorDebugEnum_FWD_DEFINED__ typedef interface ICorDebugEnum ICorDebugEnum; -#endif /* __ICorDebugEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugEnum_FWD_DEFINED__ */ #ifndef __ICorDebugGuidToTypeEnum_FWD_DEFINED__ #define __ICorDebugGuidToTypeEnum_FWD_DEFINED__ typedef interface ICorDebugGuidToTypeEnum ICorDebugGuidToTypeEnum; -#endif /* __ICorDebugGuidToTypeEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugGuidToTypeEnum_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain3_FWD_DEFINED__ #define __ICorDebugAppDomain3_FWD_DEFINED__ typedef interface ICorDebugAppDomain3 ICorDebugAppDomain3; -#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain4_FWD_DEFINED__ #define __ICorDebugAppDomain4_FWD_DEFINED__ typedef interface ICorDebugAppDomain4 ICorDebugAppDomain4; -#endif /* __ICorDebugAppDomain4_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain4_FWD_DEFINED__ */ #ifndef __ICorDebugAssembly_FWD_DEFINED__ #define __ICorDebugAssembly_FWD_DEFINED__ typedef interface ICorDebugAssembly ICorDebugAssembly; -#endif /* __ICorDebugAssembly_FWD_DEFINED__ */ +#endif /* __ICorDebugAssembly_FWD_DEFINED__ */ #ifndef __ICorDebugAssembly2_FWD_DEFINED__ #define __ICorDebugAssembly2_FWD_DEFINED__ typedef interface ICorDebugAssembly2 ICorDebugAssembly2; -#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */ +#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */ #ifndef __ICorDebugAssembly3_FWD_DEFINED__ #define __ICorDebugAssembly3_FWD_DEFINED__ typedef interface ICorDebugAssembly3 ICorDebugAssembly3; -#endif /* __ICorDebugAssembly3_FWD_DEFINED__ */ +#endif /* __ICorDebugAssembly3_FWD_DEFINED__ */ #ifndef __ICorDebugHeapEnum_FWD_DEFINED__ #define __ICorDebugHeapEnum_FWD_DEFINED__ typedef interface ICorDebugHeapEnum ICorDebugHeapEnum; -#endif /* __ICorDebugHeapEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapEnum_FWD_DEFINED__ */ #ifndef __ICorDebugHeapSegmentEnum_FWD_DEFINED__ #define __ICorDebugHeapSegmentEnum_FWD_DEFINED__ typedef interface ICorDebugHeapSegmentEnum ICorDebugHeapSegmentEnum; -#endif /* __ICorDebugHeapSegmentEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapSegmentEnum_FWD_DEFINED__ */ #ifndef __ICorDebugGCReferenceEnum_FWD_DEFINED__ #define __ICorDebugGCReferenceEnum_FWD_DEFINED__ typedef interface ICorDebugGCReferenceEnum ICorDebugGCReferenceEnum; -#endif /* __ICorDebugGCReferenceEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugGCReferenceEnum_FWD_DEFINED__ */ #ifndef __ICorDebugProcess_FWD_DEFINED__ #define __ICorDebugProcess_FWD_DEFINED__ typedef interface ICorDebugProcess ICorDebugProcess; -#endif /* __ICorDebugProcess_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess_FWD_DEFINED__ */ #ifndef __ICorDebugProcess2_FWD_DEFINED__ #define __ICorDebugProcess2_FWD_DEFINED__ typedef interface ICorDebugProcess2 ICorDebugProcess2; -#endif /* __ICorDebugProcess2_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess2_FWD_DEFINED__ */ #ifndef __ICorDebugProcess3_FWD_DEFINED__ #define __ICorDebugProcess3_FWD_DEFINED__ typedef interface ICorDebugProcess3 ICorDebugProcess3; -#endif /* __ICorDebugProcess3_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess3_FWD_DEFINED__ */ #ifndef __ICorDebugProcess5_FWD_DEFINED__ #define __ICorDebugProcess5_FWD_DEFINED__ typedef interface ICorDebugProcess5 ICorDebugProcess5; -#endif /* __ICorDebugProcess5_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess5_FWD_DEFINED__ */ #ifndef __ICorDebugDebugEvent_FWD_DEFINED__ #define __ICorDebugDebugEvent_FWD_DEFINED__ typedef interface ICorDebugDebugEvent ICorDebugDebugEvent; -#endif /* __ICorDebugDebugEvent_FWD_DEFINED__ */ +#endif /* __ICorDebugDebugEvent_FWD_DEFINED__ */ #ifndef __ICorDebugProcess6_FWD_DEFINED__ #define __ICorDebugProcess6_FWD_DEFINED__ typedef interface ICorDebugProcess6 ICorDebugProcess6; -#endif /* __ICorDebugProcess6_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess6_FWD_DEFINED__ */ #ifndef __ICorDebugProcess7_FWD_DEFINED__ #define __ICorDebugProcess7_FWD_DEFINED__ typedef interface ICorDebugProcess7 ICorDebugProcess7; -#endif /* __ICorDebugProcess7_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess7_FWD_DEFINED__ */ #ifndef __ICorDebugProcess8_FWD_DEFINED__ #define __ICorDebugProcess8_FWD_DEFINED__ typedef interface ICorDebugProcess8 ICorDebugProcess8; -#endif /* __ICorDebugProcess8_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess8_FWD_DEFINED__ */ #ifndef __ICorDebugProcess10_FWD_DEFINED__ #define __ICorDebugProcess10_FWD_DEFINED__ typedef interface ICorDebugProcess10 ICorDebugProcess10; -#endif /* __ICorDebugProcess10_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess10_FWD_DEFINED__ */ #ifndef __ICorDebugMemoryRangeEnum_FWD_DEFINED__ #define __ICorDebugMemoryRangeEnum_FWD_DEFINED__ typedef interface ICorDebugMemoryRangeEnum ICorDebugMemoryRangeEnum; -#endif /* __ICorDebugMemoryRangeEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugMemoryRangeEnum_FWD_DEFINED__ */ #ifndef __ICorDebugProcess11_FWD_DEFINED__ #define __ICorDebugProcess11_FWD_DEFINED__ typedef interface ICorDebugProcess11 ICorDebugProcess11; -#endif /* __ICorDebugProcess11_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess11_FWD_DEFINED__ */ #ifndef __ICorDebugModuleDebugEvent_FWD_DEFINED__ #define __ICorDebugModuleDebugEvent_FWD_DEFINED__ typedef interface ICorDebugModuleDebugEvent ICorDebugModuleDebugEvent; -#endif /* __ICorDebugModuleDebugEvent_FWD_DEFINED__ */ +#endif /* __ICorDebugModuleDebugEvent_FWD_DEFINED__ */ #ifndef __ICorDebugExceptionDebugEvent_FWD_DEFINED__ #define __ICorDebugExceptionDebugEvent_FWD_DEFINED__ typedef interface ICorDebugExceptionDebugEvent ICorDebugExceptionDebugEvent; -#endif /* __ICorDebugExceptionDebugEvent_FWD_DEFINED__ */ +#endif /* __ICorDebugExceptionDebugEvent_FWD_DEFINED__ */ #ifndef __ICorDebugBreakpoint_FWD_DEFINED__ #define __ICorDebugBreakpoint_FWD_DEFINED__ typedef interface ICorDebugBreakpoint ICorDebugBreakpoint; -#endif /* __ICorDebugBreakpoint_FWD_DEFINED__ */ +#endif /* __ICorDebugBreakpoint_FWD_DEFINED__ */ #ifndef __ICorDebugFunctionBreakpoint_FWD_DEFINED__ #define __ICorDebugFunctionBreakpoint_FWD_DEFINED__ typedef interface ICorDebugFunctionBreakpoint ICorDebugFunctionBreakpoint; -#endif /* __ICorDebugFunctionBreakpoint_FWD_DEFINED__ */ +#endif /* __ICorDebugFunctionBreakpoint_FWD_DEFINED__ */ #ifndef __ICorDebugModuleBreakpoint_FWD_DEFINED__ #define __ICorDebugModuleBreakpoint_FWD_DEFINED__ typedef interface ICorDebugModuleBreakpoint ICorDebugModuleBreakpoint; -#endif /* __ICorDebugModuleBreakpoint_FWD_DEFINED__ */ +#endif /* __ICorDebugModuleBreakpoint_FWD_DEFINED__ */ #ifndef __ICorDebugValueBreakpoint_FWD_DEFINED__ #define __ICorDebugValueBreakpoint_FWD_DEFINED__ typedef interface ICorDebugValueBreakpoint ICorDebugValueBreakpoint; -#endif /* __ICorDebugValueBreakpoint_FWD_DEFINED__ */ +#endif /* __ICorDebugValueBreakpoint_FWD_DEFINED__ */ #ifndef __ICorDebugStepper_FWD_DEFINED__ #define __ICorDebugStepper_FWD_DEFINED__ typedef interface ICorDebugStepper ICorDebugStepper; -#endif /* __ICorDebugStepper_FWD_DEFINED__ */ +#endif /* __ICorDebugStepper_FWD_DEFINED__ */ #ifndef __ICorDebugStepper2_FWD_DEFINED__ #define __ICorDebugStepper2_FWD_DEFINED__ typedef interface ICorDebugStepper2 ICorDebugStepper2; -#endif /* __ICorDebugStepper2_FWD_DEFINED__ */ +#endif /* __ICorDebugStepper2_FWD_DEFINED__ */ #ifndef __ICorDebugRegisterSet_FWD_DEFINED__ #define __ICorDebugRegisterSet_FWD_DEFINED__ typedef interface ICorDebugRegisterSet ICorDebugRegisterSet; -#endif /* __ICorDebugRegisterSet_FWD_DEFINED__ */ +#endif /* __ICorDebugRegisterSet_FWD_DEFINED__ */ #ifndef __ICorDebugRegisterSet2_FWD_DEFINED__ #define __ICorDebugRegisterSet2_FWD_DEFINED__ typedef interface ICorDebugRegisterSet2 ICorDebugRegisterSet2; -#endif /* __ICorDebugRegisterSet2_FWD_DEFINED__ */ +#endif /* __ICorDebugRegisterSet2_FWD_DEFINED__ */ #ifndef __ICorDebugThread_FWD_DEFINED__ #define __ICorDebugThread_FWD_DEFINED__ typedef interface ICorDebugThread ICorDebugThread; -#endif /* __ICorDebugThread_FWD_DEFINED__ */ +#endif /* __ICorDebugThread_FWD_DEFINED__ */ #ifndef __ICorDebugThread2_FWD_DEFINED__ #define __ICorDebugThread2_FWD_DEFINED__ typedef interface ICorDebugThread2 ICorDebugThread2; -#endif /* __ICorDebugThread2_FWD_DEFINED__ */ +#endif /* __ICorDebugThread2_FWD_DEFINED__ */ #ifndef __ICorDebugThread3_FWD_DEFINED__ #define __ICorDebugThread3_FWD_DEFINED__ typedef interface ICorDebugThread3 ICorDebugThread3; -#endif /* __ICorDebugThread3_FWD_DEFINED__ */ +#endif /* __ICorDebugThread3_FWD_DEFINED__ */ #ifndef __ICorDebugThread4_FWD_DEFINED__ #define __ICorDebugThread4_FWD_DEFINED__ typedef interface ICorDebugThread4 ICorDebugThread4; -#endif /* __ICorDebugThread4_FWD_DEFINED__ */ +#endif /* __ICorDebugThread4_FWD_DEFINED__ */ #ifndef __ICorDebugThread5_FWD_DEFINED__ #define __ICorDebugThread5_FWD_DEFINED__ typedef interface ICorDebugThread5 ICorDebugThread5; -#endif /* __ICorDebugThread5_FWD_DEFINED__ */ +#endif /* __ICorDebugThread5_FWD_DEFINED__ */ #ifndef __ICorDebugStackWalk_FWD_DEFINED__ #define __ICorDebugStackWalk_FWD_DEFINED__ typedef interface ICorDebugStackWalk ICorDebugStackWalk; -#endif /* __ICorDebugStackWalk_FWD_DEFINED__ */ +#endif /* __ICorDebugStackWalk_FWD_DEFINED__ */ #ifndef __ICorDebugChain_FWD_DEFINED__ #define __ICorDebugChain_FWD_DEFINED__ typedef interface ICorDebugChain ICorDebugChain; -#endif /* __ICorDebugChain_FWD_DEFINED__ */ +#endif /* __ICorDebugChain_FWD_DEFINED__ */ #ifndef __ICorDebugFrame_FWD_DEFINED__ #define __ICorDebugFrame_FWD_DEFINED__ typedef interface ICorDebugFrame ICorDebugFrame; -#endif /* __ICorDebugFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugFrame_FWD_DEFINED__ */ #ifndef __ICorDebugInternalFrame_FWD_DEFINED__ #define __ICorDebugInternalFrame_FWD_DEFINED__ typedef interface ICorDebugInternalFrame ICorDebugInternalFrame; -#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */ #ifndef __ICorDebugInternalFrame2_FWD_DEFINED__ #define __ICorDebugInternalFrame2_FWD_DEFINED__ typedef interface ICorDebugInternalFrame2 ICorDebugInternalFrame2; -#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame_FWD_DEFINED__ #define __ICorDebugILFrame_FWD_DEFINED__ typedef interface ICorDebugILFrame ICorDebugILFrame; -#endif /* __ICorDebugILFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame2_FWD_DEFINED__ #define __ICorDebugILFrame2_FWD_DEFINED__ typedef interface ICorDebugILFrame2 ICorDebugILFrame2; -#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame3_FWD_DEFINED__ #define __ICorDebugILFrame3_FWD_DEFINED__ typedef interface ICorDebugILFrame3 ICorDebugILFrame3; -#endif /* __ICorDebugILFrame3_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame3_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame4_FWD_DEFINED__ #define __ICorDebugILFrame4_FWD_DEFINED__ typedef interface ICorDebugILFrame4 ICorDebugILFrame4; -#endif /* __ICorDebugILFrame4_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame4_FWD_DEFINED__ */ #ifndef __ICorDebugNativeFrame_FWD_DEFINED__ #define __ICorDebugNativeFrame_FWD_DEFINED__ typedef interface ICorDebugNativeFrame ICorDebugNativeFrame; -#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */ #ifndef __ICorDebugNativeFrame2_FWD_DEFINED__ #define __ICorDebugNativeFrame2_FWD_DEFINED__ typedef interface ICorDebugNativeFrame2 ICorDebugNativeFrame2; -#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugModule3_FWD_DEFINED__ #define __ICorDebugModule3_FWD_DEFINED__ typedef interface ICorDebugModule3 ICorDebugModule3; -#endif /* __ICorDebugModule3_FWD_DEFINED__ */ +#endif /* __ICorDebugModule3_FWD_DEFINED__ */ #ifndef __ICorDebugModule4_FWD_DEFINED__ #define __ICorDebugModule4_FWD_DEFINED__ typedef interface ICorDebugModule4 ICorDebugModule4; -#endif /* __ICorDebugModule4_FWD_DEFINED__ */ +#endif /* __ICorDebugModule4_FWD_DEFINED__ */ #ifndef __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ #define __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ typedef interface ICorDebugRuntimeUnwindableFrame ICorDebugRuntimeUnwindableFrame; -#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */ #ifndef __ICorDebugModule_FWD_DEFINED__ #define __ICorDebugModule_FWD_DEFINED__ typedef interface ICorDebugModule ICorDebugModule; -#endif /* __ICorDebugModule_FWD_DEFINED__ */ +#endif /* __ICorDebugModule_FWD_DEFINED__ */ #ifndef __ICorDebugModule2_FWD_DEFINED__ #define __ICorDebugModule2_FWD_DEFINED__ typedef interface ICorDebugModule2 ICorDebugModule2; -#endif /* __ICorDebugModule2_FWD_DEFINED__ */ +#endif /* __ICorDebugModule2_FWD_DEFINED__ */ #ifndef __ICorDebugFunction_FWD_DEFINED__ #define __ICorDebugFunction_FWD_DEFINED__ typedef interface ICorDebugFunction ICorDebugFunction; -#endif /* __ICorDebugFunction_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction_FWD_DEFINED__ */ #ifndef __ICorDebugFunction2_FWD_DEFINED__ #define __ICorDebugFunction2_FWD_DEFINED__ typedef interface ICorDebugFunction2 ICorDebugFunction2; -#endif /* __ICorDebugFunction2_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction2_FWD_DEFINED__ */ #ifndef __ICorDebugFunction3_FWD_DEFINED__ #define __ICorDebugFunction3_FWD_DEFINED__ typedef interface ICorDebugFunction3 ICorDebugFunction3; -#endif /* __ICorDebugFunction3_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction3_FWD_DEFINED__ */ #ifndef __ICorDebugFunction4_FWD_DEFINED__ #define __ICorDebugFunction4_FWD_DEFINED__ typedef interface ICorDebugFunction4 ICorDebugFunction4; -#endif /* __ICorDebugFunction4_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction4_FWD_DEFINED__ */ + + +#ifndef __ICorDebugFunction5_FWD_DEFINED__ +#define __ICorDebugFunction5_FWD_DEFINED__ +typedef interface ICorDebugFunction5 ICorDebugFunction5; + +#endif /* __ICorDebugFunction5_FWD_DEFINED__ */ #ifndef __ICorDebugCode_FWD_DEFINED__ #define __ICorDebugCode_FWD_DEFINED__ typedef interface ICorDebugCode ICorDebugCode; -#endif /* __ICorDebugCode_FWD_DEFINED__ */ +#endif /* __ICorDebugCode_FWD_DEFINED__ */ #ifndef __ICorDebugCode2_FWD_DEFINED__ #define __ICorDebugCode2_FWD_DEFINED__ typedef interface ICorDebugCode2 ICorDebugCode2; -#endif /* __ICorDebugCode2_FWD_DEFINED__ */ +#endif /* __ICorDebugCode2_FWD_DEFINED__ */ #ifndef __ICorDebugCode3_FWD_DEFINED__ #define __ICorDebugCode3_FWD_DEFINED__ typedef interface ICorDebugCode3 ICorDebugCode3; -#endif /* __ICorDebugCode3_FWD_DEFINED__ */ +#endif /* __ICorDebugCode3_FWD_DEFINED__ */ #ifndef __ICorDebugCode4_FWD_DEFINED__ #define __ICorDebugCode4_FWD_DEFINED__ typedef interface ICorDebugCode4 ICorDebugCode4; -#endif /* __ICorDebugCode4_FWD_DEFINED__ */ +#endif /* __ICorDebugCode4_FWD_DEFINED__ */ #ifndef __ICorDebugILCode_FWD_DEFINED__ #define __ICorDebugILCode_FWD_DEFINED__ typedef interface ICorDebugILCode ICorDebugILCode; -#endif /* __ICorDebugILCode_FWD_DEFINED__ */ +#endif /* __ICorDebugILCode_FWD_DEFINED__ */ #ifndef __ICorDebugILCode2_FWD_DEFINED__ #define __ICorDebugILCode2_FWD_DEFINED__ typedef interface ICorDebugILCode2 ICorDebugILCode2; -#endif /* __ICorDebugILCode2_FWD_DEFINED__ */ +#endif /* __ICorDebugILCode2_FWD_DEFINED__ */ #ifndef __ICorDebugClass_FWD_DEFINED__ #define __ICorDebugClass_FWD_DEFINED__ typedef interface ICorDebugClass ICorDebugClass; -#endif /* __ICorDebugClass_FWD_DEFINED__ */ +#endif /* __ICorDebugClass_FWD_DEFINED__ */ #ifndef __ICorDebugClass2_FWD_DEFINED__ #define __ICorDebugClass2_FWD_DEFINED__ typedef interface ICorDebugClass2 ICorDebugClass2; -#endif /* __ICorDebugClass2_FWD_DEFINED__ */ +#endif /* __ICorDebugClass2_FWD_DEFINED__ */ #ifndef __ICorDebugEval_FWD_DEFINED__ #define __ICorDebugEval_FWD_DEFINED__ typedef interface ICorDebugEval ICorDebugEval; -#endif /* __ICorDebugEval_FWD_DEFINED__ */ +#endif /* __ICorDebugEval_FWD_DEFINED__ */ #ifndef __ICorDebugEval2_FWD_DEFINED__ #define __ICorDebugEval2_FWD_DEFINED__ typedef interface ICorDebugEval2 ICorDebugEval2; -#endif /* __ICorDebugEval2_FWD_DEFINED__ */ +#endif /* __ICorDebugEval2_FWD_DEFINED__ */ #ifndef __ICorDebugValue_FWD_DEFINED__ #define __ICorDebugValue_FWD_DEFINED__ typedef interface ICorDebugValue ICorDebugValue; -#endif /* __ICorDebugValue_FWD_DEFINED__ */ +#endif /* __ICorDebugValue_FWD_DEFINED__ */ #ifndef __ICorDebugValue2_FWD_DEFINED__ #define __ICorDebugValue2_FWD_DEFINED__ typedef interface ICorDebugValue2 ICorDebugValue2; -#endif /* __ICorDebugValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugValue2_FWD_DEFINED__ */ #ifndef __ICorDebugValue3_FWD_DEFINED__ #define __ICorDebugValue3_FWD_DEFINED__ typedef interface ICorDebugValue3 ICorDebugValue3; -#endif /* __ICorDebugValue3_FWD_DEFINED__ */ +#endif /* __ICorDebugValue3_FWD_DEFINED__ */ #ifndef __ICorDebugGenericValue_FWD_DEFINED__ #define __ICorDebugGenericValue_FWD_DEFINED__ typedef interface ICorDebugGenericValue ICorDebugGenericValue; -#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */ +#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */ #ifndef __ICorDebugReferenceValue_FWD_DEFINED__ #define __ICorDebugReferenceValue_FWD_DEFINED__ typedef interface ICorDebugReferenceValue ICorDebugReferenceValue; -#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */ +#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue_FWD_DEFINED__ #define __ICorDebugHeapValue_FWD_DEFINED__ typedef interface ICorDebugHeapValue ICorDebugHeapValue; -#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue2_FWD_DEFINED__ #define __ICorDebugHeapValue2_FWD_DEFINED__ typedef interface ICorDebugHeapValue2 ICorDebugHeapValue2; -#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue3_FWD_DEFINED__ #define __ICorDebugHeapValue3_FWD_DEFINED__ typedef interface ICorDebugHeapValue3 ICorDebugHeapValue3; -#endif /* __ICorDebugHeapValue3_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue3_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue4_FWD_DEFINED__ #define __ICorDebugHeapValue4_FWD_DEFINED__ typedef interface ICorDebugHeapValue4 ICorDebugHeapValue4; -#endif /* __ICorDebugHeapValue4_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue4_FWD_DEFINED__ */ #ifndef __ICorDebugObjectValue_FWD_DEFINED__ #define __ICorDebugObjectValue_FWD_DEFINED__ typedef interface ICorDebugObjectValue ICorDebugObjectValue; -#endif /* __ICorDebugObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugObjectValue_FWD_DEFINED__ */ #ifndef __ICorDebugObjectValue2_FWD_DEFINED__ #define __ICorDebugObjectValue2_FWD_DEFINED__ typedef interface ICorDebugObjectValue2 ICorDebugObjectValue2; -#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */ #ifndef __ICorDebugDelegateObjectValue_FWD_DEFINED__ #define __ICorDebugDelegateObjectValue_FWD_DEFINED__ typedef interface ICorDebugDelegateObjectValue ICorDebugDelegateObjectValue; -#endif /* __ICorDebugDelegateObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugDelegateObjectValue_FWD_DEFINED__ */ #ifndef __ICorDebugBoxValue_FWD_DEFINED__ #define __ICorDebugBoxValue_FWD_DEFINED__ typedef interface ICorDebugBoxValue ICorDebugBoxValue; -#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */ +#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */ #ifndef __ICorDebugStringValue_FWD_DEFINED__ #define __ICorDebugStringValue_FWD_DEFINED__ typedef interface ICorDebugStringValue ICorDebugStringValue; -#endif /* __ICorDebugStringValue_FWD_DEFINED__ */ +#endif /* __ICorDebugStringValue_FWD_DEFINED__ */ #ifndef __ICorDebugArrayValue_FWD_DEFINED__ #define __ICorDebugArrayValue_FWD_DEFINED__ typedef interface ICorDebugArrayValue ICorDebugArrayValue; -#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */ +#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */ #ifndef __ICorDebugVariableHome_FWD_DEFINED__ #define __ICorDebugVariableHome_FWD_DEFINED__ typedef interface ICorDebugVariableHome ICorDebugVariableHome; -#endif /* __ICorDebugVariableHome_FWD_DEFINED__ */ +#endif /* __ICorDebugVariableHome_FWD_DEFINED__ */ #ifndef __ICorDebugHandleValue_FWD_DEFINED__ #define __ICorDebugHandleValue_FWD_DEFINED__ typedef interface ICorDebugHandleValue ICorDebugHandleValue; -#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */ +#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */ #ifndef __ICorDebugContext_FWD_DEFINED__ #define __ICorDebugContext_FWD_DEFINED__ typedef interface ICorDebugContext ICorDebugContext; -#endif /* __ICorDebugContext_FWD_DEFINED__ */ +#endif /* __ICorDebugContext_FWD_DEFINED__ */ #ifndef __ICorDebugComObjectValue_FWD_DEFINED__ #define __ICorDebugComObjectValue_FWD_DEFINED__ typedef interface ICorDebugComObjectValue ICorDebugComObjectValue; -#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */ #ifndef __ICorDebugObjectEnum_FWD_DEFINED__ #define __ICorDebugObjectEnum_FWD_DEFINED__ typedef interface ICorDebugObjectEnum ICorDebugObjectEnum; -#endif /* __ICorDebugObjectEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugObjectEnum_FWD_DEFINED__ */ #ifndef __ICorDebugBreakpointEnum_FWD_DEFINED__ #define __ICorDebugBreakpointEnum_FWD_DEFINED__ typedef interface ICorDebugBreakpointEnum ICorDebugBreakpointEnum; -#endif /* __ICorDebugBreakpointEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugBreakpointEnum_FWD_DEFINED__ */ #ifndef __ICorDebugStepperEnum_FWD_DEFINED__ #define __ICorDebugStepperEnum_FWD_DEFINED__ typedef interface ICorDebugStepperEnum ICorDebugStepperEnum; -#endif /* __ICorDebugStepperEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugStepperEnum_FWD_DEFINED__ */ #ifndef __ICorDebugProcessEnum_FWD_DEFINED__ #define __ICorDebugProcessEnum_FWD_DEFINED__ typedef interface ICorDebugProcessEnum ICorDebugProcessEnum; -#endif /* __ICorDebugProcessEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugProcessEnum_FWD_DEFINED__ */ #ifndef __ICorDebugThreadEnum_FWD_DEFINED__ #define __ICorDebugThreadEnum_FWD_DEFINED__ typedef interface ICorDebugThreadEnum ICorDebugThreadEnum; -#endif /* __ICorDebugThreadEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugThreadEnum_FWD_DEFINED__ */ #ifndef __ICorDebugFrameEnum_FWD_DEFINED__ #define __ICorDebugFrameEnum_FWD_DEFINED__ typedef interface ICorDebugFrameEnum ICorDebugFrameEnum; -#endif /* __ICorDebugFrameEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugFrameEnum_FWD_DEFINED__ */ #ifndef __ICorDebugChainEnum_FWD_DEFINED__ #define __ICorDebugChainEnum_FWD_DEFINED__ typedef interface ICorDebugChainEnum ICorDebugChainEnum; -#endif /* __ICorDebugChainEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugChainEnum_FWD_DEFINED__ */ #ifndef __ICorDebugModuleEnum_FWD_DEFINED__ #define __ICorDebugModuleEnum_FWD_DEFINED__ typedef interface ICorDebugModuleEnum ICorDebugModuleEnum; -#endif /* __ICorDebugModuleEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugModuleEnum_FWD_DEFINED__ */ #ifndef __ICorDebugValueEnum_FWD_DEFINED__ #define __ICorDebugValueEnum_FWD_DEFINED__ typedef interface ICorDebugValueEnum ICorDebugValueEnum; -#endif /* __ICorDebugValueEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugValueEnum_FWD_DEFINED__ */ #ifndef __ICorDebugVariableHomeEnum_FWD_DEFINED__ #define __ICorDebugVariableHomeEnum_FWD_DEFINED__ typedef interface ICorDebugVariableHomeEnum ICorDebugVariableHomeEnum; -#endif /* __ICorDebugVariableHomeEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugVariableHomeEnum_FWD_DEFINED__ */ #ifndef __ICorDebugCodeEnum_FWD_DEFINED__ #define __ICorDebugCodeEnum_FWD_DEFINED__ typedef interface ICorDebugCodeEnum ICorDebugCodeEnum; -#endif /* __ICorDebugCodeEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugCodeEnum_FWD_DEFINED__ */ #ifndef __ICorDebugTypeEnum_FWD_DEFINED__ #define __ICorDebugTypeEnum_FWD_DEFINED__ typedef interface ICorDebugTypeEnum ICorDebugTypeEnum; -#endif /* __ICorDebugTypeEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugTypeEnum_FWD_DEFINED__ */ #ifndef __ICorDebugType_FWD_DEFINED__ #define __ICorDebugType_FWD_DEFINED__ typedef interface ICorDebugType ICorDebugType; -#endif /* __ICorDebugType_FWD_DEFINED__ */ +#endif /* __ICorDebugType_FWD_DEFINED__ */ #ifndef __ICorDebugType2_FWD_DEFINED__ #define __ICorDebugType2_FWD_DEFINED__ typedef interface ICorDebugType2 ICorDebugType2; -#endif /* __ICorDebugType2_FWD_DEFINED__ */ +#endif /* __ICorDebugType2_FWD_DEFINED__ */ #ifndef __ICorDebugErrorInfoEnum_FWD_DEFINED__ #define __ICorDebugErrorInfoEnum_FWD_DEFINED__ typedef interface ICorDebugErrorInfoEnum ICorDebugErrorInfoEnum; -#endif /* __ICorDebugErrorInfoEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugErrorInfoEnum_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomainEnum_FWD_DEFINED__ #define __ICorDebugAppDomainEnum_FWD_DEFINED__ typedef interface ICorDebugAppDomainEnum ICorDebugAppDomainEnum; -#endif /* __ICorDebugAppDomainEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomainEnum_FWD_DEFINED__ */ #ifndef __ICorDebugAssemblyEnum_FWD_DEFINED__ #define __ICorDebugAssemblyEnum_FWD_DEFINED__ typedef interface ICorDebugAssemblyEnum ICorDebugAssemblyEnum; -#endif /* __ICorDebugAssemblyEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugAssemblyEnum_FWD_DEFINED__ */ #ifndef __ICorDebugBlockingObjectEnum_FWD_DEFINED__ #define __ICorDebugBlockingObjectEnum_FWD_DEFINED__ typedef interface ICorDebugBlockingObjectEnum ICorDebugBlockingObjectEnum; -#endif /* __ICorDebugBlockingObjectEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugBlockingObjectEnum_FWD_DEFINED__ */ #ifndef __ICorDebugMDA_FWD_DEFINED__ #define __ICorDebugMDA_FWD_DEFINED__ typedef interface ICorDebugMDA ICorDebugMDA; -#endif /* __ICorDebugMDA_FWD_DEFINED__ */ +#endif /* __ICorDebugMDA_FWD_DEFINED__ */ #ifndef __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ #define __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ typedef interface ICorDebugEditAndContinueErrorInfo ICorDebugEditAndContinueErrorInfo; -#endif /* __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ */ +#endif /* __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ */ #ifndef __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ #define __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ typedef interface ICorDebugEditAndContinueSnapshot ICorDebugEditAndContinueSnapshot; -#endif /* __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ */ +#endif /* __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ */ #ifndef __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ #define __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ typedef interface ICorDebugExceptionObjectCallStackEnum ICorDebugExceptionObjectCallStackEnum; -#endif /* __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ */ +#endif /* __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ */ #ifndef __ICorDebugExceptionObjectValue_FWD_DEFINED__ #define __ICorDebugExceptionObjectValue_FWD_DEFINED__ typedef interface ICorDebugExceptionObjectValue ICorDebugExceptionObjectValue; -#endif /* __ICorDebugExceptionObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugExceptionObjectValue_FWD_DEFINED__ */ + + +#ifndef __ICorDebugExceptionObjectValue2_FWD_DEFINED__ +#define __ICorDebugExceptionObjectValue2_FWD_DEFINED__ +typedef interface ICorDebugExceptionObjectValue2 ICorDebugExceptionObjectValue2; + +#endif /* __ICorDebugExceptionObjectValue2_FWD_DEFINED__ */ #ifndef __CorDebug_FWD_DEFINED__ @@ -998,7 +1019,7 @@ typedef class CorDebug CorDebug; typedef struct CorDebug CorDebug; #endif /* __cplusplus */ -#endif /* __CorDebug_FWD_DEFINED__ */ +#endif /* __CorDebug_FWD_DEFINED__ */ #ifndef __EmbeddedCLRCorDebug_FWD_DEFINED__ @@ -1010,238 +1031,238 @@ typedef class EmbeddedCLRCorDebug EmbeddedCLRCorDebug; typedef struct EmbeddedCLRCorDebug EmbeddedCLRCorDebug; #endif /* __cplusplus */ -#endif /* __EmbeddedCLRCorDebug_FWD_DEFINED__ */ +#endif /* __EmbeddedCLRCorDebug_FWD_DEFINED__ */ #ifndef __ICorDebugValue_FWD_DEFINED__ #define __ICorDebugValue_FWD_DEFINED__ typedef interface ICorDebugValue ICorDebugValue; -#endif /* __ICorDebugValue_FWD_DEFINED__ */ +#endif /* __ICorDebugValue_FWD_DEFINED__ */ #ifndef __ICorDebugReferenceValue_FWD_DEFINED__ #define __ICorDebugReferenceValue_FWD_DEFINED__ typedef interface ICorDebugReferenceValue ICorDebugReferenceValue; -#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */ +#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue_FWD_DEFINED__ #define __ICorDebugHeapValue_FWD_DEFINED__ typedef interface ICorDebugHeapValue ICorDebugHeapValue; -#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */ #ifndef __ICorDebugStringValue_FWD_DEFINED__ #define __ICorDebugStringValue_FWD_DEFINED__ typedef interface ICorDebugStringValue ICorDebugStringValue; -#endif /* __ICorDebugStringValue_FWD_DEFINED__ */ +#endif /* __ICorDebugStringValue_FWD_DEFINED__ */ #ifndef __ICorDebugGenericValue_FWD_DEFINED__ #define __ICorDebugGenericValue_FWD_DEFINED__ typedef interface ICorDebugGenericValue ICorDebugGenericValue; -#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */ +#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */ #ifndef __ICorDebugBoxValue_FWD_DEFINED__ #define __ICorDebugBoxValue_FWD_DEFINED__ typedef interface ICorDebugBoxValue ICorDebugBoxValue; -#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */ +#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */ #ifndef __ICorDebugArrayValue_FWD_DEFINED__ #define __ICorDebugArrayValue_FWD_DEFINED__ typedef interface ICorDebugArrayValue ICorDebugArrayValue; -#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */ +#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */ #ifndef __ICorDebugFrame_FWD_DEFINED__ #define __ICorDebugFrame_FWD_DEFINED__ typedef interface ICorDebugFrame ICorDebugFrame; -#endif /* __ICorDebugFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugFrame_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame_FWD_DEFINED__ #define __ICorDebugILFrame_FWD_DEFINED__ typedef interface ICorDebugILFrame ICorDebugILFrame; -#endif /* __ICorDebugILFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame_FWD_DEFINED__ */ #ifndef __ICorDebugInternalFrame_FWD_DEFINED__ #define __ICorDebugInternalFrame_FWD_DEFINED__ typedef interface ICorDebugInternalFrame ICorDebugInternalFrame; -#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */ #ifndef __ICorDebugInternalFrame2_FWD_DEFINED__ #define __ICorDebugInternalFrame2_FWD_DEFINED__ typedef interface ICorDebugInternalFrame2 ICorDebugInternalFrame2; -#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugNativeFrame_FWD_DEFINED__ #define __ICorDebugNativeFrame_FWD_DEFINED__ typedef interface ICorDebugNativeFrame ICorDebugNativeFrame; -#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */ #ifndef __ICorDebugNativeFrame2_FWD_DEFINED__ #define __ICorDebugNativeFrame2_FWD_DEFINED__ typedef interface ICorDebugNativeFrame2 ICorDebugNativeFrame2; -#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ #define __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ typedef interface ICorDebugRuntimeUnwindableFrame ICorDebugRuntimeUnwindableFrame; -#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */ +#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */ #ifndef __ICorDebugManagedCallback2_FWD_DEFINED__ #define __ICorDebugManagedCallback2_FWD_DEFINED__ typedef interface ICorDebugManagedCallback2 ICorDebugManagedCallback2; -#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */ +#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain2_FWD_DEFINED__ #define __ICorDebugAppDomain2_FWD_DEFINED__ typedef interface ICorDebugAppDomain2 ICorDebugAppDomain2; -#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */ #ifndef __ICorDebugAppDomain3_FWD_DEFINED__ #define __ICorDebugAppDomain3_FWD_DEFINED__ typedef interface ICorDebugAppDomain3 ICorDebugAppDomain3; -#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */ +#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */ #ifndef __ICorDebugAssembly2_FWD_DEFINED__ #define __ICorDebugAssembly2_FWD_DEFINED__ typedef interface ICorDebugAssembly2 ICorDebugAssembly2; -#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */ +#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */ #ifndef __ICorDebugProcess2_FWD_DEFINED__ #define __ICorDebugProcess2_FWD_DEFINED__ typedef interface ICorDebugProcess2 ICorDebugProcess2; -#endif /* __ICorDebugProcess2_FWD_DEFINED__ */ +#endif /* __ICorDebugProcess2_FWD_DEFINED__ */ #ifndef __ICorDebugStepper2_FWD_DEFINED__ #define __ICorDebugStepper2_FWD_DEFINED__ typedef interface ICorDebugStepper2 ICorDebugStepper2; -#endif /* __ICorDebugStepper2_FWD_DEFINED__ */ +#endif /* __ICorDebugStepper2_FWD_DEFINED__ */ #ifndef __ICorDebugThread2_FWD_DEFINED__ #define __ICorDebugThread2_FWD_DEFINED__ typedef interface ICorDebugThread2 ICorDebugThread2; -#endif /* __ICorDebugThread2_FWD_DEFINED__ */ +#endif /* __ICorDebugThread2_FWD_DEFINED__ */ #ifndef __ICorDebugThread3_FWD_DEFINED__ #define __ICorDebugThread3_FWD_DEFINED__ typedef interface ICorDebugThread3 ICorDebugThread3; -#endif /* __ICorDebugThread3_FWD_DEFINED__ */ +#endif /* __ICorDebugThread3_FWD_DEFINED__ */ #ifndef __ICorDebugILFrame2_FWD_DEFINED__ #define __ICorDebugILFrame2_FWD_DEFINED__ typedef interface ICorDebugILFrame2 ICorDebugILFrame2; -#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */ +#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */ #ifndef __ICorDebugModule2_FWD_DEFINED__ #define __ICorDebugModule2_FWD_DEFINED__ typedef interface ICorDebugModule2 ICorDebugModule2; -#endif /* __ICorDebugModule2_FWD_DEFINED__ */ +#endif /* __ICorDebugModule2_FWD_DEFINED__ */ #ifndef __ICorDebugFunction2_FWD_DEFINED__ #define __ICorDebugFunction2_FWD_DEFINED__ typedef interface ICorDebugFunction2 ICorDebugFunction2; -#endif /* __ICorDebugFunction2_FWD_DEFINED__ */ +#endif /* __ICorDebugFunction2_FWD_DEFINED__ */ #ifndef __ICorDebugClass2_FWD_DEFINED__ #define __ICorDebugClass2_FWD_DEFINED__ typedef interface ICorDebugClass2 ICorDebugClass2; -#endif /* __ICorDebugClass2_FWD_DEFINED__ */ +#endif /* __ICorDebugClass2_FWD_DEFINED__ */ #ifndef __ICorDebugEval2_FWD_DEFINED__ #define __ICorDebugEval2_FWD_DEFINED__ typedef interface ICorDebugEval2 ICorDebugEval2; -#endif /* __ICorDebugEval2_FWD_DEFINED__ */ +#endif /* __ICorDebugEval2_FWD_DEFINED__ */ #ifndef __ICorDebugValue2_FWD_DEFINED__ #define __ICorDebugValue2_FWD_DEFINED__ typedef interface ICorDebugValue2 ICorDebugValue2; -#endif /* __ICorDebugValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugValue2_FWD_DEFINED__ */ #ifndef __ICorDebugObjectValue2_FWD_DEFINED__ #define __ICorDebugObjectValue2_FWD_DEFINED__ typedef interface ICorDebugObjectValue2 ICorDebugObjectValue2; -#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */ #ifndef __ICorDebugHandleValue_FWD_DEFINED__ #define __ICorDebugHandleValue_FWD_DEFINED__ typedef interface ICorDebugHandleValue ICorDebugHandleValue; -#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */ +#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */ #ifndef __ICorDebugHeapValue2_FWD_DEFINED__ #define __ICorDebugHeapValue2_FWD_DEFINED__ typedef interface ICorDebugHeapValue2 ICorDebugHeapValue2; -#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */ +#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */ #ifndef __ICorDebugComObjectValue_FWD_DEFINED__ #define __ICorDebugComObjectValue_FWD_DEFINED__ typedef interface ICorDebugComObjectValue ICorDebugComObjectValue; -#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */ +#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */ #ifndef __ICorDebugModule3_FWD_DEFINED__ #define __ICorDebugModule3_FWD_DEFINED__ typedef interface ICorDebugModule3 ICorDebugModule3; -#endif /* __ICorDebugModule3_FWD_DEFINED__ */ +#endif /* __ICorDebugModule3_FWD_DEFINED__ */ /* header files for imported files */ @@ -1303,7 +1324,7 @@ typedef struct _COR_IL_MAP ULONG32 oldOffset; ULONG32 newOffset; BOOL fAccurate; - } COR_IL_MAP; + } COR_IL_MAP; #endif //_COR_IL_MAP #ifndef _COR_DEBUG_IL_TO_NATIVE_MAP_ @@ -1311,39 +1332,39 @@ typedef struct _COR_IL_MAP typedef enum CorDebugIlToNativeMappingTypes { - NO_MAPPING = -1, - PROLOG = -2, - EPILOG = -3 - } CorDebugIlToNativeMappingTypes; + NO_MAPPING = -1, + PROLOG = -2, + EPILOG = -3 + } CorDebugIlToNativeMappingTypes; typedef struct COR_DEBUG_IL_TO_NATIVE_MAP { ULONG32 ilOffset; ULONG32 nativeStartOffset; ULONG32 nativeEndOffset; - } COR_DEBUG_IL_TO_NATIVE_MAP; + } COR_DEBUG_IL_TO_NATIVE_MAP; #endif // _COR_DEBUG_IL_TO_NATIVE_MAP_ #define REMOTE_DEBUGGING_DLL_ENTRY L"Software\\Microsoft\\.NETFramework\\Debugger\\ActivateRemoteDebugging" typedef enum CorDebugJITCompilerFlags { - CORDEBUG_JIT_DEFAULT = 0x1, - CORDEBUG_JIT_DISABLE_OPTIMIZATION = 0x3, - CORDEBUG_JIT_ENABLE_ENC = 0x7 - } CorDebugJITCompilerFlags; + CORDEBUG_JIT_DEFAULT = 0x1, + CORDEBUG_JIT_DISABLE_OPTIMIZATION = 0x3, + CORDEBUG_JIT_ENABLE_ENC = 0x7 + } CorDebugJITCompilerFlags; typedef enum CorDebugJITCompilerFlagsDecprecated { - CORDEBUG_JIT_TRACK_DEBUG_INFO = 0x1 - } CorDebugJITCompilerFlagsDeprecated; + CORDEBUG_JIT_TRACK_DEBUG_INFO = 0x1 + } CorDebugJITCompilerFlagsDeprecated; typedef enum CorDebugNGENPolicy { - DISABLE_LOCAL_NIC = 1 - } CorDebugNGENPolicy; + DISABLE_LOCAL_NIC = 1 + } CorDebugNGENPolicy; #pragma warning(push) #pragma warning(disable:28718) @@ -1424,17 +1445,17 @@ typedef DWORD CORDB_CONTINUE_STATUS; typedef enum CorDebugBlockingReason { - BLOCKING_NONE = 0, - BLOCKING_MONITOR_CRITICAL_SECTION = 0x1, - BLOCKING_MONITOR_EVENT = 0x2 - } CorDebugBlockingReason; + BLOCKING_NONE = 0, + BLOCKING_MONITOR_CRITICAL_SECTION = 0x1, + BLOCKING_MONITOR_EVENT = 0x2 + } CorDebugBlockingReason; typedef struct CorDebugBlockingObject { ICorDebugValue *pBlockingObject; DWORD dwTimeout; CorDebugBlockingReason blockingReason; - } CorDebugBlockingObject; + } CorDebugBlockingObject; typedef struct CorDebugExceptionObjectStackFrame { @@ -1442,13 +1463,13 @@ typedef struct CorDebugExceptionObjectStackFrame CORDB_ADDRESS ip; mdMethodDef methodDef; BOOL isLastForeignExceptionFrame; - } CorDebugExceptionObjectStackFrame; + } CorDebugExceptionObjectStackFrame; typedef struct CorDebugGuidToTypeMapping { GUID iid; ICorDebugType *pType; - } CorDebugGuidToTypeMapping; + } CorDebugGuidToTypeMapping; @@ -1464,21 +1485,21 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0000_v0_0_s_ifspec; typedef enum CorDebugPlatform { - CORDB_PLATFORM_WINDOWS_X86 = 0, - CORDB_PLATFORM_WINDOWS_AMD64 = ( CORDB_PLATFORM_WINDOWS_X86 + 1 ) , - CORDB_PLATFORM_WINDOWS_IA64 = ( CORDB_PLATFORM_WINDOWS_AMD64 + 1 ) , - CORDB_PLATFORM_MAC_PPC = ( CORDB_PLATFORM_WINDOWS_IA64 + 1 ) , - CORDB_PLATFORM_MAC_X86 = ( CORDB_PLATFORM_MAC_PPC + 1 ) , - CORDB_PLATFORM_WINDOWS_ARM = ( CORDB_PLATFORM_MAC_X86 + 1 ) , - CORDB_PLATFORM_MAC_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM + 1 ) , - CORDB_PLATFORM_WINDOWS_ARM64 = ( CORDB_PLATFORM_MAC_AMD64 + 1 ) , - CORDB_PLATFORM_POSIX_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM64 + 1 ) , - CORDB_PLATFORM_POSIX_X86 = ( CORDB_PLATFORM_POSIX_AMD64 + 1 ) , - CORDB_PLATFORM_POSIX_ARM = ( CORDB_PLATFORM_POSIX_X86 + 1 ) , - CORDB_PLATFORM_POSIX_ARM64 = ( CORDB_PLATFORM_POSIX_ARM + 1 ) , - CORDB_PLATFORM_POSIX_LOONGARCH64 = ( CORDB_PLATFORM_POSIX_ARM64 + 1 ) , - CORDB_PLATFORM_POSIX_RISCV64 = ( CORDB_PLATFORM_POSIX_LOONGARCH64 + 1 ) - } CorDebugPlatform; + CORDB_PLATFORM_WINDOWS_X86 = 0, + CORDB_PLATFORM_WINDOWS_AMD64 = ( CORDB_PLATFORM_WINDOWS_X86 + 1 ) , + CORDB_PLATFORM_WINDOWS_IA64 = ( CORDB_PLATFORM_WINDOWS_AMD64 + 1 ) , + CORDB_PLATFORM_MAC_PPC = ( CORDB_PLATFORM_WINDOWS_IA64 + 1 ) , + CORDB_PLATFORM_MAC_X86 = ( CORDB_PLATFORM_MAC_PPC + 1 ) , + CORDB_PLATFORM_WINDOWS_ARM = ( CORDB_PLATFORM_MAC_X86 + 1 ) , + CORDB_PLATFORM_MAC_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM + 1 ) , + CORDB_PLATFORM_WINDOWS_ARM64 = ( CORDB_PLATFORM_MAC_AMD64 + 1 ) , + CORDB_PLATFORM_POSIX_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM64 + 1 ) , + CORDB_PLATFORM_POSIX_X86 = ( CORDB_PLATFORM_POSIX_AMD64 + 1 ) , + CORDB_PLATFORM_POSIX_ARM = ( CORDB_PLATFORM_POSIX_X86 + 1 ) , + CORDB_PLATFORM_POSIX_ARM64 = ( CORDB_PLATFORM_POSIX_ARM + 1 ) , + CORDB_PLATFORM_POSIX_LOONGARCH64 = ( CORDB_PLATFORM_POSIX_ARM64 + 1 ) , + CORDB_PLATFORM_POSIX_RISCV64 = ( CORDB_PLATFORM_POSIX_LOONGARCH64 + 1 ) + } CorDebugPlatform; EXTERN_C const IID IID_ICorDebugDataTarget; @@ -1507,28 +1528,33 @@ EXTERN_C const IID IID_ICorDebugDataTarget; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDataTargetVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugDataTarget * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugDataTarget * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugDataTarget * This); + DECLSPEC_XFGVIRT(ICorDebugDataTarget, GetPlatform) HRESULT ( STDMETHODCALLTYPE *GetPlatform )( ICorDebugDataTarget * This, /* [out] */ CorDebugPlatform *pTargetPlatform); + DECLSPEC_XFGVIRT(ICorDebugDataTarget, ReadVirtual) HRESULT ( STDMETHODCALLTYPE *ReadVirtual )( ICorDebugDataTarget * This, /* [in] */ CORDB_ADDRESS address, @@ -1536,6 +1562,7 @@ EXTERN_C const IID IID_ICorDebugDataTarget; /* [in] */ ULONG32 bytesRequested, /* [out] */ ULONG32 *pBytesRead); + DECLSPEC_XFGVIRT(ICorDebugDataTarget, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorDebugDataTarget * This, /* [in] */ DWORD dwThreadID, @@ -1556,34 +1583,34 @@ EXTERN_C const IID IID_ICorDebugDataTarget; #ifdef COBJMACROS -#define ICorDebugDataTarget_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDataTarget_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDataTarget_AddRef(This) \ +#define ICorDebugDataTarget_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDataTarget_Release(This) \ +#define ICorDebugDataTarget_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDataTarget_GetPlatform(This,pTargetPlatform) \ +#define ICorDebugDataTarget_GetPlatform(This,pTargetPlatform) \ ( (This)->lpVtbl -> GetPlatform(This,pTargetPlatform) ) -#define ICorDebugDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \ +#define ICorDebugDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \ ( (This)->lpVtbl -> ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) ) -#define ICorDebugDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \ +#define ICorDebugDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \ ( (This)->lpVtbl -> GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDataTarget_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDataTarget_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__ @@ -1615,34 +1642,40 @@ EXTERN_C const IID IID_ICorDebugStaticFieldSymbol; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStaticFieldSymbolVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugStaticFieldSymbol * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugStaticFieldSymbol * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugStaticFieldSymbol * This); + DECLSPEC_XFGVIRT(ICorDebugStaticFieldSymbol, GetName) HRESULT ( STDMETHODCALLTYPE *GetName )( ICorDebugStaticFieldSymbol * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugStaticFieldSymbol, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugStaticFieldSymbol * This, /* [out] */ ULONG32 *pcbSize); + DECLSPEC_XFGVIRT(ICorDebugStaticFieldSymbol, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugStaticFieldSymbol * This, /* [out] */ CORDB_ADDRESS *pRVA); @@ -1660,34 +1693,34 @@ EXTERN_C const IID IID_ICorDebugStaticFieldSymbol; #ifdef COBJMACROS -#define ICorDebugStaticFieldSymbol_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStaticFieldSymbol_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStaticFieldSymbol_AddRef(This) \ +#define ICorDebugStaticFieldSymbol_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStaticFieldSymbol_Release(This) \ +#define ICorDebugStaticFieldSymbol_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStaticFieldSymbol_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugStaticFieldSymbol_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugStaticFieldSymbol_GetSize(This,pcbSize) \ +#define ICorDebugStaticFieldSymbol_GetSize(This,pcbSize) \ ( (This)->lpVtbl -> GetSize(This,pcbSize) ) -#define ICorDebugStaticFieldSymbol_GetAddress(This,pRVA) \ +#define ICorDebugStaticFieldSymbol_GetAddress(This,pRVA) \ ( (This)->lpVtbl -> GetAddress(This,pRVA) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__ */ #ifndef __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__ @@ -1719,34 +1752,40 @@ EXTERN_C const IID IID_ICorDebugInstanceFieldSymbol; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugInstanceFieldSymbolVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugInstanceFieldSymbol * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugInstanceFieldSymbol * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugInstanceFieldSymbol * This); + DECLSPEC_XFGVIRT(ICorDebugInstanceFieldSymbol, GetName) HRESULT ( STDMETHODCALLTYPE *GetName )( ICorDebugInstanceFieldSymbol * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugInstanceFieldSymbol, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugInstanceFieldSymbol * This, /* [out] */ ULONG32 *pcbSize); + DECLSPEC_XFGVIRT(ICorDebugInstanceFieldSymbol, GetOffset) HRESULT ( STDMETHODCALLTYPE *GetOffset )( ICorDebugInstanceFieldSymbol * This, /* [out] */ ULONG32 *pcbOffset); @@ -1764,34 +1803,34 @@ EXTERN_C const IID IID_ICorDebugInstanceFieldSymbol; #ifdef COBJMACROS -#define ICorDebugInstanceFieldSymbol_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugInstanceFieldSymbol_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugInstanceFieldSymbol_AddRef(This) \ +#define ICorDebugInstanceFieldSymbol_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugInstanceFieldSymbol_Release(This) \ +#define ICorDebugInstanceFieldSymbol_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugInstanceFieldSymbol_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugInstanceFieldSymbol_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugInstanceFieldSymbol_GetSize(This,pcbSize) \ +#define ICorDebugInstanceFieldSymbol_GetSize(This,pcbSize) \ ( (This)->lpVtbl -> GetSize(This,pcbSize) ) -#define ICorDebugInstanceFieldSymbol_GetOffset(This,pcbOffset) \ +#define ICorDebugInstanceFieldSymbol_GetOffset(This,pcbOffset) \ ( (This)->lpVtbl -> GetOffset(This,pcbOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__ */ #ifndef __ICorDebugVariableSymbol_INTERFACE_DEFINED__ @@ -1839,34 +1878,40 @@ EXTERN_C const IID IID_ICorDebugVariableSymbol; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVariableSymbolVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugVariableSymbol * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugVariableSymbol * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugVariableSymbol * This); + DECLSPEC_XFGVIRT(ICorDebugVariableSymbol, GetName) HRESULT ( STDMETHODCALLTYPE *GetName )( ICorDebugVariableSymbol * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugVariableSymbol, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugVariableSymbol * This, /* [out] */ ULONG32 *pcbValue); + DECLSPEC_XFGVIRT(ICorDebugVariableSymbol, GetValue) HRESULT ( STDMETHODCALLTYPE *GetValue )( ICorDebugVariableSymbol * This, /* [in] */ ULONG32 offset, @@ -1876,6 +1921,7 @@ EXTERN_C const IID IID_ICorDebugVariableSymbol; /* [out] */ ULONG32 *pcbValue, /* [length_is][size_is][out] */ BYTE pValue[ ]); + DECLSPEC_XFGVIRT(ICorDebugVariableSymbol, SetValue) HRESULT ( STDMETHODCALLTYPE *SetValue )( ICorDebugVariableSymbol * This, /* [in] */ ULONG32 offset, @@ -1885,6 +1931,7 @@ EXTERN_C const IID IID_ICorDebugVariableSymbol; /* [in] */ ULONG32 cbValue, /* [size_is][in] */ BYTE pValue[ ]); + DECLSPEC_XFGVIRT(ICorDebugVariableSymbol, GetSlotIndex) HRESULT ( STDMETHODCALLTYPE *GetSlotIndex )( ICorDebugVariableSymbol * This, /* [out] */ ULONG32 *pSlotIndex); @@ -1902,40 +1949,40 @@ EXTERN_C const IID IID_ICorDebugVariableSymbol; #ifdef COBJMACROS -#define ICorDebugVariableSymbol_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugVariableSymbol_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugVariableSymbol_AddRef(This) \ +#define ICorDebugVariableSymbol_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugVariableSymbol_Release(This) \ +#define ICorDebugVariableSymbol_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugVariableSymbol_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugVariableSymbol_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugVariableSymbol_GetSize(This,pcbValue) \ +#define ICorDebugVariableSymbol_GetSize(This,pcbValue) \ ( (This)->lpVtbl -> GetSize(This,pcbValue) ) -#define ICorDebugVariableSymbol_GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) \ +#define ICorDebugVariableSymbol_GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) \ ( (This)->lpVtbl -> GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) ) -#define ICorDebugVariableSymbol_SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) \ +#define ICorDebugVariableSymbol_SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) \ ( (This)->lpVtbl -> SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) ) -#define ICorDebugVariableSymbol_GetSlotIndex(This,pSlotIndex) \ +#define ICorDebugVariableSymbol_GetSlotIndex(This,pSlotIndex) \ ( (This)->lpVtbl -> GetSlotIndex(This,pSlotIndex) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugVariableSymbol_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugVariableSymbol_INTERFACE_DEFINED__ */ #ifndef __ICorDebugMemoryBuffer_INTERFACE_DEFINED__ @@ -1962,28 +2009,33 @@ EXTERN_C const IID IID_ICorDebugMemoryBuffer; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMemoryBufferVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugMemoryBuffer * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugMemoryBuffer * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugMemoryBuffer * This); + DECLSPEC_XFGVIRT(ICorDebugMemoryBuffer, GetStartAddress) HRESULT ( STDMETHODCALLTYPE *GetStartAddress )( ICorDebugMemoryBuffer * This, /* [out] */ LPCVOID *address); + DECLSPEC_XFGVIRT(ICorDebugMemoryBuffer, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugMemoryBuffer * This, /* [out] */ ULONG32 *pcbBufferLength); @@ -2001,31 +2053,31 @@ EXTERN_C const IID IID_ICorDebugMemoryBuffer; #ifdef COBJMACROS -#define ICorDebugMemoryBuffer_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMemoryBuffer_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMemoryBuffer_AddRef(This) \ +#define ICorDebugMemoryBuffer_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMemoryBuffer_Release(This) \ +#define ICorDebugMemoryBuffer_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMemoryBuffer_GetStartAddress(This,address) \ +#define ICorDebugMemoryBuffer_GetStartAddress(This,address) \ ( (This)->lpVtbl -> GetStartAddress(This,address) ) -#define ICorDebugMemoryBuffer_GetSize(This,pcbBufferLength) \ +#define ICorDebugMemoryBuffer_GetSize(This,pcbBufferLength) \ ( (This)->lpVtbl -> GetSize(This,pcbBufferLength) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMemoryBuffer_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMemoryBuffer_INTERFACE_DEFINED__ */ #ifndef __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__ @@ -2075,30 +2127,35 @@ EXTERN_C const IID IID_ICorDebugMergedAssemblyRecord; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMergedAssemblyRecordVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugMergedAssemblyRecord * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugMergedAssemblyRecord * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugMergedAssemblyRecord * This); + DECLSPEC_XFGVIRT(ICorDebugMergedAssemblyRecord, GetSimpleName) HRESULT ( STDMETHODCALLTYPE *GetSimpleName )( ICorDebugMergedAssemblyRecord * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugMergedAssemblyRecord, GetVersion) HRESULT ( STDMETHODCALLTYPE *GetVersion )( ICorDebugMergedAssemblyRecord * This, /* [out] */ USHORT *pMajor, @@ -2106,24 +2163,28 @@ EXTERN_C const IID IID_ICorDebugMergedAssemblyRecord; /* [out] */ USHORT *pBuild, /* [out] */ USHORT *pRevision); + DECLSPEC_XFGVIRT(ICorDebugMergedAssemblyRecord, GetCulture) HRESULT ( STDMETHODCALLTYPE *GetCulture )( ICorDebugMergedAssemblyRecord * This, /* [in] */ ULONG32 cchCulture, /* [out] */ ULONG32 *pcchCulture, /* [length_is][size_is][out] */ WCHAR szCulture[ ]); + DECLSPEC_XFGVIRT(ICorDebugMergedAssemblyRecord, GetPublicKey) HRESULT ( STDMETHODCALLTYPE *GetPublicKey )( ICorDebugMergedAssemblyRecord * This, /* [in] */ ULONG32 cbPublicKey, /* [out] */ ULONG32 *pcbPublicKey, /* [length_is][size_is][out] */ BYTE pbPublicKey[ ]); + DECLSPEC_XFGVIRT(ICorDebugMergedAssemblyRecord, GetPublicKeyToken) HRESULT ( STDMETHODCALLTYPE *GetPublicKeyToken )( ICorDebugMergedAssemblyRecord * This, /* [in] */ ULONG32 cbPublicKeyToken, /* [out] */ ULONG32 *pcbPublicKeyToken, /* [length_is][size_is][out] */ BYTE pbPublicKeyToken[ ]); + DECLSPEC_XFGVIRT(ICorDebugMergedAssemblyRecord, GetIndex) HRESULT ( STDMETHODCALLTYPE *GetIndex )( ICorDebugMergedAssemblyRecord * This, /* [out] */ ULONG32 *pIndex); @@ -2141,43 +2202,43 @@ EXTERN_C const IID IID_ICorDebugMergedAssemblyRecord; #ifdef COBJMACROS -#define ICorDebugMergedAssemblyRecord_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMergedAssemblyRecord_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMergedAssemblyRecord_AddRef(This) \ +#define ICorDebugMergedAssemblyRecord_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMergedAssemblyRecord_Release(This) \ +#define ICorDebugMergedAssemblyRecord_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMergedAssemblyRecord_GetSimpleName(This,cchName,pcchName,szName) \ +#define ICorDebugMergedAssemblyRecord_GetSimpleName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetSimpleName(This,cchName,pcchName,szName) ) -#define ICorDebugMergedAssemblyRecord_GetVersion(This,pMajor,pMinor,pBuild,pRevision) \ +#define ICorDebugMergedAssemblyRecord_GetVersion(This,pMajor,pMinor,pBuild,pRevision) \ ( (This)->lpVtbl -> GetVersion(This,pMajor,pMinor,pBuild,pRevision) ) -#define ICorDebugMergedAssemblyRecord_GetCulture(This,cchCulture,pcchCulture,szCulture) \ +#define ICorDebugMergedAssemblyRecord_GetCulture(This,cchCulture,pcchCulture,szCulture) \ ( (This)->lpVtbl -> GetCulture(This,cchCulture,pcchCulture,szCulture) ) -#define ICorDebugMergedAssemblyRecord_GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) \ +#define ICorDebugMergedAssemblyRecord_GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) \ ( (This)->lpVtbl -> GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) ) -#define ICorDebugMergedAssemblyRecord_GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) \ +#define ICorDebugMergedAssemblyRecord_GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) \ ( (This)->lpVtbl -> GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) ) -#define ICorDebugMergedAssemblyRecord_GetIndex(This,pIndex) \ +#define ICorDebugMergedAssemblyRecord_GetIndex(This,pIndex) \ ( (This)->lpVtbl -> GetIndex(This,pIndex) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__ */ #ifndef __ICorDebugSymbolProvider_INTERFACE_DEFINED__ @@ -2261,24 +2322,28 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugSymbolProviderVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugSymbolProvider * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugSymbolProvider * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugSymbolProvider * This); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetStaticFieldSymbols) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldSymbols )( ICorDebugSymbolProvider * This, /* [in] */ ULONG32 cbSignature, @@ -2287,6 +2352,7 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; /* [out] */ ULONG32 *pcFetchedSymbols, /* [length_is][size_is][out] */ ICorDebugStaticFieldSymbol *pSymbols[ ]); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetInstanceFieldSymbols) HRESULT ( STDMETHODCALLTYPE *GetInstanceFieldSymbols )( ICorDebugSymbolProvider * This, /* [in] */ ULONG32 cbSignature, @@ -2295,6 +2361,7 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; /* [out] */ ULONG32 *pcFetchedSymbols, /* [length_is][size_is][out] */ ICorDebugInstanceFieldSymbol *pSymbols[ ]); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetMethodLocalSymbols) HRESULT ( STDMETHODCALLTYPE *GetMethodLocalSymbols )( ICorDebugSymbolProvider * This, /* [in] */ ULONG32 nativeRVA, @@ -2302,6 +2369,7 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; /* [out] */ ULONG32 *pcFetchedSymbols, /* [length_is][size_is][out] */ ICorDebugVariableSymbol *pSymbols[ ]); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetMethodParameterSymbols) HRESULT ( STDMETHODCALLTYPE *GetMethodParameterSymbols )( ICorDebugSymbolProvider * This, /* [in] */ ULONG32 nativeRVA, @@ -2309,12 +2377,14 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; /* [out] */ ULONG32 *pcFetchedSymbols, /* [length_is][size_is][out] */ ICorDebugVariableSymbol *pSymbols[ ]); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetMergedAssemblyRecords) HRESULT ( STDMETHODCALLTYPE *GetMergedAssemblyRecords )( ICorDebugSymbolProvider * This, /* [in] */ ULONG32 cRequestedRecords, /* [out] */ ULONG32 *pcFetchedRecords, /* [length_is][size_is][out] */ ICorDebugMergedAssemblyRecord *pRecords[ ]); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetMethodProps) HRESULT ( STDMETHODCALLTYPE *GetMethodProps )( ICorDebugSymbolProvider * This, /* [in] */ ULONG32 codeRva, @@ -2324,6 +2394,7 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; /* [out] */ ULONG32 *pcbSignature, /* [length_is][size_is][out] */ BYTE signature[ ]); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetTypeProps) HRESULT ( STDMETHODCALLTYPE *GetTypeProps )( ICorDebugSymbolProvider * This, /* [in] */ ULONG32 vtableRva, @@ -2331,24 +2402,28 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; /* [out] */ ULONG32 *pcbSignature, /* [length_is][size_is][out] */ BYTE signature[ ]); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetCodeRange) HRESULT ( STDMETHODCALLTYPE *GetCodeRange )( ICorDebugSymbolProvider * This, /* [in] */ ULONG32 codeRva, /* [out] */ ULONG32 *pCodeStartAddress, ULONG32 *pCodeSize); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetAssemblyImageBytes) HRESULT ( STDMETHODCALLTYPE *GetAssemblyImageBytes )( ICorDebugSymbolProvider * This, /* [in] */ CORDB_ADDRESS rva, /* [in] */ ULONG32 length, /* [out] */ ICorDebugMemoryBuffer **ppMemoryBuffer); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorDebugSymbolProvider * This, /* [in] */ ULONG32 cbSignature, /* [size_is][in] */ BYTE typeSig[ ], /* [out] */ ULONG32 *pObjectSize); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider, GetAssemblyImageMetadata) HRESULT ( STDMETHODCALLTYPE *GetAssemblyImageMetadata )( ICorDebugSymbolProvider * This, /* [out] */ ICorDebugMemoryBuffer **ppMemoryBuffer); @@ -2366,58 +2441,58 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider; #ifdef COBJMACROS -#define ICorDebugSymbolProvider_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugSymbolProvider_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugSymbolProvider_AddRef(This) \ +#define ICorDebugSymbolProvider_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugSymbolProvider_Release(This) \ +#define ICorDebugSymbolProvider_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugSymbolProvider_GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ +#define ICorDebugSymbolProvider_GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ ( (This)->lpVtbl -> GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) ) -#define ICorDebugSymbolProvider_GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ +#define ICorDebugSymbolProvider_GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ ( (This)->lpVtbl -> GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) ) -#define ICorDebugSymbolProvider_GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ +#define ICorDebugSymbolProvider_GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ ( (This)->lpVtbl -> GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) ) -#define ICorDebugSymbolProvider_GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ +#define ICorDebugSymbolProvider_GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \ ( (This)->lpVtbl -> GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) ) -#define ICorDebugSymbolProvider_GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) \ +#define ICorDebugSymbolProvider_GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) \ ( (This)->lpVtbl -> GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) ) -#define ICorDebugSymbolProvider_GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) \ +#define ICorDebugSymbolProvider_GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) \ ( (This)->lpVtbl -> GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) ) -#define ICorDebugSymbolProvider_GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) \ +#define ICorDebugSymbolProvider_GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) \ ( (This)->lpVtbl -> GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) ) -#define ICorDebugSymbolProvider_GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) \ +#define ICorDebugSymbolProvider_GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) \ ( (This)->lpVtbl -> GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) ) -#define ICorDebugSymbolProvider_GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) \ +#define ICorDebugSymbolProvider_GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) \ ( (This)->lpVtbl -> GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) ) -#define ICorDebugSymbolProvider_GetObjectSize(This,cbSignature,typeSig,pObjectSize) \ +#define ICorDebugSymbolProvider_GetObjectSize(This,cbSignature,typeSig,pObjectSize) \ ( (This)->lpVtbl -> GetObjectSize(This,cbSignature,typeSig,pObjectSize) ) -#define ICorDebugSymbolProvider_GetAssemblyImageMetadata(This,ppMemoryBuffer) \ +#define ICorDebugSymbolProvider_GetAssemblyImageMetadata(This,ppMemoryBuffer) \ ( (This)->lpVtbl -> GetAssemblyImageMetadata(This,ppMemoryBuffer) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugSymbolProvider_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugSymbolProvider_INTERFACE_DEFINED__ */ #ifndef __ICorDebugSymbolProvider2_INTERFACE_DEFINED__ @@ -2446,28 +2521,33 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugSymbolProvider2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugSymbolProvider2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugSymbolProvider2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugSymbolProvider2 * This); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider2, GetGenericDictionaryInfo) HRESULT ( STDMETHODCALLTYPE *GetGenericDictionaryInfo )( ICorDebugSymbolProvider2 * This, /* [out] */ ICorDebugMemoryBuffer **ppMemoryBuffer); + DECLSPEC_XFGVIRT(ICorDebugSymbolProvider2, GetFrameProps) HRESULT ( STDMETHODCALLTYPE *GetFrameProps )( ICorDebugSymbolProvider2 * This, /* [in] */ ULONG32 codeRva, @@ -2487,31 +2567,31 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider2; #ifdef COBJMACROS -#define ICorDebugSymbolProvider2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugSymbolProvider2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugSymbolProvider2_AddRef(This) \ +#define ICorDebugSymbolProvider2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugSymbolProvider2_Release(This) \ +#define ICorDebugSymbolProvider2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugSymbolProvider2_GetGenericDictionaryInfo(This,ppMemoryBuffer) \ +#define ICorDebugSymbolProvider2_GetGenericDictionaryInfo(This,ppMemoryBuffer) \ ( (This)->lpVtbl -> GetGenericDictionaryInfo(This,ppMemoryBuffer) ) -#define ICorDebugSymbolProvider2_GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) \ +#define ICorDebugSymbolProvider2_GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) \ ( (This)->lpVtbl -> GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugSymbolProvider2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugSymbolProvider2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__ @@ -2540,24 +2620,28 @@ EXTERN_C const IID IID_ICorDebugVirtualUnwinder; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVirtualUnwinderVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugVirtualUnwinder * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugVirtualUnwinder * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugVirtualUnwinder * This); + DECLSPEC_XFGVIRT(ICorDebugVirtualUnwinder, GetContext) HRESULT ( STDMETHODCALLTYPE *GetContext )( ICorDebugVirtualUnwinder * This, /* [in] */ ULONG32 contextFlags, @@ -2565,6 +2649,7 @@ EXTERN_C const IID IID_ICorDebugVirtualUnwinder; /* [out] */ ULONG32 *contextSize, /* [size_is][out] */ BYTE contextBuf[ ]); + DECLSPEC_XFGVIRT(ICorDebugVirtualUnwinder, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugVirtualUnwinder * This); @@ -2581,31 +2666,31 @@ EXTERN_C const IID IID_ICorDebugVirtualUnwinder; #ifdef COBJMACROS -#define ICorDebugVirtualUnwinder_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugVirtualUnwinder_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugVirtualUnwinder_AddRef(This) \ +#define ICorDebugVirtualUnwinder_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugVirtualUnwinder_Release(This) \ +#define ICorDebugVirtualUnwinder_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugVirtualUnwinder_GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) \ +#define ICorDebugVirtualUnwinder_GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) \ ( (This)->lpVtbl -> GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) ) -#define ICorDebugVirtualUnwinder_Next(This) \ +#define ICorDebugVirtualUnwinder_Next(This) \ ( (This)->lpVtbl -> Next(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__ */ #ifndef __ICorDebugDataTarget2_INTERFACE_DEFINED__ @@ -2653,30 +2738,35 @@ EXTERN_C const IID IID_ICorDebugDataTarget2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDataTarget2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugDataTarget2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugDataTarget2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugDataTarget2 * This); + DECLSPEC_XFGVIRT(ICorDebugDataTarget2, GetImageFromPointer) HRESULT ( STDMETHODCALLTYPE *GetImageFromPointer )( ICorDebugDataTarget2 * This, /* [in] */ CORDB_ADDRESS addr, /* [out] */ CORDB_ADDRESS *pImageBase, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugDataTarget2, GetImageLocation) HRESULT ( STDMETHODCALLTYPE *GetImageLocation )( ICorDebugDataTarget2 * This, /* [in] */ CORDB_ADDRESS baseAddress, @@ -2684,17 +2774,20 @@ EXTERN_C const IID IID_ICorDebugDataTarget2; /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugDataTarget2, GetSymbolProviderForImage) HRESULT ( STDMETHODCALLTYPE *GetSymbolProviderForImage )( ICorDebugDataTarget2 * This, /* [in] */ CORDB_ADDRESS imageBaseAddress, /* [out] */ ICorDebugSymbolProvider **ppSymProvider); + DECLSPEC_XFGVIRT(ICorDebugDataTarget2, EnumerateThreadIDs) HRESULT ( STDMETHODCALLTYPE *EnumerateThreadIDs )( ICorDebugDataTarget2 * This, /* [in] */ ULONG32 cThreadIds, /* [out] */ ULONG32 *pcThreadIds, /* [length_is][size_is][out] */ ULONG32 pThreadIds[ ]); + DECLSPEC_XFGVIRT(ICorDebugDataTarget2, CreateVirtualUnwinder) HRESULT ( STDMETHODCALLTYPE *CreateVirtualUnwinder )( ICorDebugDataTarget2 * This, /* [in] */ DWORD nativeThreadID, @@ -2716,40 +2809,40 @@ EXTERN_C const IID IID_ICorDebugDataTarget2; #ifdef COBJMACROS -#define ICorDebugDataTarget2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDataTarget2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDataTarget2_AddRef(This) \ +#define ICorDebugDataTarget2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDataTarget2_Release(This) \ +#define ICorDebugDataTarget2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDataTarget2_GetImageFromPointer(This,addr,pImageBase,pSize) \ +#define ICorDebugDataTarget2_GetImageFromPointer(This,addr,pImageBase,pSize) \ ( (This)->lpVtbl -> GetImageFromPointer(This,addr,pImageBase,pSize) ) -#define ICorDebugDataTarget2_GetImageLocation(This,baseAddress,cchName,pcchName,szName) \ +#define ICorDebugDataTarget2_GetImageLocation(This,baseAddress,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetImageLocation(This,baseAddress,cchName,pcchName,szName) ) -#define ICorDebugDataTarget2_GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) \ +#define ICorDebugDataTarget2_GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) \ ( (This)->lpVtbl -> GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) ) -#define ICorDebugDataTarget2_EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) \ +#define ICorDebugDataTarget2_EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) \ ( (This)->lpVtbl -> EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) ) -#define ICorDebugDataTarget2_CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) \ +#define ICorDebugDataTarget2_CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) \ ( (This)->lpVtbl -> CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDataTarget2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDataTarget2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugLoadedModule_INTERFACE_DEFINED__ @@ -2781,34 +2874,40 @@ EXTERN_C const IID IID_ICorDebugLoadedModule; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugLoadedModuleVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugLoadedModule * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugLoadedModule * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugLoadedModule * This); + DECLSPEC_XFGVIRT(ICorDebugLoadedModule, GetBaseAddress) HRESULT ( STDMETHODCALLTYPE *GetBaseAddress )( ICorDebugLoadedModule * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugLoadedModule, GetName) HRESULT ( STDMETHODCALLTYPE *GetName )( ICorDebugLoadedModule * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugLoadedModule, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugLoadedModule * This, /* [out] */ ULONG32 *pcBytes); @@ -2826,34 +2925,34 @@ EXTERN_C const IID IID_ICorDebugLoadedModule; #ifdef COBJMACROS -#define ICorDebugLoadedModule_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugLoadedModule_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugLoadedModule_AddRef(This) \ +#define ICorDebugLoadedModule_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugLoadedModule_Release(This) \ +#define ICorDebugLoadedModule_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugLoadedModule_GetBaseAddress(This,pAddress) \ +#define ICorDebugLoadedModule_GetBaseAddress(This,pAddress) \ ( (This)->lpVtbl -> GetBaseAddress(This,pAddress) ) -#define ICorDebugLoadedModule_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugLoadedModule_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugLoadedModule_GetSize(This,pcBytes) \ +#define ICorDebugLoadedModule_GetSize(This,pcBytes) \ ( (This)->lpVtbl -> GetSize(This,pcBytes) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugLoadedModule_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugLoadedModule_INTERFACE_DEFINED__ */ #ifndef __ICorDebugDataTarget3_INTERFACE_DEFINED__ @@ -2879,24 +2978,28 @@ EXTERN_C const IID IID_ICorDebugDataTarget3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDataTarget3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugDataTarget3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugDataTarget3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugDataTarget3 * This); + DECLSPEC_XFGVIRT(ICorDebugDataTarget3, GetLoadedModules) HRESULT ( STDMETHODCALLTYPE *GetLoadedModules )( ICorDebugDataTarget3 * This, /* [in] */ ULONG32 cRequestedModules, @@ -2916,28 +3019,28 @@ EXTERN_C const IID IID_ICorDebugDataTarget3; #ifdef COBJMACROS -#define ICorDebugDataTarget3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDataTarget3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDataTarget3_AddRef(This) \ +#define ICorDebugDataTarget3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDataTarget3_Release(This) \ +#define ICorDebugDataTarget3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDataTarget3_GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) \ +#define ICorDebugDataTarget3_GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) \ ( (This)->lpVtbl -> GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDataTarget3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDataTarget3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugDataTarget4_INTERFACE_DEFINED__ @@ -2963,24 +3066,28 @@ EXTERN_C const IID IID_ICorDebugDataTarget4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDataTarget4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugDataTarget4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugDataTarget4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugDataTarget4 * This); + DECLSPEC_XFGVIRT(ICorDebugDataTarget4, VirtualUnwind) HRESULT ( STDMETHODCALLTYPE *VirtualUnwind )( ICorDebugDataTarget4 * This, /* [in] */ DWORD threadId, @@ -3000,28 +3107,28 @@ EXTERN_C const IID IID_ICorDebugDataTarget4; #ifdef COBJMACROS -#define ICorDebugDataTarget4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDataTarget4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDataTarget4_AddRef(This) \ +#define ICorDebugDataTarget4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDataTarget4_Release(This) \ +#define ICorDebugDataTarget4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDataTarget4_VirtualUnwind(This,threadId,contextSize,context) \ +#define ICorDebugDataTarget4_VirtualUnwind(This,threadId,contextSize,context) \ ( (This)->lpVtbl -> VirtualUnwind(This,threadId,contextSize,context) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDataTarget4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDataTarget4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugMutableDataTarget_INTERFACE_DEFINED__ @@ -3056,28 +3163,33 @@ EXTERN_C const IID IID_ICorDebugMutableDataTarget; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMutableDataTargetVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugMutableDataTarget * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugMutableDataTarget * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugMutableDataTarget * This); + DECLSPEC_XFGVIRT(ICorDebugDataTarget, GetPlatform) HRESULT ( STDMETHODCALLTYPE *GetPlatform )( ICorDebugMutableDataTarget * This, /* [out] */ CorDebugPlatform *pTargetPlatform); + DECLSPEC_XFGVIRT(ICorDebugDataTarget, ReadVirtual) HRESULT ( STDMETHODCALLTYPE *ReadVirtual )( ICorDebugMutableDataTarget * This, /* [in] */ CORDB_ADDRESS address, @@ -3085,6 +3197,7 @@ EXTERN_C const IID IID_ICorDebugMutableDataTarget; /* [in] */ ULONG32 bytesRequested, /* [out] */ ULONG32 *pBytesRead); + DECLSPEC_XFGVIRT(ICorDebugDataTarget, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorDebugMutableDataTarget * This, /* [in] */ DWORD dwThreadID, @@ -3092,18 +3205,21 @@ EXTERN_C const IID IID_ICorDebugMutableDataTarget; /* [in] */ ULONG32 contextSize, /* [size_is][out] */ BYTE *pContext); + DECLSPEC_XFGVIRT(ICorDebugMutableDataTarget, WriteVirtual) HRESULT ( STDMETHODCALLTYPE *WriteVirtual )( ICorDebugMutableDataTarget * This, /* [in] */ CORDB_ADDRESS address, /* [size_is][in] */ const BYTE *pBuffer, /* [in] */ ULONG32 bytesRequested); + DECLSPEC_XFGVIRT(ICorDebugMutableDataTarget, SetThreadContext) HRESULT ( STDMETHODCALLTYPE *SetThreadContext )( ICorDebugMutableDataTarget * This, /* [in] */ DWORD dwThreadID, /* [in] */ ULONG32 contextSize, /* [size_is][in] */ const BYTE *pContext); + DECLSPEC_XFGVIRT(ICorDebugMutableDataTarget, ContinueStatusChanged) HRESULT ( STDMETHODCALLTYPE *ContinueStatusChanged )( ICorDebugMutableDataTarget * This, /* [in] */ DWORD dwThreadId, @@ -3122,44 +3238,44 @@ EXTERN_C const IID IID_ICorDebugMutableDataTarget; #ifdef COBJMACROS -#define ICorDebugMutableDataTarget_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMutableDataTarget_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMutableDataTarget_AddRef(This) \ +#define ICorDebugMutableDataTarget_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMutableDataTarget_Release(This) \ +#define ICorDebugMutableDataTarget_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMutableDataTarget_GetPlatform(This,pTargetPlatform) \ +#define ICorDebugMutableDataTarget_GetPlatform(This,pTargetPlatform) \ ( (This)->lpVtbl -> GetPlatform(This,pTargetPlatform) ) -#define ICorDebugMutableDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \ +#define ICorDebugMutableDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \ ( (This)->lpVtbl -> ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) ) -#define ICorDebugMutableDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \ +#define ICorDebugMutableDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \ ( (This)->lpVtbl -> GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) ) -#define ICorDebugMutableDataTarget_WriteVirtual(This,address,pBuffer,bytesRequested) \ +#define ICorDebugMutableDataTarget_WriteVirtual(This,address,pBuffer,bytesRequested) \ ( (This)->lpVtbl -> WriteVirtual(This,address,pBuffer,bytesRequested) ) -#define ICorDebugMutableDataTarget_SetThreadContext(This,dwThreadID,contextSize,pContext) \ +#define ICorDebugMutableDataTarget_SetThreadContext(This,dwThreadID,contextSize,pContext) \ ( (This)->lpVtbl -> SetThreadContext(This,dwThreadID,contextSize,pContext) ) -#define ICorDebugMutableDataTarget_ContinueStatusChanged(This,dwThreadId,continueStatus) \ +#define ICorDebugMutableDataTarget_ContinueStatusChanged(This,dwThreadId,continueStatus) \ ( (This)->lpVtbl -> ContinueStatusChanged(This,dwThreadId,continueStatus) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMutableDataTarget_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMutableDataTarget_INTERFACE_DEFINED__ */ #ifndef __ICorDebugMetaDataLocator_INTERFACE_DEFINED__ @@ -3190,24 +3306,28 @@ EXTERN_C const IID IID_ICorDebugMetaDataLocator; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMetaDataLocatorVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugMetaDataLocator * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugMetaDataLocator * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugMetaDataLocator * This); + DECLSPEC_XFGVIRT(ICorDebugMetaDataLocator, GetMetaData) HRESULT ( STDMETHODCALLTYPE *GetMetaData )( ICorDebugMetaDataLocator * This, /* [in] */ LPCWSTR wszImagePath, @@ -3232,28 +3352,28 @@ EXTERN_C const IID IID_ICorDebugMetaDataLocator; #ifdef COBJMACROS -#define ICorDebugMetaDataLocator_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMetaDataLocator_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMetaDataLocator_AddRef(This) \ +#define ICorDebugMetaDataLocator_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMetaDataLocator_Release(This) \ +#define ICorDebugMetaDataLocator_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMetaDataLocator_GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) \ +#define ICorDebugMetaDataLocator_GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) \ ( (This)->lpVtbl -> GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMetaDataLocator_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMetaDataLocator_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0015 */ @@ -3275,40 +3395,40 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0015_v0_0_s_ifspec; typedef enum CorDebugStepReason { - STEP_NORMAL = 0, - STEP_RETURN = ( STEP_NORMAL + 1 ) , - STEP_CALL = ( STEP_RETURN + 1 ) , - STEP_EXCEPTION_FILTER = ( STEP_CALL + 1 ) , - STEP_EXCEPTION_HANDLER = ( STEP_EXCEPTION_FILTER + 1 ) , - STEP_INTERCEPT = ( STEP_EXCEPTION_HANDLER + 1 ) , - STEP_EXIT = ( STEP_INTERCEPT + 1 ) - } CorDebugStepReason; + STEP_NORMAL = 0, + STEP_RETURN = ( STEP_NORMAL + 1 ) , + STEP_CALL = ( STEP_RETURN + 1 ) , + STEP_EXCEPTION_FILTER = ( STEP_CALL + 1 ) , + STEP_EXCEPTION_HANDLER = ( STEP_EXCEPTION_FILTER + 1 ) , + STEP_INTERCEPT = ( STEP_EXCEPTION_HANDLER + 1 ) , + STEP_EXIT = ( STEP_INTERCEPT + 1 ) + } CorDebugStepReason; typedef enum LoggingLevelEnum { - LTraceLevel0 = 0, - LTraceLevel1 = ( LTraceLevel0 + 1 ) , - LTraceLevel2 = ( LTraceLevel1 + 1 ) , - LTraceLevel3 = ( LTraceLevel2 + 1 ) , - LTraceLevel4 = ( LTraceLevel3 + 1 ) , - LStatusLevel0 = 20, - LStatusLevel1 = ( LStatusLevel0 + 1 ) , - LStatusLevel2 = ( LStatusLevel1 + 1 ) , - LStatusLevel3 = ( LStatusLevel2 + 1 ) , - LStatusLevel4 = ( LStatusLevel3 + 1 ) , - LWarningLevel = 40, - LErrorLevel = 50, - LPanicLevel = 100 - } LoggingLevelEnum; + LTraceLevel0 = 0, + LTraceLevel1 = ( LTraceLevel0 + 1 ) , + LTraceLevel2 = ( LTraceLevel1 + 1 ) , + LTraceLevel3 = ( LTraceLevel2 + 1 ) , + LTraceLevel4 = ( LTraceLevel3 + 1 ) , + LStatusLevel0 = 20, + LStatusLevel1 = ( LStatusLevel0 + 1 ) , + LStatusLevel2 = ( LStatusLevel1 + 1 ) , + LStatusLevel3 = ( LStatusLevel2 + 1 ) , + LStatusLevel4 = ( LStatusLevel3 + 1 ) , + LWarningLevel = 40, + LErrorLevel = 50, + LPanicLevel = 100 + } LoggingLevelEnum; typedef enum LogSwitchCallReason { - SWITCH_CREATE = 0, - SWITCH_MODIFY = ( SWITCH_CREATE + 1 ) , - SWITCH_DELETE = ( SWITCH_MODIFY + 1 ) - } LogSwitchCallReason; + SWITCH_CREATE = 0, + SWITCH_MODIFY = ( SWITCH_CREATE + 1 ) , + SWITCH_DELETE = ( SWITCH_MODIFY + 1 ) + } LogSwitchCallReason; EXTERN_C const IID IID_ICorDebugManagedCallback; @@ -3442,30 +3562,35 @@ EXTERN_C const IID IID_ICorDebugManagedCallback; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugManagedCallbackVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugManagedCallback * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugManagedCallback * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugManagedCallback * This); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, Breakpoint) HRESULT ( STDMETHODCALLTYPE *Breakpoint )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugThread *pThread, /* [in] */ ICorDebugBreakpoint *pBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, StepComplete) HRESULT ( STDMETHODCALLTYPE *StepComplete )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, @@ -3473,73 +3598,87 @@ EXTERN_C const IID IID_ICorDebugManagedCallback; /* [in] */ ICorDebugStepper *pStepper, /* [in] */ CorDebugStepReason reason); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, Break) HRESULT ( STDMETHODCALLTYPE *Break )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugThread *thread); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, Exception) HRESULT ( STDMETHODCALLTYPE *Exception )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugThread *pThread, /* [in] */ BOOL unhandled); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, EvalComplete) HRESULT ( STDMETHODCALLTYPE *EvalComplete )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugThread *pThread, /* [in] */ ICorDebugEval *pEval); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, EvalException) HRESULT ( STDMETHODCALLTYPE *EvalException )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugThread *pThread, /* [in] */ ICorDebugEval *pEval); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, CreateProcess) HRESULT ( STDMETHODCALLTYPE *CreateProcess )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugProcess *pProcess); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, ExitProcess) HRESULT ( STDMETHODCALLTYPE *ExitProcess )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugProcess *pProcess); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, CreateThread) HRESULT ( STDMETHODCALLTYPE *CreateThread )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugThread *thread); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, ExitThread) HRESULT ( STDMETHODCALLTYPE *ExitThread )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugThread *thread); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, LoadModule) HRESULT ( STDMETHODCALLTYPE *LoadModule )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugModule *pModule); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, UnloadModule) HRESULT ( STDMETHODCALLTYPE *UnloadModule )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugModule *pModule); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, LoadClass) HRESULT ( STDMETHODCALLTYPE *LoadClass )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugClass *c); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, UnloadClass) HRESULT ( STDMETHODCALLTYPE *UnloadClass )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugClass *c); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, DebuggerError) HRESULT ( STDMETHODCALLTYPE *DebuggerError )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugProcess *pProcess, /* [in] */ HRESULT errorHR, /* [in] */ DWORD errorCode); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, LogMessage) HRESULT ( STDMETHODCALLTYPE *LogMessage )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, @@ -3548,6 +3687,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback; /* [in] */ WCHAR *pLogSwitchName, /* [in] */ WCHAR *pMessage); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, LogSwitch) HRESULT ( STDMETHODCALLTYPE *LogSwitch )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, @@ -3557,41 +3697,49 @@ EXTERN_C const IID IID_ICorDebugManagedCallback; /* [in] */ WCHAR *pLogSwitchName, /* [in] */ WCHAR *pParentName); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, CreateAppDomain) HRESULT ( STDMETHODCALLTYPE *CreateAppDomain )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugProcess *pProcess, /* [in] */ ICorDebugAppDomain *pAppDomain); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, ExitAppDomain) HRESULT ( STDMETHODCALLTYPE *ExitAppDomain )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugProcess *pProcess, /* [in] */ ICorDebugAppDomain *pAppDomain); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, LoadAssembly) HRESULT ( STDMETHODCALLTYPE *LoadAssembly )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugAssembly *pAssembly); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, UnloadAssembly) HRESULT ( STDMETHODCALLTYPE *UnloadAssembly )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugAssembly *pAssembly); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, ControlCTrap) HRESULT ( STDMETHODCALLTYPE *ControlCTrap )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugProcess *pProcess); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, NameChange) HRESULT ( STDMETHODCALLTYPE *NameChange )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugThread *pThread); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, UpdateModuleSymbols) HRESULT ( STDMETHODCALLTYPE *UpdateModuleSymbols )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugModule *pModule, /* [in] */ IStream *pSymbolStream); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, EditAndContinueRemap) HRESULT ( STDMETHODCALLTYPE *EditAndContinueRemap )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, @@ -3599,6 +3747,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback; /* [in] */ ICorDebugFunction *pFunction, /* [in] */ BOOL fAccurate); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback, BreakpointSetError) HRESULT ( STDMETHODCALLTYPE *BreakpointSetError )( ICorDebugManagedCallback * This, /* [in] */ ICorDebugAppDomain *pAppDomain, @@ -3619,103 +3768,103 @@ EXTERN_C const IID IID_ICorDebugManagedCallback; #ifdef COBJMACROS -#define ICorDebugManagedCallback_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugManagedCallback_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugManagedCallback_AddRef(This) \ +#define ICorDebugManagedCallback_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugManagedCallback_Release(This) \ +#define ICorDebugManagedCallback_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugManagedCallback_Breakpoint(This,pAppDomain,pThread,pBreakpoint) \ +#define ICorDebugManagedCallback_Breakpoint(This,pAppDomain,pThread,pBreakpoint) \ ( (This)->lpVtbl -> Breakpoint(This,pAppDomain,pThread,pBreakpoint) ) -#define ICorDebugManagedCallback_StepComplete(This,pAppDomain,pThread,pStepper,reason) \ +#define ICorDebugManagedCallback_StepComplete(This,pAppDomain,pThread,pStepper,reason) \ ( (This)->lpVtbl -> StepComplete(This,pAppDomain,pThread,pStepper,reason) ) -#define ICorDebugManagedCallback_Break(This,pAppDomain,thread) \ +#define ICorDebugManagedCallback_Break(This,pAppDomain,thread) \ ( (This)->lpVtbl -> Break(This,pAppDomain,thread) ) -#define ICorDebugManagedCallback_Exception(This,pAppDomain,pThread,unhandled) \ +#define ICorDebugManagedCallback_Exception(This,pAppDomain,pThread,unhandled) \ ( (This)->lpVtbl -> Exception(This,pAppDomain,pThread,unhandled) ) -#define ICorDebugManagedCallback_EvalComplete(This,pAppDomain,pThread,pEval) \ +#define ICorDebugManagedCallback_EvalComplete(This,pAppDomain,pThread,pEval) \ ( (This)->lpVtbl -> EvalComplete(This,pAppDomain,pThread,pEval) ) -#define ICorDebugManagedCallback_EvalException(This,pAppDomain,pThread,pEval) \ +#define ICorDebugManagedCallback_EvalException(This,pAppDomain,pThread,pEval) \ ( (This)->lpVtbl -> EvalException(This,pAppDomain,pThread,pEval) ) -#define ICorDebugManagedCallback_CreateProcess(This,pProcess) \ +#define ICorDebugManagedCallback_CreateProcess(This,pProcess) \ ( (This)->lpVtbl -> CreateProcess(This,pProcess) ) -#define ICorDebugManagedCallback_ExitProcess(This,pProcess) \ +#define ICorDebugManagedCallback_ExitProcess(This,pProcess) \ ( (This)->lpVtbl -> ExitProcess(This,pProcess) ) -#define ICorDebugManagedCallback_CreateThread(This,pAppDomain,thread) \ +#define ICorDebugManagedCallback_CreateThread(This,pAppDomain,thread) \ ( (This)->lpVtbl -> CreateThread(This,pAppDomain,thread) ) -#define ICorDebugManagedCallback_ExitThread(This,pAppDomain,thread) \ +#define ICorDebugManagedCallback_ExitThread(This,pAppDomain,thread) \ ( (This)->lpVtbl -> ExitThread(This,pAppDomain,thread) ) -#define ICorDebugManagedCallback_LoadModule(This,pAppDomain,pModule) \ +#define ICorDebugManagedCallback_LoadModule(This,pAppDomain,pModule) \ ( (This)->lpVtbl -> LoadModule(This,pAppDomain,pModule) ) -#define ICorDebugManagedCallback_UnloadModule(This,pAppDomain,pModule) \ +#define ICorDebugManagedCallback_UnloadModule(This,pAppDomain,pModule) \ ( (This)->lpVtbl -> UnloadModule(This,pAppDomain,pModule) ) -#define ICorDebugManagedCallback_LoadClass(This,pAppDomain,c) \ +#define ICorDebugManagedCallback_LoadClass(This,pAppDomain,c) \ ( (This)->lpVtbl -> LoadClass(This,pAppDomain,c) ) -#define ICorDebugManagedCallback_UnloadClass(This,pAppDomain,c) \ +#define ICorDebugManagedCallback_UnloadClass(This,pAppDomain,c) \ ( (This)->lpVtbl -> UnloadClass(This,pAppDomain,c) ) -#define ICorDebugManagedCallback_DebuggerError(This,pProcess,errorHR,errorCode) \ +#define ICorDebugManagedCallback_DebuggerError(This,pProcess,errorHR,errorCode) \ ( (This)->lpVtbl -> DebuggerError(This,pProcess,errorHR,errorCode) ) -#define ICorDebugManagedCallback_LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) \ +#define ICorDebugManagedCallback_LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) \ ( (This)->lpVtbl -> LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) ) -#define ICorDebugManagedCallback_LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) \ +#define ICorDebugManagedCallback_LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) \ ( (This)->lpVtbl -> LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) ) -#define ICorDebugManagedCallback_CreateAppDomain(This,pProcess,pAppDomain) \ +#define ICorDebugManagedCallback_CreateAppDomain(This,pProcess,pAppDomain) \ ( (This)->lpVtbl -> CreateAppDomain(This,pProcess,pAppDomain) ) -#define ICorDebugManagedCallback_ExitAppDomain(This,pProcess,pAppDomain) \ +#define ICorDebugManagedCallback_ExitAppDomain(This,pProcess,pAppDomain) \ ( (This)->lpVtbl -> ExitAppDomain(This,pProcess,pAppDomain) ) -#define ICorDebugManagedCallback_LoadAssembly(This,pAppDomain,pAssembly) \ +#define ICorDebugManagedCallback_LoadAssembly(This,pAppDomain,pAssembly) \ ( (This)->lpVtbl -> LoadAssembly(This,pAppDomain,pAssembly) ) -#define ICorDebugManagedCallback_UnloadAssembly(This,pAppDomain,pAssembly) \ +#define ICorDebugManagedCallback_UnloadAssembly(This,pAppDomain,pAssembly) \ ( (This)->lpVtbl -> UnloadAssembly(This,pAppDomain,pAssembly) ) -#define ICorDebugManagedCallback_ControlCTrap(This,pProcess) \ +#define ICorDebugManagedCallback_ControlCTrap(This,pProcess) \ ( (This)->lpVtbl -> ControlCTrap(This,pProcess) ) -#define ICorDebugManagedCallback_NameChange(This,pAppDomain,pThread) \ +#define ICorDebugManagedCallback_NameChange(This,pAppDomain,pThread) \ ( (This)->lpVtbl -> NameChange(This,pAppDomain,pThread) ) -#define ICorDebugManagedCallback_UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) \ +#define ICorDebugManagedCallback_UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) \ ( (This)->lpVtbl -> UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) ) -#define ICorDebugManagedCallback_EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) \ +#define ICorDebugManagedCallback_EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) \ ( (This)->lpVtbl -> EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) ) -#define ICorDebugManagedCallback_BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) \ +#define ICorDebugManagedCallback_BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) \ ( (This)->lpVtbl -> BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugManagedCallback_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugManagedCallback_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0016 */ @@ -3750,24 +3899,28 @@ EXTERN_C const IID IID_ICorDebugManagedCallback3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugManagedCallback3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugManagedCallback3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugManagedCallback3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugManagedCallback3 * This); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback3, CustomNotification) HRESULT ( STDMETHODCALLTYPE *CustomNotification )( ICorDebugManagedCallback3 * This, /* [in] */ ICorDebugThread *pThread, @@ -3786,28 +3939,28 @@ EXTERN_C const IID IID_ICorDebugManagedCallback3; #ifdef COBJMACROS -#define ICorDebugManagedCallback3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugManagedCallback3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugManagedCallback3_AddRef(This) \ +#define ICorDebugManagedCallback3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugManagedCallback3_Release(This) \ +#define ICorDebugManagedCallback3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugManagedCallback3_CustomNotification(This,pThread,pAppDomain) \ +#define ICorDebugManagedCallback3_CustomNotification(This,pThread,pAppDomain) \ ( (This)->lpVtbl -> CustomNotification(This,pThread,pAppDomain) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugManagedCallback3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugManagedCallback3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugManagedCallback4_INTERFACE_DEFINED__ @@ -3840,32 +3993,38 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugManagedCallback4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugManagedCallback4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugManagedCallback4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugManagedCallback4 * This); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback4, BeforeGarbageCollection) HRESULT ( STDMETHODCALLTYPE *BeforeGarbageCollection )( ICorDebugManagedCallback4 * This, /* [in] */ ICorDebugProcess *pProcess); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback4, AfterGarbageCollection) HRESULT ( STDMETHODCALLTYPE *AfterGarbageCollection )( ICorDebugManagedCallback4 * This, /* [in] */ ICorDebugProcess *pProcess); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback4, DataBreakpoint) HRESULT ( STDMETHODCALLTYPE *DataBreakpoint )( ICorDebugManagedCallback4 * This, /* [in] */ ICorDebugProcess *pProcess, @@ -3886,34 +4045,34 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4; #ifdef COBJMACROS -#define ICorDebugManagedCallback4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugManagedCallback4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugManagedCallback4_AddRef(This) \ +#define ICorDebugManagedCallback4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugManagedCallback4_Release(This) \ +#define ICorDebugManagedCallback4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugManagedCallback4_BeforeGarbageCollection(This,pProcess) \ +#define ICorDebugManagedCallback4_BeforeGarbageCollection(This,pProcess) \ ( (This)->lpVtbl -> BeforeGarbageCollection(This,pProcess) ) -#define ICorDebugManagedCallback4_AfterGarbageCollection(This,pProcess) \ +#define ICorDebugManagedCallback4_AfterGarbageCollection(This,pProcess) \ ( (This)->lpVtbl -> AfterGarbageCollection(This,pProcess) ) -#define ICorDebugManagedCallback4_DataBreakpoint(This,pProcess,pThread,pContext,contextSize) \ +#define ICorDebugManagedCallback4_DataBreakpoint(This,pProcess,pThread,pContext,contextSize) \ ( (This)->lpVtbl -> DataBreakpoint(This,pProcess,pThread,pContext,contextSize) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugManagedCallback4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugManagedCallback4_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0018 */ @@ -3934,25 +4093,25 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0018_v0_0_s_ifspec; typedef enum CorDebugExceptionCallbackType { - DEBUG_EXCEPTION_FIRST_CHANCE = 1, - DEBUG_EXCEPTION_USER_FIRST_CHANCE = 2, - DEBUG_EXCEPTION_CATCH_HANDLER_FOUND = 3, - DEBUG_EXCEPTION_UNHANDLED = 4 - } CorDebugExceptionCallbackType; + DEBUG_EXCEPTION_FIRST_CHANCE = 1, + DEBUG_EXCEPTION_USER_FIRST_CHANCE = 2, + DEBUG_EXCEPTION_CATCH_HANDLER_FOUND = 3, + DEBUG_EXCEPTION_UNHANDLED = 4 + } CorDebugExceptionCallbackType; typedef enum CorDebugExceptionFlags { - DEBUG_EXCEPTION_NONE = 0, - DEBUG_EXCEPTION_CAN_BE_INTERCEPTED = 0x1 - } CorDebugExceptionFlags; + DEBUG_EXCEPTION_NONE = 0, + DEBUG_EXCEPTION_CAN_BE_INTERCEPTED = 0x1 + } CorDebugExceptionFlags; typedef enum CorDebugExceptionUnwindCallbackType { - DEBUG_EXCEPTION_UNWIND_BEGIN = 1, - DEBUG_EXCEPTION_INTERCEPTED = 2 - } CorDebugExceptionUnwindCallbackType; + DEBUG_EXCEPTION_UNWIND_BEGIN = 1, + DEBUG_EXCEPTION_INTERCEPTED = 2 + } CorDebugExceptionUnwindCallbackType; EXTERN_C const IID IID_ICorDebugManagedCallback2; @@ -4010,24 +4169,28 @@ EXTERN_C const IID IID_ICorDebugManagedCallback2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugManagedCallback2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugManagedCallback2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugManagedCallback2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugManagedCallback2 * This); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback2, FunctionRemapOpportunity) HRESULT ( STDMETHODCALLTYPE *FunctionRemapOpportunity )( ICorDebugManagedCallback2 * This, /* [in] */ ICorDebugAppDomain *pAppDomain, @@ -4036,22 +4199,26 @@ EXTERN_C const IID IID_ICorDebugManagedCallback2; /* [in] */ ICorDebugFunction *pNewFunction, /* [in] */ ULONG32 oldILOffset); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback2, CreateConnection) HRESULT ( STDMETHODCALLTYPE *CreateConnection )( ICorDebugManagedCallback2 * This, /* [in] */ ICorDebugProcess *pProcess, /* [in] */ CONNID dwConnectionId, /* [in] */ WCHAR *pConnName); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback2, ChangeConnection) HRESULT ( STDMETHODCALLTYPE *ChangeConnection )( ICorDebugManagedCallback2 * This, /* [in] */ ICorDebugProcess *pProcess, /* [in] */ CONNID dwConnectionId); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback2, DestroyConnection) HRESULT ( STDMETHODCALLTYPE *DestroyConnection )( ICorDebugManagedCallback2 * This, /* [in] */ ICorDebugProcess *pProcess, /* [in] */ CONNID dwConnectionId); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback2, Exception) HRESULT ( STDMETHODCALLTYPE *Exception )( ICorDebugManagedCallback2 * This, /* [in] */ ICorDebugAppDomain *pAppDomain, @@ -4061,6 +4228,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback2; /* [in] */ CorDebugExceptionCallbackType dwEventType, /* [in] */ DWORD dwFlags); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback2, ExceptionUnwind) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwind )( ICorDebugManagedCallback2 * This, /* [in] */ ICorDebugAppDomain *pAppDomain, @@ -4068,12 +4236,14 @@ EXTERN_C const IID IID_ICorDebugManagedCallback2; /* [in] */ CorDebugExceptionUnwindCallbackType dwEventType, /* [in] */ DWORD dwFlags); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback2, FunctionRemapComplete) HRESULT ( STDMETHODCALLTYPE *FunctionRemapComplete )( ICorDebugManagedCallback2 * This, /* [in] */ ICorDebugAppDomain *pAppDomain, /* [in] */ ICorDebugThread *pThread, /* [in] */ ICorDebugFunction *pFunction); + DECLSPEC_XFGVIRT(ICorDebugManagedCallback2, MDANotification) HRESULT ( STDMETHODCALLTYPE *MDANotification )( ICorDebugManagedCallback2 * This, /* [in] */ ICorDebugController *pController, @@ -4093,49 +4263,49 @@ EXTERN_C const IID IID_ICorDebugManagedCallback2; #ifdef COBJMACROS -#define ICorDebugManagedCallback2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugManagedCallback2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugManagedCallback2_AddRef(This) \ +#define ICorDebugManagedCallback2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugManagedCallback2_Release(This) \ +#define ICorDebugManagedCallback2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugManagedCallback2_FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) \ +#define ICorDebugManagedCallback2_FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) \ ( (This)->lpVtbl -> FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) ) -#define ICorDebugManagedCallback2_CreateConnection(This,pProcess,dwConnectionId,pConnName) \ +#define ICorDebugManagedCallback2_CreateConnection(This,pProcess,dwConnectionId,pConnName) \ ( (This)->lpVtbl -> CreateConnection(This,pProcess,dwConnectionId,pConnName) ) -#define ICorDebugManagedCallback2_ChangeConnection(This,pProcess,dwConnectionId) \ +#define ICorDebugManagedCallback2_ChangeConnection(This,pProcess,dwConnectionId) \ ( (This)->lpVtbl -> ChangeConnection(This,pProcess,dwConnectionId) ) -#define ICorDebugManagedCallback2_DestroyConnection(This,pProcess,dwConnectionId) \ +#define ICorDebugManagedCallback2_DestroyConnection(This,pProcess,dwConnectionId) \ ( (This)->lpVtbl -> DestroyConnection(This,pProcess,dwConnectionId) ) -#define ICorDebugManagedCallback2_Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) \ +#define ICorDebugManagedCallback2_Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) \ ( (This)->lpVtbl -> Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) ) -#define ICorDebugManagedCallback2_ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) \ +#define ICorDebugManagedCallback2_ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) \ ( (This)->lpVtbl -> ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) ) -#define ICorDebugManagedCallback2_FunctionRemapComplete(This,pAppDomain,pThread,pFunction) \ +#define ICorDebugManagedCallback2_FunctionRemapComplete(This,pAppDomain,pThread,pFunction) \ ( (This)->lpVtbl -> FunctionRemapComplete(This,pAppDomain,pThread,pFunction) ) -#define ICorDebugManagedCallback2_MDANotification(This,pController,pThread,pMDA) \ +#define ICorDebugManagedCallback2_MDANotification(This,pController,pThread,pMDA) \ ( (This)->lpVtbl -> MDANotification(This,pController,pThread,pMDA) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugManagedCallback2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugManagedCallback2_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0019 */ @@ -4169,24 +4339,28 @@ EXTERN_C const IID IID_ICorDebugUnmanagedCallback; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugUnmanagedCallbackVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugUnmanagedCallback * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugUnmanagedCallback * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugUnmanagedCallback * This); + DECLSPEC_XFGVIRT(ICorDebugUnmanagedCallback, DebugEvent) HRESULT ( STDMETHODCALLTYPE *DebugEvent )( ICorDebugUnmanagedCallback * This, /* [in] */ LPDEBUG_EVENT pDebugEvent, @@ -4205,28 +4379,28 @@ EXTERN_C const IID IID_ICorDebugUnmanagedCallback; #ifdef COBJMACROS -#define ICorDebugUnmanagedCallback_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugUnmanagedCallback_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugUnmanagedCallback_AddRef(This) \ +#define ICorDebugUnmanagedCallback_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugUnmanagedCallback_Release(This) \ +#define ICorDebugUnmanagedCallback_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugUnmanagedCallback_DebugEvent(This,pDebugEvent,fOutOfBand) \ +#define ICorDebugUnmanagedCallback_DebugEvent(This,pDebugEvent,fOutOfBand) \ ( (This)->lpVtbl -> DebugEvent(This,pDebugEvent,fOutOfBand) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugUnmanagedCallback_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugUnmanagedCallback_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0020 */ @@ -4235,16 +4409,16 @@ EXTERN_C const IID IID_ICorDebugUnmanagedCallback; typedef enum CorDebugCreateProcessFlags { - DEBUG_NO_SPECIAL_OPTIONS = 0 - } CorDebugCreateProcessFlags; + DEBUG_NO_SPECIAL_OPTIONS = 0 + } CorDebugCreateProcessFlags; typedef enum CorDebugHandleType { - HANDLE_STRONG = 1, - HANDLE_WEAK_TRACK_RESURRECTION = 2, - HANDLE_PINNED = 3 - } CorDebugHandleType; + HANDLE_STRONG = 1, + HANDLE_WEAK_TRACK_RESURRECTION = 2, + HANDLE_PINNED = 3 + } CorDebugHandleType; #pragma warning(push) #pragma warning(disable:28718) @@ -4311,38 +4485,46 @@ EXTERN_C const IID IID_ICorDebug; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebug * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebug * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebug * This); + DECLSPEC_XFGVIRT(ICorDebug, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorDebug * This); + DECLSPEC_XFGVIRT(ICorDebug, Terminate) HRESULT ( STDMETHODCALLTYPE *Terminate )( ICorDebug * This); + DECLSPEC_XFGVIRT(ICorDebug, SetManagedHandler) HRESULT ( STDMETHODCALLTYPE *SetManagedHandler )( ICorDebug * This, /* [in] */ ICorDebugManagedCallback *pCallback); + DECLSPEC_XFGVIRT(ICorDebug, SetUnmanagedHandler) HRESULT ( STDMETHODCALLTYPE *SetUnmanagedHandler )( ICorDebug * This, /* [in] */ ICorDebugUnmanagedCallback *pCallback); + DECLSPEC_XFGVIRT(ICorDebug, CreateProcess) HRESULT ( STDMETHODCALLTYPE *CreateProcess )( ICorDebug * This, /* [in] */ LPCWSTR lpApplicationName, @@ -4358,21 +4540,25 @@ EXTERN_C const IID IID_ICorDebug; /* [in] */ CorDebugCreateProcessFlags debuggingFlags, /* [out] */ ICorDebugProcess **ppProcess); + DECLSPEC_XFGVIRT(ICorDebug, DebugActiveProcess) HRESULT ( STDMETHODCALLTYPE *DebugActiveProcess )( ICorDebug * This, /* [in] */ DWORD id, /* [in] */ BOOL win32Attach, /* [out] */ ICorDebugProcess **ppProcess); + DECLSPEC_XFGVIRT(ICorDebug, EnumerateProcesses) HRESULT ( STDMETHODCALLTYPE *EnumerateProcesses )( ICorDebug * This, /* [out] */ ICorDebugProcessEnum **ppProcess); + DECLSPEC_XFGVIRT(ICorDebug, GetProcess) HRESULT ( STDMETHODCALLTYPE *GetProcess )( ICorDebug * This, /* [in] */ DWORD dwProcessId, /* [out] */ ICorDebugProcess **ppProcess); + DECLSPEC_XFGVIRT(ICorDebug, CanLaunchOrAttach) HRESULT ( STDMETHODCALLTYPE *CanLaunchOrAttach )( ICorDebug * This, /* [in] */ DWORD dwProcessId, @@ -4391,52 +4577,52 @@ EXTERN_C const IID IID_ICorDebug; #ifdef COBJMACROS -#define ICorDebug_QueryInterface(This,riid,ppvObject) \ +#define ICorDebug_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebug_AddRef(This) \ +#define ICorDebug_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebug_Release(This) \ +#define ICorDebug_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebug_Initialize(This) \ +#define ICorDebug_Initialize(This) \ ( (This)->lpVtbl -> Initialize(This) ) -#define ICorDebug_Terminate(This) \ +#define ICorDebug_Terminate(This) \ ( (This)->lpVtbl -> Terminate(This) ) -#define ICorDebug_SetManagedHandler(This,pCallback) \ +#define ICorDebug_SetManagedHandler(This,pCallback) \ ( (This)->lpVtbl -> SetManagedHandler(This,pCallback) ) -#define ICorDebug_SetUnmanagedHandler(This,pCallback) \ +#define ICorDebug_SetUnmanagedHandler(This,pCallback) \ ( (This)->lpVtbl -> SetUnmanagedHandler(This,pCallback) ) -#define ICorDebug_CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \ +#define ICorDebug_CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \ ( (This)->lpVtbl -> CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) ) -#define ICorDebug_DebugActiveProcess(This,id,win32Attach,ppProcess) \ +#define ICorDebug_DebugActiveProcess(This,id,win32Attach,ppProcess) \ ( (This)->lpVtbl -> DebugActiveProcess(This,id,win32Attach,ppProcess) ) -#define ICorDebug_EnumerateProcesses(This,ppProcess) \ +#define ICorDebug_EnumerateProcesses(This,ppProcess) \ ( (This)->lpVtbl -> EnumerateProcesses(This,ppProcess) ) -#define ICorDebug_GetProcess(This,dwProcessId,ppProcess) \ +#define ICorDebug_GetProcess(This,dwProcessId,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,dwProcessId,ppProcess) ) -#define ICorDebug_CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) \ +#define ICorDebug_CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) \ ( (This)->lpVtbl -> CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebug_INTERFACE_DEFINED__ */ +#endif /* __ICorDebug_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0021 */ @@ -4473,24 +4659,28 @@ EXTERN_C const IID IID_ICorDebugRemoteTarget; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRemoteTargetVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugRemoteTarget * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugRemoteTarget * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugRemoteTarget * This); + DECLSPEC_XFGVIRT(ICorDebugRemoteTarget, GetHostName) HRESULT ( STDMETHODCALLTYPE *GetHostName )( ICorDebugRemoteTarget * This, /* [in] */ ULONG32 cchHostName, @@ -4512,28 +4702,28 @@ EXTERN_C const IID IID_ICorDebugRemoteTarget; #ifdef COBJMACROS -#define ICorDebugRemoteTarget_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRemoteTarget_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRemoteTarget_AddRef(This) \ +#define ICorDebugRemoteTarget_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRemoteTarget_Release(This) \ +#define ICorDebugRemoteTarget_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRemoteTarget_GetHostName(This,cchHostName,pcchHostName,szHostName) \ +#define ICorDebugRemoteTarget_GetHostName(This,cchHostName,pcchHostName,szHostName) \ ( (This)->lpVtbl -> GetHostName(This,cchHostName,pcchHostName,szHostName) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRemoteTarget_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRemoteTarget_INTERFACE_DEFINED__ */ #ifndef __ICorDebugRemote_INTERFACE_DEFINED__ @@ -4576,24 +4766,28 @@ EXTERN_C const IID IID_ICorDebugRemote; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRemoteVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugRemote * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugRemote * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugRemote * This); + DECLSPEC_XFGVIRT(ICorDebugRemote, CreateProcessEx) HRESULT ( STDMETHODCALLTYPE *CreateProcessEx )( ICorDebugRemote * This, /* [in] */ ICorDebugRemoteTarget *pRemoteTarget, @@ -4611,6 +4805,7 @@ EXTERN_C const IID IID_ICorDebugRemote; /* [in] */ CorDebugCreateProcessFlags debuggingFlags, /* [out] */ ICorDebugProcess **ppProcess); + DECLSPEC_XFGVIRT(ICorDebugRemote, DebugActiveProcessEx) HRESULT ( STDMETHODCALLTYPE *DebugActiveProcessEx )( ICorDebugRemote * This, /* [in] */ ICorDebugRemoteTarget *pRemoteTarget, @@ -4631,31 +4826,31 @@ EXTERN_C const IID IID_ICorDebugRemote; #ifdef COBJMACROS -#define ICorDebugRemote_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRemote_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRemote_AddRef(This) \ +#define ICorDebugRemote_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRemote_Release(This) \ +#define ICorDebugRemote_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRemote_CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \ +#define ICorDebugRemote_CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \ ( (This)->lpVtbl -> CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) ) -#define ICorDebugRemote_DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) \ +#define ICorDebugRemote_DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) \ ( (This)->lpVtbl -> DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRemote_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRemote_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0023 */ @@ -4667,7 +4862,7 @@ typedef struct _COR_VERSION DWORD dwMinor; DWORD dwBuild; DWORD dwSubBuild; - } COR_VERSION; + } COR_VERSION; @@ -4683,92 +4878,92 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0023_v0_0_s_ifspec; typedef enum CorDebugInterfaceVersion { - CorDebugInvalidVersion = 0, - CorDebugVersion_1_0 = ( CorDebugInvalidVersion + 1 ) , - ver_ICorDebugManagedCallback = CorDebugVersion_1_0, - ver_ICorDebugUnmanagedCallback = CorDebugVersion_1_0, - ver_ICorDebug = CorDebugVersion_1_0, - ver_ICorDebugController = CorDebugVersion_1_0, - ver_ICorDebugAppDomain = CorDebugVersion_1_0, - ver_ICorDebugAssembly = CorDebugVersion_1_0, - ver_ICorDebugProcess = CorDebugVersion_1_0, - ver_ICorDebugBreakpoint = CorDebugVersion_1_0, - ver_ICorDebugFunctionBreakpoint = CorDebugVersion_1_0, - ver_ICorDebugModuleBreakpoint = CorDebugVersion_1_0, - ver_ICorDebugValueBreakpoint = CorDebugVersion_1_0, - ver_ICorDebugStepper = CorDebugVersion_1_0, - ver_ICorDebugRegisterSet = CorDebugVersion_1_0, - ver_ICorDebugThread = CorDebugVersion_1_0, - ver_ICorDebugChain = CorDebugVersion_1_0, - ver_ICorDebugFrame = CorDebugVersion_1_0, - ver_ICorDebugILFrame = CorDebugVersion_1_0, - ver_ICorDebugNativeFrame = CorDebugVersion_1_0, - ver_ICorDebugModule = CorDebugVersion_1_0, - ver_ICorDebugFunction = CorDebugVersion_1_0, - ver_ICorDebugCode = CorDebugVersion_1_0, - ver_ICorDebugClass = CorDebugVersion_1_0, - ver_ICorDebugEval = CorDebugVersion_1_0, - ver_ICorDebugValue = CorDebugVersion_1_0, - ver_ICorDebugGenericValue = CorDebugVersion_1_0, - ver_ICorDebugReferenceValue = CorDebugVersion_1_0, - ver_ICorDebugHeapValue = CorDebugVersion_1_0, - ver_ICorDebugObjectValue = CorDebugVersion_1_0, - ver_ICorDebugBoxValue = CorDebugVersion_1_0, - ver_ICorDebugStringValue = CorDebugVersion_1_0, - ver_ICorDebugArrayValue = CorDebugVersion_1_0, - ver_ICorDebugContext = CorDebugVersion_1_0, - ver_ICorDebugEnum = CorDebugVersion_1_0, - ver_ICorDebugObjectEnum = CorDebugVersion_1_0, - ver_ICorDebugBreakpointEnum = CorDebugVersion_1_0, - ver_ICorDebugStepperEnum = CorDebugVersion_1_0, - ver_ICorDebugProcessEnum = CorDebugVersion_1_0, - ver_ICorDebugThreadEnum = CorDebugVersion_1_0, - ver_ICorDebugFrameEnum = CorDebugVersion_1_0, - ver_ICorDebugChainEnum = CorDebugVersion_1_0, - ver_ICorDebugModuleEnum = CorDebugVersion_1_0, - ver_ICorDebugValueEnum = CorDebugVersion_1_0, - ver_ICorDebugCodeEnum = CorDebugVersion_1_0, - ver_ICorDebugTypeEnum = CorDebugVersion_1_0, - ver_ICorDebugErrorInfoEnum = CorDebugVersion_1_0, - ver_ICorDebugAppDomainEnum = CorDebugVersion_1_0, - ver_ICorDebugAssemblyEnum = CorDebugVersion_1_0, - ver_ICorDebugEditAndContinueErrorInfo = CorDebugVersion_1_0, - ver_ICorDebugEditAndContinueSnapshot = CorDebugVersion_1_0, - CorDebugVersion_1_1 = ( CorDebugVersion_1_0 + 1 ) , - CorDebugVersion_2_0 = ( CorDebugVersion_1_1 + 1 ) , - ver_ICorDebugManagedCallback2 = CorDebugVersion_2_0, - ver_ICorDebugAppDomain2 = CorDebugVersion_2_0, - ver_ICorDebugAssembly2 = CorDebugVersion_2_0, - ver_ICorDebugProcess2 = CorDebugVersion_2_0, - ver_ICorDebugStepper2 = CorDebugVersion_2_0, - ver_ICorDebugRegisterSet2 = CorDebugVersion_2_0, - ver_ICorDebugThread2 = CorDebugVersion_2_0, - ver_ICorDebugILFrame2 = CorDebugVersion_2_0, - ver_ICorDebugInternalFrame = CorDebugVersion_2_0, - ver_ICorDebugModule2 = CorDebugVersion_2_0, - ver_ICorDebugFunction2 = CorDebugVersion_2_0, - ver_ICorDebugCode2 = CorDebugVersion_2_0, - ver_ICorDebugClass2 = CorDebugVersion_2_0, - ver_ICorDebugValue2 = CorDebugVersion_2_0, - ver_ICorDebugEval2 = CorDebugVersion_2_0, - ver_ICorDebugObjectValue2 = CorDebugVersion_2_0, - CorDebugVersion_4_0 = ( CorDebugVersion_2_0 + 1 ) , - ver_ICorDebugThread3 = CorDebugVersion_4_0, - ver_ICorDebugThread4 = CorDebugVersion_4_0, - ver_ICorDebugStackWalk = CorDebugVersion_4_0, - ver_ICorDebugNativeFrame2 = CorDebugVersion_4_0, - ver_ICorDebugInternalFrame2 = CorDebugVersion_4_0, - ver_ICorDebugRuntimeUnwindableFrame = CorDebugVersion_4_0, - ver_ICorDebugHeapValue3 = CorDebugVersion_4_0, - ver_ICorDebugBlockingObjectEnum = CorDebugVersion_4_0, - ver_ICorDebugValue3 = CorDebugVersion_4_0, - CorDebugVersion_4_5 = ( CorDebugVersion_4_0 + 1 ) , - ver_ICorDebugComObjectValue = CorDebugVersion_4_5, - ver_ICorDebugAppDomain3 = CorDebugVersion_4_5, - ver_ICorDebugCode3 = CorDebugVersion_4_5, - ver_ICorDebugILFrame3 = CorDebugVersion_4_5, - CorDebugLatestVersion = CorDebugVersion_4_5 - } CorDebugInterfaceVersion; + CorDebugInvalidVersion = 0, + CorDebugVersion_1_0 = ( CorDebugInvalidVersion + 1 ) , + ver_ICorDebugManagedCallback = CorDebugVersion_1_0, + ver_ICorDebugUnmanagedCallback = CorDebugVersion_1_0, + ver_ICorDebug = CorDebugVersion_1_0, + ver_ICorDebugController = CorDebugVersion_1_0, + ver_ICorDebugAppDomain = CorDebugVersion_1_0, + ver_ICorDebugAssembly = CorDebugVersion_1_0, + ver_ICorDebugProcess = CorDebugVersion_1_0, + ver_ICorDebugBreakpoint = CorDebugVersion_1_0, + ver_ICorDebugFunctionBreakpoint = CorDebugVersion_1_0, + ver_ICorDebugModuleBreakpoint = CorDebugVersion_1_0, + ver_ICorDebugValueBreakpoint = CorDebugVersion_1_0, + ver_ICorDebugStepper = CorDebugVersion_1_0, + ver_ICorDebugRegisterSet = CorDebugVersion_1_0, + ver_ICorDebugThread = CorDebugVersion_1_0, + ver_ICorDebugChain = CorDebugVersion_1_0, + ver_ICorDebugFrame = CorDebugVersion_1_0, + ver_ICorDebugILFrame = CorDebugVersion_1_0, + ver_ICorDebugNativeFrame = CorDebugVersion_1_0, + ver_ICorDebugModule = CorDebugVersion_1_0, + ver_ICorDebugFunction = CorDebugVersion_1_0, + ver_ICorDebugCode = CorDebugVersion_1_0, + ver_ICorDebugClass = CorDebugVersion_1_0, + ver_ICorDebugEval = CorDebugVersion_1_0, + ver_ICorDebugValue = CorDebugVersion_1_0, + ver_ICorDebugGenericValue = CorDebugVersion_1_0, + ver_ICorDebugReferenceValue = CorDebugVersion_1_0, + ver_ICorDebugHeapValue = CorDebugVersion_1_0, + ver_ICorDebugObjectValue = CorDebugVersion_1_0, + ver_ICorDebugBoxValue = CorDebugVersion_1_0, + ver_ICorDebugStringValue = CorDebugVersion_1_0, + ver_ICorDebugArrayValue = CorDebugVersion_1_0, + ver_ICorDebugContext = CorDebugVersion_1_0, + ver_ICorDebugEnum = CorDebugVersion_1_0, + ver_ICorDebugObjectEnum = CorDebugVersion_1_0, + ver_ICorDebugBreakpointEnum = CorDebugVersion_1_0, + ver_ICorDebugStepperEnum = CorDebugVersion_1_0, + ver_ICorDebugProcessEnum = CorDebugVersion_1_0, + ver_ICorDebugThreadEnum = CorDebugVersion_1_0, + ver_ICorDebugFrameEnum = CorDebugVersion_1_0, + ver_ICorDebugChainEnum = CorDebugVersion_1_0, + ver_ICorDebugModuleEnum = CorDebugVersion_1_0, + ver_ICorDebugValueEnum = CorDebugVersion_1_0, + ver_ICorDebugCodeEnum = CorDebugVersion_1_0, + ver_ICorDebugTypeEnum = CorDebugVersion_1_0, + ver_ICorDebugErrorInfoEnum = CorDebugVersion_1_0, + ver_ICorDebugAppDomainEnum = CorDebugVersion_1_0, + ver_ICorDebugAssemblyEnum = CorDebugVersion_1_0, + ver_ICorDebugEditAndContinueErrorInfo = CorDebugVersion_1_0, + ver_ICorDebugEditAndContinueSnapshot = CorDebugVersion_1_0, + CorDebugVersion_1_1 = ( CorDebugVersion_1_0 + 1 ) , + CorDebugVersion_2_0 = ( CorDebugVersion_1_1 + 1 ) , + ver_ICorDebugManagedCallback2 = CorDebugVersion_2_0, + ver_ICorDebugAppDomain2 = CorDebugVersion_2_0, + ver_ICorDebugAssembly2 = CorDebugVersion_2_0, + ver_ICorDebugProcess2 = CorDebugVersion_2_0, + ver_ICorDebugStepper2 = CorDebugVersion_2_0, + ver_ICorDebugRegisterSet2 = CorDebugVersion_2_0, + ver_ICorDebugThread2 = CorDebugVersion_2_0, + ver_ICorDebugILFrame2 = CorDebugVersion_2_0, + ver_ICorDebugInternalFrame = CorDebugVersion_2_0, + ver_ICorDebugModule2 = CorDebugVersion_2_0, + ver_ICorDebugFunction2 = CorDebugVersion_2_0, + ver_ICorDebugCode2 = CorDebugVersion_2_0, + ver_ICorDebugClass2 = CorDebugVersion_2_0, + ver_ICorDebugValue2 = CorDebugVersion_2_0, + ver_ICorDebugEval2 = CorDebugVersion_2_0, + ver_ICorDebugObjectValue2 = CorDebugVersion_2_0, + CorDebugVersion_4_0 = ( CorDebugVersion_2_0 + 1 ) , + ver_ICorDebugThread3 = CorDebugVersion_4_0, + ver_ICorDebugThread4 = CorDebugVersion_4_0, + ver_ICorDebugStackWalk = CorDebugVersion_4_0, + ver_ICorDebugNativeFrame2 = CorDebugVersion_4_0, + ver_ICorDebugInternalFrame2 = CorDebugVersion_4_0, + ver_ICorDebugRuntimeUnwindableFrame = CorDebugVersion_4_0, + ver_ICorDebugHeapValue3 = CorDebugVersion_4_0, + ver_ICorDebugBlockingObjectEnum = CorDebugVersion_4_0, + ver_ICorDebugValue3 = CorDebugVersion_4_0, + CorDebugVersion_4_5 = ( CorDebugVersion_4_0 + 1 ) , + ver_ICorDebugComObjectValue = CorDebugVersion_4_5, + ver_ICorDebugAppDomain3 = CorDebugVersion_4_5, + ver_ICorDebugCode3 = CorDebugVersion_4_5, + ver_ICorDebugILFrame3 = CorDebugVersion_4_5, + CorDebugLatestVersion = CorDebugVersion_4_5 + } CorDebugInterfaceVersion; EXTERN_C const IID IID_ICorDebug2; @@ -4782,21 +4977,24 @@ EXTERN_C const IID IID_ICorDebug2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebug2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebug2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebug2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebug2 * This); @@ -4813,25 +5011,25 @@ EXTERN_C const IID IID_ICorDebug2; #ifdef COBJMACROS -#define ICorDebug2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebug2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebug2_AddRef(This) \ +#define ICorDebug2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebug2_Release(This) \ +#define ICorDebug2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebug2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebug2_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0024 */ @@ -4840,9 +5038,9 @@ EXTERN_C const IID IID_ICorDebug2; typedef enum CorDebugThreadState { - THREAD_RUN = 0, - THREAD_SUSPEND = ( THREAD_RUN + 1 ) - } CorDebugThreadState; + THREAD_RUN = 0, + THREAD_SUSPEND = ( THREAD_RUN + 1 ) + } CorDebugThreadState; @@ -4902,63 +5100,76 @@ EXTERN_C const IID IID_ICorDebugController; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugControllerVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugController * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugController * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugController * This); + DECLSPEC_XFGVIRT(ICorDebugController, Stop) HRESULT ( STDMETHODCALLTYPE *Stop )( ICorDebugController * This, /* [in] */ DWORD dwTimeoutIgnored); + DECLSPEC_XFGVIRT(ICorDebugController, Continue) HRESULT ( STDMETHODCALLTYPE *Continue )( ICorDebugController * This, /* [in] */ BOOL fIsOutOfBand); + DECLSPEC_XFGVIRT(ICorDebugController, IsRunning) HRESULT ( STDMETHODCALLTYPE *IsRunning )( ICorDebugController * This, /* [out] */ BOOL *pbRunning); + DECLSPEC_XFGVIRT(ICorDebugController, HasQueuedCallbacks) HRESULT ( STDMETHODCALLTYPE *HasQueuedCallbacks )( ICorDebugController * This, /* [in] */ ICorDebugThread *pThread, /* [out] */ BOOL *pbQueued); + DECLSPEC_XFGVIRT(ICorDebugController, EnumerateThreads) HRESULT ( STDMETHODCALLTYPE *EnumerateThreads )( ICorDebugController * This, /* [out] */ ICorDebugThreadEnum **ppThreads); + DECLSPEC_XFGVIRT(ICorDebugController, SetAllThreadsDebugState) HRESULT ( STDMETHODCALLTYPE *SetAllThreadsDebugState )( ICorDebugController * This, /* [in] */ CorDebugThreadState state, /* [in] */ ICorDebugThread *pExceptThisThread); + DECLSPEC_XFGVIRT(ICorDebugController, Detach) HRESULT ( STDMETHODCALLTYPE *Detach )( ICorDebugController * This); + DECLSPEC_XFGVIRT(ICorDebugController, Terminate) HRESULT ( STDMETHODCALLTYPE *Terminate )( ICorDebugController * This, /* [in] */ UINT exitCode); + DECLSPEC_XFGVIRT(ICorDebugController, CanCommitChanges) HRESULT ( STDMETHODCALLTYPE *CanCommitChanges )( ICorDebugController * This, /* [in] */ ULONG cSnapshots, /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[ ], /* [out] */ ICorDebugErrorInfoEnum **pError); + DECLSPEC_XFGVIRT(ICorDebugController, CommitChanges) HRESULT ( STDMETHODCALLTYPE *CommitChanges )( ICorDebugController * This, /* [in] */ ULONG cSnapshots, @@ -4978,55 +5189,55 @@ EXTERN_C const IID IID_ICorDebugController; #ifdef COBJMACROS -#define ICorDebugController_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugController_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugController_AddRef(This) \ +#define ICorDebugController_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugController_Release(This) \ +#define ICorDebugController_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugController_Stop(This,dwTimeoutIgnored) \ +#define ICorDebugController_Stop(This,dwTimeoutIgnored) \ ( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) ) -#define ICorDebugController_Continue(This,fIsOutOfBand) \ +#define ICorDebugController_Continue(This,fIsOutOfBand) \ ( (This)->lpVtbl -> Continue(This,fIsOutOfBand) ) -#define ICorDebugController_IsRunning(This,pbRunning) \ +#define ICorDebugController_IsRunning(This,pbRunning) \ ( (This)->lpVtbl -> IsRunning(This,pbRunning) ) -#define ICorDebugController_HasQueuedCallbacks(This,pThread,pbQueued) \ +#define ICorDebugController_HasQueuedCallbacks(This,pThread,pbQueued) \ ( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) ) -#define ICorDebugController_EnumerateThreads(This,ppThreads) \ +#define ICorDebugController_EnumerateThreads(This,ppThreads) \ ( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) ) -#define ICorDebugController_SetAllThreadsDebugState(This,state,pExceptThisThread) \ +#define ICorDebugController_SetAllThreadsDebugState(This,state,pExceptThisThread) \ ( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) ) -#define ICorDebugController_Detach(This) \ +#define ICorDebugController_Detach(This) \ ( (This)->lpVtbl -> Detach(This) ) -#define ICorDebugController_Terminate(This,exitCode) \ +#define ICorDebugController_Terminate(This,exitCode) \ ( (This)->lpVtbl -> Terminate(This,exitCode) ) -#define ICorDebugController_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugController_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugController_CommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugController_CommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugController_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugController_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0025 */ @@ -5089,107 +5300,130 @@ EXTERN_C const IID IID_ICorDebugAppDomain; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomainVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugAppDomain * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugAppDomain * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAppDomain * This); + DECLSPEC_XFGVIRT(ICorDebugController, Stop) HRESULT ( STDMETHODCALLTYPE *Stop )( ICorDebugAppDomain * This, /* [in] */ DWORD dwTimeoutIgnored); + DECLSPEC_XFGVIRT(ICorDebugController, Continue) HRESULT ( STDMETHODCALLTYPE *Continue )( ICorDebugAppDomain * This, /* [in] */ BOOL fIsOutOfBand); + DECLSPEC_XFGVIRT(ICorDebugController, IsRunning) HRESULT ( STDMETHODCALLTYPE *IsRunning )( ICorDebugAppDomain * This, /* [out] */ BOOL *pbRunning); + DECLSPEC_XFGVIRT(ICorDebugController, HasQueuedCallbacks) HRESULT ( STDMETHODCALLTYPE *HasQueuedCallbacks )( ICorDebugAppDomain * This, /* [in] */ ICorDebugThread *pThread, /* [out] */ BOOL *pbQueued); + DECLSPEC_XFGVIRT(ICorDebugController, EnumerateThreads) HRESULT ( STDMETHODCALLTYPE *EnumerateThreads )( ICorDebugAppDomain * This, /* [out] */ ICorDebugThreadEnum **ppThreads); + DECLSPEC_XFGVIRT(ICorDebugController, SetAllThreadsDebugState) HRESULT ( STDMETHODCALLTYPE *SetAllThreadsDebugState )( ICorDebugAppDomain * This, /* [in] */ CorDebugThreadState state, /* [in] */ ICorDebugThread *pExceptThisThread); + DECLSPEC_XFGVIRT(ICorDebugController, Detach) HRESULT ( STDMETHODCALLTYPE *Detach )( ICorDebugAppDomain * This); + DECLSPEC_XFGVIRT(ICorDebugController, Terminate) HRESULT ( STDMETHODCALLTYPE *Terminate )( ICorDebugAppDomain * This, /* [in] */ UINT exitCode); + DECLSPEC_XFGVIRT(ICorDebugController, CanCommitChanges) HRESULT ( STDMETHODCALLTYPE *CanCommitChanges )( ICorDebugAppDomain * This, /* [in] */ ULONG cSnapshots, /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[ ], /* [out] */ ICorDebugErrorInfoEnum **pError); + DECLSPEC_XFGVIRT(ICorDebugController, CommitChanges) HRESULT ( STDMETHODCALLTYPE *CommitChanges )( ICorDebugAppDomain * This, /* [in] */ ULONG cSnapshots, /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[ ], /* [out] */ ICorDebugErrorInfoEnum **pError); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, GetProcess) HRESULT ( STDMETHODCALLTYPE *GetProcess )( ICorDebugAppDomain * This, /* [out] */ ICorDebugProcess **ppProcess); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, EnumerateAssemblies) HRESULT ( STDMETHODCALLTYPE *EnumerateAssemblies )( ICorDebugAppDomain * This, /* [out] */ ICorDebugAssemblyEnum **ppAssemblies); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, GetModuleFromMetaDataInterface) HRESULT ( STDMETHODCALLTYPE *GetModuleFromMetaDataInterface )( ICorDebugAppDomain * This, /* [in] */ IUnknown *pIMetaData, /* [out] */ ICorDebugModule **ppModule); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, EnumerateBreakpoints) HRESULT ( STDMETHODCALLTYPE *EnumerateBreakpoints )( ICorDebugAppDomain * This, /* [out] */ ICorDebugBreakpointEnum **ppBreakpoints); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, EnumerateSteppers) HRESULT ( STDMETHODCALLTYPE *EnumerateSteppers )( ICorDebugAppDomain * This, /* [out] */ ICorDebugStepperEnum **ppSteppers); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, IsAttached) HRESULT ( STDMETHODCALLTYPE *IsAttached )( ICorDebugAppDomain * This, /* [out] */ BOOL *pbAttached); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, GetName) HRESULT ( STDMETHODCALLTYPE *GetName )( ICorDebugAppDomain * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, GetObject) HRESULT ( STDMETHODCALLTYPE *GetObject )( ICorDebugAppDomain * This, /* [out] */ ICorDebugValue **ppObject); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, Attach) HRESULT ( STDMETHODCALLTYPE *Attach )( ICorDebugAppDomain * This); + DECLSPEC_XFGVIRT(ICorDebugAppDomain, GetID) HRESULT ( STDMETHODCALLTYPE *GetID )( ICorDebugAppDomain * This, /* [out] */ ULONG32 *pId); @@ -5207,86 +5441,86 @@ EXTERN_C const IID IID_ICorDebugAppDomain; #ifdef COBJMACROS -#define ICorDebugAppDomain_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomain_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomain_AddRef(This) \ +#define ICorDebugAppDomain_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomain_Release(This) \ +#define ICorDebugAppDomain_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomain_Stop(This,dwTimeoutIgnored) \ +#define ICorDebugAppDomain_Stop(This,dwTimeoutIgnored) \ ( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) ) -#define ICorDebugAppDomain_Continue(This,fIsOutOfBand) \ +#define ICorDebugAppDomain_Continue(This,fIsOutOfBand) \ ( (This)->lpVtbl -> Continue(This,fIsOutOfBand) ) -#define ICorDebugAppDomain_IsRunning(This,pbRunning) \ +#define ICorDebugAppDomain_IsRunning(This,pbRunning) \ ( (This)->lpVtbl -> IsRunning(This,pbRunning) ) -#define ICorDebugAppDomain_HasQueuedCallbacks(This,pThread,pbQueued) \ +#define ICorDebugAppDomain_HasQueuedCallbacks(This,pThread,pbQueued) \ ( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) ) -#define ICorDebugAppDomain_EnumerateThreads(This,ppThreads) \ +#define ICorDebugAppDomain_EnumerateThreads(This,ppThreads) \ ( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) ) -#define ICorDebugAppDomain_SetAllThreadsDebugState(This,state,pExceptThisThread) \ +#define ICorDebugAppDomain_SetAllThreadsDebugState(This,state,pExceptThisThread) \ ( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) ) -#define ICorDebugAppDomain_Detach(This) \ +#define ICorDebugAppDomain_Detach(This) \ ( (This)->lpVtbl -> Detach(This) ) -#define ICorDebugAppDomain_Terminate(This,exitCode) \ +#define ICorDebugAppDomain_Terminate(This,exitCode) \ ( (This)->lpVtbl -> Terminate(This,exitCode) ) -#define ICorDebugAppDomain_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugAppDomain_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugAppDomain_CommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugAppDomain_CommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugAppDomain_GetProcess(This,ppProcess) \ +#define ICorDebugAppDomain_GetProcess(This,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,ppProcess) ) -#define ICorDebugAppDomain_EnumerateAssemblies(This,ppAssemblies) \ +#define ICorDebugAppDomain_EnumerateAssemblies(This,ppAssemblies) \ ( (This)->lpVtbl -> EnumerateAssemblies(This,ppAssemblies) ) -#define ICorDebugAppDomain_GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) \ +#define ICorDebugAppDomain_GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) \ ( (This)->lpVtbl -> GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) ) -#define ICorDebugAppDomain_EnumerateBreakpoints(This,ppBreakpoints) \ +#define ICorDebugAppDomain_EnumerateBreakpoints(This,ppBreakpoints) \ ( (This)->lpVtbl -> EnumerateBreakpoints(This,ppBreakpoints) ) -#define ICorDebugAppDomain_EnumerateSteppers(This,ppSteppers) \ +#define ICorDebugAppDomain_EnumerateSteppers(This,ppSteppers) \ ( (This)->lpVtbl -> EnumerateSteppers(This,ppSteppers) ) -#define ICorDebugAppDomain_IsAttached(This,pbAttached) \ +#define ICorDebugAppDomain_IsAttached(This,pbAttached) \ ( (This)->lpVtbl -> IsAttached(This,pbAttached) ) -#define ICorDebugAppDomain_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugAppDomain_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugAppDomain_GetObject(This,ppObject) \ +#define ICorDebugAppDomain_GetObject(This,ppObject) \ ( (This)->lpVtbl -> GetObject(This,ppObject) ) -#define ICorDebugAppDomain_Attach(This) \ +#define ICorDebugAppDomain_Attach(This) \ ( (This)->lpVtbl -> Attach(This) ) -#define ICorDebugAppDomain_GetID(This,pId) \ +#define ICorDebugAppDomain_GetID(This,pId) \ ( (This)->lpVtbl -> GetID(This,pId) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomain_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomain_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0026 */ @@ -5327,24 +5561,28 @@ EXTERN_C const IID IID_ICorDebugAppDomain2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomain2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugAppDomain2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugAppDomain2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAppDomain2 * This); + DECLSPEC_XFGVIRT(ICorDebugAppDomain2, GetArrayOrPointerType) HRESULT ( STDMETHODCALLTYPE *GetArrayOrPointerType )( ICorDebugAppDomain2 * This, /* [in] */ CorElementType elementType, @@ -5352,6 +5590,7 @@ EXTERN_C const IID IID_ICorDebugAppDomain2; /* [in] */ ICorDebugType *pTypeArg, /* [out] */ ICorDebugType **ppType); + DECLSPEC_XFGVIRT(ICorDebugAppDomain2, GetFunctionPointerType) HRESULT ( STDMETHODCALLTYPE *GetFunctionPointerType )( ICorDebugAppDomain2 * This, /* [in] */ ULONG32 nTypeArgs, @@ -5371,31 +5610,31 @@ EXTERN_C const IID IID_ICorDebugAppDomain2; #ifdef COBJMACROS -#define ICorDebugAppDomain2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomain2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomain2_AddRef(This) \ +#define ICorDebugAppDomain2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomain2_Release(This) \ +#define ICorDebugAppDomain2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomain2_GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) \ +#define ICorDebugAppDomain2_GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) \ ( (This)->lpVtbl -> GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) ) -#define ICorDebugAppDomain2_GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) \ +#define ICorDebugAppDomain2_GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) \ ( (This)->lpVtbl -> GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomain2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomain2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugEnum_INTERFACE_DEFINED__ @@ -5427,35 +5666,42 @@ EXTERN_C const IID IID_ICorDebugEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugEnum * This, /* [out] */ ULONG *pcelt); @@ -5473,37 +5719,37 @@ EXTERN_C const IID IID_ICorDebugEnum; #ifdef COBJMACROS -#define ICorDebugEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEnum_AddRef(This) \ +#define ICorDebugEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEnum_Release(This) \ +#define ICorDebugEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEnum_Skip(This,celt) \ +#define ICorDebugEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugEnum_Reset(This) \ +#define ICorDebugEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugEnum_Clone(This,ppEnum) \ +#define ICorDebugEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugEnum_GetCount(This,pcelt) \ +#define ICorDebugEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__ @@ -5529,39 +5775,47 @@ EXTERN_C const IID IID_ICorDebugGuidToTypeEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugGuidToTypeEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugGuidToTypeEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugGuidToTypeEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugGuidToTypeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugGuidToTypeEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugGuidToTypeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugGuidToTypeEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugGuidToTypeEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugGuidToTypeEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugGuidToTypeEnum * This, /* [in] */ ULONG celt, @@ -5581,41 +5835,41 @@ EXTERN_C const IID IID_ICorDebugGuidToTypeEnum; #ifdef COBJMACROS -#define ICorDebugGuidToTypeEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugGuidToTypeEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugGuidToTypeEnum_AddRef(This) \ +#define ICorDebugGuidToTypeEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugGuidToTypeEnum_Release(This) \ +#define ICorDebugGuidToTypeEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugGuidToTypeEnum_Skip(This,celt) \ +#define ICorDebugGuidToTypeEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugGuidToTypeEnum_Reset(This) \ +#define ICorDebugGuidToTypeEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugGuidToTypeEnum_Clone(This,ppEnum) \ +#define ICorDebugGuidToTypeEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugGuidToTypeEnum_GetCount(This,pcelt) \ +#define ICorDebugGuidToTypeEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugGuidToTypeEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugGuidToTypeEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAppDomain3_INTERFACE_DEFINED__ @@ -5644,30 +5898,35 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomain3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugAppDomain3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugAppDomain3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAppDomain3 * This); + DECLSPEC_XFGVIRT(ICorDebugAppDomain3, GetCachedWinRTTypesForIIDs) HRESULT ( STDMETHODCALLTYPE *GetCachedWinRTTypesForIIDs )( ICorDebugAppDomain3 * This, /* [in] */ ULONG32 cReqTypes, /* [size_is][in] */ GUID *iidsToResolve, /* [out] */ ICorDebugTypeEnum **ppTypesEnum); + DECLSPEC_XFGVIRT(ICorDebugAppDomain3, GetCachedWinRTTypes) HRESULT ( STDMETHODCALLTYPE *GetCachedWinRTTypes )( ICorDebugAppDomain3 * This, /* [out] */ ICorDebugGuidToTypeEnum **ppGuidToTypeEnum); @@ -5685,31 +5944,31 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; #ifdef COBJMACROS -#define ICorDebugAppDomain3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomain3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomain3_AddRef(This) \ +#define ICorDebugAppDomain3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomain3_Release(This) \ +#define ICorDebugAppDomain3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomain3_GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) \ +#define ICorDebugAppDomain3_GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) \ ( (This)->lpVtbl -> GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) ) -#define ICorDebugAppDomain3_GetCachedWinRTTypes(This,ppGuidToTypeEnum) \ +#define ICorDebugAppDomain3_GetCachedWinRTTypes(This,ppGuidToTypeEnum) \ ( (This)->lpVtbl -> GetCachedWinRTTypes(This,ppGuidToTypeEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomain3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomain3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAppDomain4_INTERFACE_DEFINED__ @@ -5734,24 +5993,28 @@ EXTERN_C const IID IID_ICorDebugAppDomain4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomain4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugAppDomain4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugAppDomain4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAppDomain4 * This); + DECLSPEC_XFGVIRT(ICorDebugAppDomain4, GetObjectForCCW) HRESULT ( STDMETHODCALLTYPE *GetObjectForCCW )( ICorDebugAppDomain4 * This, /* [in] */ CORDB_ADDRESS ccwPointer, @@ -5770,28 +6033,28 @@ EXTERN_C const IID IID_ICorDebugAppDomain4; #ifdef COBJMACROS -#define ICorDebugAppDomain4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomain4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomain4_AddRef(This) \ +#define ICorDebugAppDomain4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomain4_Release(This) \ +#define ICorDebugAppDomain4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomain4_GetObjectForCCW(This,ccwPointer,ppManagedObject) \ +#define ICorDebugAppDomain4_GetObjectForCCW(This,ccwPointer,ppManagedObject) \ ( (This)->lpVtbl -> GetObjectForCCW(This,ccwPointer,ppManagedObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomain4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomain4_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0030 */ @@ -5841,42 +6104,50 @@ EXTERN_C const IID IID_ICorDebugAssembly; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAssemblyVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugAssembly * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugAssembly * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAssembly * This); + DECLSPEC_XFGVIRT(ICorDebugAssembly, GetProcess) HRESULT ( STDMETHODCALLTYPE *GetProcess )( ICorDebugAssembly * This, /* [out] */ ICorDebugProcess **ppProcess); + DECLSPEC_XFGVIRT(ICorDebugAssembly, GetAppDomain) HRESULT ( STDMETHODCALLTYPE *GetAppDomain )( ICorDebugAssembly * This, /* [out] */ ICorDebugAppDomain **ppAppDomain); + DECLSPEC_XFGVIRT(ICorDebugAssembly, EnumerateModules) HRESULT ( STDMETHODCALLTYPE *EnumerateModules )( ICorDebugAssembly * This, /* [out] */ ICorDebugModuleEnum **ppModules); + DECLSPEC_XFGVIRT(ICorDebugAssembly, GetCodeBase) HRESULT ( STDMETHODCALLTYPE *GetCodeBase )( ICorDebugAssembly * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugAssembly, GetName) HRESULT ( STDMETHODCALLTYPE *GetName )( ICorDebugAssembly * This, /* [in] */ ULONG32 cchName, @@ -5896,40 +6167,40 @@ EXTERN_C const IID IID_ICorDebugAssembly; #ifdef COBJMACROS -#define ICorDebugAssembly_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAssembly_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAssembly_AddRef(This) \ +#define ICorDebugAssembly_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAssembly_Release(This) \ +#define ICorDebugAssembly_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAssembly_GetProcess(This,ppProcess) \ +#define ICorDebugAssembly_GetProcess(This,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,ppProcess) ) -#define ICorDebugAssembly_GetAppDomain(This,ppAppDomain) \ +#define ICorDebugAssembly_GetAppDomain(This,ppAppDomain) \ ( (This)->lpVtbl -> GetAppDomain(This,ppAppDomain) ) -#define ICorDebugAssembly_EnumerateModules(This,ppModules) \ +#define ICorDebugAssembly_EnumerateModules(This,ppModules) \ ( (This)->lpVtbl -> EnumerateModules(This,ppModules) ) -#define ICorDebugAssembly_GetCodeBase(This,cchName,pcchName,szName) \ +#define ICorDebugAssembly_GetCodeBase(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetCodeBase(This,cchName,pcchName,szName) ) -#define ICorDebugAssembly_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugAssembly_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAssembly_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAssembly_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0031 */ @@ -5962,24 +6233,28 @@ EXTERN_C const IID IID_ICorDebugAssembly2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAssembly2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugAssembly2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugAssembly2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAssembly2 * This); + DECLSPEC_XFGVIRT(ICorDebugAssembly2, IsFullyTrusted) HRESULT ( STDMETHODCALLTYPE *IsFullyTrusted )( ICorDebugAssembly2 * This, /* [out] */ BOOL *pbFullyTrusted); @@ -5997,28 +6272,28 @@ EXTERN_C const IID IID_ICorDebugAssembly2; #ifdef COBJMACROS -#define ICorDebugAssembly2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAssembly2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAssembly2_AddRef(This) \ +#define ICorDebugAssembly2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAssembly2_Release(This) \ +#define ICorDebugAssembly2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAssembly2_IsFullyTrusted(This,pbFullyTrusted) \ +#define ICorDebugAssembly2_IsFullyTrusted(This,pbFullyTrusted) \ ( (This)->lpVtbl -> IsFullyTrusted(This,pbFullyTrusted) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAssembly2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAssembly2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAssembly3_INTERFACE_DEFINED__ @@ -6045,28 +6320,33 @@ EXTERN_C const IID IID_ICorDebugAssembly3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAssembly3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugAssembly3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugAssembly3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAssembly3 * This); + DECLSPEC_XFGVIRT(ICorDebugAssembly3, GetContainerAssembly) HRESULT ( STDMETHODCALLTYPE *GetContainerAssembly )( ICorDebugAssembly3 * This, ICorDebugAssembly **ppAssembly); + DECLSPEC_XFGVIRT(ICorDebugAssembly3, EnumerateContainedAssemblies) HRESULT ( STDMETHODCALLTYPE *EnumerateContainedAssemblies )( ICorDebugAssembly3 * This, ICorDebugAssemblyEnum **ppAssemblies); @@ -6084,31 +6364,31 @@ EXTERN_C const IID IID_ICorDebugAssembly3; #ifdef COBJMACROS -#define ICorDebugAssembly3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAssembly3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAssembly3_AddRef(This) \ +#define ICorDebugAssembly3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAssembly3_Release(This) \ +#define ICorDebugAssembly3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAssembly3_GetContainerAssembly(This,ppAssembly) \ +#define ICorDebugAssembly3_GetContainerAssembly(This,ppAssembly) \ ( (This)->lpVtbl -> GetContainerAssembly(This,ppAssembly) ) -#define ICorDebugAssembly3_EnumerateContainedAssemblies(This,ppAssemblies) \ +#define ICorDebugAssembly3_EnumerateContainedAssemblies(This,ppAssemblies) \ ( (This)->lpVtbl -> EnumerateContainedAssemblies(This,ppAssemblies) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAssembly3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAssembly3_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0033 */ @@ -6120,7 +6400,7 @@ typedef struct COR_TYPEID { UINT64 token1; UINT64 token2; - } COR_TYPEID; + } COR_TYPEID; #endif // _DEF_COR_TYPEID_ typedef struct _COR_HEAPOBJECT @@ -6128,7 +6408,7 @@ typedef struct _COR_HEAPOBJECT CORDB_ADDRESS address; ULONG64 size; COR_TYPEID type; - } COR_HEAPOBJECT; + } COR_HEAPOBJECT; @@ -6158,39 +6438,47 @@ EXTERN_C const IID IID_ICorDebugHeapEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugHeapEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugHeapEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugHeapEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugHeapEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugHeapEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugHeapEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugHeapEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugHeapEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugHeapEnum * This, /* [in] */ ULONG celt, @@ -6210,41 +6498,41 @@ EXTERN_C const IID IID_ICorDebugHeapEnum; #ifdef COBJMACROS -#define ICorDebugHeapEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapEnum_AddRef(This) \ +#define ICorDebugHeapEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapEnum_Release(This) \ +#define ICorDebugHeapEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapEnum_Skip(This,celt) \ +#define ICorDebugHeapEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugHeapEnum_Reset(This) \ +#define ICorDebugHeapEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugHeapEnum_Clone(This,ppEnum) \ +#define ICorDebugHeapEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugHeapEnum_GetCount(This,pcelt) \ +#define ICorDebugHeapEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugHeapEnum_Next(This,celt,objects,pceltFetched) \ +#define ICorDebugHeapEnum_Next(This,celt,objects,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapEnum_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0034 */ @@ -6253,12 +6541,13 @@ EXTERN_C const IID IID_ICorDebugHeapEnum; typedef enum CorDebugGenerationTypes { - CorDebug_Gen0 = 0, - CorDebug_Gen1 = 1, - CorDebug_Gen2 = 2, - CorDebug_LOH = 3, - CorDebug_POH = 4 - } CorDebugGenerationTypes; + CorDebug_Gen0 = 0, + CorDebug_Gen1 = 1, + CorDebug_Gen2 = 2, + CorDebug_LOH = 3, + CorDebug_POH = 4, + CorDebug_NonGC = 0x7FFFFFFF + } CorDebugGenerationTypes; typedef struct _COR_SEGMENT { @@ -6266,14 +6555,14 @@ typedef struct _COR_SEGMENT CORDB_ADDRESS end; CorDebugGenerationTypes type; ULONG heap; - } COR_SEGMENT; + } COR_SEGMENT; typedef enum CorDebugGCType { - CorDebugWorkstationGC = 0, - CorDebugServerGC = ( CorDebugWorkstationGC + 1 ) - } CorDebugGCType; + CorDebugWorkstationGC = 0, + CorDebugServerGC = ( CorDebugWorkstationGC + 1 ) + } CorDebugGCType; typedef struct _COR_HEAPINFO { @@ -6282,7 +6571,7 @@ typedef struct _COR_HEAPINFO DWORD numHeaps; BOOL concurrent; CorDebugGCType gcType; - } COR_HEAPINFO; + } COR_HEAPINFO; @@ -6312,39 +6601,47 @@ EXTERN_C const IID IID_ICorDebugHeapSegmentEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapSegmentEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugHeapSegmentEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugHeapSegmentEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugHeapSegmentEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugHeapSegmentEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugHeapSegmentEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugHeapSegmentEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugHeapSegmentEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugHeapSegmentEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugHeapSegmentEnum * This, /* [in] */ ULONG celt, @@ -6364,41 +6661,41 @@ EXTERN_C const IID IID_ICorDebugHeapSegmentEnum; #ifdef COBJMACROS -#define ICorDebugHeapSegmentEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapSegmentEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapSegmentEnum_AddRef(This) \ +#define ICorDebugHeapSegmentEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapSegmentEnum_Release(This) \ +#define ICorDebugHeapSegmentEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapSegmentEnum_Skip(This,celt) \ +#define ICorDebugHeapSegmentEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugHeapSegmentEnum_Reset(This) \ +#define ICorDebugHeapSegmentEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugHeapSegmentEnum_Clone(This,ppEnum) \ +#define ICorDebugHeapSegmentEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugHeapSegmentEnum_GetCount(This,pcelt) \ +#define ICorDebugHeapSegmentEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugHeapSegmentEnum_Next(This,celt,segments,pceltFetched) \ +#define ICorDebugHeapSegmentEnum_Next(This,celt,segments,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,segments,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapSegmentEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapSegmentEnum_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0035 */ @@ -6407,23 +6704,23 @@ EXTERN_C const IID IID_ICorDebugHeapSegmentEnum; typedef enum CorGCReferenceType { - CorHandleStrong = ( 1 << 0 ) , - CorHandleStrongPinning = ( 1 << 1 ) , - CorHandleWeakShort = ( 1 << 2 ) , - CorHandleWeakLong = ( 1 << 3 ) , - CorHandleWeakRefCount = ( 1 << 4 ) , - CorHandleStrongRefCount = ( 1 << 5 ) , - CorHandleStrongDependent = ( 1 << 6 ) , - CorHandleStrongAsyncPinned = ( 1 << 7 ) , - CorHandleStrongSizedByref = ( 1 << 8 ) , - CorHandleWeakNativeCom = ( 1 << 9 ) , - CorHandleWeakWinRT = CorHandleWeakNativeCom, - CorReferenceStack = 0x80000001, - CorReferenceFinalizer = 80000002, - CorHandleStrongOnly = 0x1e3, - CorHandleWeakOnly = 0x21c, - CorHandleAll = 0x7fffffff - } CorGCReferenceType; + CorHandleStrong = ( 1 << 0 ) , + CorHandleStrongPinning = ( 1 << 1 ) , + CorHandleWeakShort = ( 1 << 2 ) , + CorHandleWeakLong = ( 1 << 3 ) , + CorHandleWeakRefCount = ( 1 << 4 ) , + CorHandleStrongRefCount = ( 1 << 5 ) , + CorHandleStrongDependent = ( 1 << 6 ) , + CorHandleStrongAsyncPinned = ( 1 << 7 ) , + CorHandleStrongSizedByref = ( 1 << 8 ) , + CorHandleWeakNativeCom = ( 1 << 9 ) , + CorHandleWeakWinRT = CorHandleWeakNativeCom, + CorReferenceStack = 0x80000001, + CorReferenceFinalizer = 80000002, + CorHandleStrongOnly = 0x1e3, + CorHandleWeakOnly = 0x21c, + CorHandleAll = 0x7fffffff + } CorGCReferenceType; #ifndef _DEF_COR_GC_REFERENCE_ #define _DEF_COR_GC_REFERENCE_ @@ -6433,7 +6730,7 @@ typedef struct COR_GC_REFERENCE ICorDebugValue *Location; CorGCReferenceType Type; UINT64 ExtraData; - } COR_GC_REFERENCE; + } COR_GC_REFERENCE; #endif // _DEF_COR_GC_REFERENCE_ @@ -6464,39 +6761,47 @@ EXTERN_C const IID IID_ICorDebugGCReferenceEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugGCReferenceEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugGCReferenceEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugGCReferenceEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugGCReferenceEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugGCReferenceEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugGCReferenceEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugGCReferenceEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugGCReferenceEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugGCReferenceEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugGCReferenceEnum * This, /* [in] */ ULONG celt, @@ -6516,41 +6821,41 @@ EXTERN_C const IID IID_ICorDebugGCReferenceEnum; #ifdef COBJMACROS -#define ICorDebugGCReferenceEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugGCReferenceEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugGCReferenceEnum_AddRef(This) \ +#define ICorDebugGCReferenceEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugGCReferenceEnum_Release(This) \ +#define ICorDebugGCReferenceEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugGCReferenceEnum_Skip(This,celt) \ +#define ICorDebugGCReferenceEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugGCReferenceEnum_Reset(This) \ +#define ICorDebugGCReferenceEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugGCReferenceEnum_Clone(This,ppEnum) \ +#define ICorDebugGCReferenceEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugGCReferenceEnum_GetCount(This,pcelt) \ +#define ICorDebugGCReferenceEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugGCReferenceEnum_Next(This,celt,roots,pceltFetched) \ +#define ICorDebugGCReferenceEnum_Next(This,celt,roots,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,roots,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugGCReferenceEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugGCReferenceEnum_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0036 */ @@ -6568,7 +6873,7 @@ typedef struct COR_ARRAY_LAYOUT ULONG32 rankSize; ULONG32 numRanks; ULONG32 rankOffset; - } COR_ARRAY_LAYOUT; + } COR_ARRAY_LAYOUT; #endif // _DEF_COR_ARRAY_LAYOUT_ #ifndef _DEF_COR_TYPE_LAYOUT_ @@ -6580,7 +6885,7 @@ typedef struct COR_TYPE_LAYOUT ULONG32 numFields; ULONG32 boxOffset; CorElementType type; - } COR_TYPE_LAYOUT; + } COR_TYPE_LAYOUT; #endif // _DEF_COR_TYPE_LAYOUT_ #ifndef _DEF_COR_FIELD_ @@ -6591,7 +6896,7 @@ typedef struct COR_FIELD ULONG32 offset; COR_TYPEID id; CorElementType fieldType; - } COR_FIELD; + } COR_FIELD; #endif // _DEF_COR_FIELD_ #pragma warning(push) @@ -6686,108 +6991,130 @@ EXTERN_C const IID IID_ICorDebugProcess; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcessVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcess * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcess * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcess * This); + DECLSPEC_XFGVIRT(ICorDebugController, Stop) HRESULT ( STDMETHODCALLTYPE *Stop )( ICorDebugProcess * This, /* [in] */ DWORD dwTimeoutIgnored); + DECLSPEC_XFGVIRT(ICorDebugController, Continue) HRESULT ( STDMETHODCALLTYPE *Continue )( ICorDebugProcess * This, /* [in] */ BOOL fIsOutOfBand); + DECLSPEC_XFGVIRT(ICorDebugController, IsRunning) HRESULT ( STDMETHODCALLTYPE *IsRunning )( ICorDebugProcess * This, /* [out] */ BOOL *pbRunning); + DECLSPEC_XFGVIRT(ICorDebugController, HasQueuedCallbacks) HRESULT ( STDMETHODCALLTYPE *HasQueuedCallbacks )( ICorDebugProcess * This, /* [in] */ ICorDebugThread *pThread, /* [out] */ BOOL *pbQueued); + DECLSPEC_XFGVIRT(ICorDebugController, EnumerateThreads) HRESULT ( STDMETHODCALLTYPE *EnumerateThreads )( ICorDebugProcess * This, /* [out] */ ICorDebugThreadEnum **ppThreads); + DECLSPEC_XFGVIRT(ICorDebugController, SetAllThreadsDebugState) HRESULT ( STDMETHODCALLTYPE *SetAllThreadsDebugState )( ICorDebugProcess * This, /* [in] */ CorDebugThreadState state, /* [in] */ ICorDebugThread *pExceptThisThread); + DECLSPEC_XFGVIRT(ICorDebugController, Detach) HRESULT ( STDMETHODCALLTYPE *Detach )( ICorDebugProcess * This); + DECLSPEC_XFGVIRT(ICorDebugController, Terminate) HRESULT ( STDMETHODCALLTYPE *Terminate )( ICorDebugProcess * This, /* [in] */ UINT exitCode); + DECLSPEC_XFGVIRT(ICorDebugController, CanCommitChanges) HRESULT ( STDMETHODCALLTYPE *CanCommitChanges )( ICorDebugProcess * This, /* [in] */ ULONG cSnapshots, /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[ ], /* [out] */ ICorDebugErrorInfoEnum **pError); + DECLSPEC_XFGVIRT(ICorDebugController, CommitChanges) HRESULT ( STDMETHODCALLTYPE *CommitChanges )( ICorDebugProcess * This, /* [in] */ ULONG cSnapshots, /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[ ], /* [out] */ ICorDebugErrorInfoEnum **pError); + DECLSPEC_XFGVIRT(ICorDebugProcess, GetID) HRESULT ( STDMETHODCALLTYPE *GetID )( ICorDebugProcess * This, /* [out] */ DWORD *pdwProcessId); + DECLSPEC_XFGVIRT(ICorDebugProcess, GetHandle) HRESULT ( STDMETHODCALLTYPE *GetHandle )( ICorDebugProcess * This, /* [out] */ HPROCESS *phProcessHandle); + DECLSPEC_XFGVIRT(ICorDebugProcess, GetThread) HRESULT ( STDMETHODCALLTYPE *GetThread )( ICorDebugProcess * This, /* [in] */ DWORD dwThreadId, /* [out] */ ICorDebugThread **ppThread); + DECLSPEC_XFGVIRT(ICorDebugProcess, EnumerateObjects) HRESULT ( STDMETHODCALLTYPE *EnumerateObjects )( ICorDebugProcess * This, /* [out] */ ICorDebugObjectEnum **ppObjects); + DECLSPEC_XFGVIRT(ICorDebugProcess, IsTransitionStub) HRESULT ( STDMETHODCALLTYPE *IsTransitionStub )( ICorDebugProcess * This, /* [in] */ CORDB_ADDRESS address, /* [out] */ BOOL *pbTransitionStub); + DECLSPEC_XFGVIRT(ICorDebugProcess, IsOSSuspended) HRESULT ( STDMETHODCALLTYPE *IsOSSuspended )( ICorDebugProcess * This, /* [in] */ DWORD threadID, /* [out] */ BOOL *pbSuspended); + DECLSPEC_XFGVIRT(ICorDebugProcess, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorDebugProcess * This, /* [in] */ DWORD threadID, /* [in] */ ULONG32 contextSize, /* [size_is][length_is][out][in] */ BYTE context[ ]); + DECLSPEC_XFGVIRT(ICorDebugProcess, SetThreadContext) HRESULT ( STDMETHODCALLTYPE *SetThreadContext )( ICorDebugProcess * This, /* [in] */ DWORD threadID, /* [in] */ ULONG32 contextSize, /* [size_is][length_is][in] */ BYTE context[ ]); + DECLSPEC_XFGVIRT(ICorDebugProcess, ReadMemory) HRESULT ( STDMETHODCALLTYPE *ReadMemory )( ICorDebugProcess * This, /* [in] */ CORDB_ADDRESS address, @@ -6795,6 +7122,7 @@ EXTERN_C const IID IID_ICorDebugProcess; /* [length_is][size_is][out] */ BYTE buffer[ ], /* [out] */ SIZE_T *read); + DECLSPEC_XFGVIRT(ICorDebugProcess, WriteMemory) HRESULT ( STDMETHODCALLTYPE *WriteMemory )( ICorDebugProcess * This, /* [in] */ CORDB_ADDRESS address, @@ -6802,33 +7130,40 @@ EXTERN_C const IID IID_ICorDebugProcess; /* [size_is][in] */ BYTE buffer[ ], /* [out] */ SIZE_T *written); + DECLSPEC_XFGVIRT(ICorDebugProcess, ClearCurrentException) HRESULT ( STDMETHODCALLTYPE *ClearCurrentException )( ICorDebugProcess * This, /* [in] */ DWORD threadID); + DECLSPEC_XFGVIRT(ICorDebugProcess, EnableLogMessages) HRESULT ( STDMETHODCALLTYPE *EnableLogMessages )( ICorDebugProcess * This, /* [in] */ BOOL fOnOff); + DECLSPEC_XFGVIRT(ICorDebugProcess, ModifyLogSwitch) HRESULT ( STDMETHODCALLTYPE *ModifyLogSwitch )( ICorDebugProcess * This, /* [annotation][in] */ _In_ WCHAR *pLogSwitchName, /* [in] */ LONG lLevel); + DECLSPEC_XFGVIRT(ICorDebugProcess, EnumerateAppDomains) HRESULT ( STDMETHODCALLTYPE *EnumerateAppDomains )( ICorDebugProcess * This, /* [out] */ ICorDebugAppDomainEnum **ppAppDomains); + DECLSPEC_XFGVIRT(ICorDebugProcess, GetObject) HRESULT ( STDMETHODCALLTYPE *GetObject )( ICorDebugProcess * This, /* [out] */ ICorDebugValue **ppObject); + DECLSPEC_XFGVIRT(ICorDebugProcess, ThreadForFiberCookie) HRESULT ( STDMETHODCALLTYPE *ThreadForFiberCookie )( ICorDebugProcess * This, /* [in] */ DWORD fiberCookie, /* [out] */ ICorDebugThread **ppThread); + DECLSPEC_XFGVIRT(ICorDebugProcess, GetHelperThreadID) HRESULT ( STDMETHODCALLTYPE *GetHelperThreadID )( ICorDebugProcess * This, /* [out] */ DWORD *pThreadID); @@ -6846,107 +7181,107 @@ EXTERN_C const IID IID_ICorDebugProcess; #ifdef COBJMACROS -#define ICorDebugProcess_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess_AddRef(This) \ +#define ICorDebugProcess_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess_Release(This) \ +#define ICorDebugProcess_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess_Stop(This,dwTimeoutIgnored) \ +#define ICorDebugProcess_Stop(This,dwTimeoutIgnored) \ ( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) ) -#define ICorDebugProcess_Continue(This,fIsOutOfBand) \ +#define ICorDebugProcess_Continue(This,fIsOutOfBand) \ ( (This)->lpVtbl -> Continue(This,fIsOutOfBand) ) -#define ICorDebugProcess_IsRunning(This,pbRunning) \ +#define ICorDebugProcess_IsRunning(This,pbRunning) \ ( (This)->lpVtbl -> IsRunning(This,pbRunning) ) -#define ICorDebugProcess_HasQueuedCallbacks(This,pThread,pbQueued) \ +#define ICorDebugProcess_HasQueuedCallbacks(This,pThread,pbQueued) \ ( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) ) -#define ICorDebugProcess_EnumerateThreads(This,ppThreads) \ +#define ICorDebugProcess_EnumerateThreads(This,ppThreads) \ ( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) ) -#define ICorDebugProcess_SetAllThreadsDebugState(This,state,pExceptThisThread) \ +#define ICorDebugProcess_SetAllThreadsDebugState(This,state,pExceptThisThread) \ ( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) ) -#define ICorDebugProcess_Detach(This) \ +#define ICorDebugProcess_Detach(This) \ ( (This)->lpVtbl -> Detach(This) ) -#define ICorDebugProcess_Terminate(This,exitCode) \ +#define ICorDebugProcess_Terminate(This,exitCode) \ ( (This)->lpVtbl -> Terminate(This,exitCode) ) -#define ICorDebugProcess_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugProcess_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugProcess_CommitChanges(This,cSnapshots,pSnapshots,pError) \ +#define ICorDebugProcess_CommitChanges(This,cSnapshots,pSnapshots,pError) \ ( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) ) -#define ICorDebugProcess_GetID(This,pdwProcessId) \ +#define ICorDebugProcess_GetID(This,pdwProcessId) \ ( (This)->lpVtbl -> GetID(This,pdwProcessId) ) -#define ICorDebugProcess_GetHandle(This,phProcessHandle) \ +#define ICorDebugProcess_GetHandle(This,phProcessHandle) \ ( (This)->lpVtbl -> GetHandle(This,phProcessHandle) ) -#define ICorDebugProcess_GetThread(This,dwThreadId,ppThread) \ +#define ICorDebugProcess_GetThread(This,dwThreadId,ppThread) \ ( (This)->lpVtbl -> GetThread(This,dwThreadId,ppThread) ) -#define ICorDebugProcess_EnumerateObjects(This,ppObjects) \ +#define ICorDebugProcess_EnumerateObjects(This,ppObjects) \ ( (This)->lpVtbl -> EnumerateObjects(This,ppObjects) ) -#define ICorDebugProcess_IsTransitionStub(This,address,pbTransitionStub) \ +#define ICorDebugProcess_IsTransitionStub(This,address,pbTransitionStub) \ ( (This)->lpVtbl -> IsTransitionStub(This,address,pbTransitionStub) ) -#define ICorDebugProcess_IsOSSuspended(This,threadID,pbSuspended) \ +#define ICorDebugProcess_IsOSSuspended(This,threadID,pbSuspended) \ ( (This)->lpVtbl -> IsOSSuspended(This,threadID,pbSuspended) ) -#define ICorDebugProcess_GetThreadContext(This,threadID,contextSize,context) \ +#define ICorDebugProcess_GetThreadContext(This,threadID,contextSize,context) \ ( (This)->lpVtbl -> GetThreadContext(This,threadID,contextSize,context) ) -#define ICorDebugProcess_SetThreadContext(This,threadID,contextSize,context) \ +#define ICorDebugProcess_SetThreadContext(This,threadID,contextSize,context) \ ( (This)->lpVtbl -> SetThreadContext(This,threadID,contextSize,context) ) -#define ICorDebugProcess_ReadMemory(This,address,size,buffer,read) \ +#define ICorDebugProcess_ReadMemory(This,address,size,buffer,read) \ ( (This)->lpVtbl -> ReadMemory(This,address,size,buffer,read) ) -#define ICorDebugProcess_WriteMemory(This,address,size,buffer,written) \ +#define ICorDebugProcess_WriteMemory(This,address,size,buffer,written) \ ( (This)->lpVtbl -> WriteMemory(This,address,size,buffer,written) ) -#define ICorDebugProcess_ClearCurrentException(This,threadID) \ +#define ICorDebugProcess_ClearCurrentException(This,threadID) \ ( (This)->lpVtbl -> ClearCurrentException(This,threadID) ) -#define ICorDebugProcess_EnableLogMessages(This,fOnOff) \ +#define ICorDebugProcess_EnableLogMessages(This,fOnOff) \ ( (This)->lpVtbl -> EnableLogMessages(This,fOnOff) ) -#define ICorDebugProcess_ModifyLogSwitch(This,pLogSwitchName,lLevel) \ +#define ICorDebugProcess_ModifyLogSwitch(This,pLogSwitchName,lLevel) \ ( (This)->lpVtbl -> ModifyLogSwitch(This,pLogSwitchName,lLevel) ) -#define ICorDebugProcess_EnumerateAppDomains(This,ppAppDomains) \ +#define ICorDebugProcess_EnumerateAppDomains(This,ppAppDomains) \ ( (This)->lpVtbl -> EnumerateAppDomains(This,ppAppDomains) ) -#define ICorDebugProcess_GetObject(This,ppObject) \ +#define ICorDebugProcess_GetObject(This,ppObject) \ ( (This)->lpVtbl -> GetObject(This,ppObject) ) -#define ICorDebugProcess_ThreadForFiberCookie(This,fiberCookie,ppThread) \ +#define ICorDebugProcess_ThreadForFiberCookie(This,fiberCookie,ppThread) \ ( (This)->lpVtbl -> ThreadForFiberCookie(This,fiberCookie,ppThread) ) -#define ICorDebugProcess_GetHelperThreadID(This,pThreadID) \ +#define ICorDebugProcess_GetHelperThreadID(This,pThreadID) \ ( (This)->lpVtbl -> GetHelperThreadID(This,pThreadID) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0037 */ @@ -7002,33 +7337,39 @@ EXTERN_C const IID IID_ICorDebugProcess2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcess2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcess2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcess2 * This); + DECLSPEC_XFGVIRT(ICorDebugProcess2, GetThreadForTaskID) HRESULT ( STDMETHODCALLTYPE *GetThreadForTaskID )( ICorDebugProcess2 * This, /* [in] */ TASKID taskid, /* [out] */ ICorDebugThread2 **ppThread); + DECLSPEC_XFGVIRT(ICorDebugProcess2, GetVersion) HRESULT ( STDMETHODCALLTYPE *GetVersion )( ICorDebugProcess2 * This, /* [out] */ COR_VERSION *version); + DECLSPEC_XFGVIRT(ICorDebugProcess2, SetUnmanagedBreakpoint) HRESULT ( STDMETHODCALLTYPE *SetUnmanagedBreakpoint )( ICorDebugProcess2 * This, /* [in] */ CORDB_ADDRESS address, @@ -7036,18 +7377,22 @@ EXTERN_C const IID IID_ICorDebugProcess2; /* [length_is][size_is][out] */ BYTE buffer[ ], /* [out] */ ULONG32 *bufLen); + DECLSPEC_XFGVIRT(ICorDebugProcess2, ClearUnmanagedBreakpoint) HRESULT ( STDMETHODCALLTYPE *ClearUnmanagedBreakpoint )( ICorDebugProcess2 * This, /* [in] */ CORDB_ADDRESS address); + DECLSPEC_XFGVIRT(ICorDebugProcess2, SetDesiredNGENCompilerFlags) HRESULT ( STDMETHODCALLTYPE *SetDesiredNGENCompilerFlags )( ICorDebugProcess2 * This, /* [in] */ DWORD pdwFlags); + DECLSPEC_XFGVIRT(ICorDebugProcess2, GetDesiredNGENCompilerFlags) HRESULT ( STDMETHODCALLTYPE *GetDesiredNGENCompilerFlags )( ICorDebugProcess2 * This, /* [out] */ DWORD *pdwFlags); + DECLSPEC_XFGVIRT(ICorDebugProcess2, GetReferenceValueFromGCHandle) HRESULT ( STDMETHODCALLTYPE *GetReferenceValueFromGCHandle )( ICorDebugProcess2 * This, /* [in] */ UINT_PTR handle, @@ -7066,46 +7411,46 @@ EXTERN_C const IID IID_ICorDebugProcess2; #ifdef COBJMACROS -#define ICorDebugProcess2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess2_AddRef(This) \ +#define ICorDebugProcess2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess2_Release(This) \ +#define ICorDebugProcess2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess2_GetThreadForTaskID(This,taskid,ppThread) \ +#define ICorDebugProcess2_GetThreadForTaskID(This,taskid,ppThread) \ ( (This)->lpVtbl -> GetThreadForTaskID(This,taskid,ppThread) ) -#define ICorDebugProcess2_GetVersion(This,version) \ +#define ICorDebugProcess2_GetVersion(This,version) \ ( (This)->lpVtbl -> GetVersion(This,version) ) -#define ICorDebugProcess2_SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) \ +#define ICorDebugProcess2_SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) \ ( (This)->lpVtbl -> SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) ) -#define ICorDebugProcess2_ClearUnmanagedBreakpoint(This,address) \ +#define ICorDebugProcess2_ClearUnmanagedBreakpoint(This,address) \ ( (This)->lpVtbl -> ClearUnmanagedBreakpoint(This,address) ) -#define ICorDebugProcess2_SetDesiredNGENCompilerFlags(This,pdwFlags) \ +#define ICorDebugProcess2_SetDesiredNGENCompilerFlags(This,pdwFlags) \ ( (This)->lpVtbl -> SetDesiredNGENCompilerFlags(This,pdwFlags) ) -#define ICorDebugProcess2_GetDesiredNGENCompilerFlags(This,pdwFlags) \ +#define ICorDebugProcess2_GetDesiredNGENCompilerFlags(This,pdwFlags) \ ( (This)->lpVtbl -> GetDesiredNGENCompilerFlags(This,pdwFlags) ) -#define ICorDebugProcess2_GetReferenceValueFromGCHandle(This,handle,pOutValue) \ +#define ICorDebugProcess2_GetReferenceValueFromGCHandle(This,handle,pOutValue) \ ( (This)->lpVtbl -> GetReferenceValueFromGCHandle(This,handle,pOutValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcess3_INTERFACE_DEFINED__ @@ -7130,24 +7475,28 @@ EXTERN_C const IID IID_ICorDebugProcess3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcess3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcess3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcess3 * This); + DECLSPEC_XFGVIRT(ICorDebugProcess3, SetEnableCustomNotification) HRESULT ( STDMETHODCALLTYPE *SetEnableCustomNotification )( ICorDebugProcess3 * This, ICorDebugClass *pClass, @@ -7166,28 +7515,28 @@ EXTERN_C const IID IID_ICorDebugProcess3; #ifdef COBJMACROS -#define ICorDebugProcess3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess3_AddRef(This) \ +#define ICorDebugProcess3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess3_Release(This) \ +#define ICorDebugProcess3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess3_SetEnableCustomNotification(This,pClass,fEnable) \ +#define ICorDebugProcess3_SetEnableCustomNotification(This,pClass,fEnable) \ ( (This)->lpVtbl -> SetEnableCustomNotification(This,pClass,fEnable) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcess5_INTERFACE_DEFINED__ @@ -7254,71 +7603,85 @@ EXTERN_C const IID IID_ICorDebugProcess5; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess5Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcess5 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcess5 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcess5 * This); + DECLSPEC_XFGVIRT(ICorDebugProcess5, GetGCHeapInformation) HRESULT ( STDMETHODCALLTYPE *GetGCHeapInformation )( ICorDebugProcess5 * This, /* [out] */ COR_HEAPINFO *pHeapInfo); + DECLSPEC_XFGVIRT(ICorDebugProcess5, EnumerateHeap) HRESULT ( STDMETHODCALLTYPE *EnumerateHeap )( ICorDebugProcess5 * This, /* [out] */ ICorDebugHeapEnum **ppObjects); + DECLSPEC_XFGVIRT(ICorDebugProcess5, EnumerateHeapRegions) HRESULT ( STDMETHODCALLTYPE *EnumerateHeapRegions )( ICorDebugProcess5 * This, /* [out] */ ICorDebugHeapSegmentEnum **ppRegions); + DECLSPEC_XFGVIRT(ICorDebugProcess5, GetObject) HRESULT ( STDMETHODCALLTYPE *GetObject )( ICorDebugProcess5 * This, /* [in] */ CORDB_ADDRESS addr, /* [out] */ ICorDebugObjectValue **pObject); + DECLSPEC_XFGVIRT(ICorDebugProcess5, EnumerateGCReferences) HRESULT ( STDMETHODCALLTYPE *EnumerateGCReferences )( ICorDebugProcess5 * This, /* [in] */ BOOL enumerateWeakReferences, /* [out] */ ICorDebugGCReferenceEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugProcess5, EnumerateHandles) HRESULT ( STDMETHODCALLTYPE *EnumerateHandles )( ICorDebugProcess5 * This, /* [in] */ CorGCReferenceType types, /* [out] */ ICorDebugGCReferenceEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugProcess5, GetTypeID) HRESULT ( STDMETHODCALLTYPE *GetTypeID )( ICorDebugProcess5 * This, /* [in] */ CORDB_ADDRESS obj, /* [out] */ COR_TYPEID *pId); + DECLSPEC_XFGVIRT(ICorDebugProcess5, GetTypeForTypeID) HRESULT ( STDMETHODCALLTYPE *GetTypeForTypeID )( ICorDebugProcess5 * This, /* [in] */ COR_TYPEID id, /* [out] */ ICorDebugType **ppType); + DECLSPEC_XFGVIRT(ICorDebugProcess5, GetArrayLayout) HRESULT ( STDMETHODCALLTYPE *GetArrayLayout )( ICorDebugProcess5 * This, /* [in] */ COR_TYPEID id, /* [out] */ COR_ARRAY_LAYOUT *pLayout); + DECLSPEC_XFGVIRT(ICorDebugProcess5, GetTypeLayout) HRESULT ( STDMETHODCALLTYPE *GetTypeLayout )( ICorDebugProcess5 * This, /* [in] */ COR_TYPEID id, /* [out] */ COR_TYPE_LAYOUT *pLayout); + DECLSPEC_XFGVIRT(ICorDebugProcess5, GetTypeFields) HRESULT ( STDMETHODCALLTYPE *GetTypeFields )( ICorDebugProcess5 * This, /* [in] */ COR_TYPEID id, @@ -7326,6 +7689,7 @@ EXTERN_C const IID IID_ICorDebugProcess5; COR_FIELD fields[ ], ULONG32 *pceltNeeded); + DECLSPEC_XFGVIRT(ICorDebugProcess5, EnableNGENPolicy) HRESULT ( STDMETHODCALLTYPE *EnableNGENPolicy )( ICorDebugProcess5 * This, /* [in] */ CorDebugNGENPolicy ePolicy); @@ -7343,61 +7707,61 @@ EXTERN_C const IID IID_ICorDebugProcess5; #ifdef COBJMACROS -#define ICorDebugProcess5_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess5_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess5_AddRef(This) \ +#define ICorDebugProcess5_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess5_Release(This) \ +#define ICorDebugProcess5_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess5_GetGCHeapInformation(This,pHeapInfo) \ +#define ICorDebugProcess5_GetGCHeapInformation(This,pHeapInfo) \ ( (This)->lpVtbl -> GetGCHeapInformation(This,pHeapInfo) ) -#define ICorDebugProcess5_EnumerateHeap(This,ppObjects) \ +#define ICorDebugProcess5_EnumerateHeap(This,ppObjects) \ ( (This)->lpVtbl -> EnumerateHeap(This,ppObjects) ) -#define ICorDebugProcess5_EnumerateHeapRegions(This,ppRegions) \ +#define ICorDebugProcess5_EnumerateHeapRegions(This,ppRegions) \ ( (This)->lpVtbl -> EnumerateHeapRegions(This,ppRegions) ) -#define ICorDebugProcess5_GetObject(This,addr,pObject) \ +#define ICorDebugProcess5_GetObject(This,addr,pObject) \ ( (This)->lpVtbl -> GetObject(This,addr,pObject) ) -#define ICorDebugProcess5_EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) \ +#define ICorDebugProcess5_EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) \ ( (This)->lpVtbl -> EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) ) -#define ICorDebugProcess5_EnumerateHandles(This,types,ppEnum) \ +#define ICorDebugProcess5_EnumerateHandles(This,types,ppEnum) \ ( (This)->lpVtbl -> EnumerateHandles(This,types,ppEnum) ) -#define ICorDebugProcess5_GetTypeID(This,obj,pId) \ +#define ICorDebugProcess5_GetTypeID(This,obj,pId) \ ( (This)->lpVtbl -> GetTypeID(This,obj,pId) ) -#define ICorDebugProcess5_GetTypeForTypeID(This,id,ppType) \ +#define ICorDebugProcess5_GetTypeForTypeID(This,id,ppType) \ ( (This)->lpVtbl -> GetTypeForTypeID(This,id,ppType) ) -#define ICorDebugProcess5_GetArrayLayout(This,id,pLayout) \ +#define ICorDebugProcess5_GetArrayLayout(This,id,pLayout) \ ( (This)->lpVtbl -> GetArrayLayout(This,id,pLayout) ) -#define ICorDebugProcess5_GetTypeLayout(This,id,pLayout) \ +#define ICorDebugProcess5_GetTypeLayout(This,id,pLayout) \ ( (This)->lpVtbl -> GetTypeLayout(This,id,pLayout) ) -#define ICorDebugProcess5_GetTypeFields(This,id,celt,fields,pceltNeeded) \ +#define ICorDebugProcess5_GetTypeFields(This,id,celt,fields,pceltNeeded) \ ( (This)->lpVtbl -> GetTypeFields(This,id,celt,fields,pceltNeeded) ) -#define ICorDebugProcess5_EnableNGENPolicy(This,ePolicy) \ +#define ICorDebugProcess5_EnableNGENPolicy(This,ePolicy) \ ( (This)->lpVtbl -> EnableNGENPolicy(This,ePolicy) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess5_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess5_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0040 */ @@ -7406,33 +7770,33 @@ EXTERN_C const IID IID_ICorDebugProcess5; typedef enum CorDebugRecordFormat { - FORMAT_WINDOWS_EXCEPTIONRECORD32 = 1, - FORMAT_WINDOWS_EXCEPTIONRECORD64 = 2 - } CorDebugRecordFormat; + FORMAT_WINDOWS_EXCEPTIONRECORD32 = 1, + FORMAT_WINDOWS_EXCEPTIONRECORD64 = 2 + } CorDebugRecordFormat; typedef enum CorDebugDecodeEventFlagsWindows { - IS_FIRST_CHANCE = 1 - } CorDebugDecodeEventFlagsWindows; + IS_FIRST_CHANCE = 1 + } CorDebugDecodeEventFlagsWindows; typedef enum CorDebugDebugEventKind { - DEBUG_EVENT_KIND_MODULE_LOADED = 1, - DEBUG_EVENT_KIND_MODULE_UNLOADED = 2, - DEBUG_EVENT_KIND_MANAGED_EXCEPTION_FIRST_CHANCE = 3, - DEBUG_EVENT_KIND_MANAGED_EXCEPTION_USER_FIRST_CHANCE = 4, - DEBUG_EVENT_KIND_MANAGED_EXCEPTION_CATCH_HANDLER_FOUND = 5, - DEBUG_EVENT_KIND_MANAGED_EXCEPTION_UNHANDLED = 6 - } CorDebugDebugEventKind; + DEBUG_EVENT_KIND_MODULE_LOADED = 1, + DEBUG_EVENT_KIND_MODULE_UNLOADED = 2, + DEBUG_EVENT_KIND_MANAGED_EXCEPTION_FIRST_CHANCE = 3, + DEBUG_EVENT_KIND_MANAGED_EXCEPTION_USER_FIRST_CHANCE = 4, + DEBUG_EVENT_KIND_MANAGED_EXCEPTION_CATCH_HANDLER_FOUND = 5, + DEBUG_EVENT_KIND_MANAGED_EXCEPTION_UNHANDLED = 6 + } CorDebugDebugEventKind; typedef enum CorDebugStateChange { - PROCESS_RUNNING = 0x1, - FLUSH_ALL = 0x2 - } CorDebugStateChange; + PROCESS_RUNNING = 0x1, + FLUSH_ALL = 0x2 + } CorDebugStateChange; @@ -7463,28 +7827,33 @@ EXTERN_C const IID IID_ICorDebugDebugEvent; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDebugEventVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugDebugEvent * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugDebugEvent * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugDebugEvent * This); + DECLSPEC_XFGVIRT(ICorDebugDebugEvent, GetEventKind) HRESULT ( STDMETHODCALLTYPE *GetEventKind )( ICorDebugDebugEvent * This, /* [out] */ CorDebugDebugEventKind *pDebugEventKind); + DECLSPEC_XFGVIRT(ICorDebugDebugEvent, GetThread) HRESULT ( STDMETHODCALLTYPE *GetThread )( ICorDebugDebugEvent * This, /* [out] */ ICorDebugThread **ppThread); @@ -7502,31 +7871,31 @@ EXTERN_C const IID IID_ICorDebugDebugEvent; #ifdef COBJMACROS -#define ICorDebugDebugEvent_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDebugEvent_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDebugEvent_AddRef(This) \ +#define ICorDebugDebugEvent_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDebugEvent_Release(This) \ +#define ICorDebugDebugEvent_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDebugEvent_GetEventKind(This,pDebugEventKind) \ +#define ICorDebugDebugEvent_GetEventKind(This,pDebugEventKind) \ ( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) ) -#define ICorDebugDebugEvent_GetThread(This,ppThread) \ +#define ICorDebugDebugEvent_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDebugEvent_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDebugEvent_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0041 */ @@ -7535,19 +7904,19 @@ EXTERN_C const IID IID_ICorDebugDebugEvent; typedef enum CorDebugCodeInvokeKind { - CODE_INVOKE_KIND_NONE = 0, - CODE_INVOKE_KIND_RETURN = ( CODE_INVOKE_KIND_NONE + 1 ) , - CODE_INVOKE_KIND_TAILCALL = ( CODE_INVOKE_KIND_RETURN + 1 ) - } CorDebugCodeInvokeKind; + CODE_INVOKE_KIND_NONE = 0, + CODE_INVOKE_KIND_RETURN = ( CODE_INVOKE_KIND_NONE + 1 ) , + CODE_INVOKE_KIND_TAILCALL = ( CODE_INVOKE_KIND_RETURN + 1 ) + } CorDebugCodeInvokeKind; typedef enum CorDebugCodeInvokePurpose { - CODE_INVOKE_PURPOSE_NONE = 0, - CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION = ( CODE_INVOKE_PURPOSE_NONE + 1 ) , - CODE_INVOKE_PURPOSE_CLASS_INIT = ( CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION + 1 ) , - CODE_INVOKE_PURPOSE_INTERFACE_DISPATCH = ( CODE_INVOKE_PURPOSE_CLASS_INIT + 1 ) - } CorDebugCodeInvokePurpose; + CODE_INVOKE_PURPOSE_NONE = 0, + CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION = ( CODE_INVOKE_PURPOSE_NONE + 1 ) , + CODE_INVOKE_PURPOSE_CLASS_INIT = ( CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION + 1 ) , + CODE_INVOKE_PURPOSE_INTERFACE_DISPATCH = ( CODE_INVOKE_PURPOSE_CLASS_INIT + 1 ) + } CorDebugCodeInvokePurpose; @@ -7598,24 +7967,28 @@ EXTERN_C const IID IID_ICorDebugProcess6; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess6Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcess6 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcess6 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcess6 * This); + DECLSPEC_XFGVIRT(ICorDebugProcess6, DecodeEvent) HRESULT ( STDMETHODCALLTYPE *DecodeEvent )( ICorDebugProcess6 * This, /* [size_is][length_is][in] */ const BYTE pRecord[ ], @@ -7625,23 +7998,28 @@ EXTERN_C const IID IID_ICorDebugProcess6; /* [in] */ DWORD dwThreadId, /* [out] */ ICorDebugDebugEvent **ppEvent); + DECLSPEC_XFGVIRT(ICorDebugProcess6, ProcessStateChanged) HRESULT ( STDMETHODCALLTYPE *ProcessStateChanged )( ICorDebugProcess6 * This, /* [in] */ CorDebugStateChange change); + DECLSPEC_XFGVIRT(ICorDebugProcess6, GetCode) HRESULT ( STDMETHODCALLTYPE *GetCode )( ICorDebugProcess6 * This, /* [in] */ CORDB_ADDRESS codeAddress, /* [out] */ ICorDebugCode **ppCode); + DECLSPEC_XFGVIRT(ICorDebugProcess6, EnableVirtualModuleSplitting) HRESULT ( STDMETHODCALLTYPE *EnableVirtualModuleSplitting )( ICorDebugProcess6 * This, BOOL enableSplitting); + DECLSPEC_XFGVIRT(ICorDebugProcess6, MarkDebuggerAttached) HRESULT ( STDMETHODCALLTYPE *MarkDebuggerAttached )( ICorDebugProcess6 * This, BOOL fIsAttached); + DECLSPEC_XFGVIRT(ICorDebugProcess6, GetExportStepInfo) HRESULT ( STDMETHODCALLTYPE *GetExportStepInfo )( ICorDebugProcess6 * This, /* [in] */ LPCWSTR pszExportName, @@ -7661,43 +8039,43 @@ EXTERN_C const IID IID_ICorDebugProcess6; #ifdef COBJMACROS -#define ICorDebugProcess6_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess6_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess6_AddRef(This) \ +#define ICorDebugProcess6_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess6_Release(This) \ +#define ICorDebugProcess6_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess6_DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) \ +#define ICorDebugProcess6_DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) \ ( (This)->lpVtbl -> DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) ) -#define ICorDebugProcess6_ProcessStateChanged(This,change) \ +#define ICorDebugProcess6_ProcessStateChanged(This,change) \ ( (This)->lpVtbl -> ProcessStateChanged(This,change) ) -#define ICorDebugProcess6_GetCode(This,codeAddress,ppCode) \ +#define ICorDebugProcess6_GetCode(This,codeAddress,ppCode) \ ( (This)->lpVtbl -> GetCode(This,codeAddress,ppCode) ) -#define ICorDebugProcess6_EnableVirtualModuleSplitting(This,enableSplitting) \ +#define ICorDebugProcess6_EnableVirtualModuleSplitting(This,enableSplitting) \ ( (This)->lpVtbl -> EnableVirtualModuleSplitting(This,enableSplitting) ) -#define ICorDebugProcess6_MarkDebuggerAttached(This,fIsAttached) \ +#define ICorDebugProcess6_MarkDebuggerAttached(This,fIsAttached) \ ( (This)->lpVtbl -> MarkDebuggerAttached(This,fIsAttached) ) -#define ICorDebugProcess6_GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) \ +#define ICorDebugProcess6_GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) \ ( (This)->lpVtbl -> GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess6_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess6_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0042 */ @@ -7706,9 +8084,9 @@ EXTERN_C const IID IID_ICorDebugProcess6; typedef enum WriteableMetadataUpdateMode { - LegacyCompatPolicy = 0, - AlwaysShowUpdates = ( LegacyCompatPolicy + 1 ) - } WriteableMetadataUpdateMode; + LegacyCompatPolicy = 0, + AlwaysShowUpdates = ( LegacyCompatPolicy + 1 ) + } WriteableMetadataUpdateMode; @@ -7736,24 +8114,28 @@ EXTERN_C const IID IID_ICorDebugProcess7; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess7Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcess7 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcess7 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcess7 * This); + DECLSPEC_XFGVIRT(ICorDebugProcess7, SetWriteableMetadataUpdateMode) HRESULT ( STDMETHODCALLTYPE *SetWriteableMetadataUpdateMode )( ICorDebugProcess7 * This, WriteableMetadataUpdateMode flags); @@ -7771,28 +8153,28 @@ EXTERN_C const IID IID_ICorDebugProcess7; #ifdef COBJMACROS -#define ICorDebugProcess7_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess7_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess7_AddRef(This) \ +#define ICorDebugProcess7_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess7_Release(This) \ +#define ICorDebugProcess7_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess7_SetWriteableMetadataUpdateMode(This,flags) \ +#define ICorDebugProcess7_SetWriteableMetadataUpdateMode(This,flags) \ ( (This)->lpVtbl -> SetWriteableMetadataUpdateMode(This,flags) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess7_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess7_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcess8_INTERFACE_DEFINED__ @@ -7816,24 +8198,28 @@ EXTERN_C const IID IID_ICorDebugProcess8; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess8Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcess8 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcess8 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcess8 * This); + DECLSPEC_XFGVIRT(ICorDebugProcess8, EnableExceptionCallbacksOutsideOfMyCode) HRESULT ( STDMETHODCALLTYPE *EnableExceptionCallbacksOutsideOfMyCode )( ICorDebugProcess8 * This, /* [in] */ BOOL enableExceptionsOutsideOfJMC); @@ -7851,28 +8237,28 @@ EXTERN_C const IID IID_ICorDebugProcess8; #ifdef COBJMACROS -#define ICorDebugProcess8_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess8_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess8_AddRef(This) \ +#define ICorDebugProcess8_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess8_Release(This) \ +#define ICorDebugProcess8_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess8_EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) \ +#define ICorDebugProcess8_EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) \ ( (This)->lpVtbl -> EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess8_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess8_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcess10_INTERFACE_DEFINED__ @@ -7896,24 +8282,28 @@ EXTERN_C const IID IID_ICorDebugProcess10; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess10Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcess10 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcess10 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcess10 * This); + DECLSPEC_XFGVIRT(ICorDebugProcess10, EnableGCNotificationEvents) HRESULT ( STDMETHODCALLTYPE *EnableGCNotificationEvents )( ICorDebugProcess10 * This, BOOL fEnable); @@ -7931,28 +8321,28 @@ EXTERN_C const IID IID_ICorDebugProcess10; #ifdef COBJMACROS -#define ICorDebugProcess10_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess10_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess10_AddRef(This) \ +#define ICorDebugProcess10_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess10_Release(This) \ +#define ICorDebugProcess10_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess10_EnableGCNotificationEvents(This,fEnable) \ +#define ICorDebugProcess10_EnableGCNotificationEvents(This,fEnable) \ ( (This)->lpVtbl -> EnableGCNotificationEvents(This,fEnable) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess10_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess10_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0045 */ @@ -7962,7 +8352,7 @@ typedef struct _COR_MEMORY_RANGE { CORDB_ADDRESS start; CORDB_ADDRESS end; - } COR_MEMORY_RANGE; + } COR_MEMORY_RANGE; @@ -7992,39 +8382,47 @@ EXTERN_C const IID IID_ICorDebugMemoryRangeEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMemoryRangeEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugMemoryRangeEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugMemoryRangeEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugMemoryRangeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugMemoryRangeEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugMemoryRangeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugMemoryRangeEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugMemoryRangeEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugMemoryRangeEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugMemoryRangeEnum * This, /* [in] */ ULONG celt, @@ -8044,41 +8442,41 @@ EXTERN_C const IID IID_ICorDebugMemoryRangeEnum; #ifdef COBJMACROS -#define ICorDebugMemoryRangeEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMemoryRangeEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMemoryRangeEnum_AddRef(This) \ +#define ICorDebugMemoryRangeEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMemoryRangeEnum_Release(This) \ +#define ICorDebugMemoryRangeEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMemoryRangeEnum_Skip(This,celt) \ +#define ICorDebugMemoryRangeEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugMemoryRangeEnum_Reset(This) \ +#define ICorDebugMemoryRangeEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugMemoryRangeEnum_Clone(This,ppEnum) \ +#define ICorDebugMemoryRangeEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugMemoryRangeEnum_GetCount(This,pcelt) \ +#define ICorDebugMemoryRangeEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugMemoryRangeEnum_Next(This,celt,objects,pceltFetched) \ +#define ICorDebugMemoryRangeEnum_Next(This,celt,objects,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcess11_INTERFACE_DEFINED__ @@ -8102,24 +8500,28 @@ EXTERN_C const IID IID_ICorDebugProcess11; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcess11Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcess11 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcess11 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcess11 * This); + DECLSPEC_XFGVIRT(ICorDebugProcess11, EnumerateLoaderHeapMemoryRegions) HRESULT ( STDMETHODCALLTYPE *EnumerateLoaderHeapMemoryRegions )( ICorDebugProcess11 * This, /* [out] */ ICorDebugMemoryRangeEnum **ppRanges); @@ -8137,28 +8539,28 @@ EXTERN_C const IID IID_ICorDebugProcess11; #ifdef COBJMACROS -#define ICorDebugProcess11_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcess11_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcess11_AddRef(This) \ +#define ICorDebugProcess11_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcess11_Release(This) \ +#define ICorDebugProcess11_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcess11_EnumerateLoaderHeapMemoryRegions(This,ppRanges) \ +#define ICorDebugProcess11_EnumerateLoaderHeapMemoryRegions(This,ppRanges) \ ( (This)->lpVtbl -> EnumerateLoaderHeapMemoryRegions(This,ppRanges) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcess11_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcess11_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ @@ -8182,32 +8584,38 @@ EXTERN_C const IID IID_ICorDebugModuleDebugEvent; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModuleDebugEventVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugModuleDebugEvent * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugModuleDebugEvent * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugModuleDebugEvent * This); + DECLSPEC_XFGVIRT(ICorDebugDebugEvent, GetEventKind) HRESULT ( STDMETHODCALLTYPE *GetEventKind )( ICorDebugModuleDebugEvent * This, /* [out] */ CorDebugDebugEventKind *pDebugEventKind); + DECLSPEC_XFGVIRT(ICorDebugDebugEvent, GetThread) HRESULT ( STDMETHODCALLTYPE *GetThread )( ICorDebugModuleDebugEvent * This, /* [out] */ ICorDebugThread **ppThread); + DECLSPEC_XFGVIRT(ICorDebugModuleDebugEvent, GetModule) HRESULT ( STDMETHODCALLTYPE *GetModule )( ICorDebugModuleDebugEvent * This, /* [out] */ ICorDebugModule **ppModule); @@ -8225,35 +8633,35 @@ EXTERN_C const IID IID_ICorDebugModuleDebugEvent; #ifdef COBJMACROS -#define ICorDebugModuleDebugEvent_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModuleDebugEvent_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModuleDebugEvent_AddRef(This) \ +#define ICorDebugModuleDebugEvent_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModuleDebugEvent_Release(This) \ +#define ICorDebugModuleDebugEvent_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModuleDebugEvent_GetEventKind(This,pDebugEventKind) \ +#define ICorDebugModuleDebugEvent_GetEventKind(This,pDebugEventKind) \ ( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) ) -#define ICorDebugModuleDebugEvent_GetThread(This,ppThread) \ +#define ICorDebugModuleDebugEvent_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) -#define ICorDebugModuleDebugEvent_GetModule(This,ppModule) \ +#define ICorDebugModuleDebugEvent_GetModule(This,ppModule) \ ( (This)->lpVtbl -> GetModule(This,ppModule) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ */ #ifndef __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__ @@ -8283,40 +8691,48 @@ EXTERN_C const IID IID_ICorDebugExceptionDebugEvent; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugExceptionDebugEventVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugExceptionDebugEvent * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugExceptionDebugEvent * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugExceptionDebugEvent * This); + DECLSPEC_XFGVIRT(ICorDebugDebugEvent, GetEventKind) HRESULT ( STDMETHODCALLTYPE *GetEventKind )( ICorDebugExceptionDebugEvent * This, /* [out] */ CorDebugDebugEventKind *pDebugEventKind); + DECLSPEC_XFGVIRT(ICorDebugDebugEvent, GetThread) HRESULT ( STDMETHODCALLTYPE *GetThread )( ICorDebugExceptionDebugEvent * This, /* [out] */ ICorDebugThread **ppThread); + DECLSPEC_XFGVIRT(ICorDebugExceptionDebugEvent, GetStackPointer) HRESULT ( STDMETHODCALLTYPE *GetStackPointer )( ICorDebugExceptionDebugEvent * This, /* [out] */ CORDB_ADDRESS *pStackPointer); + DECLSPEC_XFGVIRT(ICorDebugExceptionDebugEvent, GetNativeIP) HRESULT ( STDMETHODCALLTYPE *GetNativeIP )( ICorDebugExceptionDebugEvent * This, /* [out] */ CORDB_ADDRESS *pIP); + DECLSPEC_XFGVIRT(ICorDebugExceptionDebugEvent, GetFlags) HRESULT ( STDMETHODCALLTYPE *GetFlags )( ICorDebugExceptionDebugEvent * This, /* [out] */ CorDebugExceptionFlags *pdwFlags); @@ -8334,41 +8750,41 @@ EXTERN_C const IID IID_ICorDebugExceptionDebugEvent; #ifdef COBJMACROS -#define ICorDebugExceptionDebugEvent_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugExceptionDebugEvent_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugExceptionDebugEvent_AddRef(This) \ +#define ICorDebugExceptionDebugEvent_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugExceptionDebugEvent_Release(This) \ +#define ICorDebugExceptionDebugEvent_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugExceptionDebugEvent_GetEventKind(This,pDebugEventKind) \ +#define ICorDebugExceptionDebugEvent_GetEventKind(This,pDebugEventKind) \ ( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) ) -#define ICorDebugExceptionDebugEvent_GetThread(This,ppThread) \ +#define ICorDebugExceptionDebugEvent_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) -#define ICorDebugExceptionDebugEvent_GetStackPointer(This,pStackPointer) \ +#define ICorDebugExceptionDebugEvent_GetStackPointer(This,pStackPointer) \ ( (This)->lpVtbl -> GetStackPointer(This,pStackPointer) ) -#define ICorDebugExceptionDebugEvent_GetNativeIP(This,pIP) \ +#define ICorDebugExceptionDebugEvent_GetNativeIP(This,pIP) \ ( (This)->lpVtbl -> GetNativeIP(This,pIP) ) -#define ICorDebugExceptionDebugEvent_GetFlags(This,pdwFlags) \ +#define ICorDebugExceptionDebugEvent_GetFlags(This,pdwFlags) \ ( (This)->lpVtbl -> GetFlags(This,pdwFlags) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__ */ #ifndef __ICorDebugBreakpoint_INTERFACE_DEFINED__ @@ -8395,28 +8811,33 @@ EXTERN_C const IID IID_ICorDebugBreakpoint; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugBreakpointVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugBreakpoint * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugBreakpoint * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugBreakpoint * This); + DECLSPEC_XFGVIRT(ICorDebugBreakpoint, Activate) HRESULT ( STDMETHODCALLTYPE *Activate )( ICorDebugBreakpoint * This, /* [in] */ BOOL bActive); + DECLSPEC_XFGVIRT(ICorDebugBreakpoint, IsActive) HRESULT ( STDMETHODCALLTYPE *IsActive )( ICorDebugBreakpoint * This, /* [out] */ BOOL *pbActive); @@ -8434,31 +8855,31 @@ EXTERN_C const IID IID_ICorDebugBreakpoint; #ifdef COBJMACROS -#define ICorDebugBreakpoint_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugBreakpoint_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugBreakpoint_AddRef(This) \ +#define ICorDebugBreakpoint_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugBreakpoint_Release(This) \ +#define ICorDebugBreakpoint_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugBreakpoint_Activate(This,bActive) \ +#define ICorDebugBreakpoint_Activate(This,bActive) \ ( (This)->lpVtbl -> Activate(This,bActive) ) -#define ICorDebugBreakpoint_IsActive(This,pbActive) \ +#define ICorDebugBreakpoint_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugBreakpoint_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugBreakpoint_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__ @@ -8485,36 +8906,43 @@ EXTERN_C const IID IID_ICorDebugFunctionBreakpoint; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunctionBreakpointVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugFunctionBreakpoint * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugFunctionBreakpoint * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugFunctionBreakpoint * This); + DECLSPEC_XFGVIRT(ICorDebugBreakpoint, Activate) HRESULT ( STDMETHODCALLTYPE *Activate )( ICorDebugFunctionBreakpoint * This, /* [in] */ BOOL bActive); + DECLSPEC_XFGVIRT(ICorDebugBreakpoint, IsActive) HRESULT ( STDMETHODCALLTYPE *IsActive )( ICorDebugFunctionBreakpoint * This, /* [out] */ BOOL *pbActive); + DECLSPEC_XFGVIRT(ICorDebugFunctionBreakpoint, GetFunction) HRESULT ( STDMETHODCALLTYPE *GetFunction )( ICorDebugFunctionBreakpoint * This, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugFunctionBreakpoint, GetOffset) HRESULT ( STDMETHODCALLTYPE *GetOffset )( ICorDebugFunctionBreakpoint * This, /* [out] */ ULONG32 *pnOffset); @@ -8532,38 +8960,38 @@ EXTERN_C const IID IID_ICorDebugFunctionBreakpoint; #ifdef COBJMACROS -#define ICorDebugFunctionBreakpoint_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunctionBreakpoint_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunctionBreakpoint_AddRef(This) \ +#define ICorDebugFunctionBreakpoint_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunctionBreakpoint_Release(This) \ +#define ICorDebugFunctionBreakpoint_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunctionBreakpoint_Activate(This,bActive) \ +#define ICorDebugFunctionBreakpoint_Activate(This,bActive) \ ( (This)->lpVtbl -> Activate(This,bActive) ) -#define ICorDebugFunctionBreakpoint_IsActive(This,pbActive) \ +#define ICorDebugFunctionBreakpoint_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugFunctionBreakpoint_GetFunction(This,ppFunction) \ +#define ICorDebugFunctionBreakpoint_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugFunctionBreakpoint_GetOffset(This,pnOffset) \ +#define ICorDebugFunctionBreakpoint_GetOffset(This,pnOffset) \ ( (This)->lpVtbl -> GetOffset(This,pnOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__ @@ -8587,32 +9015,38 @@ EXTERN_C const IID IID_ICorDebugModuleBreakpoint; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModuleBreakpointVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugModuleBreakpoint * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugModuleBreakpoint * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugModuleBreakpoint * This); + DECLSPEC_XFGVIRT(ICorDebugBreakpoint, Activate) HRESULT ( STDMETHODCALLTYPE *Activate )( ICorDebugModuleBreakpoint * This, /* [in] */ BOOL bActive); + DECLSPEC_XFGVIRT(ICorDebugBreakpoint, IsActive) HRESULT ( STDMETHODCALLTYPE *IsActive )( ICorDebugModuleBreakpoint * This, /* [out] */ BOOL *pbActive); + DECLSPEC_XFGVIRT(ICorDebugModuleBreakpoint, GetModule) HRESULT ( STDMETHODCALLTYPE *GetModule )( ICorDebugModuleBreakpoint * This, /* [out] */ ICorDebugModule **ppModule); @@ -8630,35 +9064,35 @@ EXTERN_C const IID IID_ICorDebugModuleBreakpoint; #ifdef COBJMACROS -#define ICorDebugModuleBreakpoint_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModuleBreakpoint_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModuleBreakpoint_AddRef(This) \ +#define ICorDebugModuleBreakpoint_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModuleBreakpoint_Release(This) \ +#define ICorDebugModuleBreakpoint_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModuleBreakpoint_Activate(This,bActive) \ +#define ICorDebugModuleBreakpoint_Activate(This,bActive) \ ( (This)->lpVtbl -> Activate(This,bActive) ) -#define ICorDebugModuleBreakpoint_IsActive(This,pbActive) \ +#define ICorDebugModuleBreakpoint_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugModuleBreakpoint_GetModule(This,ppModule) \ +#define ICorDebugModuleBreakpoint_GetModule(This,ppModule) \ ( (This)->lpVtbl -> GetModule(This,ppModule) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValueBreakpoint_INTERFACE_DEFINED__ @@ -8682,32 +9116,38 @@ EXTERN_C const IID IID_ICorDebugValueBreakpoint; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValueBreakpointVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugValueBreakpoint * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugValueBreakpoint * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugValueBreakpoint * This); + DECLSPEC_XFGVIRT(ICorDebugBreakpoint, Activate) HRESULT ( STDMETHODCALLTYPE *Activate )( ICorDebugValueBreakpoint * This, /* [in] */ BOOL bActive); + DECLSPEC_XFGVIRT(ICorDebugBreakpoint, IsActive) HRESULT ( STDMETHODCALLTYPE *IsActive )( ICorDebugValueBreakpoint * This, /* [out] */ BOOL *pbActive); + DECLSPEC_XFGVIRT(ICorDebugValueBreakpoint, GetValue) HRESULT ( STDMETHODCALLTYPE *GetValue )( ICorDebugValueBreakpoint * This, /* [out] */ ICorDebugValue **ppValue); @@ -8725,35 +9165,35 @@ EXTERN_C const IID IID_ICorDebugValueBreakpoint; #ifdef COBJMACROS -#define ICorDebugValueBreakpoint_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValueBreakpoint_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValueBreakpoint_AddRef(This) \ +#define ICorDebugValueBreakpoint_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValueBreakpoint_Release(This) \ +#define ICorDebugValueBreakpoint_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValueBreakpoint_Activate(This,bActive) \ +#define ICorDebugValueBreakpoint_Activate(This,bActive) \ ( (This)->lpVtbl -> Activate(This,bActive) ) -#define ICorDebugValueBreakpoint_IsActive(This,pbActive) \ +#define ICorDebugValueBreakpoint_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugValueBreakpoint_GetValue(This,ppValue) \ +#define ICorDebugValueBreakpoint_GetValue(This,ppValue) \ ( (This)->lpVtbl -> GetValue(This,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValueBreakpoint_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValueBreakpoint_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStepper_INTERFACE_DEFINED__ @@ -8765,32 +9205,32 @@ EXTERN_C const IID IID_ICorDebugValueBreakpoint; typedef enum CorDebugIntercept { - INTERCEPT_NONE = 0, - INTERCEPT_CLASS_INIT = 0x1, - INTERCEPT_EXCEPTION_FILTER = 0x2, - INTERCEPT_SECURITY = 0x4, - INTERCEPT_CONTEXT_POLICY = 0x8, - INTERCEPT_INTERCEPTION = 0x10, - INTERCEPT_ALL = 0xffff - } CorDebugIntercept; + INTERCEPT_NONE = 0, + INTERCEPT_CLASS_INIT = 0x1, + INTERCEPT_EXCEPTION_FILTER = 0x2, + INTERCEPT_SECURITY = 0x4, + INTERCEPT_CONTEXT_POLICY = 0x8, + INTERCEPT_INTERCEPTION = 0x10, + INTERCEPT_ALL = 0xffff + } CorDebugIntercept; typedef enum CorDebugUnmappedStop { - STOP_NONE = 0, - STOP_PROLOG = 0x1, - STOP_EPILOG = 0x2, - STOP_NO_MAPPING_INFO = 0x4, - STOP_OTHER_UNMAPPED = 0x8, - STOP_UNMANAGED = 0x10, - STOP_ALL = 0xffff - } CorDebugUnmappedStop; + STOP_NONE = 0, + STOP_PROLOG = 0x1, + STOP_EPILOG = 0x2, + STOP_NO_MAPPING_INFO = 0x4, + STOP_OTHER_UNMAPPED = 0x8, + STOP_UNMANAGED = 0x10, + STOP_ALL = 0xffff + } CorDebugUnmappedStop; typedef struct COR_DEBUG_STEP_RANGE { ULONG32 startOffset; ULONG32 endOffset; - } COR_DEBUG_STEP_RANGE; + } COR_DEBUG_STEP_RANGE; EXTERN_C const IID IID_ICorDebugStepper; @@ -8828,52 +9268,63 @@ EXTERN_C const IID IID_ICorDebugStepper; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStepperVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugStepper * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugStepper * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugStepper * This); + DECLSPEC_XFGVIRT(ICorDebugStepper, IsActive) HRESULT ( STDMETHODCALLTYPE *IsActive )( ICorDebugStepper * This, /* [out] */ BOOL *pbActive); + DECLSPEC_XFGVIRT(ICorDebugStepper, Deactivate) HRESULT ( STDMETHODCALLTYPE *Deactivate )( ICorDebugStepper * This); + DECLSPEC_XFGVIRT(ICorDebugStepper, SetInterceptMask) HRESULT ( STDMETHODCALLTYPE *SetInterceptMask )( ICorDebugStepper * This, /* [in] */ CorDebugIntercept mask); + DECLSPEC_XFGVIRT(ICorDebugStepper, SetUnmappedStopMask) HRESULT ( STDMETHODCALLTYPE *SetUnmappedStopMask )( ICorDebugStepper * This, /* [in] */ CorDebugUnmappedStop mask); + DECLSPEC_XFGVIRT(ICorDebugStepper, Step) HRESULT ( STDMETHODCALLTYPE *Step )( ICorDebugStepper * This, /* [in] */ BOOL bStepIn); + DECLSPEC_XFGVIRT(ICorDebugStepper, StepRange) HRESULT ( STDMETHODCALLTYPE *StepRange )( ICorDebugStepper * This, /* [in] */ BOOL bStepIn, /* [size_is][in] */ COR_DEBUG_STEP_RANGE ranges[ ], /* [in] */ ULONG32 cRangeCount); + DECLSPEC_XFGVIRT(ICorDebugStepper, StepOut) HRESULT ( STDMETHODCALLTYPE *StepOut )( ICorDebugStepper * This); + DECLSPEC_XFGVIRT(ICorDebugStepper, SetRangeIL) HRESULT ( STDMETHODCALLTYPE *SetRangeIL )( ICorDebugStepper * This, /* [in] */ BOOL bIL); @@ -8891,49 +9342,49 @@ EXTERN_C const IID IID_ICorDebugStepper; #ifdef COBJMACROS -#define ICorDebugStepper_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStepper_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStepper_AddRef(This) \ +#define ICorDebugStepper_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStepper_Release(This) \ +#define ICorDebugStepper_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStepper_IsActive(This,pbActive) \ +#define ICorDebugStepper_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugStepper_Deactivate(This) \ +#define ICorDebugStepper_Deactivate(This) \ ( (This)->lpVtbl -> Deactivate(This) ) -#define ICorDebugStepper_SetInterceptMask(This,mask) \ +#define ICorDebugStepper_SetInterceptMask(This,mask) \ ( (This)->lpVtbl -> SetInterceptMask(This,mask) ) -#define ICorDebugStepper_SetUnmappedStopMask(This,mask) \ +#define ICorDebugStepper_SetUnmappedStopMask(This,mask) \ ( (This)->lpVtbl -> SetUnmappedStopMask(This,mask) ) -#define ICorDebugStepper_Step(This,bStepIn) \ +#define ICorDebugStepper_Step(This,bStepIn) \ ( (This)->lpVtbl -> Step(This,bStepIn) ) -#define ICorDebugStepper_StepRange(This,bStepIn,ranges,cRangeCount) \ +#define ICorDebugStepper_StepRange(This,bStepIn,ranges,cRangeCount) \ ( (This)->lpVtbl -> StepRange(This,bStepIn,ranges,cRangeCount) ) -#define ICorDebugStepper_StepOut(This) \ +#define ICorDebugStepper_StepOut(This) \ ( (This)->lpVtbl -> StepOut(This) ) -#define ICorDebugStepper_SetRangeIL(This,bIL) \ +#define ICorDebugStepper_SetRangeIL(This,bIL) \ ( (This)->lpVtbl -> SetRangeIL(This,bIL) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStepper_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStepper_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStepper2_INTERFACE_DEFINED__ @@ -8957,24 +9408,28 @@ EXTERN_C const IID IID_ICorDebugStepper2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStepper2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugStepper2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugStepper2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugStepper2 * This); + DECLSPEC_XFGVIRT(ICorDebugStepper2, SetJMC) HRESULT ( STDMETHODCALLTYPE *SetJMC )( ICorDebugStepper2 * This, /* [in] */ BOOL fIsJMCStepper); @@ -8992,28 +9447,28 @@ EXTERN_C const IID IID_ICorDebugStepper2; #ifdef COBJMACROS -#define ICorDebugStepper2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStepper2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStepper2_AddRef(This) \ +#define ICorDebugStepper2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStepper2_Release(This) \ +#define ICorDebugStepper2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStepper2_SetJMC(This,fIsJMCStepper) \ +#define ICorDebugStepper2_SetJMC(This,fIsJMCStepper) \ ( (This)->lpVtbl -> SetJMC(This,fIsJMCStepper) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStepper2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStepper2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugRegisterSet_INTERFACE_DEFINED__ @@ -9025,241 +9480,304 @@ EXTERN_C const IID IID_ICorDebugStepper2; typedef enum CorDebugRegister { - REGISTER_INSTRUCTION_POINTER = 0, - REGISTER_STACK_POINTER = ( REGISTER_INSTRUCTION_POINTER + 1 ) , - REGISTER_FRAME_POINTER = ( REGISTER_STACK_POINTER + 1 ) , - REGISTER_X86_EIP = 0, - REGISTER_X86_ESP = ( REGISTER_X86_EIP + 1 ) , - REGISTER_X86_EBP = ( REGISTER_X86_ESP + 1 ) , - REGISTER_X86_EAX = ( REGISTER_X86_EBP + 1 ) , - REGISTER_X86_ECX = ( REGISTER_X86_EAX + 1 ) , - REGISTER_X86_EDX = ( REGISTER_X86_ECX + 1 ) , - REGISTER_X86_EBX = ( REGISTER_X86_EDX + 1 ) , - REGISTER_X86_ESI = ( REGISTER_X86_EBX + 1 ) , - REGISTER_X86_EDI = ( REGISTER_X86_ESI + 1 ) , - REGISTER_X86_FPSTACK_0 = ( REGISTER_X86_EDI + 1 ) , - REGISTER_X86_FPSTACK_1 = ( REGISTER_X86_FPSTACK_0 + 1 ) , - REGISTER_X86_FPSTACK_2 = ( REGISTER_X86_FPSTACK_1 + 1 ) , - REGISTER_X86_FPSTACK_3 = ( REGISTER_X86_FPSTACK_2 + 1 ) , - REGISTER_X86_FPSTACK_4 = ( REGISTER_X86_FPSTACK_3 + 1 ) , - REGISTER_X86_FPSTACK_5 = ( REGISTER_X86_FPSTACK_4 + 1 ) , - REGISTER_X86_FPSTACK_6 = ( REGISTER_X86_FPSTACK_5 + 1 ) , - REGISTER_X86_FPSTACK_7 = ( REGISTER_X86_FPSTACK_6 + 1 ) , - REGISTER_AMD64_RIP = 0, - REGISTER_AMD64_RSP = ( REGISTER_AMD64_RIP + 1 ) , - REGISTER_AMD64_RBP = ( REGISTER_AMD64_RSP + 1 ) , - REGISTER_AMD64_RAX = ( REGISTER_AMD64_RBP + 1 ) , - REGISTER_AMD64_RCX = ( REGISTER_AMD64_RAX + 1 ) , - REGISTER_AMD64_RDX = ( REGISTER_AMD64_RCX + 1 ) , - REGISTER_AMD64_RBX = ( REGISTER_AMD64_RDX + 1 ) , - REGISTER_AMD64_RSI = ( REGISTER_AMD64_RBX + 1 ) , - REGISTER_AMD64_RDI = ( REGISTER_AMD64_RSI + 1 ) , - REGISTER_AMD64_R8 = ( REGISTER_AMD64_RDI + 1 ) , - REGISTER_AMD64_R9 = ( REGISTER_AMD64_R8 + 1 ) , - REGISTER_AMD64_R10 = ( REGISTER_AMD64_R9 + 1 ) , - REGISTER_AMD64_R11 = ( REGISTER_AMD64_R10 + 1 ) , - REGISTER_AMD64_R12 = ( REGISTER_AMD64_R11 + 1 ) , - REGISTER_AMD64_R13 = ( REGISTER_AMD64_R12 + 1 ) , - REGISTER_AMD64_R14 = ( REGISTER_AMD64_R13 + 1 ) , - REGISTER_AMD64_R15 = ( REGISTER_AMD64_R14 + 1 ) , - REGISTER_AMD64_XMM0 = ( REGISTER_AMD64_R15 + 1 ) , - REGISTER_AMD64_XMM1 = ( REGISTER_AMD64_XMM0 + 1 ) , - REGISTER_AMD64_XMM2 = ( REGISTER_AMD64_XMM1 + 1 ) , - REGISTER_AMD64_XMM3 = ( REGISTER_AMD64_XMM2 + 1 ) , - REGISTER_AMD64_XMM4 = ( REGISTER_AMD64_XMM3 + 1 ) , - REGISTER_AMD64_XMM5 = ( REGISTER_AMD64_XMM4 + 1 ) , - REGISTER_AMD64_XMM6 = ( REGISTER_AMD64_XMM5 + 1 ) , - REGISTER_AMD64_XMM7 = ( REGISTER_AMD64_XMM6 + 1 ) , - REGISTER_AMD64_XMM8 = ( REGISTER_AMD64_XMM7 + 1 ) , - REGISTER_AMD64_XMM9 = ( REGISTER_AMD64_XMM8 + 1 ) , - REGISTER_AMD64_XMM10 = ( REGISTER_AMD64_XMM9 + 1 ) , - REGISTER_AMD64_XMM11 = ( REGISTER_AMD64_XMM10 + 1 ) , - REGISTER_AMD64_XMM12 = ( REGISTER_AMD64_XMM11 + 1 ) , - REGISTER_AMD64_XMM13 = ( REGISTER_AMD64_XMM12 + 1 ) , - REGISTER_AMD64_XMM14 = ( REGISTER_AMD64_XMM13 + 1 ) , - REGISTER_AMD64_XMM15 = ( REGISTER_AMD64_XMM14 + 1 ) , - REGISTER_IA64_BSP = REGISTER_FRAME_POINTER, - REGISTER_IA64_R0 = ( REGISTER_IA64_BSP + 1 ) , - REGISTER_IA64_F0 = ( REGISTER_IA64_R0 + 128 ) , - REGISTER_ARM_PC = 0, - REGISTER_ARM_SP = ( REGISTER_ARM_PC + 1 ) , - REGISTER_ARM_R0 = ( REGISTER_ARM_SP + 1 ) , - REGISTER_ARM_R1 = ( REGISTER_ARM_R0 + 1 ) , - REGISTER_ARM_R2 = ( REGISTER_ARM_R1 + 1 ) , - REGISTER_ARM_R3 = ( REGISTER_ARM_R2 + 1 ) , - REGISTER_ARM_R4 = ( REGISTER_ARM_R3 + 1 ) , - REGISTER_ARM_R5 = ( REGISTER_ARM_R4 + 1 ) , - REGISTER_ARM_R6 = ( REGISTER_ARM_R5 + 1 ) , - REGISTER_ARM_R7 = ( REGISTER_ARM_R6 + 1 ) , - REGISTER_ARM_R8 = ( REGISTER_ARM_R7 + 1 ) , - REGISTER_ARM_R9 = ( REGISTER_ARM_R8 + 1 ) , - REGISTER_ARM_R10 = ( REGISTER_ARM_R9 + 1 ) , - REGISTER_ARM_R11 = ( REGISTER_ARM_R10 + 1 ) , - REGISTER_ARM_R12 = ( REGISTER_ARM_R11 + 1 ) , - REGISTER_ARM_LR = ( REGISTER_ARM_R12 + 1 ) , - REGISTER_ARM_D0 = ( REGISTER_ARM_LR + 1 ) , - REGISTER_ARM_D1 = ( REGISTER_ARM_D0 + 1 ) , - REGISTER_ARM_D2 = ( REGISTER_ARM_D1 + 1 ) , - REGISTER_ARM_D3 = ( REGISTER_ARM_D2 + 1 ) , - REGISTER_ARM_D4 = ( REGISTER_ARM_D3 + 1 ) , - REGISTER_ARM_D5 = ( REGISTER_ARM_D4 + 1 ) , - REGISTER_ARM_D6 = ( REGISTER_ARM_D5 + 1 ) , - REGISTER_ARM_D7 = ( REGISTER_ARM_D6 + 1 ) , - REGISTER_ARM_D8 = ( REGISTER_ARM_D7 + 1 ) , - REGISTER_ARM_D9 = ( REGISTER_ARM_D8 + 1 ) , - REGISTER_ARM_D10 = ( REGISTER_ARM_D9 + 1 ) , - REGISTER_ARM_D11 = ( REGISTER_ARM_D10 + 1 ) , - REGISTER_ARM_D12 = ( REGISTER_ARM_D11 + 1 ) , - REGISTER_ARM_D13 = ( REGISTER_ARM_D12 + 1 ) , - REGISTER_ARM_D14 = ( REGISTER_ARM_D13 + 1 ) , - REGISTER_ARM_D15 = ( REGISTER_ARM_D14 + 1 ) , - REGISTER_ARM_D16 = ( REGISTER_ARM_D15 + 1 ) , - REGISTER_ARM_D17 = ( REGISTER_ARM_D16 + 1 ) , - REGISTER_ARM_D18 = ( REGISTER_ARM_D17 + 1 ) , - REGISTER_ARM_D19 = ( REGISTER_ARM_D18 + 1 ) , - REGISTER_ARM_D20 = ( REGISTER_ARM_D19 + 1 ) , - REGISTER_ARM_D21 = ( REGISTER_ARM_D20 + 1 ) , - REGISTER_ARM_D22 = ( REGISTER_ARM_D21 + 1 ) , - REGISTER_ARM_D23 = ( REGISTER_ARM_D22 + 1 ) , - REGISTER_ARM_D24 = ( REGISTER_ARM_D23 + 1 ) , - REGISTER_ARM_D25 = ( REGISTER_ARM_D24 + 1 ) , - REGISTER_ARM_D26 = ( REGISTER_ARM_D25 + 1 ) , - REGISTER_ARM_D27 = ( REGISTER_ARM_D26 + 1 ) , - REGISTER_ARM_D28 = ( REGISTER_ARM_D27 + 1 ) , - REGISTER_ARM_D29 = ( REGISTER_ARM_D28 + 1 ) , - REGISTER_ARM_D30 = ( REGISTER_ARM_D29 + 1 ) , - REGISTER_ARM_D31 = ( REGISTER_ARM_D30 + 1 ) , - REGISTER_ARM64_PC = 0, - REGISTER_ARM64_SP = ( REGISTER_ARM64_PC + 1 ) , - REGISTER_ARM64_FP = ( REGISTER_ARM64_SP + 1 ) , - REGISTER_ARM64_X0 = ( REGISTER_ARM64_FP + 1 ) , - REGISTER_ARM64_X1 = ( REGISTER_ARM64_X0 + 1 ) , - REGISTER_ARM64_X2 = ( REGISTER_ARM64_X1 + 1 ) , - REGISTER_ARM64_X3 = ( REGISTER_ARM64_X2 + 1 ) , - REGISTER_ARM64_X4 = ( REGISTER_ARM64_X3 + 1 ) , - REGISTER_ARM64_X5 = ( REGISTER_ARM64_X4 + 1 ) , - REGISTER_ARM64_X6 = ( REGISTER_ARM64_X5 + 1 ) , - REGISTER_ARM64_X7 = ( REGISTER_ARM64_X6 + 1 ) , - REGISTER_ARM64_X8 = ( REGISTER_ARM64_X7 + 1 ) , - REGISTER_ARM64_X9 = ( REGISTER_ARM64_X8 + 1 ) , - REGISTER_ARM64_X10 = ( REGISTER_ARM64_X9 + 1 ) , - REGISTER_ARM64_X11 = ( REGISTER_ARM64_X10 + 1 ) , - REGISTER_ARM64_X12 = ( REGISTER_ARM64_X11 + 1 ) , - REGISTER_ARM64_X13 = ( REGISTER_ARM64_X12 + 1 ) , - REGISTER_ARM64_X14 = ( REGISTER_ARM64_X13 + 1 ) , - REGISTER_ARM64_X15 = ( REGISTER_ARM64_X14 + 1 ) , - REGISTER_ARM64_X16 = ( REGISTER_ARM64_X15 + 1 ) , - REGISTER_ARM64_X17 = ( REGISTER_ARM64_X16 + 1 ) , - REGISTER_ARM64_X18 = ( REGISTER_ARM64_X17 + 1 ) , - REGISTER_ARM64_X19 = ( REGISTER_ARM64_X18 + 1 ) , - REGISTER_ARM64_X20 = ( REGISTER_ARM64_X19 + 1 ) , - REGISTER_ARM64_X21 = ( REGISTER_ARM64_X20 + 1 ) , - REGISTER_ARM64_X22 = ( REGISTER_ARM64_X21 + 1 ) , - REGISTER_ARM64_X23 = ( REGISTER_ARM64_X22 + 1 ) , - REGISTER_ARM64_X24 = ( REGISTER_ARM64_X23 + 1 ) , - REGISTER_ARM64_X25 = ( REGISTER_ARM64_X24 + 1 ) , - REGISTER_ARM64_X26 = ( REGISTER_ARM64_X25 + 1 ) , - REGISTER_ARM64_X27 = ( REGISTER_ARM64_X26 + 1 ) , - REGISTER_ARM64_X28 = ( REGISTER_ARM64_X27 + 1 ) , - REGISTER_ARM64_LR = ( REGISTER_ARM64_X28 + 1 ) , - REGISTER_ARM64_V0 = ( REGISTER_ARM64_LR + 1 ) , - REGISTER_ARM64_V1 = ( REGISTER_ARM64_V0 + 1 ) , - REGISTER_ARM64_V2 = ( REGISTER_ARM64_V1 + 1 ) , - REGISTER_ARM64_V3 = ( REGISTER_ARM64_V2 + 1 ) , - REGISTER_ARM64_V4 = ( REGISTER_ARM64_V3 + 1 ) , - REGISTER_ARM64_V5 = ( REGISTER_ARM64_V4 + 1 ) , - REGISTER_ARM64_V6 = ( REGISTER_ARM64_V5 + 1 ) , - REGISTER_ARM64_V7 = ( REGISTER_ARM64_V6 + 1 ) , - REGISTER_ARM64_V8 = ( REGISTER_ARM64_V7 + 1 ) , - REGISTER_ARM64_V9 = ( REGISTER_ARM64_V8 + 1 ) , - REGISTER_ARM64_V10 = ( REGISTER_ARM64_V9 + 1 ) , - REGISTER_ARM64_V11 = ( REGISTER_ARM64_V10 + 1 ) , - REGISTER_ARM64_V12 = ( REGISTER_ARM64_V11 + 1 ) , - REGISTER_ARM64_V13 = ( REGISTER_ARM64_V12 + 1 ) , - REGISTER_ARM64_V14 = ( REGISTER_ARM64_V13 + 1 ) , - REGISTER_ARM64_V15 = ( REGISTER_ARM64_V14 + 1 ) , - REGISTER_ARM64_V16 = ( REGISTER_ARM64_V15 + 1 ) , - REGISTER_ARM64_V17 = ( REGISTER_ARM64_V16 + 1 ) , - REGISTER_ARM64_V18 = ( REGISTER_ARM64_V17 + 1 ) , - REGISTER_ARM64_V19 = ( REGISTER_ARM64_V18 + 1 ) , - REGISTER_ARM64_V20 = ( REGISTER_ARM64_V19 + 1 ) , - REGISTER_ARM64_V21 = ( REGISTER_ARM64_V20 + 1 ) , - REGISTER_ARM64_V22 = ( REGISTER_ARM64_V21 + 1 ) , - REGISTER_ARM64_V23 = ( REGISTER_ARM64_V22 + 1 ) , - REGISTER_ARM64_V24 = ( REGISTER_ARM64_V23 + 1 ) , - REGISTER_ARM64_V25 = ( REGISTER_ARM64_V24 + 1 ) , - REGISTER_ARM64_V26 = ( REGISTER_ARM64_V25 + 1 ) , - REGISTER_ARM64_V27 = ( REGISTER_ARM64_V26 + 1 ) , - REGISTER_ARM64_V28 = ( REGISTER_ARM64_V27 + 1 ) , - REGISTER_ARM64_V29 = ( REGISTER_ARM64_V28 + 1 ) , - REGISTER_ARM64_V30 = ( REGISTER_ARM64_V29 + 1 ) , - REGISTER_ARM64_V31 = ( REGISTER_ARM64_V30 + 1 ) , + REGISTER_INSTRUCTION_POINTER = 0, + REGISTER_STACK_POINTER = ( REGISTER_INSTRUCTION_POINTER + 1 ) , + REGISTER_FRAME_POINTER = ( REGISTER_STACK_POINTER + 1 ) , + REGISTER_X86_EIP = 0, + REGISTER_X86_ESP = ( REGISTER_X86_EIP + 1 ) , + REGISTER_X86_EBP = ( REGISTER_X86_ESP + 1 ) , + REGISTER_X86_EAX = ( REGISTER_X86_EBP + 1 ) , + REGISTER_X86_ECX = ( REGISTER_X86_EAX + 1 ) , + REGISTER_X86_EDX = ( REGISTER_X86_ECX + 1 ) , + REGISTER_X86_EBX = ( REGISTER_X86_EDX + 1 ) , + REGISTER_X86_ESI = ( REGISTER_X86_EBX + 1 ) , + REGISTER_X86_EDI = ( REGISTER_X86_ESI + 1 ) , + REGISTER_X86_FPSTACK_0 = ( REGISTER_X86_EDI + 1 ) , + REGISTER_X86_FPSTACK_1 = ( REGISTER_X86_FPSTACK_0 + 1 ) , + REGISTER_X86_FPSTACK_2 = ( REGISTER_X86_FPSTACK_1 + 1 ) , + REGISTER_X86_FPSTACK_3 = ( REGISTER_X86_FPSTACK_2 + 1 ) , + REGISTER_X86_FPSTACK_4 = ( REGISTER_X86_FPSTACK_3 + 1 ) , + REGISTER_X86_FPSTACK_5 = ( REGISTER_X86_FPSTACK_4 + 1 ) , + REGISTER_X86_FPSTACK_6 = ( REGISTER_X86_FPSTACK_5 + 1 ) , + REGISTER_X86_FPSTACK_7 = ( REGISTER_X86_FPSTACK_6 + 1 ) , + REGISTER_AMD64_RIP = 0, + REGISTER_AMD64_RSP = ( REGISTER_AMD64_RIP + 1 ) , + REGISTER_AMD64_RBP = ( REGISTER_AMD64_RSP + 1 ) , + REGISTER_AMD64_RAX = ( REGISTER_AMD64_RBP + 1 ) , + REGISTER_AMD64_RCX = ( REGISTER_AMD64_RAX + 1 ) , + REGISTER_AMD64_RDX = ( REGISTER_AMD64_RCX + 1 ) , + REGISTER_AMD64_RBX = ( REGISTER_AMD64_RDX + 1 ) , + REGISTER_AMD64_RSI = ( REGISTER_AMD64_RBX + 1 ) , + REGISTER_AMD64_RDI = ( REGISTER_AMD64_RSI + 1 ) , + REGISTER_AMD64_R8 = ( REGISTER_AMD64_RDI + 1 ) , + REGISTER_AMD64_R9 = ( REGISTER_AMD64_R8 + 1 ) , + REGISTER_AMD64_R10 = ( REGISTER_AMD64_R9 + 1 ) , + REGISTER_AMD64_R11 = ( REGISTER_AMD64_R10 + 1 ) , + REGISTER_AMD64_R12 = ( REGISTER_AMD64_R11 + 1 ) , + REGISTER_AMD64_R13 = ( REGISTER_AMD64_R12 + 1 ) , + REGISTER_AMD64_R14 = ( REGISTER_AMD64_R13 + 1 ) , + REGISTER_AMD64_R15 = ( REGISTER_AMD64_R14 + 1 ) , + REGISTER_AMD64_XMM0 = ( REGISTER_AMD64_R15 + 1 ) , + REGISTER_AMD64_XMM1 = ( REGISTER_AMD64_XMM0 + 1 ) , + REGISTER_AMD64_XMM2 = ( REGISTER_AMD64_XMM1 + 1 ) , + REGISTER_AMD64_XMM3 = ( REGISTER_AMD64_XMM2 + 1 ) , + REGISTER_AMD64_XMM4 = ( REGISTER_AMD64_XMM3 + 1 ) , + REGISTER_AMD64_XMM5 = ( REGISTER_AMD64_XMM4 + 1 ) , + REGISTER_AMD64_XMM6 = ( REGISTER_AMD64_XMM5 + 1 ) , + REGISTER_AMD64_XMM7 = ( REGISTER_AMD64_XMM6 + 1 ) , + REGISTER_AMD64_XMM8 = ( REGISTER_AMD64_XMM7 + 1 ) , + REGISTER_AMD64_XMM9 = ( REGISTER_AMD64_XMM8 + 1 ) , + REGISTER_AMD64_XMM10 = ( REGISTER_AMD64_XMM9 + 1 ) , + REGISTER_AMD64_XMM11 = ( REGISTER_AMD64_XMM10 + 1 ) , + REGISTER_AMD64_XMM12 = ( REGISTER_AMD64_XMM11 + 1 ) , + REGISTER_AMD64_XMM13 = ( REGISTER_AMD64_XMM12 + 1 ) , + REGISTER_AMD64_XMM14 = ( REGISTER_AMD64_XMM13 + 1 ) , + REGISTER_AMD64_XMM15 = ( REGISTER_AMD64_XMM14 + 1 ) , + REGISTER_IA64_BSP = REGISTER_FRAME_POINTER, + REGISTER_IA64_R0 = ( REGISTER_IA64_BSP + 1 ) , + REGISTER_IA64_F0 = ( REGISTER_IA64_R0 + 128 ) , + REGISTER_ARM_PC = 0, + REGISTER_ARM_SP = ( REGISTER_ARM_PC + 1 ) , + REGISTER_ARM_R0 = ( REGISTER_ARM_SP + 1 ) , + REGISTER_ARM_R1 = ( REGISTER_ARM_R0 + 1 ) , + REGISTER_ARM_R2 = ( REGISTER_ARM_R1 + 1 ) , + REGISTER_ARM_R3 = ( REGISTER_ARM_R2 + 1 ) , + REGISTER_ARM_R4 = ( REGISTER_ARM_R3 + 1 ) , + REGISTER_ARM_R5 = ( REGISTER_ARM_R4 + 1 ) , + REGISTER_ARM_R6 = ( REGISTER_ARM_R5 + 1 ) , + REGISTER_ARM_R7 = ( REGISTER_ARM_R6 + 1 ) , + REGISTER_ARM_R8 = ( REGISTER_ARM_R7 + 1 ) , + REGISTER_ARM_R9 = ( REGISTER_ARM_R8 + 1 ) , + REGISTER_ARM_R10 = ( REGISTER_ARM_R9 + 1 ) , + REGISTER_ARM_R11 = ( REGISTER_ARM_R10 + 1 ) , + REGISTER_ARM_R12 = ( REGISTER_ARM_R11 + 1 ) , + REGISTER_ARM_LR = ( REGISTER_ARM_R12 + 1 ) , + REGISTER_ARM_D0 = ( REGISTER_ARM_LR + 1 ) , + REGISTER_ARM_D1 = ( REGISTER_ARM_D0 + 1 ) , + REGISTER_ARM_D2 = ( REGISTER_ARM_D1 + 1 ) , + REGISTER_ARM_D3 = ( REGISTER_ARM_D2 + 1 ) , + REGISTER_ARM_D4 = ( REGISTER_ARM_D3 + 1 ) , + REGISTER_ARM_D5 = ( REGISTER_ARM_D4 + 1 ) , + REGISTER_ARM_D6 = ( REGISTER_ARM_D5 + 1 ) , + REGISTER_ARM_D7 = ( REGISTER_ARM_D6 + 1 ) , + REGISTER_ARM_D8 = ( REGISTER_ARM_D7 + 1 ) , + REGISTER_ARM_D9 = ( REGISTER_ARM_D8 + 1 ) , + REGISTER_ARM_D10 = ( REGISTER_ARM_D9 + 1 ) , + REGISTER_ARM_D11 = ( REGISTER_ARM_D10 + 1 ) , + REGISTER_ARM_D12 = ( REGISTER_ARM_D11 + 1 ) , + REGISTER_ARM_D13 = ( REGISTER_ARM_D12 + 1 ) , + REGISTER_ARM_D14 = ( REGISTER_ARM_D13 + 1 ) , + REGISTER_ARM_D15 = ( REGISTER_ARM_D14 + 1 ) , + REGISTER_ARM_D16 = ( REGISTER_ARM_D15 + 1 ) , + REGISTER_ARM_D17 = ( REGISTER_ARM_D16 + 1 ) , + REGISTER_ARM_D18 = ( REGISTER_ARM_D17 + 1 ) , + REGISTER_ARM_D19 = ( REGISTER_ARM_D18 + 1 ) , + REGISTER_ARM_D20 = ( REGISTER_ARM_D19 + 1 ) , + REGISTER_ARM_D21 = ( REGISTER_ARM_D20 + 1 ) , + REGISTER_ARM_D22 = ( REGISTER_ARM_D21 + 1 ) , + REGISTER_ARM_D23 = ( REGISTER_ARM_D22 + 1 ) , + REGISTER_ARM_D24 = ( REGISTER_ARM_D23 + 1 ) , + REGISTER_ARM_D25 = ( REGISTER_ARM_D24 + 1 ) , + REGISTER_ARM_D26 = ( REGISTER_ARM_D25 + 1 ) , + REGISTER_ARM_D27 = ( REGISTER_ARM_D26 + 1 ) , + REGISTER_ARM_D28 = ( REGISTER_ARM_D27 + 1 ) , + REGISTER_ARM_D29 = ( REGISTER_ARM_D28 + 1 ) , + REGISTER_ARM_D30 = ( REGISTER_ARM_D29 + 1 ) , + REGISTER_ARM_D31 = ( REGISTER_ARM_D30 + 1 ) , + REGISTER_ARM64_PC = 0, + REGISTER_ARM64_SP = ( REGISTER_ARM64_PC + 1 ) , + REGISTER_ARM64_FP = ( REGISTER_ARM64_SP + 1 ) , + REGISTER_ARM64_X0 = ( REGISTER_ARM64_FP + 1 ) , + REGISTER_ARM64_X1 = ( REGISTER_ARM64_X0 + 1 ) , + REGISTER_ARM64_X2 = ( REGISTER_ARM64_X1 + 1 ) , + REGISTER_ARM64_X3 = ( REGISTER_ARM64_X2 + 1 ) , + REGISTER_ARM64_X4 = ( REGISTER_ARM64_X3 + 1 ) , + REGISTER_ARM64_X5 = ( REGISTER_ARM64_X4 + 1 ) , + REGISTER_ARM64_X6 = ( REGISTER_ARM64_X5 + 1 ) , + REGISTER_ARM64_X7 = ( REGISTER_ARM64_X6 + 1 ) , + REGISTER_ARM64_X8 = ( REGISTER_ARM64_X7 + 1 ) , + REGISTER_ARM64_X9 = ( REGISTER_ARM64_X8 + 1 ) , + REGISTER_ARM64_X10 = ( REGISTER_ARM64_X9 + 1 ) , + REGISTER_ARM64_X11 = ( REGISTER_ARM64_X10 + 1 ) , + REGISTER_ARM64_X12 = ( REGISTER_ARM64_X11 + 1 ) , + REGISTER_ARM64_X13 = ( REGISTER_ARM64_X12 + 1 ) , + REGISTER_ARM64_X14 = ( REGISTER_ARM64_X13 + 1 ) , + REGISTER_ARM64_X15 = ( REGISTER_ARM64_X14 + 1 ) , + REGISTER_ARM64_X16 = ( REGISTER_ARM64_X15 + 1 ) , + REGISTER_ARM64_X17 = ( REGISTER_ARM64_X16 + 1 ) , + REGISTER_ARM64_X18 = ( REGISTER_ARM64_X17 + 1 ) , + REGISTER_ARM64_X19 = ( REGISTER_ARM64_X18 + 1 ) , + REGISTER_ARM64_X20 = ( REGISTER_ARM64_X19 + 1 ) , + REGISTER_ARM64_X21 = ( REGISTER_ARM64_X20 + 1 ) , + REGISTER_ARM64_X22 = ( REGISTER_ARM64_X21 + 1 ) , + REGISTER_ARM64_X23 = ( REGISTER_ARM64_X22 + 1 ) , + REGISTER_ARM64_X24 = ( REGISTER_ARM64_X23 + 1 ) , + REGISTER_ARM64_X25 = ( REGISTER_ARM64_X24 + 1 ) , + REGISTER_ARM64_X26 = ( REGISTER_ARM64_X25 + 1 ) , + REGISTER_ARM64_X27 = ( REGISTER_ARM64_X26 + 1 ) , + REGISTER_ARM64_X28 = ( REGISTER_ARM64_X27 + 1 ) , + REGISTER_ARM64_LR = ( REGISTER_ARM64_X28 + 1 ) , + REGISTER_ARM64_V0 = ( REGISTER_ARM64_LR + 1 ) , + REGISTER_ARM64_V1 = ( REGISTER_ARM64_V0 + 1 ) , + REGISTER_ARM64_V2 = ( REGISTER_ARM64_V1 + 1 ) , + REGISTER_ARM64_V3 = ( REGISTER_ARM64_V2 + 1 ) , + REGISTER_ARM64_V4 = ( REGISTER_ARM64_V3 + 1 ) , + REGISTER_ARM64_V5 = ( REGISTER_ARM64_V4 + 1 ) , + REGISTER_ARM64_V6 = ( REGISTER_ARM64_V5 + 1 ) , + REGISTER_ARM64_V7 = ( REGISTER_ARM64_V6 + 1 ) , + REGISTER_ARM64_V8 = ( REGISTER_ARM64_V7 + 1 ) , + REGISTER_ARM64_V9 = ( REGISTER_ARM64_V8 + 1 ) , + REGISTER_ARM64_V10 = ( REGISTER_ARM64_V9 + 1 ) , + REGISTER_ARM64_V11 = ( REGISTER_ARM64_V10 + 1 ) , + REGISTER_ARM64_V12 = ( REGISTER_ARM64_V11 + 1 ) , + REGISTER_ARM64_V13 = ( REGISTER_ARM64_V12 + 1 ) , + REGISTER_ARM64_V14 = ( REGISTER_ARM64_V13 + 1 ) , + REGISTER_ARM64_V15 = ( REGISTER_ARM64_V14 + 1 ) , + REGISTER_ARM64_V16 = ( REGISTER_ARM64_V15 + 1 ) , + REGISTER_ARM64_V17 = ( REGISTER_ARM64_V16 + 1 ) , + REGISTER_ARM64_V18 = ( REGISTER_ARM64_V17 + 1 ) , + REGISTER_ARM64_V19 = ( REGISTER_ARM64_V18 + 1 ) , + REGISTER_ARM64_V20 = ( REGISTER_ARM64_V19 + 1 ) , + REGISTER_ARM64_V21 = ( REGISTER_ARM64_V20 + 1 ) , + REGISTER_ARM64_V22 = ( REGISTER_ARM64_V21 + 1 ) , + REGISTER_ARM64_V23 = ( REGISTER_ARM64_V22 + 1 ) , + REGISTER_ARM64_V24 = ( REGISTER_ARM64_V23 + 1 ) , + REGISTER_ARM64_V25 = ( REGISTER_ARM64_V24 + 1 ) , + REGISTER_ARM64_V26 = ( REGISTER_ARM64_V25 + 1 ) , + REGISTER_ARM64_V27 = ( REGISTER_ARM64_V26 + 1 ) , + REGISTER_ARM64_V28 = ( REGISTER_ARM64_V27 + 1 ) , + REGISTER_ARM64_V29 = ( REGISTER_ARM64_V28 + 1 ) , + REGISTER_ARM64_V30 = ( REGISTER_ARM64_V29 + 1 ) , + REGISTER_ARM64_V31 = ( REGISTER_ARM64_V30 + 1 ) , + REGISTER_LOONGARCH64_PC = 0, + REGISTER_LOONGARCH64_SP = ( REGISTER_LOONGARCH64_PC + 1 ) , + REGISTER_LOONGARCH64_FP = ( REGISTER_LOONGARCH64_SP + 1 ) , + REGISTER_LOONGARCH64_RA = ( REGISTER_LOONGARCH64_FP + 1 ) , + REGISTER_LOONGARCH64_TP = ( REGISTER_LOONGARCH64_RA + 1 ) , + REGISTER_LOONGARCH64_A0 = ( REGISTER_LOONGARCH64_TP + 1 ) , + REGISTER_LOONGARCH64_A1 = ( REGISTER_LOONGARCH64_A0 + 1 ) , + REGISTER_LOONGARCH64_A2 = ( REGISTER_LOONGARCH64_A1 + 1 ) , + REGISTER_LOONGARCH64_A3 = ( REGISTER_LOONGARCH64_A2 + 1 ) , + REGISTER_LOONGARCH64_A4 = ( REGISTER_LOONGARCH64_A3 + 1 ) , + REGISTER_LOONGARCH64_A5 = ( REGISTER_LOONGARCH64_A4 + 1 ) , + REGISTER_LOONGARCH64_A6 = ( REGISTER_LOONGARCH64_A5 + 1 ) , + REGISTER_LOONGARCH64_A7 = ( REGISTER_LOONGARCH64_A6 + 1 ) , + REGISTER_LOONGARCH64_T0 = ( REGISTER_LOONGARCH64_A7 + 1 ) , + REGISTER_LOONGARCH64_T1 = ( REGISTER_LOONGARCH64_T0 + 1 ) , + REGISTER_LOONGARCH64_T2 = ( REGISTER_LOONGARCH64_T1 + 1 ) , + REGISTER_LOONGARCH64_T3 = ( REGISTER_LOONGARCH64_T2 + 1 ) , + REGISTER_LOONGARCH64_T4 = ( REGISTER_LOONGARCH64_T3 + 1 ) , + REGISTER_LOONGARCH64_T5 = ( REGISTER_LOONGARCH64_T4 + 1 ) , + REGISTER_LOONGARCH64_T6 = ( REGISTER_LOONGARCH64_T5 + 1 ) , + REGISTER_LOONGARCH64_T7 = ( REGISTER_LOONGARCH64_T6 + 1 ) , + REGISTER_LOONGARCH64_T8 = ( REGISTER_LOONGARCH64_T7 + 1 ) , + REGISTER_LOONGARCH64_X0 = ( REGISTER_LOONGARCH64_T8 + 1 ) , + REGISTER_LOONGARCH64_S0 = ( REGISTER_LOONGARCH64_X0 + 1 ) , + REGISTER_LOONGARCH64_S1 = ( REGISTER_LOONGARCH64_S0 + 1 ) , + REGISTER_LOONGARCH64_S2 = ( REGISTER_LOONGARCH64_S1 + 1 ) , + REGISTER_LOONGARCH64_S3 = ( REGISTER_LOONGARCH64_S2 + 1 ) , + REGISTER_LOONGARCH64_S4 = ( REGISTER_LOONGARCH64_S3 + 1 ) , + REGISTER_LOONGARCH64_S5 = ( REGISTER_LOONGARCH64_S4 + 1 ) , + REGISTER_LOONGARCH64_S6 = ( REGISTER_LOONGARCH64_S5 + 1 ) , + REGISTER_LOONGARCH64_S7 = ( REGISTER_LOONGARCH64_S6 + 1 ) , + REGISTER_LOONGARCH64_S8 = ( REGISTER_LOONGARCH64_S7 + 1 ) , + REGISTER_LOONGARCH64_F0 = ( REGISTER_LOONGARCH64_S8 + 1 ) , + REGISTER_LOONGARCH64_F1 = ( REGISTER_LOONGARCH64_F0 + 1 ) , + REGISTER_LOONGARCH64_F2 = ( REGISTER_LOONGARCH64_F1 + 1 ) , + REGISTER_LOONGARCH64_F3 = ( REGISTER_LOONGARCH64_F2 + 1 ) , + REGISTER_LOONGARCH64_F4 = ( REGISTER_LOONGARCH64_F3 + 1 ) , + REGISTER_LOONGARCH64_F5 = ( REGISTER_LOONGARCH64_F4 + 1 ) , + REGISTER_LOONGARCH64_F6 = ( REGISTER_LOONGARCH64_F5 + 1 ) , + REGISTER_LOONGARCH64_F7 = ( REGISTER_LOONGARCH64_F6 + 1 ) , + REGISTER_LOONGARCH64_F8 = ( REGISTER_LOONGARCH64_F7 + 1 ) , + REGISTER_LOONGARCH64_F9 = ( REGISTER_LOONGARCH64_F8 + 1 ) , + REGISTER_LOONGARCH64_F10 = ( REGISTER_LOONGARCH64_F9 + 1 ) , + REGISTER_LOONGARCH64_F11 = ( REGISTER_LOONGARCH64_F10 + 1 ) , + REGISTER_LOONGARCH64_F12 = ( REGISTER_LOONGARCH64_F11 + 1 ) , + REGISTER_LOONGARCH64_F13 = ( REGISTER_LOONGARCH64_F12 + 1 ) , + REGISTER_LOONGARCH64_F14 = ( REGISTER_LOONGARCH64_F13 + 1 ) , + REGISTER_LOONGARCH64_F15 = ( REGISTER_LOONGARCH64_F14 + 1 ) , + REGISTER_LOONGARCH64_F16 = ( REGISTER_LOONGARCH64_F15 + 1 ) , + REGISTER_LOONGARCH64_F17 = ( REGISTER_LOONGARCH64_F16 + 1 ) , + REGISTER_LOONGARCH64_F18 = ( REGISTER_LOONGARCH64_F17 + 1 ) , + REGISTER_LOONGARCH64_F19 = ( REGISTER_LOONGARCH64_F18 + 1 ) , + REGISTER_LOONGARCH64_F20 = ( REGISTER_LOONGARCH64_F19 + 1 ) , + REGISTER_LOONGARCH64_F21 = ( REGISTER_LOONGARCH64_F20 + 1 ) , + REGISTER_LOONGARCH64_F22 = ( REGISTER_LOONGARCH64_F21 + 1 ) , + REGISTER_LOONGARCH64_F23 = ( REGISTER_LOONGARCH64_F22 + 1 ) , + REGISTER_LOONGARCH64_F24 = ( REGISTER_LOONGARCH64_F23 + 1 ) , + REGISTER_LOONGARCH64_F25 = ( REGISTER_LOONGARCH64_F24 + 1 ) , + REGISTER_LOONGARCH64_F26 = ( REGISTER_LOONGARCH64_F25 + 1 ) , + REGISTER_LOONGARCH64_F27 = ( REGISTER_LOONGARCH64_F26 + 1 ) , + REGISTER_LOONGARCH64_F28 = ( REGISTER_LOONGARCH64_F27 + 1 ) , + REGISTER_LOONGARCH64_F29 = ( REGISTER_LOONGARCH64_F28 + 1 ) , + REGISTER_LOONGARCH64_F30 = ( REGISTER_LOONGARCH64_F29 + 1 ) , + REGISTER_LOONGARCH64_F31 = ( REGISTER_LOONGARCH64_F30 + 1 ) , REGISTER_RISCV64_PC = 0, - REGISTER_RISCV64_SP = ( REGISTER_RISCV64_PC + 1 ), - REGISTER_RISCV64_FP = ( REGISTER_RISCV64_SP + 1 ), - REGISTER_RISCV64_RA = ( REGISTER_RISCV64_FP + 1 ), - REGISTER_RISCV64_GP = ( REGISTER_RISCV64_RA + 1 ), - REGISTER_RISCV64_TP = ( REGISTER_RISCV64_GP + 1 ), - REGISTER_RISCV64_T0 = ( REGISTER_RISCV64_TP + 1 ), - REGISTER_RISCV64_T1 = ( REGISTER_RISCV64_T0 + 1 ), - REGISTER_RISCV64_T2 = ( REGISTER_RISCV64_T1 + 1 ), - REGISTER_RISCV64_S1 = ( REGISTER_RISCV64_T2 + 1 ), - REGISTER_RISCV64_A0 = ( REGISTER_RISCV64_S1 + 1 ), - REGISTER_RISCV64_A1 = ( REGISTER_RISCV64_A0 + 1 ), - REGISTER_RISCV64_A2 = ( REGISTER_RISCV64_A1 + 1 ), - REGISTER_RISCV64_A3 = ( REGISTER_RISCV64_A2 + 1 ), - REGISTER_RISCV64_A4 = ( REGISTER_RISCV64_A3 + 1 ), - REGISTER_RISCV64_A5 = ( REGISTER_RISCV64_A4 + 1 ), - REGISTER_RISCV64_A6 = ( REGISTER_RISCV64_A5 + 1 ), - REGISTER_RISCV64_A7 = ( REGISTER_RISCV64_A6 + 1 ), - REGISTER_RISCV64_S2 = ( REGISTER_RISCV64_A7 + 1 ), - REGISTER_RISCV64_S3 = ( REGISTER_RISCV64_S2 + 1 ), - REGISTER_RISCV64_S4 = ( REGISTER_RISCV64_S3 + 1 ), - REGISTER_RISCV64_S5 = ( REGISTER_RISCV64_S4 + 1 ), - REGISTER_RISCV64_S6 = ( REGISTER_RISCV64_S5 + 1 ), - REGISTER_RISCV64_S7 = ( REGISTER_RISCV64_S6 + 1 ), - REGISTER_RISCV64_S8 = ( REGISTER_RISCV64_S7 + 1 ), - REGISTER_RISCV64_S9 = ( REGISTER_RISCV64_S8 + 1 ), - REGISTER_RISCV64_S10 = ( REGISTER_RISCV64_S9 + 1 ), - REGISTER_RISCV64_S11 = ( REGISTER_RISCV64_S10 + 1 ), - REGISTER_RISCV64_T3 = ( REGISTER_RISCV64_S11 + 1 ), - REGISTER_RISCV64_T4 = ( REGISTER_RISCV64_T3 + 1 ), - REGISTER_RISCV64_T5 = ( REGISTER_RISCV64_T4 + 1 ), - REGISTER_RISCV64_T6 = ( REGISTER_RISCV64_T5 + 1 ), - REGISTER_RISCV64_F0 = ( REGISTER_RISCV64_T6 + 1 ), - REGISTER_RISCV64_F1 = ( REGISTER_RISCV64_F0 + 1 ), - REGISTER_RISCV64_F2 = ( REGISTER_RISCV64_F1 + 1 ), - REGISTER_RISCV64_F3 = ( REGISTER_RISCV64_F2 + 1 ), - REGISTER_RISCV64_F4 = ( REGISTER_RISCV64_F3 + 1 ), - REGISTER_RISCV64_F5 = ( REGISTER_RISCV64_F4 + 1 ), - REGISTER_RISCV64_F6 = ( REGISTER_RISCV64_F5 + 1 ), - REGISTER_RISCV64_F7 = ( REGISTER_RISCV64_F6 + 1 ), - REGISTER_RISCV64_F8 = ( REGISTER_RISCV64_F7 + 1 ), - REGISTER_RISCV64_F9 = ( REGISTER_RISCV64_F8 + 1 ), - REGISTER_RISCV64_F10 = ( REGISTER_RISCV64_F9 + 1 ), - REGISTER_RISCV64_F11 = ( REGISTER_RISCV64_F10 + 1 ), - REGISTER_RISCV64_F12 = ( REGISTER_RISCV64_F11 + 1 ), - REGISTER_RISCV64_F13 = ( REGISTER_RISCV64_F12 + 1 ), - REGISTER_RISCV64_F14 = ( REGISTER_RISCV64_F13 + 1 ), - REGISTER_RISCV64_F15 = ( REGISTER_RISCV64_F14 + 1 ), - REGISTER_RISCV64_F16 = ( REGISTER_RISCV64_F15 + 1 ), - REGISTER_RISCV64_F17 = ( REGISTER_RISCV64_F16 + 1 ), - REGISTER_RISCV64_F18 = ( REGISTER_RISCV64_F17 + 1 ), - REGISTER_RISCV64_F19 = ( REGISTER_RISCV64_F18 + 1 ), - REGISTER_RISCV64_F20 = ( REGISTER_RISCV64_F19 + 1 ), - REGISTER_RISCV64_F21 = ( REGISTER_RISCV64_F20 + 1 ), - REGISTER_RISCV64_F22 = ( REGISTER_RISCV64_F21 + 1 ), - REGISTER_RISCV64_F23 = ( REGISTER_RISCV64_F22 + 1 ), - REGISTER_RISCV64_F24 = ( REGISTER_RISCV64_F23 + 1 ), - REGISTER_RISCV64_F25 = ( REGISTER_RISCV64_F24 + 1 ), - REGISTER_RISCV64_F26 = ( REGISTER_RISCV64_F25 + 1 ), - REGISTER_RISCV64_F27 = ( REGISTER_RISCV64_F26 + 1 ), - REGISTER_RISCV64_F28 = ( REGISTER_RISCV64_F27 + 1 ), - REGISTER_RISCV64_F29 = ( REGISTER_RISCV64_F28 + 1 ), - REGISTER_RISCV64_F30 = ( REGISTER_RISCV64_F29 + 1 ), - REGISTER_RISCV64_F31 = ( REGISTER_RISCV64_F30 + 1 ), - REGISTER_RISCV64_X0 = ( REGISTER_RISCV64_F31 + 1 ), // TODO-RISCV64-CQ: Add X0 for an use in debug. Need to check. - } CorDebugRegister; + REGISTER_RISCV64_SP = ( REGISTER_RISCV64_PC + 1 ) , + REGISTER_RISCV64_FP = ( REGISTER_RISCV64_SP + 1 ) , + REGISTER_RISCV64_RA = ( REGISTER_RISCV64_FP + 1 ) , + REGISTER_RISCV64_GP = ( REGISTER_RISCV64_RA + 1 ) , + REGISTER_RISCV64_TP = ( REGISTER_RISCV64_GP + 1 ) , + REGISTER_RISCV64_T0 = ( REGISTER_RISCV64_TP + 1 ) , + REGISTER_RISCV64_T1 = ( REGISTER_RISCV64_T0 + 1 ) , + REGISTER_RISCV64_T2 = ( REGISTER_RISCV64_T1 + 1 ) , + REGISTER_RISCV64_S1 = ( REGISTER_RISCV64_T2 + 1 ) , + REGISTER_RISCV64_A0 = ( REGISTER_RISCV64_S1 + 1 ) , + REGISTER_RISCV64_A1 = ( REGISTER_RISCV64_A0 + 1 ) , + REGISTER_RISCV64_A2 = ( REGISTER_RISCV64_A1 + 1 ) , + REGISTER_RISCV64_A3 = ( REGISTER_RISCV64_A2 + 1 ) , + REGISTER_RISCV64_A4 = ( REGISTER_RISCV64_A3 + 1 ) , + REGISTER_RISCV64_A5 = ( REGISTER_RISCV64_A4 + 1 ) , + REGISTER_RISCV64_A6 = ( REGISTER_RISCV64_A5 + 1 ) , + REGISTER_RISCV64_A7 = ( REGISTER_RISCV64_A6 + 1 ) , + REGISTER_RISCV64_S2 = ( REGISTER_RISCV64_A7 + 1 ) , + REGISTER_RISCV64_S3 = ( REGISTER_RISCV64_S2 + 1 ) , + REGISTER_RISCV64_S4 = ( REGISTER_RISCV64_S3 + 1 ) , + REGISTER_RISCV64_S5 = ( REGISTER_RISCV64_S4 + 1 ) , + REGISTER_RISCV64_S6 = ( REGISTER_RISCV64_S5 + 1 ) , + REGISTER_RISCV64_S7 = ( REGISTER_RISCV64_S6 + 1 ) , + REGISTER_RISCV64_S8 = ( REGISTER_RISCV64_S7 + 1 ) , + REGISTER_RISCV64_S9 = ( REGISTER_RISCV64_S8 + 1 ) , + REGISTER_RISCV64_S10 = ( REGISTER_RISCV64_S9 + 1 ) , + REGISTER_RISCV64_S11 = ( REGISTER_RISCV64_S10 + 1 ) , + REGISTER_RISCV64_T3 = ( REGISTER_RISCV64_S11 + 1 ) , + REGISTER_RISCV64_T4 = ( REGISTER_RISCV64_T3 + 1 ) , + REGISTER_RISCV64_T5 = ( REGISTER_RISCV64_T4 + 1 ) , + REGISTER_RISCV64_T6 = ( REGISTER_RISCV64_T5 + 1 ) , + REGISTER_RISCV64_F0 = ( REGISTER_RISCV64_T6 + 1 ) , + REGISTER_RISCV64_F1 = ( REGISTER_RISCV64_F0 + 1 ) , + REGISTER_RISCV64_F2 = ( REGISTER_RISCV64_F1 + 1 ) , + REGISTER_RISCV64_F3 = ( REGISTER_RISCV64_F2 + 1 ) , + REGISTER_RISCV64_F4 = ( REGISTER_RISCV64_F3 + 1 ) , + REGISTER_RISCV64_F5 = ( REGISTER_RISCV64_F4 + 1 ) , + REGISTER_RISCV64_F6 = ( REGISTER_RISCV64_F5 + 1 ) , + REGISTER_RISCV64_F7 = ( REGISTER_RISCV64_F6 + 1 ) , + REGISTER_RISCV64_F8 = ( REGISTER_RISCV64_F7 + 1 ) , + REGISTER_RISCV64_F9 = ( REGISTER_RISCV64_F8 + 1 ) , + REGISTER_RISCV64_F10 = ( REGISTER_RISCV64_F9 + 1 ) , + REGISTER_RISCV64_F11 = ( REGISTER_RISCV64_F10 + 1 ) , + REGISTER_RISCV64_F12 = ( REGISTER_RISCV64_F11 + 1 ) , + REGISTER_RISCV64_F13 = ( REGISTER_RISCV64_F12 + 1 ) , + REGISTER_RISCV64_F14 = ( REGISTER_RISCV64_F13 + 1 ) , + REGISTER_RISCV64_F15 = ( REGISTER_RISCV64_F14 + 1 ) , + REGISTER_RISCV64_F16 = ( REGISTER_RISCV64_F15 + 1 ) , + REGISTER_RISCV64_F17 = ( REGISTER_RISCV64_F16 + 1 ) , + REGISTER_RISCV64_F18 = ( REGISTER_RISCV64_F17 + 1 ) , + REGISTER_RISCV64_F19 = ( REGISTER_RISCV64_F18 + 1 ) , + REGISTER_RISCV64_F20 = ( REGISTER_RISCV64_F19 + 1 ) , + REGISTER_RISCV64_F21 = ( REGISTER_RISCV64_F20 + 1 ) , + REGISTER_RISCV64_F22 = ( REGISTER_RISCV64_F21 + 1 ) , + REGISTER_RISCV64_F23 = ( REGISTER_RISCV64_F22 + 1 ) , + REGISTER_RISCV64_F24 = ( REGISTER_RISCV64_F23 + 1 ) , + REGISTER_RISCV64_F25 = ( REGISTER_RISCV64_F24 + 1 ) , + REGISTER_RISCV64_F26 = ( REGISTER_RISCV64_F25 + 1 ) , + REGISTER_RISCV64_F27 = ( REGISTER_RISCV64_F26 + 1 ) , + REGISTER_RISCV64_F28 = ( REGISTER_RISCV64_F27 + 1 ) , + REGISTER_RISCV64_F29 = ( REGISTER_RISCV64_F28 + 1 ) , + REGISTER_RISCV64_F30 = ( REGISTER_RISCV64_F29 + 1 ) , + REGISTER_RISCV64_F31 = ( REGISTER_RISCV64_F30 + 1 ) + } CorDebugRegister; EXTERN_C const IID IID_ICorDebugRegisterSet; @@ -9294,45 +9812,53 @@ EXTERN_C const IID IID_ICorDebugRegisterSet; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRegisterSetVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugRegisterSet * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugRegisterSet * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugRegisterSet * This); + DECLSPEC_XFGVIRT(ICorDebugRegisterSet, GetRegistersAvailable) HRESULT ( STDMETHODCALLTYPE *GetRegistersAvailable )( ICorDebugRegisterSet * This, /* [out] */ ULONG64 *pAvailable); + DECLSPEC_XFGVIRT(ICorDebugRegisterSet, GetRegisters) HRESULT ( STDMETHODCALLTYPE *GetRegisters )( ICorDebugRegisterSet * This, /* [in] */ ULONG64 mask, /* [in] */ ULONG32 regCount, /* [length_is][size_is][out] */ CORDB_REGISTER regBuffer[ ]); + DECLSPEC_XFGVIRT(ICorDebugRegisterSet, SetRegisters) HRESULT ( STDMETHODCALLTYPE *SetRegisters )( ICorDebugRegisterSet * This, /* [in] */ ULONG64 mask, /* [in] */ ULONG32 regCount, /* [size_is][in] */ CORDB_REGISTER regBuffer[ ]); + DECLSPEC_XFGVIRT(ICorDebugRegisterSet, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorDebugRegisterSet * This, /* [in] */ ULONG32 contextSize, /* [size_is][length_is][out][in] */ BYTE context[ ]); + DECLSPEC_XFGVIRT(ICorDebugRegisterSet, SetThreadContext) HRESULT ( STDMETHODCALLTYPE *SetThreadContext )( ICorDebugRegisterSet * This, /* [in] */ ULONG32 contextSize, @@ -9351,40 +9877,40 @@ EXTERN_C const IID IID_ICorDebugRegisterSet; #ifdef COBJMACROS -#define ICorDebugRegisterSet_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRegisterSet_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRegisterSet_AddRef(This) \ +#define ICorDebugRegisterSet_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRegisterSet_Release(This) \ +#define ICorDebugRegisterSet_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRegisterSet_GetRegistersAvailable(This,pAvailable) \ +#define ICorDebugRegisterSet_GetRegistersAvailable(This,pAvailable) \ ( (This)->lpVtbl -> GetRegistersAvailable(This,pAvailable) ) -#define ICorDebugRegisterSet_GetRegisters(This,mask,regCount,regBuffer) \ +#define ICorDebugRegisterSet_GetRegisters(This,mask,regCount,regBuffer) \ ( (This)->lpVtbl -> GetRegisters(This,mask,regCount,regBuffer) ) -#define ICorDebugRegisterSet_SetRegisters(This,mask,regCount,regBuffer) \ +#define ICorDebugRegisterSet_SetRegisters(This,mask,regCount,regBuffer) \ ( (This)->lpVtbl -> SetRegisters(This,mask,regCount,regBuffer) ) -#define ICorDebugRegisterSet_GetThreadContext(This,contextSize,context) \ +#define ICorDebugRegisterSet_GetThreadContext(This,contextSize,context) \ ( (This)->lpVtbl -> GetThreadContext(This,contextSize,context) ) -#define ICorDebugRegisterSet_SetThreadContext(This,contextSize,context) \ +#define ICorDebugRegisterSet_SetThreadContext(This,contextSize,context) \ ( (This)->lpVtbl -> SetThreadContext(This,contextSize,context) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRegisterSet_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRegisterSet_INTERFACE_DEFINED__ */ #ifndef __ICorDebugRegisterSet2_INTERFACE_DEFINED__ @@ -9421,29 +9947,34 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRegisterSet2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugRegisterSet2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugRegisterSet2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugRegisterSet2 * This); + DECLSPEC_XFGVIRT(ICorDebugRegisterSet2, GetRegistersAvailable) HRESULT ( STDMETHODCALLTYPE *GetRegistersAvailable )( ICorDebugRegisterSet2 * This, /* [in] */ ULONG32 numChunks, /* [size_is][out] */ BYTE availableRegChunks[ ]); + DECLSPEC_XFGVIRT(ICorDebugRegisterSet2, GetRegisters) HRESULT ( STDMETHODCALLTYPE *GetRegisters )( ICorDebugRegisterSet2 * This, /* [in] */ ULONG32 maskCount, @@ -9451,6 +9982,7 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2; /* [in] */ ULONG32 regCount, /* [size_is][out] */ CORDB_REGISTER regBuffer[ ]); + DECLSPEC_XFGVIRT(ICorDebugRegisterSet2, SetRegisters) HRESULT ( STDMETHODCALLTYPE *SetRegisters )( ICorDebugRegisterSet2 * This, /* [in] */ ULONG32 maskCount, @@ -9471,34 +10003,34 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2; #ifdef COBJMACROS -#define ICorDebugRegisterSet2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRegisterSet2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRegisterSet2_AddRef(This) \ +#define ICorDebugRegisterSet2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRegisterSet2_Release(This) \ +#define ICorDebugRegisterSet2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRegisterSet2_GetRegistersAvailable(This,numChunks,availableRegChunks) \ +#define ICorDebugRegisterSet2_GetRegistersAvailable(This,numChunks,availableRegChunks) \ ( (This)->lpVtbl -> GetRegistersAvailable(This,numChunks,availableRegChunks) ) -#define ICorDebugRegisterSet2_GetRegisters(This,maskCount,mask,regCount,regBuffer) \ +#define ICorDebugRegisterSet2_GetRegisters(This,maskCount,mask,regCount,regBuffer) \ ( (This)->lpVtbl -> GetRegisters(This,maskCount,mask,regCount,regBuffer) ) -#define ICorDebugRegisterSet2_SetRegisters(This,maskCount,mask,regCount,regBuffer) \ +#define ICorDebugRegisterSet2_SetRegisters(This,maskCount,mask,regCount,regBuffer) \ ( (This)->lpVtbl -> SetRegisters(This,maskCount,mask,regCount,regBuffer) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRegisterSet2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRegisterSet2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThread_INTERFACE_DEFINED__ @@ -9510,16 +10042,16 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2; typedef enum CorDebugUserState { - USER_STOP_REQUESTED = 0x1, - USER_SUSPEND_REQUESTED = 0x2, - USER_BACKGROUND = 0x4, - USER_UNSTARTED = 0x8, - USER_STOPPED = 0x10, - USER_WAIT_SLEEP_JOIN = 0x20, - USER_SUSPENDED = 0x40, - USER_UNSAFE_POINT = 0x80, - USER_THREADPOOL = 0x100 - } CorDebugUserState; + USER_STOP_REQUESTED = 0x1, + USER_SUSPEND_REQUESTED = 0x2, + USER_BACKGROUND = 0x4, + USER_UNSTARTED = 0x8, + USER_STOPPED = 0x10, + USER_WAIT_SLEEP_JOIN = 0x20, + USER_SUSPENDED = 0x40, + USER_UNSAFE_POINT = 0x80, + USER_THREADPOOL = 0x100 + } CorDebugUserState; EXTERN_C const IID IID_ICorDebugThread; @@ -9580,83 +10112,102 @@ EXTERN_C const IID IID_ICorDebugThread; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThreadVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugThread * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugThread * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugThread * This); + DECLSPEC_XFGVIRT(ICorDebugThread, GetProcess) HRESULT ( STDMETHODCALLTYPE *GetProcess )( ICorDebugThread * This, /* [out] */ ICorDebugProcess **ppProcess); + DECLSPEC_XFGVIRT(ICorDebugThread, GetID) HRESULT ( STDMETHODCALLTYPE *GetID )( ICorDebugThread * This, /* [out] */ DWORD *pdwThreadId); + DECLSPEC_XFGVIRT(ICorDebugThread, GetHandle) HRESULT ( STDMETHODCALLTYPE *GetHandle )( ICorDebugThread * This, /* [out] */ HTHREAD *phThreadHandle); + DECLSPEC_XFGVIRT(ICorDebugThread, GetAppDomain) HRESULT ( STDMETHODCALLTYPE *GetAppDomain )( ICorDebugThread * This, /* [out] */ ICorDebugAppDomain **ppAppDomain); + DECLSPEC_XFGVIRT(ICorDebugThread, SetDebugState) HRESULT ( STDMETHODCALLTYPE *SetDebugState )( ICorDebugThread * This, /* [in] */ CorDebugThreadState state); + DECLSPEC_XFGVIRT(ICorDebugThread, GetDebugState) HRESULT ( STDMETHODCALLTYPE *GetDebugState )( ICorDebugThread * This, /* [out] */ CorDebugThreadState *pState); + DECLSPEC_XFGVIRT(ICorDebugThread, GetUserState) HRESULT ( STDMETHODCALLTYPE *GetUserState )( ICorDebugThread * This, /* [out] */ CorDebugUserState *pState); + DECLSPEC_XFGVIRT(ICorDebugThread, GetCurrentException) HRESULT ( STDMETHODCALLTYPE *GetCurrentException )( ICorDebugThread * This, /* [out] */ ICorDebugValue **ppExceptionObject); + DECLSPEC_XFGVIRT(ICorDebugThread, ClearCurrentException) HRESULT ( STDMETHODCALLTYPE *ClearCurrentException )( ICorDebugThread * This); + DECLSPEC_XFGVIRT(ICorDebugThread, CreateStepper) HRESULT ( STDMETHODCALLTYPE *CreateStepper )( ICorDebugThread * This, /* [out] */ ICorDebugStepper **ppStepper); + DECLSPEC_XFGVIRT(ICorDebugThread, EnumerateChains) HRESULT ( STDMETHODCALLTYPE *EnumerateChains )( ICorDebugThread * This, /* [out] */ ICorDebugChainEnum **ppChains); + DECLSPEC_XFGVIRT(ICorDebugThread, GetActiveChain) HRESULT ( STDMETHODCALLTYPE *GetActiveChain )( ICorDebugThread * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugThread, GetActiveFrame) HRESULT ( STDMETHODCALLTYPE *GetActiveFrame )( ICorDebugThread * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugThread, GetRegisterSet) HRESULT ( STDMETHODCALLTYPE *GetRegisterSet )( ICorDebugThread * This, /* [out] */ ICorDebugRegisterSet **ppRegisters); + DECLSPEC_XFGVIRT(ICorDebugThread, CreateEval) HRESULT ( STDMETHODCALLTYPE *CreateEval )( ICorDebugThread * This, /* [out] */ ICorDebugEval **ppEval); + DECLSPEC_XFGVIRT(ICorDebugThread, GetObject) HRESULT ( STDMETHODCALLTYPE *GetObject )( ICorDebugThread * This, /* [out] */ ICorDebugValue **ppObject); @@ -9674,73 +10225,73 @@ EXTERN_C const IID IID_ICorDebugThread; #ifdef COBJMACROS -#define ICorDebugThread_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThread_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThread_AddRef(This) \ +#define ICorDebugThread_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThread_Release(This) \ +#define ICorDebugThread_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThread_GetProcess(This,ppProcess) \ +#define ICorDebugThread_GetProcess(This,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,ppProcess) ) -#define ICorDebugThread_GetID(This,pdwThreadId) \ +#define ICorDebugThread_GetID(This,pdwThreadId) \ ( (This)->lpVtbl -> GetID(This,pdwThreadId) ) -#define ICorDebugThread_GetHandle(This,phThreadHandle) \ +#define ICorDebugThread_GetHandle(This,phThreadHandle) \ ( (This)->lpVtbl -> GetHandle(This,phThreadHandle) ) -#define ICorDebugThread_GetAppDomain(This,ppAppDomain) \ +#define ICorDebugThread_GetAppDomain(This,ppAppDomain) \ ( (This)->lpVtbl -> GetAppDomain(This,ppAppDomain) ) -#define ICorDebugThread_SetDebugState(This,state) \ +#define ICorDebugThread_SetDebugState(This,state) \ ( (This)->lpVtbl -> SetDebugState(This,state) ) -#define ICorDebugThread_GetDebugState(This,pState) \ +#define ICorDebugThread_GetDebugState(This,pState) \ ( (This)->lpVtbl -> GetDebugState(This,pState) ) -#define ICorDebugThread_GetUserState(This,pState) \ +#define ICorDebugThread_GetUserState(This,pState) \ ( (This)->lpVtbl -> GetUserState(This,pState) ) -#define ICorDebugThread_GetCurrentException(This,ppExceptionObject) \ +#define ICorDebugThread_GetCurrentException(This,ppExceptionObject) \ ( (This)->lpVtbl -> GetCurrentException(This,ppExceptionObject) ) -#define ICorDebugThread_ClearCurrentException(This) \ +#define ICorDebugThread_ClearCurrentException(This) \ ( (This)->lpVtbl -> ClearCurrentException(This) ) -#define ICorDebugThread_CreateStepper(This,ppStepper) \ +#define ICorDebugThread_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) -#define ICorDebugThread_EnumerateChains(This,ppChains) \ +#define ICorDebugThread_EnumerateChains(This,ppChains) \ ( (This)->lpVtbl -> EnumerateChains(This,ppChains) ) -#define ICorDebugThread_GetActiveChain(This,ppChain) \ +#define ICorDebugThread_GetActiveChain(This,ppChain) \ ( (This)->lpVtbl -> GetActiveChain(This,ppChain) ) -#define ICorDebugThread_GetActiveFrame(This,ppFrame) \ +#define ICorDebugThread_GetActiveFrame(This,ppFrame) \ ( (This)->lpVtbl -> GetActiveFrame(This,ppFrame) ) -#define ICorDebugThread_GetRegisterSet(This,ppRegisters) \ +#define ICorDebugThread_GetRegisterSet(This,ppRegisters) \ ( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) ) -#define ICorDebugThread_CreateEval(This,ppEval) \ +#define ICorDebugThread_CreateEval(This,ppEval) \ ( (This)->lpVtbl -> CreateEval(This,ppEval) ) -#define ICorDebugThread_GetObject(This,ppObject) \ +#define ICorDebugThread_GetObject(This,ppObject) \ ( (This)->lpVtbl -> GetObject(This,ppObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThread_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThread_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThread2_INTERFACE_DEFINED__ @@ -9756,7 +10307,7 @@ typedef struct _COR_ACTIVE_FUNCTION ICorDebugFunction2 *pFunction; ULONG32 ilOffset; ULONG32 flags; - } COR_ACTIVE_FUNCTION; + } COR_ACTIVE_FUNCTION; EXTERN_C const IID IID_ICorDebugThread2; @@ -9787,42 +10338,50 @@ EXTERN_C const IID IID_ICorDebugThread2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThread2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugThread2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugThread2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugThread2 * This); + DECLSPEC_XFGVIRT(ICorDebugThread2, GetActiveFunctions) HRESULT ( STDMETHODCALLTYPE *GetActiveFunctions )( ICorDebugThread2 * This, /* [in] */ ULONG32 cFunctions, /* [out] */ ULONG32 *pcFunctions, /* [length_is][size_is][out][in] */ COR_ACTIVE_FUNCTION pFunctions[ ]); + DECLSPEC_XFGVIRT(ICorDebugThread2, GetConnectionID) HRESULT ( STDMETHODCALLTYPE *GetConnectionID )( ICorDebugThread2 * This, /* [out] */ CONNID *pdwConnectionId); + DECLSPEC_XFGVIRT(ICorDebugThread2, GetTaskID) HRESULT ( STDMETHODCALLTYPE *GetTaskID )( ICorDebugThread2 * This, /* [out] */ TASKID *pTaskId); + DECLSPEC_XFGVIRT(ICorDebugThread2, GetVolatileOSThreadID) HRESULT ( STDMETHODCALLTYPE *GetVolatileOSThreadID )( ICorDebugThread2 * This, /* [out] */ DWORD *pdwTid); + DECLSPEC_XFGVIRT(ICorDebugThread2, InterceptCurrentException) HRESULT ( STDMETHODCALLTYPE *InterceptCurrentException )( ICorDebugThread2 * This, /* [in] */ ICorDebugFrame *pFrame); @@ -9840,40 +10399,40 @@ EXTERN_C const IID IID_ICorDebugThread2; #ifdef COBJMACROS -#define ICorDebugThread2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThread2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThread2_AddRef(This) \ +#define ICorDebugThread2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThread2_Release(This) \ +#define ICorDebugThread2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThread2_GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) \ +#define ICorDebugThread2_GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) \ ( (This)->lpVtbl -> GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) ) -#define ICorDebugThread2_GetConnectionID(This,pdwConnectionId) \ +#define ICorDebugThread2_GetConnectionID(This,pdwConnectionId) \ ( (This)->lpVtbl -> GetConnectionID(This,pdwConnectionId) ) -#define ICorDebugThread2_GetTaskID(This,pTaskId) \ +#define ICorDebugThread2_GetTaskID(This,pTaskId) \ ( (This)->lpVtbl -> GetTaskID(This,pTaskId) ) -#define ICorDebugThread2_GetVolatileOSThreadID(This,pdwTid) \ +#define ICorDebugThread2_GetVolatileOSThreadID(This,pdwTid) \ ( (This)->lpVtbl -> GetVolatileOSThreadID(This,pdwTid) ) -#define ICorDebugThread2_InterceptCurrentException(This,pFrame) \ +#define ICorDebugThread2_InterceptCurrentException(This,pFrame) \ ( (This)->lpVtbl -> InterceptCurrentException(This,pFrame) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThread2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThread2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThread3_INTERFACE_DEFINED__ @@ -9902,28 +10461,33 @@ EXTERN_C const IID IID_ICorDebugThread3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThread3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugThread3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugThread3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugThread3 * This); + DECLSPEC_XFGVIRT(ICorDebugThread3, CreateStackWalk) HRESULT ( STDMETHODCALLTYPE *CreateStackWalk )( ICorDebugThread3 * This, /* [out] */ ICorDebugStackWalk **ppStackWalk); + DECLSPEC_XFGVIRT(ICorDebugThread3, GetActiveInternalFrames) HRESULT ( STDMETHODCALLTYPE *GetActiveInternalFrames )( ICorDebugThread3 * This, /* [in] */ ULONG32 cInternalFrames, @@ -9943,31 +10507,31 @@ EXTERN_C const IID IID_ICorDebugThread3; #ifdef COBJMACROS -#define ICorDebugThread3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThread3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThread3_AddRef(This) \ +#define ICorDebugThread3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThread3_Release(This) \ +#define ICorDebugThread3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThread3_CreateStackWalk(This,ppStackWalk) \ +#define ICorDebugThread3_CreateStackWalk(This,ppStackWalk) \ ( (This)->lpVtbl -> CreateStackWalk(This,ppStackWalk) ) -#define ICorDebugThread3_GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) \ +#define ICorDebugThread3_GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) \ ( (This)->lpVtbl -> GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThread3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThread3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThread4_INTERFACE_DEFINED__ @@ -9996,31 +10560,37 @@ EXTERN_C const IID IID_ICorDebugThread4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThread4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugThread4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugThread4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugThread4 * This); + DECLSPEC_XFGVIRT(ICorDebugThread4, HasUnhandledException) HRESULT ( STDMETHODCALLTYPE *HasUnhandledException )( ICorDebugThread4 * This); + DECLSPEC_XFGVIRT(ICorDebugThread4, GetBlockingObjects) HRESULT ( STDMETHODCALLTYPE *GetBlockingObjects )( ICorDebugThread4 * This, /* [out] */ ICorDebugBlockingObjectEnum **ppBlockingObjectEnum); + DECLSPEC_XFGVIRT(ICorDebugThread4, GetCurrentCustomDebuggerNotification) HRESULT ( STDMETHODCALLTYPE *GetCurrentCustomDebuggerNotification )( ICorDebugThread4 * This, /* [out] */ ICorDebugValue **ppNotificationObject); @@ -10038,34 +10608,34 @@ EXTERN_C const IID IID_ICorDebugThread4; #ifdef COBJMACROS -#define ICorDebugThread4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThread4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThread4_AddRef(This) \ +#define ICorDebugThread4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThread4_Release(This) \ +#define ICorDebugThread4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThread4_HasUnhandledException(This) \ +#define ICorDebugThread4_HasUnhandledException(This) \ ( (This)->lpVtbl -> HasUnhandledException(This) ) -#define ICorDebugThread4_GetBlockingObjects(This,ppBlockingObjectEnum) \ +#define ICorDebugThread4_GetBlockingObjects(This,ppBlockingObjectEnum) \ ( (This)->lpVtbl -> GetBlockingObjects(This,ppBlockingObjectEnum) ) -#define ICorDebugThread4_GetCurrentCustomDebuggerNotification(This,ppNotificationObject) \ +#define ICorDebugThread4_GetCurrentCustomDebuggerNotification(This,ppNotificationObject) \ ( (This)->lpVtbl -> GetCurrentCustomDebuggerNotification(This,ppNotificationObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThread4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThread4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThread5_INTERFACE_DEFINED__ @@ -10090,24 +10660,28 @@ EXTERN_C const IID IID_ICorDebugThread5; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThread5Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugThread5 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugThread5 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugThread5 * This); + DECLSPEC_XFGVIRT(ICorDebugThread5, GetBytesAllocated) HRESULT ( STDMETHODCALLTYPE *GetBytesAllocated )( ICorDebugThread5 * This, /* [out] */ ULONG64 *pSohAllocatedBytes, @@ -10126,28 +10700,28 @@ EXTERN_C const IID IID_ICorDebugThread5; #ifdef COBJMACROS -#define ICorDebugThread5_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThread5_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThread5_AddRef(This) \ +#define ICorDebugThread5_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThread5_Release(This) \ +#define ICorDebugThread5_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThread5_GetBytesAllocated(This,pSohAllocatedBytes,pUohAllocatedBytes) \ +#define ICorDebugThread5_GetBytesAllocated(This,pSohAllocatedBytes,pUohAllocatedBytes) \ ( (This)->lpVtbl -> GetBytesAllocated(This,pSohAllocatedBytes,pUohAllocatedBytes) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThread5_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThread5_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStackWalk_INTERFACE_DEFINED__ @@ -10159,9 +10733,9 @@ EXTERN_C const IID IID_ICorDebugThread5; typedef enum CorDebugSetContextFlag { - SET_CONTEXT_FLAG_ACTIVE_FRAME = 0x1, - SET_CONTEXT_FLAG_UNWIND_FRAME = 0x2 - } CorDebugSetContextFlag; + SET_CONTEXT_FLAG_ACTIVE_FRAME = 0x1, + SET_CONTEXT_FLAG_UNWIND_FRAME = 0x2 + } CorDebugSetContextFlag; EXTERN_C const IID IID_ICorDebugStackWalk; @@ -10191,24 +10765,28 @@ EXTERN_C const IID IID_ICorDebugStackWalk; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStackWalkVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugStackWalk * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugStackWalk * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugStackWalk * This); + DECLSPEC_XFGVIRT(ICorDebugStackWalk, GetContext) HRESULT ( STDMETHODCALLTYPE *GetContext )( ICorDebugStackWalk * This, /* [in] */ ULONG32 contextFlags, @@ -10216,15 +10794,18 @@ EXTERN_C const IID IID_ICorDebugStackWalk; /* [out] */ ULONG32 *contextSize, /* [size_is][out] */ BYTE contextBuf[ ]); + DECLSPEC_XFGVIRT(ICorDebugStackWalk, SetContext) HRESULT ( STDMETHODCALLTYPE *SetContext )( ICorDebugStackWalk * This, /* [in] */ CorDebugSetContextFlag flag, /* [in] */ ULONG32 contextSize, /* [size_is][in] */ BYTE context[ ]); + DECLSPEC_XFGVIRT(ICorDebugStackWalk, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugStackWalk * This); + DECLSPEC_XFGVIRT(ICorDebugStackWalk, GetFrame) HRESULT ( STDMETHODCALLTYPE *GetFrame )( ICorDebugStackWalk * This, /* [out] */ ICorDebugFrame **pFrame); @@ -10242,37 +10823,37 @@ EXTERN_C const IID IID_ICorDebugStackWalk; #ifdef COBJMACROS -#define ICorDebugStackWalk_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStackWalk_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStackWalk_AddRef(This) \ +#define ICorDebugStackWalk_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStackWalk_Release(This) \ +#define ICorDebugStackWalk_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStackWalk_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) \ +#define ICorDebugStackWalk_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) \ ( (This)->lpVtbl -> GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) ) -#define ICorDebugStackWalk_SetContext(This,flag,contextSize,context) \ +#define ICorDebugStackWalk_SetContext(This,flag,contextSize,context) \ ( (This)->lpVtbl -> SetContext(This,flag,contextSize,context) ) -#define ICorDebugStackWalk_Next(This) \ +#define ICorDebugStackWalk_Next(This) \ ( (This)->lpVtbl -> Next(This) ) -#define ICorDebugStackWalk_GetFrame(This,pFrame) \ +#define ICorDebugStackWalk_GetFrame(This,pFrame) \ ( (This)->lpVtbl -> GetFrame(This,pFrame) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStackWalk_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStackWalk_INTERFACE_DEFINED__ */ #ifndef __ICorDebugChain_INTERFACE_DEFINED__ @@ -10284,20 +10865,20 @@ EXTERN_C const IID IID_ICorDebugStackWalk; typedef enum CorDebugChainReason { - CHAIN_NONE = 0, - CHAIN_CLASS_INIT = 0x1, - CHAIN_EXCEPTION_FILTER = 0x2, - CHAIN_SECURITY = 0x4, - CHAIN_CONTEXT_POLICY = 0x8, - CHAIN_INTERCEPTION = 0x10, - CHAIN_PROCESS_START = 0x20, - CHAIN_THREAD_START = 0x40, - CHAIN_ENTER_MANAGED = 0x80, - CHAIN_ENTER_UNMANAGED = 0x100, - CHAIN_DEBUGGER_EVAL = 0x200, - CHAIN_CONTEXT_SWITCH = 0x400, - CHAIN_FUNC_EVAL = 0x800 - } CorDebugChainReason; + CHAIN_NONE = 0, + CHAIN_CLASS_INIT = 0x1, + CHAIN_EXCEPTION_FILTER = 0x2, + CHAIN_SECURITY = 0x4, + CHAIN_CONTEXT_POLICY = 0x8, + CHAIN_INTERCEPTION = 0x10, + CHAIN_PROCESS_START = 0x20, + CHAIN_THREAD_START = 0x40, + CHAIN_ENTER_MANAGED = 0x80, + CHAIN_ENTER_UNMANAGED = 0x100, + CHAIN_DEBUGGER_EVAL = 0x200, + CHAIN_CONTEXT_SWITCH = 0x400, + CHAIN_FUNC_EVAL = 0x800 + } CorDebugChainReason; EXTERN_C const IID IID_ICorDebugChain; @@ -10348,69 +10929,84 @@ EXTERN_C const IID IID_ICorDebugChain; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugChainVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugChain * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugChain * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugChain * This); + DECLSPEC_XFGVIRT(ICorDebugChain, GetThread) HRESULT ( STDMETHODCALLTYPE *GetThread )( ICorDebugChain * This, /* [out] */ ICorDebugThread **ppThread); + DECLSPEC_XFGVIRT(ICorDebugChain, GetStackRange) HRESULT ( STDMETHODCALLTYPE *GetStackRange )( ICorDebugChain * This, /* [out] */ CORDB_ADDRESS *pStart, /* [out] */ CORDB_ADDRESS *pEnd); + DECLSPEC_XFGVIRT(ICorDebugChain, GetContext) HRESULT ( STDMETHODCALLTYPE *GetContext )( ICorDebugChain * This, /* [out] */ ICorDebugContext **ppContext); + DECLSPEC_XFGVIRT(ICorDebugChain, GetCaller) HRESULT ( STDMETHODCALLTYPE *GetCaller )( ICorDebugChain * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugChain, GetCallee) HRESULT ( STDMETHODCALLTYPE *GetCallee )( ICorDebugChain * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugChain, GetPrevious) HRESULT ( STDMETHODCALLTYPE *GetPrevious )( ICorDebugChain * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugChain, GetNext) HRESULT ( STDMETHODCALLTYPE *GetNext )( ICorDebugChain * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugChain, IsManaged) HRESULT ( STDMETHODCALLTYPE *IsManaged )( ICorDebugChain * This, /* [out] */ BOOL *pManaged); + DECLSPEC_XFGVIRT(ICorDebugChain, EnumerateFrames) HRESULT ( STDMETHODCALLTYPE *EnumerateFrames )( ICorDebugChain * This, /* [out] */ ICorDebugFrameEnum **ppFrames); + DECLSPEC_XFGVIRT(ICorDebugChain, GetActiveFrame) HRESULT ( STDMETHODCALLTYPE *GetActiveFrame )( ICorDebugChain * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugChain, GetRegisterSet) HRESULT ( STDMETHODCALLTYPE *GetRegisterSet )( ICorDebugChain * This, /* [out] */ ICorDebugRegisterSet **ppRegisters); + DECLSPEC_XFGVIRT(ICorDebugChain, GetReason) HRESULT ( STDMETHODCALLTYPE *GetReason )( ICorDebugChain * This, /* [out] */ CorDebugChainReason *pReason); @@ -10428,61 +11024,61 @@ EXTERN_C const IID IID_ICorDebugChain; #ifdef COBJMACROS -#define ICorDebugChain_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugChain_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugChain_AddRef(This) \ +#define ICorDebugChain_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugChain_Release(This) \ +#define ICorDebugChain_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugChain_GetThread(This,ppThread) \ +#define ICorDebugChain_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) -#define ICorDebugChain_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugChain_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugChain_GetContext(This,ppContext) \ +#define ICorDebugChain_GetContext(This,ppContext) \ ( (This)->lpVtbl -> GetContext(This,ppContext) ) -#define ICorDebugChain_GetCaller(This,ppChain) \ +#define ICorDebugChain_GetCaller(This,ppChain) \ ( (This)->lpVtbl -> GetCaller(This,ppChain) ) -#define ICorDebugChain_GetCallee(This,ppChain) \ +#define ICorDebugChain_GetCallee(This,ppChain) \ ( (This)->lpVtbl -> GetCallee(This,ppChain) ) -#define ICorDebugChain_GetPrevious(This,ppChain) \ +#define ICorDebugChain_GetPrevious(This,ppChain) \ ( (This)->lpVtbl -> GetPrevious(This,ppChain) ) -#define ICorDebugChain_GetNext(This,ppChain) \ +#define ICorDebugChain_GetNext(This,ppChain) \ ( (This)->lpVtbl -> GetNext(This,ppChain) ) -#define ICorDebugChain_IsManaged(This,pManaged) \ +#define ICorDebugChain_IsManaged(This,pManaged) \ ( (This)->lpVtbl -> IsManaged(This,pManaged) ) -#define ICorDebugChain_EnumerateFrames(This,ppFrames) \ +#define ICorDebugChain_EnumerateFrames(This,ppFrames) \ ( (This)->lpVtbl -> EnumerateFrames(This,ppFrames) ) -#define ICorDebugChain_GetActiveFrame(This,ppFrame) \ +#define ICorDebugChain_GetActiveFrame(This,ppFrame) \ ( (This)->lpVtbl -> GetActiveFrame(This,ppFrame) ) -#define ICorDebugChain_GetRegisterSet(This,ppRegisters) \ +#define ICorDebugChain_GetRegisterSet(This,ppRegisters) \ ( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) ) -#define ICorDebugChain_GetReason(This,pReason) \ +#define ICorDebugChain_GetReason(This,pReason) \ ( (This)->lpVtbl -> GetReason(This,pReason) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugChain_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugChain_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFrame_INTERFACE_DEFINED__ @@ -10528,53 +11124,64 @@ EXTERN_C const IID IID_ICorDebugFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFrameVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugFrame * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugFrame * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugFrame * This); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetChain) HRESULT ( STDMETHODCALLTYPE *GetChain )( ICorDebugFrame * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCode) HRESULT ( STDMETHODCALLTYPE *GetCode )( ICorDebugFrame * This, /* [out] */ ICorDebugCode **ppCode); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunction) HRESULT ( STDMETHODCALLTYPE *GetFunction )( ICorDebugFrame * This, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunctionToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )( ICorDebugFrame * This, /* [out] */ mdMethodDef *pToken); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetStackRange) HRESULT ( STDMETHODCALLTYPE *GetStackRange )( ICorDebugFrame * This, /* [out] */ CORDB_ADDRESS *pStart, /* [out] */ CORDB_ADDRESS *pEnd); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCaller) HRESULT ( STDMETHODCALLTYPE *GetCaller )( ICorDebugFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCallee) HRESULT ( STDMETHODCALLTYPE *GetCallee )( ICorDebugFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, CreateStepper) HRESULT ( STDMETHODCALLTYPE *CreateStepper )( ICorDebugFrame * This, /* [out] */ ICorDebugStepper **ppStepper); @@ -10592,49 +11199,49 @@ EXTERN_C const IID IID_ICorDebugFrame; #ifdef COBJMACROS -#define ICorDebugFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFrame_AddRef(This) \ +#define ICorDebugFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFrame_Release(This) \ +#define ICorDebugFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFrame_GetChain(This,ppChain) \ +#define ICorDebugFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugFrame_GetCode(This,ppCode) \ +#define ICorDebugFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugFrame_GetFunction(This,ppFunction) \ +#define ICorDebugFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugFrame_GetCaller(This,ppFrame) \ +#define ICorDebugFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugFrame_GetCallee(This,ppFrame) \ +#define ICorDebugFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFrame_INTERFACE_DEFINED__ */ #ifndef __ICorDebugInternalFrame_INTERFACE_DEFINED__ @@ -10646,18 +11253,18 @@ EXTERN_C const IID IID_ICorDebugFrame; typedef enum CorDebugInternalFrameType { - STUBFRAME_NONE = 0, - STUBFRAME_M2U = 0x1, - STUBFRAME_U2M = 0x2, - STUBFRAME_APPDOMAIN_TRANSITION = 0x3, - STUBFRAME_LIGHTWEIGHT_FUNCTION = 0x4, - STUBFRAME_FUNC_EVAL = 0x5, - STUBFRAME_INTERNALCALL = 0x6, - STUBFRAME_CLASS_INIT = 0x7, - STUBFRAME_EXCEPTION = 0x8, - STUBFRAME_SECURITY = 0x9, - STUBFRAME_JIT_COMPILATION = 0xa - } CorDebugInternalFrameType; + STUBFRAME_NONE = 0, + STUBFRAME_M2U = 0x1, + STUBFRAME_U2M = 0x2, + STUBFRAME_APPDOMAIN_TRANSITION = 0x3, + STUBFRAME_LIGHTWEIGHT_FUNCTION = 0x4, + STUBFRAME_FUNC_EVAL = 0x5, + STUBFRAME_INTERNALCALL = 0x6, + STUBFRAME_CLASS_INIT = 0x7, + STUBFRAME_EXCEPTION = 0x8, + STUBFRAME_SECURITY = 0x9, + STUBFRAME_JIT_COMPILATION = 0xa + } CorDebugInternalFrameType; EXTERN_C const IID IID_ICorDebugInternalFrame; @@ -10674,57 +11281,69 @@ EXTERN_C const IID IID_ICorDebugInternalFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugInternalFrameVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugInternalFrame * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugInternalFrame * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugInternalFrame * This); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetChain) HRESULT ( STDMETHODCALLTYPE *GetChain )( ICorDebugInternalFrame * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCode) HRESULT ( STDMETHODCALLTYPE *GetCode )( ICorDebugInternalFrame * This, /* [out] */ ICorDebugCode **ppCode); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunction) HRESULT ( STDMETHODCALLTYPE *GetFunction )( ICorDebugInternalFrame * This, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunctionToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )( ICorDebugInternalFrame * This, /* [out] */ mdMethodDef *pToken); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetStackRange) HRESULT ( STDMETHODCALLTYPE *GetStackRange )( ICorDebugInternalFrame * This, /* [out] */ CORDB_ADDRESS *pStart, /* [out] */ CORDB_ADDRESS *pEnd); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCaller) HRESULT ( STDMETHODCALLTYPE *GetCaller )( ICorDebugInternalFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCallee) HRESULT ( STDMETHODCALLTYPE *GetCallee )( ICorDebugInternalFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, CreateStepper) HRESULT ( STDMETHODCALLTYPE *CreateStepper )( ICorDebugInternalFrame * This, /* [out] */ ICorDebugStepper **ppStepper); + DECLSPEC_XFGVIRT(ICorDebugInternalFrame, GetFrameType) HRESULT ( STDMETHODCALLTYPE *GetFrameType )( ICorDebugInternalFrame * This, /* [out] */ CorDebugInternalFrameType *pType); @@ -10742,53 +11361,53 @@ EXTERN_C const IID IID_ICorDebugInternalFrame; #ifdef COBJMACROS -#define ICorDebugInternalFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugInternalFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugInternalFrame_AddRef(This) \ +#define ICorDebugInternalFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugInternalFrame_Release(This) \ +#define ICorDebugInternalFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugInternalFrame_GetChain(This,ppChain) \ +#define ICorDebugInternalFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugInternalFrame_GetCode(This,ppCode) \ +#define ICorDebugInternalFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugInternalFrame_GetFunction(This,ppFunction) \ +#define ICorDebugInternalFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugInternalFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugInternalFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugInternalFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugInternalFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugInternalFrame_GetCaller(This,ppFrame) \ +#define ICorDebugInternalFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugInternalFrame_GetCallee(This,ppFrame) \ +#define ICorDebugInternalFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugInternalFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugInternalFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) -#define ICorDebugInternalFrame_GetFrameType(This,pType) \ +#define ICorDebugInternalFrame_GetFrameType(This,pType) \ ( (This)->lpVtbl -> GetFrameType(This,pType) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugInternalFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugInternalFrame_INTERFACE_DEFINED__ */ #ifndef __ICorDebugInternalFrame2_INTERFACE_DEFINED__ @@ -10816,28 +11435,33 @@ EXTERN_C const IID IID_ICorDebugInternalFrame2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugInternalFrame2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugInternalFrame2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugInternalFrame2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugInternalFrame2 * This); + DECLSPEC_XFGVIRT(ICorDebugInternalFrame2, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugInternalFrame2 * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugInternalFrame2, IsCloserToLeaf) HRESULT ( STDMETHODCALLTYPE *IsCloserToLeaf )( ICorDebugInternalFrame2 * This, /* [in] */ ICorDebugFrame *pFrameToCompare, @@ -10856,31 +11480,31 @@ EXTERN_C const IID IID_ICorDebugInternalFrame2; #ifdef COBJMACROS -#define ICorDebugInternalFrame2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugInternalFrame2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugInternalFrame2_AddRef(This) \ +#define ICorDebugInternalFrame2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugInternalFrame2_Release(This) \ +#define ICorDebugInternalFrame2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugInternalFrame2_GetAddress(This,pAddress) \ +#define ICorDebugInternalFrame2_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugInternalFrame2_IsCloserToLeaf(This,pFrameToCompare,pIsCloser) \ +#define ICorDebugInternalFrame2_IsCloserToLeaf(This,pFrameToCompare,pIsCloser) \ ( (This)->lpVtbl -> IsCloserToLeaf(This,pFrameToCompare,pIsCloser) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugInternalFrame2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugInternalFrame2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILFrame_INTERFACE_DEFINED__ @@ -10892,13 +11516,13 @@ EXTERN_C const IID IID_ICorDebugInternalFrame2; typedef enum CorDebugMappingResult { - MAPPING_PROLOG = 0x1, - MAPPING_EPILOG = 0x2, - MAPPING_NO_INFO = 0x4, - MAPPING_UNMAPPED_ADDRESS = 0x8, - MAPPING_EXACT = 0x10, - MAPPING_APPROXIMATE = 0x20 - } CorDebugMappingResult; + MAPPING_PROLOG = 0x1, + MAPPING_EPILOG = 0x2, + MAPPING_NO_INFO = 0x4, + MAPPING_UNMAPPED_ADDRESS = 0x8, + MAPPING_EXACT = 0x10, + MAPPING_APPROXIMATE = 0x20 + } CorDebugMappingResult; EXTERN_C const IID IID_ICorDebugILFrame; @@ -10943,93 +11567,113 @@ EXTERN_C const IID IID_ICorDebugILFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILFrameVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugILFrame * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugILFrame * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugILFrame * This); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetChain) HRESULT ( STDMETHODCALLTYPE *GetChain )( ICorDebugILFrame * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCode) HRESULT ( STDMETHODCALLTYPE *GetCode )( ICorDebugILFrame * This, /* [out] */ ICorDebugCode **ppCode); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunction) HRESULT ( STDMETHODCALLTYPE *GetFunction )( ICorDebugILFrame * This, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunctionToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )( ICorDebugILFrame * This, /* [out] */ mdMethodDef *pToken); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetStackRange) HRESULT ( STDMETHODCALLTYPE *GetStackRange )( ICorDebugILFrame * This, /* [out] */ CORDB_ADDRESS *pStart, /* [out] */ CORDB_ADDRESS *pEnd); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCaller) HRESULT ( STDMETHODCALLTYPE *GetCaller )( ICorDebugILFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCallee) HRESULT ( STDMETHODCALLTYPE *GetCallee )( ICorDebugILFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, CreateStepper) HRESULT ( STDMETHODCALLTYPE *CreateStepper )( ICorDebugILFrame * This, /* [out] */ ICorDebugStepper **ppStepper); + DECLSPEC_XFGVIRT(ICorDebugILFrame, GetIP) HRESULT ( STDMETHODCALLTYPE *GetIP )( ICorDebugILFrame * This, /* [out] */ ULONG32 *pnOffset, /* [out] */ CorDebugMappingResult *pMappingResult); + DECLSPEC_XFGVIRT(ICorDebugILFrame, SetIP) HRESULT ( STDMETHODCALLTYPE *SetIP )( ICorDebugILFrame * This, /* [in] */ ULONG32 nOffset); + DECLSPEC_XFGVIRT(ICorDebugILFrame, EnumerateLocalVariables) HRESULT ( STDMETHODCALLTYPE *EnumerateLocalVariables )( ICorDebugILFrame * This, /* [out] */ ICorDebugValueEnum **ppValueEnum); + DECLSPEC_XFGVIRT(ICorDebugILFrame, GetLocalVariable) HRESULT ( STDMETHODCALLTYPE *GetLocalVariable )( ICorDebugILFrame * This, /* [in] */ DWORD dwIndex, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugILFrame, EnumerateArguments) HRESULT ( STDMETHODCALLTYPE *EnumerateArguments )( ICorDebugILFrame * This, /* [out] */ ICorDebugValueEnum **ppValueEnum); + DECLSPEC_XFGVIRT(ICorDebugILFrame, GetArgument) HRESULT ( STDMETHODCALLTYPE *GetArgument )( ICorDebugILFrame * This, /* [in] */ DWORD dwIndex, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugILFrame, GetStackDepth) HRESULT ( STDMETHODCALLTYPE *GetStackDepth )( ICorDebugILFrame * This, /* [out] */ ULONG32 *pDepth); + DECLSPEC_XFGVIRT(ICorDebugILFrame, GetStackValue) HRESULT ( STDMETHODCALLTYPE *GetStackValue )( ICorDebugILFrame * This, /* [in] */ DWORD dwIndex, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugILFrame, CanSetIP) HRESULT ( STDMETHODCALLTYPE *CanSetIP )( ICorDebugILFrame * This, /* [in] */ ULONG32 nOffset); @@ -11047,77 +11691,77 @@ EXTERN_C const IID IID_ICorDebugILFrame; #ifdef COBJMACROS -#define ICorDebugILFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILFrame_AddRef(This) \ +#define ICorDebugILFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILFrame_Release(This) \ +#define ICorDebugILFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILFrame_GetChain(This,ppChain) \ +#define ICorDebugILFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugILFrame_GetCode(This,ppCode) \ +#define ICorDebugILFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugILFrame_GetFunction(This,ppFunction) \ +#define ICorDebugILFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugILFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugILFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugILFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugILFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugILFrame_GetCaller(This,ppFrame) \ +#define ICorDebugILFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugILFrame_GetCallee(This,ppFrame) \ +#define ICorDebugILFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugILFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugILFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) -#define ICorDebugILFrame_GetIP(This,pnOffset,pMappingResult) \ +#define ICorDebugILFrame_GetIP(This,pnOffset,pMappingResult) \ ( (This)->lpVtbl -> GetIP(This,pnOffset,pMappingResult) ) -#define ICorDebugILFrame_SetIP(This,nOffset) \ +#define ICorDebugILFrame_SetIP(This,nOffset) \ ( (This)->lpVtbl -> SetIP(This,nOffset) ) -#define ICorDebugILFrame_EnumerateLocalVariables(This,ppValueEnum) \ +#define ICorDebugILFrame_EnumerateLocalVariables(This,ppValueEnum) \ ( (This)->lpVtbl -> EnumerateLocalVariables(This,ppValueEnum) ) -#define ICorDebugILFrame_GetLocalVariable(This,dwIndex,ppValue) \ +#define ICorDebugILFrame_GetLocalVariable(This,dwIndex,ppValue) \ ( (This)->lpVtbl -> GetLocalVariable(This,dwIndex,ppValue) ) -#define ICorDebugILFrame_EnumerateArguments(This,ppValueEnum) \ +#define ICorDebugILFrame_EnumerateArguments(This,ppValueEnum) \ ( (This)->lpVtbl -> EnumerateArguments(This,ppValueEnum) ) -#define ICorDebugILFrame_GetArgument(This,dwIndex,ppValue) \ +#define ICorDebugILFrame_GetArgument(This,dwIndex,ppValue) \ ( (This)->lpVtbl -> GetArgument(This,dwIndex,ppValue) ) -#define ICorDebugILFrame_GetStackDepth(This,pDepth) \ +#define ICorDebugILFrame_GetStackDepth(This,pDepth) \ ( (This)->lpVtbl -> GetStackDepth(This,pDepth) ) -#define ICorDebugILFrame_GetStackValue(This,dwIndex,ppValue) \ +#define ICorDebugILFrame_GetStackValue(This,dwIndex,ppValue) \ ( (This)->lpVtbl -> GetStackValue(This,dwIndex,ppValue) ) -#define ICorDebugILFrame_CanSetIP(This,nOffset) \ +#define ICorDebugILFrame_CanSetIP(This,nOffset) \ ( (This)->lpVtbl -> CanSetIP(This,nOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILFrame_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILFrame2_INTERFACE_DEFINED__ @@ -11144,28 +11788,33 @@ EXTERN_C const IID IID_ICorDebugILFrame2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILFrame2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugILFrame2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugILFrame2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugILFrame2 * This); + DECLSPEC_XFGVIRT(ICorDebugILFrame2, RemapFunction) HRESULT ( STDMETHODCALLTYPE *RemapFunction )( ICorDebugILFrame2 * This, /* [in] */ ULONG32 newILOffset); + DECLSPEC_XFGVIRT(ICorDebugILFrame2, EnumerateTypeParameters) HRESULT ( STDMETHODCALLTYPE *EnumerateTypeParameters )( ICorDebugILFrame2 * This, /* [out] */ ICorDebugTypeEnum **ppTyParEnum); @@ -11183,31 +11832,31 @@ EXTERN_C const IID IID_ICorDebugILFrame2; #ifdef COBJMACROS -#define ICorDebugILFrame2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILFrame2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILFrame2_AddRef(This) \ +#define ICorDebugILFrame2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILFrame2_Release(This) \ +#define ICorDebugILFrame2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILFrame2_RemapFunction(This,newILOffset) \ +#define ICorDebugILFrame2_RemapFunction(This,newILOffset) \ ( (This)->lpVtbl -> RemapFunction(This,newILOffset) ) -#define ICorDebugILFrame2_EnumerateTypeParameters(This,ppTyParEnum) \ +#define ICorDebugILFrame2_EnumerateTypeParameters(This,ppTyParEnum) \ ( (This)->lpVtbl -> EnumerateTypeParameters(This,ppTyParEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILFrame2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILFrame2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILFrame3_INTERFACE_DEFINED__ @@ -11232,24 +11881,28 @@ EXTERN_C const IID IID_ICorDebugILFrame3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILFrame3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugILFrame3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugILFrame3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugILFrame3 * This); + DECLSPEC_XFGVIRT(ICorDebugILFrame3, GetReturnValueForILOffset) HRESULT ( STDMETHODCALLTYPE *GetReturnValueForILOffset )( ICorDebugILFrame3 * This, ULONG32 ILoffset, @@ -11268,28 +11921,28 @@ EXTERN_C const IID IID_ICorDebugILFrame3; #ifdef COBJMACROS -#define ICorDebugILFrame3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILFrame3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILFrame3_AddRef(This) \ +#define ICorDebugILFrame3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILFrame3_Release(This) \ +#define ICorDebugILFrame3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILFrame3_GetReturnValueForILOffset(This,ILoffset,ppReturnValue) \ +#define ICorDebugILFrame3_GetReturnValueForILOffset(This,ILoffset,ppReturnValue) \ ( (This)->lpVtbl -> GetReturnValueForILOffset(This,ILoffset,ppReturnValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILFrame3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILFrame3_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0070 */ @@ -11298,9 +11951,9 @@ EXTERN_C const IID IID_ICorDebugILFrame3; typedef enum ILCodeKind { - ILCODE_ORIGINAL_IL = 0x1, - ILCODE_REJIT_IL = 0x2 - } ILCodeKind; + ILCODE_ORIGINAL_IL = 0x1, + ILCODE_REJIT_IL = 0x2 + } ILCodeKind; @@ -11338,35 +11991,41 @@ EXTERN_C const IID IID_ICorDebugILFrame4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILFrame4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugILFrame4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugILFrame4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugILFrame4 * This); + DECLSPEC_XFGVIRT(ICorDebugILFrame4, EnumerateLocalVariablesEx) HRESULT ( STDMETHODCALLTYPE *EnumerateLocalVariablesEx )( ICorDebugILFrame4 * This, /* [in] */ ILCodeKind flags, /* [out] */ ICorDebugValueEnum **ppValueEnum); + DECLSPEC_XFGVIRT(ICorDebugILFrame4, GetLocalVariableEx) HRESULT ( STDMETHODCALLTYPE *GetLocalVariableEx )( ICorDebugILFrame4 * This, /* [in] */ ILCodeKind flags, /* [in] */ DWORD dwIndex, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugILFrame4, GetCodeEx) HRESULT ( STDMETHODCALLTYPE *GetCodeEx )( ICorDebugILFrame4 * This, /* [in] */ ILCodeKind flags, @@ -11385,34 +12044,34 @@ EXTERN_C const IID IID_ICorDebugILFrame4; #ifdef COBJMACROS -#define ICorDebugILFrame4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILFrame4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILFrame4_AddRef(This) \ +#define ICorDebugILFrame4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILFrame4_Release(This) \ +#define ICorDebugILFrame4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILFrame4_EnumerateLocalVariablesEx(This,flags,ppValueEnum) \ +#define ICorDebugILFrame4_EnumerateLocalVariablesEx(This,flags,ppValueEnum) \ ( (This)->lpVtbl -> EnumerateLocalVariablesEx(This,flags,ppValueEnum) ) -#define ICorDebugILFrame4_GetLocalVariableEx(This,flags,dwIndex,ppValue) \ +#define ICorDebugILFrame4_GetLocalVariableEx(This,flags,dwIndex,ppValue) \ ( (This)->lpVtbl -> GetLocalVariableEx(This,flags,dwIndex,ppValue) ) -#define ICorDebugILFrame4_GetCodeEx(This,flags,ppCode) \ +#define ICorDebugILFrame4_GetCodeEx(This,flags,ppCode) \ ( (This)->lpVtbl -> GetCodeEx(This,flags,ppCode) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILFrame4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILFrame4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugNativeFrame_INTERFACE_DEFINED__ @@ -11478,69 +12137,84 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugNativeFrameVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugNativeFrame * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugNativeFrame * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugNativeFrame * This); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetChain) HRESULT ( STDMETHODCALLTYPE *GetChain )( ICorDebugNativeFrame * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCode) HRESULT ( STDMETHODCALLTYPE *GetCode )( ICorDebugNativeFrame * This, /* [out] */ ICorDebugCode **ppCode); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunction) HRESULT ( STDMETHODCALLTYPE *GetFunction )( ICorDebugNativeFrame * This, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunctionToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )( ICorDebugNativeFrame * This, /* [out] */ mdMethodDef *pToken); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetStackRange) HRESULT ( STDMETHODCALLTYPE *GetStackRange )( ICorDebugNativeFrame * This, /* [out] */ CORDB_ADDRESS *pStart, /* [out] */ CORDB_ADDRESS *pEnd); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCaller) HRESULT ( STDMETHODCALLTYPE *GetCaller )( ICorDebugNativeFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCallee) HRESULT ( STDMETHODCALLTYPE *GetCallee )( ICorDebugNativeFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, CreateStepper) HRESULT ( STDMETHODCALLTYPE *CreateStepper )( ICorDebugNativeFrame * This, /* [out] */ ICorDebugStepper **ppStepper); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame, GetIP) HRESULT ( STDMETHODCALLTYPE *GetIP )( ICorDebugNativeFrame * This, /* [out] */ ULONG32 *pnOffset); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame, SetIP) HRESULT ( STDMETHODCALLTYPE *SetIP )( ICorDebugNativeFrame * This, /* [in] */ ULONG32 nOffset); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame, GetRegisterSet) HRESULT ( STDMETHODCALLTYPE *GetRegisterSet )( ICorDebugNativeFrame * This, /* [out] */ ICorDebugRegisterSet **ppRegisters); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame, GetLocalRegisterValue) HRESULT ( STDMETHODCALLTYPE *GetLocalRegisterValue )( ICorDebugNativeFrame * This, /* [in] */ CorDebugRegister reg, @@ -11548,6 +12222,7 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; /* [in] */ PCCOR_SIGNATURE pvSigBlob, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame, GetLocalDoubleRegisterValue) HRESULT ( STDMETHODCALLTYPE *GetLocalDoubleRegisterValue )( ICorDebugNativeFrame * This, /* [in] */ CorDebugRegister highWordReg, @@ -11556,6 +12231,7 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; /* [in] */ PCCOR_SIGNATURE pvSigBlob, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame, GetLocalMemoryValue) HRESULT ( STDMETHODCALLTYPE *GetLocalMemoryValue )( ICorDebugNativeFrame * This, /* [in] */ CORDB_ADDRESS address, @@ -11563,6 +12239,7 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; /* [in] */ PCCOR_SIGNATURE pvSigBlob, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame, GetLocalRegisterMemoryValue) HRESULT ( STDMETHODCALLTYPE *GetLocalRegisterMemoryValue )( ICorDebugNativeFrame * This, /* [in] */ CorDebugRegister highWordReg, @@ -11571,6 +12248,7 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; /* [in] */ PCCOR_SIGNATURE pvSigBlob, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame, GetLocalMemoryRegisterValue) HRESULT ( STDMETHODCALLTYPE *GetLocalMemoryRegisterValue )( ICorDebugNativeFrame * This, /* [in] */ CORDB_ADDRESS highWordAddress, @@ -11579,6 +12257,7 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; /* [in] */ PCCOR_SIGNATURE pvSigBlob, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame, CanSetIP) HRESULT ( STDMETHODCALLTYPE *CanSetIP )( ICorDebugNativeFrame * This, /* [in] */ ULONG32 nOffset); @@ -11596,77 +12275,77 @@ EXTERN_C const IID IID_ICorDebugNativeFrame; #ifdef COBJMACROS -#define ICorDebugNativeFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugNativeFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugNativeFrame_AddRef(This) \ +#define ICorDebugNativeFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugNativeFrame_Release(This) \ +#define ICorDebugNativeFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugNativeFrame_GetChain(This,ppChain) \ +#define ICorDebugNativeFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugNativeFrame_GetCode(This,ppCode) \ +#define ICorDebugNativeFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugNativeFrame_GetFunction(This,ppFunction) \ +#define ICorDebugNativeFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugNativeFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugNativeFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugNativeFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugNativeFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugNativeFrame_GetCaller(This,ppFrame) \ +#define ICorDebugNativeFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugNativeFrame_GetCallee(This,ppFrame) \ +#define ICorDebugNativeFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugNativeFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugNativeFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) -#define ICorDebugNativeFrame_GetIP(This,pnOffset) \ +#define ICorDebugNativeFrame_GetIP(This,pnOffset) \ ( (This)->lpVtbl -> GetIP(This,pnOffset) ) -#define ICorDebugNativeFrame_SetIP(This,nOffset) \ +#define ICorDebugNativeFrame_SetIP(This,nOffset) \ ( (This)->lpVtbl -> SetIP(This,nOffset) ) -#define ICorDebugNativeFrame_GetRegisterSet(This,ppRegisters) \ +#define ICorDebugNativeFrame_GetRegisterSet(This,ppRegisters) \ ( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) ) -#define ICorDebugNativeFrame_GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) \ +#define ICorDebugNativeFrame_GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) \ ( (This)->lpVtbl -> GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) ) -#define ICorDebugNativeFrame_CanSetIP(This,nOffset) \ +#define ICorDebugNativeFrame_CanSetIP(This,nOffset) \ ( (This)->lpVtbl -> CanSetIP(This,nOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugNativeFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugNativeFrame_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0072 */ @@ -11707,33 +12386,39 @@ EXTERN_C const IID IID_ICorDebugNativeFrame2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugNativeFrame2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugNativeFrame2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugNativeFrame2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugNativeFrame2 * This); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame2, IsChild) HRESULT ( STDMETHODCALLTYPE *IsChild )( ICorDebugNativeFrame2 * This, /* [out] */ BOOL *pIsChild); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame2, IsMatchingParentFrame) HRESULT ( STDMETHODCALLTYPE *IsMatchingParentFrame )( ICorDebugNativeFrame2 * This, /* [in] */ ICorDebugNativeFrame2 *pPotentialParentFrame, /* [out] */ BOOL *pIsParent); + DECLSPEC_XFGVIRT(ICorDebugNativeFrame2, GetStackParameterSize) HRESULT ( STDMETHODCALLTYPE *GetStackParameterSize )( ICorDebugNativeFrame2 * This, /* [out] */ ULONG32 *pSize); @@ -11751,34 +12436,34 @@ EXTERN_C const IID IID_ICorDebugNativeFrame2; #ifdef COBJMACROS -#define ICorDebugNativeFrame2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugNativeFrame2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugNativeFrame2_AddRef(This) \ +#define ICorDebugNativeFrame2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugNativeFrame2_Release(This) \ +#define ICorDebugNativeFrame2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugNativeFrame2_IsChild(This,pIsChild) \ +#define ICorDebugNativeFrame2_IsChild(This,pIsChild) \ ( (This)->lpVtbl -> IsChild(This,pIsChild) ) -#define ICorDebugNativeFrame2_IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) \ +#define ICorDebugNativeFrame2_IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) \ ( (This)->lpVtbl -> IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) ) -#define ICorDebugNativeFrame2_GetStackParameterSize(This,pSize) \ +#define ICorDebugNativeFrame2_GetStackParameterSize(This,pSize) \ ( (This)->lpVtbl -> GetStackParameterSize(This,pSize) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugNativeFrame2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugNativeFrame2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModule3_INTERFACE_DEFINED__ @@ -11803,24 +12488,28 @@ EXTERN_C const IID IID_ICorDebugModule3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModule3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugModule3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugModule3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugModule3 * This); + DECLSPEC_XFGVIRT(ICorDebugModule3, CreateReaderForInMemorySymbols) HRESULT ( STDMETHODCALLTYPE *CreateReaderForInMemorySymbols )( ICorDebugModule3 * This, /* [in] */ REFIID riid, @@ -11839,28 +12528,28 @@ EXTERN_C const IID IID_ICorDebugModule3; #ifdef COBJMACROS -#define ICorDebugModule3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModule3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModule3_AddRef(This) \ +#define ICorDebugModule3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModule3_Release(This) \ +#define ICorDebugModule3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModule3_CreateReaderForInMemorySymbols(This,riid,ppObj) \ +#define ICorDebugModule3_CreateReaderForInMemorySymbols(This,riid,ppObj) \ ( (This)->lpVtbl -> CreateReaderForInMemorySymbols(This,riid,ppObj) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModule3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModule3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModule4_INTERFACE_DEFINED__ @@ -11884,24 +12573,28 @@ EXTERN_C const IID IID_ICorDebugModule4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModule4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugModule4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugModule4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugModule4 * This); + DECLSPEC_XFGVIRT(ICorDebugModule4, IsMappedLayout) HRESULT ( STDMETHODCALLTYPE *IsMappedLayout )( ICorDebugModule4 * This, /* [out] */ BOOL *pIsMapped); @@ -11919,28 +12612,28 @@ EXTERN_C const IID IID_ICorDebugModule4; #ifdef COBJMACROS -#define ICorDebugModule4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModule4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModule4_AddRef(This) \ +#define ICorDebugModule4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModule4_Release(This) \ +#define ICorDebugModule4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModule4_IsMappedLayout(This,pIsMapped) \ +#define ICorDebugModule4_IsMappedLayout(This,pIsMapped) \ ( (This)->lpVtbl -> IsMappedLayout(This,pIsMapped) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModule4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModule4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ @@ -11961,53 +12654,64 @@ EXTERN_C const IID IID_ICorDebugRuntimeUnwindableFrame; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugRuntimeUnwindableFrameVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugRuntimeUnwindableFrame * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugRuntimeUnwindableFrame * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugRuntimeUnwindableFrame * This); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetChain) HRESULT ( STDMETHODCALLTYPE *GetChain )( ICorDebugRuntimeUnwindableFrame * This, /* [out] */ ICorDebugChain **ppChain); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCode) HRESULT ( STDMETHODCALLTYPE *GetCode )( ICorDebugRuntimeUnwindableFrame * This, /* [out] */ ICorDebugCode **ppCode); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunction) HRESULT ( STDMETHODCALLTYPE *GetFunction )( ICorDebugRuntimeUnwindableFrame * This, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetFunctionToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )( ICorDebugRuntimeUnwindableFrame * This, /* [out] */ mdMethodDef *pToken); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetStackRange) HRESULT ( STDMETHODCALLTYPE *GetStackRange )( ICorDebugRuntimeUnwindableFrame * This, /* [out] */ CORDB_ADDRESS *pStart, /* [out] */ CORDB_ADDRESS *pEnd); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCaller) HRESULT ( STDMETHODCALLTYPE *GetCaller )( ICorDebugRuntimeUnwindableFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, GetCallee) HRESULT ( STDMETHODCALLTYPE *GetCallee )( ICorDebugRuntimeUnwindableFrame * This, /* [out] */ ICorDebugFrame **ppFrame); + DECLSPEC_XFGVIRT(ICorDebugFrame, CreateStepper) HRESULT ( STDMETHODCALLTYPE *CreateStepper )( ICorDebugRuntimeUnwindableFrame * This, /* [out] */ ICorDebugStepper **ppStepper); @@ -12025,50 +12729,50 @@ EXTERN_C const IID IID_ICorDebugRuntimeUnwindableFrame; #ifdef COBJMACROS -#define ICorDebugRuntimeUnwindableFrame_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugRuntimeUnwindableFrame_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugRuntimeUnwindableFrame_AddRef(This) \ +#define ICorDebugRuntimeUnwindableFrame_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugRuntimeUnwindableFrame_Release(This) \ +#define ICorDebugRuntimeUnwindableFrame_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugRuntimeUnwindableFrame_GetChain(This,ppChain) \ +#define ICorDebugRuntimeUnwindableFrame_GetChain(This,ppChain) \ ( (This)->lpVtbl -> GetChain(This,ppChain) ) -#define ICorDebugRuntimeUnwindableFrame_GetCode(This,ppCode) \ +#define ICorDebugRuntimeUnwindableFrame_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugRuntimeUnwindableFrame_GetFunction(This,ppFunction) \ +#define ICorDebugRuntimeUnwindableFrame_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugRuntimeUnwindableFrame_GetFunctionToken(This,pToken) \ +#define ICorDebugRuntimeUnwindableFrame_GetFunctionToken(This,pToken) \ ( (This)->lpVtbl -> GetFunctionToken(This,pToken) ) -#define ICorDebugRuntimeUnwindableFrame_GetStackRange(This,pStart,pEnd) \ +#define ICorDebugRuntimeUnwindableFrame_GetStackRange(This,pStart,pEnd) \ ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) ) -#define ICorDebugRuntimeUnwindableFrame_GetCaller(This,ppFrame) \ +#define ICorDebugRuntimeUnwindableFrame_GetCaller(This,ppFrame) \ ( (This)->lpVtbl -> GetCaller(This,ppFrame) ) -#define ICorDebugRuntimeUnwindableFrame_GetCallee(This,ppFrame) \ +#define ICorDebugRuntimeUnwindableFrame_GetCallee(This,ppFrame) \ ( (This)->lpVtbl -> GetCallee(This,ppFrame) ) -#define ICorDebugRuntimeUnwindableFrame_CreateStepper(This,ppStepper) \ +#define ICorDebugRuntimeUnwindableFrame_CreateStepper(This,ppStepper) \ ( (This)->lpVtbl -> CreateStepper(This,ppStepper) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModule_INTERFACE_DEFINED__ @@ -12148,96 +12852,116 @@ EXTERN_C const IID IID_ICorDebugModule; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModuleVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugModule * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugModule * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugModule * This); + DECLSPEC_XFGVIRT(ICorDebugModule, GetProcess) HRESULT ( STDMETHODCALLTYPE *GetProcess )( ICorDebugModule * This, /* [out] */ ICorDebugProcess **ppProcess); + DECLSPEC_XFGVIRT(ICorDebugModule, GetBaseAddress) HRESULT ( STDMETHODCALLTYPE *GetBaseAddress )( ICorDebugModule * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugModule, GetAssembly) HRESULT ( STDMETHODCALLTYPE *GetAssembly )( ICorDebugModule * This, /* [out] */ ICorDebugAssembly **ppAssembly); + DECLSPEC_XFGVIRT(ICorDebugModule, GetName) HRESULT ( STDMETHODCALLTYPE *GetName )( ICorDebugModule * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugModule, EnableJITDebugging) HRESULT ( STDMETHODCALLTYPE *EnableJITDebugging )( ICorDebugModule * This, /* [in] */ BOOL bTrackJITInfo, /* [in] */ BOOL bAllowJitOpts); + DECLSPEC_XFGVIRT(ICorDebugModule, EnableClassLoadCallbacks) HRESULT ( STDMETHODCALLTYPE *EnableClassLoadCallbacks )( ICorDebugModule * This, /* [in] */ BOOL bClassLoadCallbacks); + DECLSPEC_XFGVIRT(ICorDebugModule, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorDebugModule * This, /* [in] */ mdMethodDef methodDef, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugModule, GetFunctionFromRVA) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromRVA )( ICorDebugModule * This, /* [in] */ CORDB_ADDRESS rva, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugModule, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorDebugModule * This, /* [in] */ mdTypeDef typeDef, /* [out] */ ICorDebugClass **ppClass); + DECLSPEC_XFGVIRT(ICorDebugModule, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugModule * This, /* [out] */ ICorDebugModuleBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugModule, GetEditAndContinueSnapshot) HRESULT ( STDMETHODCALLTYPE *GetEditAndContinueSnapshot )( ICorDebugModule * This, /* [out] */ ICorDebugEditAndContinueSnapshot **ppEditAndContinueSnapshot); + DECLSPEC_XFGVIRT(ICorDebugModule, GetMetaDataInterface) HRESULT ( STDMETHODCALLTYPE *GetMetaDataInterface )( ICorDebugModule * This, /* [in] */ REFIID riid, /* [out] */ IUnknown **ppObj); + DECLSPEC_XFGVIRT(ICorDebugModule, GetToken) HRESULT ( STDMETHODCALLTYPE *GetToken )( ICorDebugModule * This, /* [out] */ mdModule *pToken); + DECLSPEC_XFGVIRT(ICorDebugModule, IsDynamic) HRESULT ( STDMETHODCALLTYPE *IsDynamic )( ICorDebugModule * This, /* [out] */ BOOL *pDynamic); + DECLSPEC_XFGVIRT(ICorDebugModule, GetGlobalVariableValue) HRESULT ( STDMETHODCALLTYPE *GetGlobalVariableValue )( ICorDebugModule * This, /* [in] */ mdFieldDef fieldDef, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugModule, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugModule * This, /* [out] */ ULONG32 *pcBytes); + DECLSPEC_XFGVIRT(ICorDebugModule, IsInMemory) HRESULT ( STDMETHODCALLTYPE *IsInMemory )( ICorDebugModule * This, /* [out] */ BOOL *pInMemory); @@ -12255,76 +12979,76 @@ EXTERN_C const IID IID_ICorDebugModule; #ifdef COBJMACROS -#define ICorDebugModule_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModule_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModule_AddRef(This) \ +#define ICorDebugModule_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModule_Release(This) \ +#define ICorDebugModule_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModule_GetProcess(This,ppProcess) \ +#define ICorDebugModule_GetProcess(This,ppProcess) \ ( (This)->lpVtbl -> GetProcess(This,ppProcess) ) -#define ICorDebugModule_GetBaseAddress(This,pAddress) \ +#define ICorDebugModule_GetBaseAddress(This,pAddress) \ ( (This)->lpVtbl -> GetBaseAddress(This,pAddress) ) -#define ICorDebugModule_GetAssembly(This,ppAssembly) \ +#define ICorDebugModule_GetAssembly(This,ppAssembly) \ ( (This)->lpVtbl -> GetAssembly(This,ppAssembly) ) -#define ICorDebugModule_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugModule_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugModule_EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) \ +#define ICorDebugModule_EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) \ ( (This)->lpVtbl -> EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) ) -#define ICorDebugModule_EnableClassLoadCallbacks(This,bClassLoadCallbacks) \ +#define ICorDebugModule_EnableClassLoadCallbacks(This,bClassLoadCallbacks) \ ( (This)->lpVtbl -> EnableClassLoadCallbacks(This,bClassLoadCallbacks) ) -#define ICorDebugModule_GetFunctionFromToken(This,methodDef,ppFunction) \ +#define ICorDebugModule_GetFunctionFromToken(This,methodDef,ppFunction) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,methodDef,ppFunction) ) -#define ICorDebugModule_GetFunctionFromRVA(This,rva,ppFunction) \ +#define ICorDebugModule_GetFunctionFromRVA(This,rva,ppFunction) \ ( (This)->lpVtbl -> GetFunctionFromRVA(This,rva,ppFunction) ) -#define ICorDebugModule_GetClassFromToken(This,typeDef,ppClass) \ +#define ICorDebugModule_GetClassFromToken(This,typeDef,ppClass) \ ( (This)->lpVtbl -> GetClassFromToken(This,typeDef,ppClass) ) -#define ICorDebugModule_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugModule_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugModule_GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) \ +#define ICorDebugModule_GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) \ ( (This)->lpVtbl -> GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) ) -#define ICorDebugModule_GetMetaDataInterface(This,riid,ppObj) \ +#define ICorDebugModule_GetMetaDataInterface(This,riid,ppObj) \ ( (This)->lpVtbl -> GetMetaDataInterface(This,riid,ppObj) ) -#define ICorDebugModule_GetToken(This,pToken) \ +#define ICorDebugModule_GetToken(This,pToken) \ ( (This)->lpVtbl -> GetToken(This,pToken) ) -#define ICorDebugModule_IsDynamic(This,pDynamic) \ +#define ICorDebugModule_IsDynamic(This,pDynamic) \ ( (This)->lpVtbl -> IsDynamic(This,pDynamic) ) -#define ICorDebugModule_GetGlobalVariableValue(This,fieldDef,ppValue) \ +#define ICorDebugModule_GetGlobalVariableValue(This,fieldDef,ppValue) \ ( (This)->lpVtbl -> GetGlobalVariableValue(This,fieldDef,ppValue) ) -#define ICorDebugModule_GetSize(This,pcBytes) \ +#define ICorDebugModule_GetSize(This,pcBytes) \ ( (This)->lpVtbl -> GetSize(This,pcBytes) ) -#define ICorDebugModule_IsInMemory(This,pInMemory) \ +#define ICorDebugModule_IsInMemory(This,pInMemory) \ ( (This)->lpVtbl -> IsInMemory(This,pInMemory) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModule_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModule_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_cordebug_0000_0077 */ @@ -12375,30 +13099,35 @@ EXTERN_C const IID IID_ICorDebugModule2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModule2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugModule2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugModule2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugModule2 * This); + DECLSPEC_XFGVIRT(ICorDebugModule2, SetJMCStatus) HRESULT ( STDMETHODCALLTYPE *SetJMCStatus )( ICorDebugModule2 * This, /* [in] */ BOOL bIsJustMyCode, /* [in] */ ULONG32 cTokens, /* [size_is][in] */ mdToken pTokens[ ]); + DECLSPEC_XFGVIRT(ICorDebugModule2, ApplyChanges) HRESULT ( STDMETHODCALLTYPE *ApplyChanges )( ICorDebugModule2 * This, /* [in] */ ULONG cbMetadata, @@ -12406,14 +13135,17 @@ EXTERN_C const IID IID_ICorDebugModule2; /* [in] */ ULONG cbIL, /* [size_is][in] */ BYTE pbIL[ ]); + DECLSPEC_XFGVIRT(ICorDebugModule2, SetJITCompilerFlags) HRESULT ( STDMETHODCALLTYPE *SetJITCompilerFlags )( ICorDebugModule2 * This, /* [in] */ DWORD dwFlags); + DECLSPEC_XFGVIRT(ICorDebugModule2, GetJITCompilerFlags) HRESULT ( STDMETHODCALLTYPE *GetJITCompilerFlags )( ICorDebugModule2 * This, /* [out] */ DWORD *pdwFlags); + DECLSPEC_XFGVIRT(ICorDebugModule2, ResolveAssembly) HRESULT ( STDMETHODCALLTYPE *ResolveAssembly )( ICorDebugModule2 * This, /* [in] */ mdToken tkAssemblyRef, @@ -12432,40 +13164,40 @@ EXTERN_C const IID IID_ICorDebugModule2; #ifdef COBJMACROS -#define ICorDebugModule2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModule2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModule2_AddRef(This) \ +#define ICorDebugModule2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModule2_Release(This) \ +#define ICorDebugModule2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModule2_SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) \ +#define ICorDebugModule2_SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) \ ( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) ) -#define ICorDebugModule2_ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) \ +#define ICorDebugModule2_ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) \ ( (This)->lpVtbl -> ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) ) -#define ICorDebugModule2_SetJITCompilerFlags(This,dwFlags) \ +#define ICorDebugModule2_SetJITCompilerFlags(This,dwFlags) \ ( (This)->lpVtbl -> SetJITCompilerFlags(This,dwFlags) ) -#define ICorDebugModule2_GetJITCompilerFlags(This,pdwFlags) \ +#define ICorDebugModule2_GetJITCompilerFlags(This,pdwFlags) \ ( (This)->lpVtbl -> GetJITCompilerFlags(This,pdwFlags) ) -#define ICorDebugModule2_ResolveAssembly(This,tkAssemblyRef,ppAssembly) \ +#define ICorDebugModule2_ResolveAssembly(This,tkAssemblyRef,ppAssembly) \ ( (This)->lpVtbl -> ResolveAssembly(This,tkAssemblyRef,ppAssembly) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModule2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModule2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunction_INTERFACE_DEFINED__ @@ -12510,52 +13242,63 @@ EXTERN_C const IID IID_ICorDebugFunction; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunctionVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugFunction * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugFunction * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugFunction * This); + DECLSPEC_XFGVIRT(ICorDebugFunction, GetModule) HRESULT ( STDMETHODCALLTYPE *GetModule )( ICorDebugFunction * This, /* [out] */ ICorDebugModule **ppModule); + DECLSPEC_XFGVIRT(ICorDebugFunction, GetClass) HRESULT ( STDMETHODCALLTYPE *GetClass )( ICorDebugFunction * This, /* [out] */ ICorDebugClass **ppClass); + DECLSPEC_XFGVIRT(ICorDebugFunction, GetToken) HRESULT ( STDMETHODCALLTYPE *GetToken )( ICorDebugFunction * This, /* [out] */ mdMethodDef *pMethodDef); + DECLSPEC_XFGVIRT(ICorDebugFunction, GetILCode) HRESULT ( STDMETHODCALLTYPE *GetILCode )( ICorDebugFunction * This, /* [out] */ ICorDebugCode **ppCode); + DECLSPEC_XFGVIRT(ICorDebugFunction, GetNativeCode) HRESULT ( STDMETHODCALLTYPE *GetNativeCode )( ICorDebugFunction * This, /* [out] */ ICorDebugCode **ppCode); + DECLSPEC_XFGVIRT(ICorDebugFunction, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugFunction * This, /* [out] */ ICorDebugFunctionBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugFunction, GetLocalVarSigToken) HRESULT ( STDMETHODCALLTYPE *GetLocalVarSigToken )( ICorDebugFunction * This, /* [out] */ mdSignature *pmdSig); + DECLSPEC_XFGVIRT(ICorDebugFunction, GetCurrentVersionNumber) HRESULT ( STDMETHODCALLTYPE *GetCurrentVersionNumber )( ICorDebugFunction * This, /* [out] */ ULONG32 *pnCurrentVersion); @@ -12573,49 +13316,49 @@ EXTERN_C const IID IID_ICorDebugFunction; #ifdef COBJMACROS -#define ICorDebugFunction_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunction_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunction_AddRef(This) \ +#define ICorDebugFunction_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunction_Release(This) \ +#define ICorDebugFunction_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunction_GetModule(This,ppModule) \ +#define ICorDebugFunction_GetModule(This,ppModule) \ ( (This)->lpVtbl -> GetModule(This,ppModule) ) -#define ICorDebugFunction_GetClass(This,ppClass) \ +#define ICorDebugFunction_GetClass(This,ppClass) \ ( (This)->lpVtbl -> GetClass(This,ppClass) ) -#define ICorDebugFunction_GetToken(This,pMethodDef) \ +#define ICorDebugFunction_GetToken(This,pMethodDef) \ ( (This)->lpVtbl -> GetToken(This,pMethodDef) ) -#define ICorDebugFunction_GetILCode(This,ppCode) \ +#define ICorDebugFunction_GetILCode(This,ppCode) \ ( (This)->lpVtbl -> GetILCode(This,ppCode) ) -#define ICorDebugFunction_GetNativeCode(This,ppCode) \ +#define ICorDebugFunction_GetNativeCode(This,ppCode) \ ( (This)->lpVtbl -> GetNativeCode(This,ppCode) ) -#define ICorDebugFunction_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugFunction_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugFunction_GetLocalVarSigToken(This,pmdSig) \ +#define ICorDebugFunction_GetLocalVarSigToken(This,pmdSig) \ ( (This)->lpVtbl -> GetLocalVarSigToken(This,pmdSig) ) -#define ICorDebugFunction_GetCurrentVersionNumber(This,pnCurrentVersion) \ +#define ICorDebugFunction_GetCurrentVersionNumber(This,pnCurrentVersion) \ ( (This)->lpVtbl -> GetCurrentVersionNumber(This,pnCurrentVersion) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFunction_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFunction_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunction2_INTERFACE_DEFINED__ @@ -12648,36 +13391,43 @@ EXTERN_C const IID IID_ICorDebugFunction2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunction2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugFunction2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugFunction2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugFunction2 * This); + DECLSPEC_XFGVIRT(ICorDebugFunction2, SetJMCStatus) HRESULT ( STDMETHODCALLTYPE *SetJMCStatus )( ICorDebugFunction2 * This, /* [in] */ BOOL bIsJustMyCode); + DECLSPEC_XFGVIRT(ICorDebugFunction2, GetJMCStatus) HRESULT ( STDMETHODCALLTYPE *GetJMCStatus )( ICorDebugFunction2 * This, /* [out] */ BOOL *pbIsJustMyCode); + DECLSPEC_XFGVIRT(ICorDebugFunction2, EnumerateNativeCode) HRESULT ( STDMETHODCALLTYPE *EnumerateNativeCode )( ICorDebugFunction2 * This, /* [out] */ ICorDebugCodeEnum **ppCodeEnum); + DECLSPEC_XFGVIRT(ICorDebugFunction2, GetVersionNumber) HRESULT ( STDMETHODCALLTYPE *GetVersionNumber )( ICorDebugFunction2 * This, /* [out] */ ULONG32 *pnVersion); @@ -12695,37 +13445,37 @@ EXTERN_C const IID IID_ICorDebugFunction2; #ifdef COBJMACROS -#define ICorDebugFunction2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunction2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunction2_AddRef(This) \ +#define ICorDebugFunction2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunction2_Release(This) \ +#define ICorDebugFunction2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunction2_SetJMCStatus(This,bIsJustMyCode) \ +#define ICorDebugFunction2_SetJMCStatus(This,bIsJustMyCode) \ ( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode) ) -#define ICorDebugFunction2_GetJMCStatus(This,pbIsJustMyCode) \ +#define ICorDebugFunction2_GetJMCStatus(This,pbIsJustMyCode) \ ( (This)->lpVtbl -> GetJMCStatus(This,pbIsJustMyCode) ) -#define ICorDebugFunction2_EnumerateNativeCode(This,ppCodeEnum) \ +#define ICorDebugFunction2_EnumerateNativeCode(This,ppCodeEnum) \ ( (This)->lpVtbl -> EnumerateNativeCode(This,ppCodeEnum) ) -#define ICorDebugFunction2_GetVersionNumber(This,pnVersion) \ +#define ICorDebugFunction2_GetVersionNumber(This,pnVersion) \ ( (This)->lpVtbl -> GetVersionNumber(This,pnVersion) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFunction2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFunction2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunction3_INTERFACE_DEFINED__ @@ -12749,24 +13499,28 @@ EXTERN_C const IID IID_ICorDebugFunction3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunction3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugFunction3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugFunction3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugFunction3 * This); + DECLSPEC_XFGVIRT(ICorDebugFunction3, GetActiveReJitRequestILCode) HRESULT ( STDMETHODCALLTYPE *GetActiveReJitRequestILCode )( ICorDebugFunction3 * This, ICorDebugILCode **ppReJitedILCode); @@ -12784,28 +13538,28 @@ EXTERN_C const IID IID_ICorDebugFunction3; #ifdef COBJMACROS -#define ICorDebugFunction3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunction3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunction3_AddRef(This) \ +#define ICorDebugFunction3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunction3_Release(This) \ +#define ICorDebugFunction3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunction3_GetActiveReJitRequestILCode(This,ppReJitedILCode) \ +#define ICorDebugFunction3_GetActiveReJitRequestILCode(This,ppReJitedILCode) \ ( (This)->lpVtbl -> GetActiveReJitRequestILCode(This,ppReJitedILCode) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFunction3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFunction3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFunction4_INTERFACE_DEFINED__ @@ -12829,24 +13583,28 @@ EXTERN_C const IID IID_ICorDebugFunction4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFunction4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugFunction4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugFunction4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugFunction4 * This); + DECLSPEC_XFGVIRT(ICorDebugFunction4, CreateNativeBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateNativeBreakpoint )( ICorDebugFunction4 * This, ICorDebugFunctionBreakpoint **ppBreakpoint); @@ -12864,28 +13622,121 @@ EXTERN_C const IID IID_ICorDebugFunction4; #ifdef COBJMACROS -#define ICorDebugFunction4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFunction4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFunction4_AddRef(This) \ +#define ICorDebugFunction4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFunction4_Release(This) \ +#define ICorDebugFunction4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFunction4_CreateNativeBreakpoint(This,ppBreakpoint) \ +#define ICorDebugFunction4_CreateNativeBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateNativeBreakpoint(This,ppBreakpoint) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ + + + + +#endif /* __ICorDebugFunction4_INTERFACE_DEFINED__ */ + + +#ifndef __ICorDebugFunction5_INTERFACE_DEFINED__ +#define __ICorDebugFunction5_INTERFACE_DEFINED__ + +/* interface ICorDebugFunction5 */ +/* [unique][uuid][local][object] */ + + +EXTERN_C const IID IID_ICorDebugFunction5; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9D4DAB7B-3401-4F37-BD08-CA09F3FDF10F") + ICorDebugFunction5 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE DisableOptimizations( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AreOptimizationsDisabled( + BOOL *pOptimizationsDisabled) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorDebugFunction5Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorDebugFunction5 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorDebugFunction5 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ICorDebugFunction5 * This); + + DECLSPEC_XFGVIRT(ICorDebugFunction5, DisableOptimizations) + HRESULT ( STDMETHODCALLTYPE *DisableOptimizations )( + ICorDebugFunction5 * This); + + DECLSPEC_XFGVIRT(ICorDebugFunction5, AreOptimizationsDisabled) + HRESULT ( STDMETHODCALLTYPE *AreOptimizationsDisabled )( + ICorDebugFunction5 * This, + BOOL *pOptimizationsDisabled); + + END_INTERFACE + } ICorDebugFunction5Vtbl; + + interface ICorDebugFunction5 + { + CONST_VTBL struct ICorDebugFunction5Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorDebugFunction5_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorDebugFunction5_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorDebugFunction5_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorDebugFunction5_DisableOptimizations(This) \ + ( (This)->lpVtbl -> DisableOptimizations(This) ) + +#define ICorDebugFunction5_AreOptimizationsDisabled(This,pOptimizationsDisabled) \ + ( (This)->lpVtbl -> AreOptimizationsDisabled(This,pOptimizationsDisabled) ) + +#endif /* COBJMACROS */ +#endif /* C style interface */ -#endif /* __ICorDebugFunction4_INTERFACE_DEFINED__ */ + + +#endif /* __ICorDebugFunction5_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCode_INTERFACE_DEFINED__ @@ -12942,45 +13793,54 @@ EXTERN_C const IID IID_ICorDebugCode; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCodeVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugCode * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugCode * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugCode * This); + DECLSPEC_XFGVIRT(ICorDebugCode, IsIL) HRESULT ( STDMETHODCALLTYPE *IsIL )( ICorDebugCode * This, /* [out] */ BOOL *pbIL); + DECLSPEC_XFGVIRT(ICorDebugCode, GetFunction) HRESULT ( STDMETHODCALLTYPE *GetFunction )( ICorDebugCode * This, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugCode, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugCode * This, /* [out] */ CORDB_ADDRESS *pStart); + DECLSPEC_XFGVIRT(ICorDebugCode, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugCode * This, /* [out] */ ULONG32 *pcBytes); + DECLSPEC_XFGVIRT(ICorDebugCode, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugCode * This, /* [in] */ ULONG32 offset, /* [out] */ ICorDebugFunctionBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugCode, GetCode) HRESULT ( STDMETHODCALLTYPE *GetCode )( ICorDebugCode * This, /* [in] */ ULONG32 startOffset, @@ -12989,16 +13849,19 @@ EXTERN_C const IID IID_ICorDebugCode; /* [length_is][size_is][out] */ BYTE buffer[ ], /* [out] */ ULONG32 *pcBufferSize); + DECLSPEC_XFGVIRT(ICorDebugCode, GetVersionNumber) HRESULT ( STDMETHODCALLTYPE *GetVersionNumber )( ICorDebugCode * This, /* [out] */ ULONG32 *nVersion); + DECLSPEC_XFGVIRT(ICorDebugCode, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorDebugCode * This, /* [in] */ ULONG32 cMap, /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorDebugCode, GetEnCRemapSequencePoints) HRESULT ( STDMETHODCALLTYPE *GetEnCRemapSequencePoints )( ICorDebugCode * This, /* [in] */ ULONG32 cMap, @@ -13018,52 +13881,52 @@ EXTERN_C const IID IID_ICorDebugCode; #ifdef COBJMACROS -#define ICorDebugCode_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCode_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCode_AddRef(This) \ +#define ICorDebugCode_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCode_Release(This) \ +#define ICorDebugCode_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCode_IsIL(This,pbIL) \ +#define ICorDebugCode_IsIL(This,pbIL) \ ( (This)->lpVtbl -> IsIL(This,pbIL) ) -#define ICorDebugCode_GetFunction(This,ppFunction) \ +#define ICorDebugCode_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) -#define ICorDebugCode_GetAddress(This,pStart) \ +#define ICorDebugCode_GetAddress(This,pStart) \ ( (This)->lpVtbl -> GetAddress(This,pStart) ) -#define ICorDebugCode_GetSize(This,pcBytes) \ +#define ICorDebugCode_GetSize(This,pcBytes) \ ( (This)->lpVtbl -> GetSize(This,pcBytes) ) -#define ICorDebugCode_CreateBreakpoint(This,offset,ppBreakpoint) \ +#define ICorDebugCode_CreateBreakpoint(This,offset,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,offset,ppBreakpoint) ) -#define ICorDebugCode_GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) \ +#define ICorDebugCode_GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) \ ( (This)->lpVtbl -> GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) ) -#define ICorDebugCode_GetVersionNumber(This,nVersion) \ +#define ICorDebugCode_GetVersionNumber(This,nVersion) \ ( (This)->lpVtbl -> GetVersionNumber(This,nVersion) ) -#define ICorDebugCode_GetILToNativeMapping(This,cMap,pcMap,map) \ +#define ICorDebugCode_GetILToNativeMapping(This,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,cMap,pcMap,map) ) -#define ICorDebugCode_GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) \ +#define ICorDebugCode_GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) \ ( (This)->lpVtbl -> GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCode_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCode_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCode2_INTERFACE_DEFINED__ @@ -13076,7 +13939,7 @@ typedef struct _CodeChunkInfo { CORDB_ADDRESS startAddr; ULONG32 length; - } CodeChunkInfo; + } CodeChunkInfo; EXTERN_C const IID IID_ICorDebugCode2; @@ -13098,30 +13961,35 @@ EXTERN_C const IID IID_ICorDebugCode2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCode2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugCode2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugCode2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugCode2 * This); + DECLSPEC_XFGVIRT(ICorDebugCode2, GetCodeChunks) HRESULT ( STDMETHODCALLTYPE *GetCodeChunks )( ICorDebugCode2 * This, /* [in] */ ULONG32 cbufSize, /* [out] */ ULONG32 *pcnumChunks, /* [length_is][size_is][out] */ CodeChunkInfo chunks[ ]); + DECLSPEC_XFGVIRT(ICorDebugCode2, GetCompilerFlags) HRESULT ( STDMETHODCALLTYPE *GetCompilerFlags )( ICorDebugCode2 * This, /* [out] */ DWORD *pdwFlags); @@ -13139,31 +14007,31 @@ EXTERN_C const IID IID_ICorDebugCode2; #ifdef COBJMACROS -#define ICorDebugCode2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCode2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCode2_AddRef(This) \ +#define ICorDebugCode2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCode2_Release(This) \ +#define ICorDebugCode2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCode2_GetCodeChunks(This,cbufSize,pcnumChunks,chunks) \ +#define ICorDebugCode2_GetCodeChunks(This,cbufSize,pcnumChunks,chunks) \ ( (This)->lpVtbl -> GetCodeChunks(This,cbufSize,pcnumChunks,chunks) ) -#define ICorDebugCode2_GetCompilerFlags(This,pdwFlags) \ +#define ICorDebugCode2_GetCompilerFlags(This,pdwFlags) \ ( (This)->lpVtbl -> GetCompilerFlags(This,pdwFlags) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCode2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCode2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCode3_INTERFACE_DEFINED__ @@ -13190,24 +14058,28 @@ EXTERN_C const IID IID_ICorDebugCode3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCode3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugCode3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugCode3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugCode3 * This); + DECLSPEC_XFGVIRT(ICorDebugCode3, GetReturnValueLiveOffset) HRESULT ( STDMETHODCALLTYPE *GetReturnValueLiveOffset )( ICorDebugCode3 * This, /* [in] */ ULONG32 ILoffset, @@ -13228,28 +14100,28 @@ EXTERN_C const IID IID_ICorDebugCode3; #ifdef COBJMACROS -#define ICorDebugCode3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCode3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCode3_AddRef(This) \ +#define ICorDebugCode3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCode3_Release(This) \ +#define ICorDebugCode3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCode3_GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) \ +#define ICorDebugCode3_GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) \ ( (This)->lpVtbl -> GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCode3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCode3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCode4_INTERFACE_DEFINED__ @@ -13273,24 +14145,28 @@ EXTERN_C const IID IID_ICorDebugCode4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCode4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugCode4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugCode4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugCode4 * This); + DECLSPEC_XFGVIRT(ICorDebugCode4, EnumerateVariableHomes) HRESULT ( STDMETHODCALLTYPE *EnumerateVariableHomes )( ICorDebugCode4 * This, /* [out] */ ICorDebugVariableHomeEnum **ppEnum); @@ -13308,28 +14184,28 @@ EXTERN_C const IID IID_ICorDebugCode4; #ifdef COBJMACROS -#define ICorDebugCode4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCode4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCode4_AddRef(This) \ +#define ICorDebugCode4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCode4_Release(This) \ +#define ICorDebugCode4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCode4_EnumerateVariableHomes(This,ppEnum) \ +#define ICorDebugCode4_EnumerateVariableHomes(This,ppEnum) \ ( (This)->lpVtbl -> EnumerateVariableHomes(This,ppEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCode4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCode4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILCode_INTERFACE_DEFINED__ @@ -13347,7 +14223,7 @@ typedef struct _CorDebugEHClause ULONG32 HandlerLength; ULONG32 ClassToken; ULONG32 FilterOffset; - } CorDebugEHClause; + } CorDebugEHClause; EXTERN_C const IID IID_ICorDebugILCode; @@ -13366,24 +14242,28 @@ EXTERN_C const IID IID_ICorDebugILCode; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILCodeVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugILCode * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugILCode * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugILCode * This); + DECLSPEC_XFGVIRT(ICorDebugILCode, GetEHClauses) HRESULT ( STDMETHODCALLTYPE *GetEHClauses )( ICorDebugILCode * This, /* [in] */ ULONG32 cClauses, @@ -13403,28 +14283,28 @@ EXTERN_C const IID IID_ICorDebugILCode; #ifdef COBJMACROS -#define ICorDebugILCode_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILCode_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILCode_AddRef(This) \ +#define ICorDebugILCode_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILCode_Release(This) \ +#define ICorDebugILCode_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILCode_GetEHClauses(This,cClauses,pcClauses,clauses) \ +#define ICorDebugILCode_GetEHClauses(This,cClauses,pcClauses,clauses) \ ( (This)->lpVtbl -> GetEHClauses(This,cClauses,pcClauses,clauses) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILCode_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILCode_INTERFACE_DEFINED__ */ #ifndef __ICorDebugILCode2_INTERFACE_DEFINED__ @@ -13453,28 +14333,33 @@ EXTERN_C const IID IID_ICorDebugILCode2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugILCode2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugILCode2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugILCode2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugILCode2 * This); + DECLSPEC_XFGVIRT(ICorDebugILCode2, GetLocalVarSigToken) HRESULT ( STDMETHODCALLTYPE *GetLocalVarSigToken )( ICorDebugILCode2 * This, /* [out] */ mdSignature *pmdSig); + DECLSPEC_XFGVIRT(ICorDebugILCode2, GetInstrumentedILMap) HRESULT ( STDMETHODCALLTYPE *GetInstrumentedILMap )( ICorDebugILCode2 * This, /* [in] */ ULONG32 cMap, @@ -13494,31 +14379,31 @@ EXTERN_C const IID IID_ICorDebugILCode2; #ifdef COBJMACROS -#define ICorDebugILCode2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugILCode2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugILCode2_AddRef(This) \ +#define ICorDebugILCode2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugILCode2_Release(This) \ +#define ICorDebugILCode2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugILCode2_GetLocalVarSigToken(This,pmdSig) \ +#define ICorDebugILCode2_GetLocalVarSigToken(This,pmdSig) \ ( (This)->lpVtbl -> GetLocalVarSigToken(This,pmdSig) ) -#define ICorDebugILCode2_GetInstrumentedILMap(This,cMap,pcMap,map) \ +#define ICorDebugILCode2_GetInstrumentedILMap(This,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetInstrumentedILMap(This,cMap,pcMap,map) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugILCode2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugILCode2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugClass_INTERFACE_DEFINED__ @@ -13550,32 +14435,38 @@ EXTERN_C const IID IID_ICorDebugClass; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugClassVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugClass * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugClass * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugClass * This); + DECLSPEC_XFGVIRT(ICorDebugClass, GetModule) HRESULT ( STDMETHODCALLTYPE *GetModule )( ICorDebugClass * This, /* [out] */ ICorDebugModule **pModule); + DECLSPEC_XFGVIRT(ICorDebugClass, GetToken) HRESULT ( STDMETHODCALLTYPE *GetToken )( ICorDebugClass * This, /* [out] */ mdTypeDef *pTypeDef); + DECLSPEC_XFGVIRT(ICorDebugClass, GetStaticFieldValue) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldValue )( ICorDebugClass * This, /* [in] */ mdFieldDef fieldDef, @@ -13595,34 +14486,34 @@ EXTERN_C const IID IID_ICorDebugClass; #ifdef COBJMACROS -#define ICorDebugClass_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugClass_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugClass_AddRef(This) \ +#define ICorDebugClass_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugClass_Release(This) \ +#define ICorDebugClass_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugClass_GetModule(This,pModule) \ +#define ICorDebugClass_GetModule(This,pModule) \ ( (This)->lpVtbl -> GetModule(This,pModule) ) -#define ICorDebugClass_GetToken(This,pTypeDef) \ +#define ICorDebugClass_GetToken(This,pTypeDef) \ ( (This)->lpVtbl -> GetToken(This,pTypeDef) ) -#define ICorDebugClass_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \ +#define ICorDebugClass_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \ ( (This)->lpVtbl -> GetStaticFieldValue(This,fieldDef,pFrame,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugClass_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugClass_INTERFACE_DEFINED__ */ #ifndef __ICorDebugClass2_INTERFACE_DEFINED__ @@ -13652,24 +14543,28 @@ EXTERN_C const IID IID_ICorDebugClass2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugClass2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugClass2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugClass2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugClass2 * This); + DECLSPEC_XFGVIRT(ICorDebugClass2, GetParameterizedType) HRESULT ( STDMETHODCALLTYPE *GetParameterizedType )( ICorDebugClass2 * This, /* [in] */ CorElementType elementType, @@ -13677,6 +14572,7 @@ EXTERN_C const IID IID_ICorDebugClass2; /* [size_is][in] */ ICorDebugType *ppTypeArgs[ ], /* [out] */ ICorDebugType **ppType); + DECLSPEC_XFGVIRT(ICorDebugClass2, SetJMCStatus) HRESULT ( STDMETHODCALLTYPE *SetJMCStatus )( ICorDebugClass2 * This, /* [in] */ BOOL bIsJustMyCode); @@ -13694,31 +14590,31 @@ EXTERN_C const IID IID_ICorDebugClass2; #ifdef COBJMACROS -#define ICorDebugClass2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugClass2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugClass2_AddRef(This) \ +#define ICorDebugClass2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugClass2_Release(This) \ +#define ICorDebugClass2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugClass2_GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) \ +#define ICorDebugClass2_GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) \ ( (This)->lpVtbl -> GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) ) -#define ICorDebugClass2_SetJMCStatus(This,bIsJustMyCode) \ +#define ICorDebugClass2_SetJMCStatus(This,bIsJustMyCode) \ ( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugClass2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugClass2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugEval_INTERFACE_DEFINED__ @@ -13778,44 +14674,52 @@ EXTERN_C const IID IID_ICorDebugEval; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEvalVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugEval * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugEval * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugEval * This); + DECLSPEC_XFGVIRT(ICorDebugEval, CallFunction) HRESULT ( STDMETHODCALLTYPE *CallFunction )( ICorDebugEval * This, /* [in] */ ICorDebugFunction *pFunction, /* [in] */ ULONG32 nArgs, /* [size_is][in] */ ICorDebugValue *ppArgs[ ]); + DECLSPEC_XFGVIRT(ICorDebugEval, NewObject) HRESULT ( STDMETHODCALLTYPE *NewObject )( ICorDebugEval * This, /* [in] */ ICorDebugFunction *pConstructor, /* [in] */ ULONG32 nArgs, /* [size_is][in] */ ICorDebugValue *ppArgs[ ]); + DECLSPEC_XFGVIRT(ICorDebugEval, NewObjectNoConstructor) HRESULT ( STDMETHODCALLTYPE *NewObjectNoConstructor )( ICorDebugEval * This, /* [in] */ ICorDebugClass *pClass); + DECLSPEC_XFGVIRT(ICorDebugEval, NewString) HRESULT ( STDMETHODCALLTYPE *NewString )( ICorDebugEval * This, /* [in] */ LPCWSTR string); + DECLSPEC_XFGVIRT(ICorDebugEval, NewArray) HRESULT ( STDMETHODCALLTYPE *NewArray )( ICorDebugEval * This, /* [in] */ CorElementType elementType, @@ -13824,21 +14728,26 @@ EXTERN_C const IID IID_ICorDebugEval; /* [size_is][in] */ ULONG32 dims[ ], /* [size_is][in] */ ULONG32 lowBounds[ ]); + DECLSPEC_XFGVIRT(ICorDebugEval, IsActive) HRESULT ( STDMETHODCALLTYPE *IsActive )( ICorDebugEval * This, /* [out] */ BOOL *pbActive); + DECLSPEC_XFGVIRT(ICorDebugEval, Abort) HRESULT ( STDMETHODCALLTYPE *Abort )( ICorDebugEval * This); + DECLSPEC_XFGVIRT(ICorDebugEval, GetResult) HRESULT ( STDMETHODCALLTYPE *GetResult )( ICorDebugEval * This, /* [out] */ ICorDebugValue **ppResult); + DECLSPEC_XFGVIRT(ICorDebugEval, GetThread) HRESULT ( STDMETHODCALLTYPE *GetThread )( ICorDebugEval * This, /* [out] */ ICorDebugThread **ppThread); + DECLSPEC_XFGVIRT(ICorDebugEval, CreateValue) HRESULT ( STDMETHODCALLTYPE *CreateValue )( ICorDebugEval * This, /* [in] */ CorElementType elementType, @@ -13858,55 +14767,55 @@ EXTERN_C const IID IID_ICorDebugEval; #ifdef COBJMACROS -#define ICorDebugEval_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEval_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEval_AddRef(This) \ +#define ICorDebugEval_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEval_Release(This) \ +#define ICorDebugEval_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEval_CallFunction(This,pFunction,nArgs,ppArgs) \ +#define ICorDebugEval_CallFunction(This,pFunction,nArgs,ppArgs) \ ( (This)->lpVtbl -> CallFunction(This,pFunction,nArgs,ppArgs) ) -#define ICorDebugEval_NewObject(This,pConstructor,nArgs,ppArgs) \ +#define ICorDebugEval_NewObject(This,pConstructor,nArgs,ppArgs) \ ( (This)->lpVtbl -> NewObject(This,pConstructor,nArgs,ppArgs) ) -#define ICorDebugEval_NewObjectNoConstructor(This,pClass) \ +#define ICorDebugEval_NewObjectNoConstructor(This,pClass) \ ( (This)->lpVtbl -> NewObjectNoConstructor(This,pClass) ) -#define ICorDebugEval_NewString(This,string) \ +#define ICorDebugEval_NewString(This,string) \ ( (This)->lpVtbl -> NewString(This,string) ) -#define ICorDebugEval_NewArray(This,elementType,pElementClass,rank,dims,lowBounds) \ +#define ICorDebugEval_NewArray(This,elementType,pElementClass,rank,dims,lowBounds) \ ( (This)->lpVtbl -> NewArray(This,elementType,pElementClass,rank,dims,lowBounds) ) -#define ICorDebugEval_IsActive(This,pbActive) \ +#define ICorDebugEval_IsActive(This,pbActive) \ ( (This)->lpVtbl -> IsActive(This,pbActive) ) -#define ICorDebugEval_Abort(This) \ +#define ICorDebugEval_Abort(This) \ ( (This)->lpVtbl -> Abort(This) ) -#define ICorDebugEval_GetResult(This,ppResult) \ +#define ICorDebugEval_GetResult(This,ppResult) \ ( (This)->lpVtbl -> GetResult(This,ppResult) ) -#define ICorDebugEval_GetThread(This,ppThread) \ +#define ICorDebugEval_GetThread(This,ppThread) \ ( (This)->lpVtbl -> GetThread(This,ppThread) ) -#define ICorDebugEval_CreateValue(This,elementType,pElementClass,ppValue) \ +#define ICorDebugEval_CreateValue(This,elementType,pElementClass,ppValue) \ ( (This)->lpVtbl -> CreateValue(This,elementType,pElementClass,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEval_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEval_INTERFACE_DEFINED__ */ #ifndef __ICorDebugEval2_INTERFACE_DEFINED__ @@ -13962,24 +14871,28 @@ EXTERN_C const IID IID_ICorDebugEval2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEval2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugEval2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugEval2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugEval2 * This); + DECLSPEC_XFGVIRT(ICorDebugEval2, CallParameterizedFunction) HRESULT ( STDMETHODCALLTYPE *CallParameterizedFunction )( ICorDebugEval2 * This, /* [in] */ ICorDebugFunction *pFunction, @@ -13988,11 +14901,13 @@ EXTERN_C const IID IID_ICorDebugEval2; /* [in] */ ULONG32 nArgs, /* [size_is][in] */ ICorDebugValue *ppArgs[ ]); + DECLSPEC_XFGVIRT(ICorDebugEval2, CreateValueForType) HRESULT ( STDMETHODCALLTYPE *CreateValueForType )( ICorDebugEval2 * This, /* [in] */ ICorDebugType *pType, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugEval2, NewParameterizedObject) HRESULT ( STDMETHODCALLTYPE *NewParameterizedObject )( ICorDebugEval2 * This, /* [in] */ ICorDebugFunction *pConstructor, @@ -14001,12 +14916,14 @@ EXTERN_C const IID IID_ICorDebugEval2; /* [in] */ ULONG32 nArgs, /* [size_is][in] */ ICorDebugValue *ppArgs[ ]); + DECLSPEC_XFGVIRT(ICorDebugEval2, NewParameterizedObjectNoConstructor) HRESULT ( STDMETHODCALLTYPE *NewParameterizedObjectNoConstructor )( ICorDebugEval2 * This, /* [in] */ ICorDebugClass *pClass, /* [in] */ ULONG32 nTypeArgs, /* [size_is][in] */ ICorDebugType *ppTypeArgs[ ]); + DECLSPEC_XFGVIRT(ICorDebugEval2, NewParameterizedArray) HRESULT ( STDMETHODCALLTYPE *NewParameterizedArray )( ICorDebugEval2 * This, /* [in] */ ICorDebugType *pElementType, @@ -14014,11 +14931,13 @@ EXTERN_C const IID IID_ICorDebugEval2; /* [size_is][in] */ ULONG32 dims[ ], /* [size_is][in] */ ULONG32 lowBounds[ ]); + DECLSPEC_XFGVIRT(ICorDebugEval2, NewStringWithLength) HRESULT ( STDMETHODCALLTYPE *NewStringWithLength )( ICorDebugEval2 * This, /* [in] */ LPCWSTR string, /* [in] */ UINT uiLength); + DECLSPEC_XFGVIRT(ICorDebugEval2, RudeAbort) HRESULT ( STDMETHODCALLTYPE *RudeAbort )( ICorDebugEval2 * This); @@ -14035,46 +14954,46 @@ EXTERN_C const IID IID_ICorDebugEval2; #ifdef COBJMACROS -#define ICorDebugEval2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEval2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEval2_AddRef(This) \ +#define ICorDebugEval2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEval2_Release(This) \ +#define ICorDebugEval2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEval2_CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \ +#define ICorDebugEval2_CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \ ( (This)->lpVtbl -> CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) ) -#define ICorDebugEval2_CreateValueForType(This,pType,ppValue) \ +#define ICorDebugEval2_CreateValueForType(This,pType,ppValue) \ ( (This)->lpVtbl -> CreateValueForType(This,pType,ppValue) ) -#define ICorDebugEval2_NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \ +#define ICorDebugEval2_NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \ ( (This)->lpVtbl -> NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) ) -#define ICorDebugEval2_NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) \ +#define ICorDebugEval2_NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) \ ( (This)->lpVtbl -> NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) ) -#define ICorDebugEval2_NewParameterizedArray(This,pElementType,rank,dims,lowBounds) \ +#define ICorDebugEval2_NewParameterizedArray(This,pElementType,rank,dims,lowBounds) \ ( (This)->lpVtbl -> NewParameterizedArray(This,pElementType,rank,dims,lowBounds) ) -#define ICorDebugEval2_NewStringWithLength(This,string,uiLength) \ +#define ICorDebugEval2_NewStringWithLength(This,string,uiLength) \ ( (This)->lpVtbl -> NewStringWithLength(This,string,uiLength) ) -#define ICorDebugEval2_RudeAbort(This) \ +#define ICorDebugEval2_RudeAbort(This) \ ( (This)->lpVtbl -> RudeAbort(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEval2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEval2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValue_INTERFACE_DEFINED__ @@ -14107,36 +15026,43 @@ EXTERN_C const IID IID_ICorDebugValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugValue * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugValue * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugValue * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); @@ -14154,37 +15080,37 @@ EXTERN_C const IID IID_ICorDebugValue; #ifdef COBJMACROS -#define ICorDebugValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValue_AddRef(This) \ +#define ICorDebugValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValue_Release(This) \ +#define ICorDebugValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValue_GetType(This,pType) \ +#define ICorDebugValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugValue_GetSize(This,pSize) \ +#define ICorDebugValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugValue_GetAddress(This,pAddress) \ +#define ICorDebugValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValue2_INTERFACE_DEFINED__ @@ -14208,24 +15134,28 @@ EXTERN_C const IID IID_ICorDebugValue2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValue2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugValue2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugValue2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugValue2 * This); + DECLSPEC_XFGVIRT(ICorDebugValue2, GetExactType) HRESULT ( STDMETHODCALLTYPE *GetExactType )( ICorDebugValue2 * This, /* [out] */ ICorDebugType **ppType); @@ -14243,28 +15173,28 @@ EXTERN_C const IID IID_ICorDebugValue2; #ifdef COBJMACROS -#define ICorDebugValue2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValue2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValue2_AddRef(This) \ +#define ICorDebugValue2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValue2_Release(This) \ +#define ICorDebugValue2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValue2_GetExactType(This,ppType) \ +#define ICorDebugValue2_GetExactType(This,ppType) \ ( (This)->lpVtbl -> GetExactType(This,ppType) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValue2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValue2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValue3_INTERFACE_DEFINED__ @@ -14288,24 +15218,28 @@ EXTERN_C const IID IID_ICorDebugValue3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValue3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugValue3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugValue3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugValue3 * This); + DECLSPEC_XFGVIRT(ICorDebugValue3, GetSize64) HRESULT ( STDMETHODCALLTYPE *GetSize64 )( ICorDebugValue3 * This, /* [out] */ ULONG64 *pSize); @@ -14323,28 +15257,28 @@ EXTERN_C const IID IID_ICorDebugValue3; #ifdef COBJMACROS -#define ICorDebugValue3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValue3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValue3_AddRef(This) \ +#define ICorDebugValue3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValue3_Release(This) \ +#define ICorDebugValue3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValue3_GetSize64(This,pSize) \ +#define ICorDebugValue3_GetSize64(This,pSize) \ ( (This)->lpVtbl -> GetSize64(This,pSize) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValue3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValue3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugGenericValue_INTERFACE_DEFINED__ @@ -14371,44 +15305,53 @@ EXTERN_C const IID IID_ICorDebugGenericValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugGenericValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugGenericValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugGenericValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugGenericValue * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugGenericValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugGenericValue * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugGenericValue * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugGenericValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugGenericValue, GetValue) HRESULT ( STDMETHODCALLTYPE *GetValue )( ICorDebugGenericValue * This, /* [out] */ void *pTo); + DECLSPEC_XFGVIRT(ICorDebugGenericValue, SetValue) HRESULT ( STDMETHODCALLTYPE *SetValue )( ICorDebugGenericValue * This, /* [in] */ void *pFrom); @@ -14426,44 +15369,44 @@ EXTERN_C const IID IID_ICorDebugGenericValue; #ifdef COBJMACROS -#define ICorDebugGenericValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugGenericValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugGenericValue_AddRef(This) \ +#define ICorDebugGenericValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugGenericValue_Release(This) \ +#define ICorDebugGenericValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugGenericValue_GetType(This,pType) \ +#define ICorDebugGenericValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugGenericValue_GetSize(This,pSize) \ +#define ICorDebugGenericValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugGenericValue_GetAddress(This,pAddress) \ +#define ICorDebugGenericValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugGenericValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugGenericValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugGenericValue_GetValue(This,pTo) \ +#define ICorDebugGenericValue_GetValue(This,pTo) \ ( (This)->lpVtbl -> GetValue(This,pTo) ) -#define ICorDebugGenericValue_SetValue(This,pFrom) \ +#define ICorDebugGenericValue_SetValue(This,pFrom) \ ( (This)->lpVtbl -> SetValue(This,pFrom) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugGenericValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugGenericValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugReferenceValue_INTERFACE_DEFINED__ @@ -14499,56 +15442,68 @@ EXTERN_C const IID IID_ICorDebugReferenceValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugReferenceValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugReferenceValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugReferenceValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugReferenceValue * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugReferenceValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugReferenceValue * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugReferenceValue * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugReferenceValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, IsNull) HRESULT ( STDMETHODCALLTYPE *IsNull )( ICorDebugReferenceValue * This, /* [out] */ BOOL *pbNull); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, GetValue) HRESULT ( STDMETHODCALLTYPE *GetValue )( ICorDebugReferenceValue * This, /* [out] */ CORDB_ADDRESS *pValue); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, SetValue) HRESULT ( STDMETHODCALLTYPE *SetValue )( ICorDebugReferenceValue * This, /* [in] */ CORDB_ADDRESS value); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, Dereference) HRESULT ( STDMETHODCALLTYPE *Dereference )( ICorDebugReferenceValue * This, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, DereferenceStrong) HRESULT ( STDMETHODCALLTYPE *DereferenceStrong )( ICorDebugReferenceValue * This, /* [out] */ ICorDebugValue **ppValue); @@ -14566,53 +15521,53 @@ EXTERN_C const IID IID_ICorDebugReferenceValue; #ifdef COBJMACROS -#define ICorDebugReferenceValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugReferenceValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugReferenceValue_AddRef(This) \ +#define ICorDebugReferenceValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugReferenceValue_Release(This) \ +#define ICorDebugReferenceValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugReferenceValue_GetType(This,pType) \ +#define ICorDebugReferenceValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugReferenceValue_GetSize(This,pSize) \ +#define ICorDebugReferenceValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugReferenceValue_GetAddress(This,pAddress) \ +#define ICorDebugReferenceValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugReferenceValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugReferenceValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugReferenceValue_IsNull(This,pbNull) \ +#define ICorDebugReferenceValue_IsNull(This,pbNull) \ ( (This)->lpVtbl -> IsNull(This,pbNull) ) -#define ICorDebugReferenceValue_GetValue(This,pValue) \ +#define ICorDebugReferenceValue_GetValue(This,pValue) \ ( (This)->lpVtbl -> GetValue(This,pValue) ) -#define ICorDebugReferenceValue_SetValue(This,value) \ +#define ICorDebugReferenceValue_SetValue(This,value) \ ( (This)->lpVtbl -> SetValue(This,value) ) -#define ICorDebugReferenceValue_Dereference(This,ppValue) \ +#define ICorDebugReferenceValue_Dereference(This,ppValue) \ ( (This)->lpVtbl -> Dereference(This,ppValue) ) -#define ICorDebugReferenceValue_DereferenceStrong(This,ppValue) \ +#define ICorDebugReferenceValue_DereferenceStrong(This,ppValue) \ ( (This)->lpVtbl -> DereferenceStrong(This,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugReferenceValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugReferenceValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugHeapValue_INTERFACE_DEFINED__ @@ -14639,44 +15594,53 @@ EXTERN_C const IID IID_ICorDebugHeapValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugHeapValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugHeapValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugHeapValue * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugHeapValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugHeapValue * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugHeapValue * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugHeapValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugHeapValue, IsValid) HRESULT ( STDMETHODCALLTYPE *IsValid )( ICorDebugHeapValue * This, /* [out] */ BOOL *pbValid); + DECLSPEC_XFGVIRT(ICorDebugHeapValue, CreateRelocBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateRelocBreakpoint )( ICorDebugHeapValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); @@ -14694,44 +15658,44 @@ EXTERN_C const IID IID_ICorDebugHeapValue; #ifdef COBJMACROS -#define ICorDebugHeapValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapValue_AddRef(This) \ +#define ICorDebugHeapValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapValue_Release(This) \ +#define ICorDebugHeapValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapValue_GetType(This,pType) \ +#define ICorDebugHeapValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugHeapValue_GetSize(This,pSize) \ +#define ICorDebugHeapValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugHeapValue_GetAddress(This,pAddress) \ +#define ICorDebugHeapValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugHeapValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugHeapValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugHeapValue_IsValid(This,pbValid) \ +#define ICorDebugHeapValue_IsValid(This,pbValid) \ ( (This)->lpVtbl -> IsValid(This,pbValid) ) -#define ICorDebugHeapValue_CreateRelocBreakpoint(This,ppBreakpoint) \ +#define ICorDebugHeapValue_CreateRelocBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugHeapValue2_INTERFACE_DEFINED__ @@ -14756,24 +15720,28 @@ EXTERN_C const IID IID_ICorDebugHeapValue2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapValue2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugHeapValue2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugHeapValue2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugHeapValue2 * This); + DECLSPEC_XFGVIRT(ICorDebugHeapValue2, CreateHandle) HRESULT ( STDMETHODCALLTYPE *CreateHandle )( ICorDebugHeapValue2 * This, /* [in] */ CorDebugHandleType type, @@ -14792,28 +15760,28 @@ EXTERN_C const IID IID_ICorDebugHeapValue2; #ifdef COBJMACROS -#define ICorDebugHeapValue2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapValue2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapValue2_AddRef(This) \ +#define ICorDebugHeapValue2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapValue2_Release(This) \ +#define ICorDebugHeapValue2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapValue2_CreateHandle(This,type,ppHandle) \ +#define ICorDebugHeapValue2_CreateHandle(This,type,ppHandle) \ ( (This)->lpVtbl -> CreateHandle(This,type,ppHandle) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapValue2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapValue2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugHeapValue3_INTERFACE_DEFINED__ @@ -14841,29 +15809,34 @@ EXTERN_C const IID IID_ICorDebugHeapValue3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapValue3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugHeapValue3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugHeapValue3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugHeapValue3 * This); + DECLSPEC_XFGVIRT(ICorDebugHeapValue3, GetThreadOwningMonitorLock) HRESULT ( STDMETHODCALLTYPE *GetThreadOwningMonitorLock )( ICorDebugHeapValue3 * This, /* [out] */ ICorDebugThread **ppThread, /* [out] */ DWORD *pAcquisitionCount); + DECLSPEC_XFGVIRT(ICorDebugHeapValue3, GetMonitorEventWaitList) HRESULT ( STDMETHODCALLTYPE *GetMonitorEventWaitList )( ICorDebugHeapValue3 * This, /* [out] */ ICorDebugThreadEnum **ppThreadEnum); @@ -14881,31 +15854,31 @@ EXTERN_C const IID IID_ICorDebugHeapValue3; #ifdef COBJMACROS -#define ICorDebugHeapValue3_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapValue3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapValue3_AddRef(This) \ +#define ICorDebugHeapValue3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapValue3_Release(This) \ +#define ICorDebugHeapValue3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapValue3_GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) \ +#define ICorDebugHeapValue3_GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) \ ( (This)->lpVtbl -> GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) ) -#define ICorDebugHeapValue3_GetMonitorEventWaitList(This,ppThreadEnum) \ +#define ICorDebugHeapValue3_GetMonitorEventWaitList(This,ppThreadEnum) \ ( (This)->lpVtbl -> GetMonitorEventWaitList(This,ppThreadEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapValue3_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapValue3_INTERFACE_DEFINED__ */ #ifndef __ICorDebugHeapValue4_INTERFACE_DEFINED__ @@ -14929,24 +15902,28 @@ EXTERN_C const IID IID_ICorDebugHeapValue4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHeapValue4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugHeapValue4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugHeapValue4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugHeapValue4 * This); + DECLSPEC_XFGVIRT(ICorDebugHeapValue4, CreatePinnedHandle) HRESULT ( STDMETHODCALLTYPE *CreatePinnedHandle )( ICorDebugHeapValue4 * This, /* [out] */ ICorDebugHandleValue **ppHandle); @@ -14964,28 +15941,28 @@ EXTERN_C const IID IID_ICorDebugHeapValue4; #ifdef COBJMACROS -#define ICorDebugHeapValue4_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHeapValue4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHeapValue4_AddRef(This) \ +#define ICorDebugHeapValue4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHeapValue4_Release(This) \ +#define ICorDebugHeapValue4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHeapValue4_CreatePinnedHandle(This,ppHandle) \ +#define ICorDebugHeapValue4_CreatePinnedHandle(This,ppHandle) \ ( (This)->lpVtbl -> CreatePinnedHandle(This,ppHandle) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHeapValue4_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHeapValue4_INTERFACE_DEFINED__ */ #ifndef __ICorDebugObjectValue_INTERFACE_DEFINED__ @@ -15030,67 +16007,81 @@ EXTERN_C const IID IID_ICorDebugObjectValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugObjectValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugObjectValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugObjectValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugObjectValue * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugObjectValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugObjectValue * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugObjectValue * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugObjectValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetClass) HRESULT ( STDMETHODCALLTYPE *GetClass )( ICorDebugObjectValue * This, /* [out] */ ICorDebugClass **ppClass); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetFieldValue) HRESULT ( STDMETHODCALLTYPE *GetFieldValue )( ICorDebugObjectValue * This, /* [in] */ ICorDebugClass *pClass, /* [in] */ mdFieldDef fieldDef, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetVirtualMethod) HRESULT ( STDMETHODCALLTYPE *GetVirtualMethod )( ICorDebugObjectValue * This, /* [in] */ mdMemberRef memberRef, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetContext) HRESULT ( STDMETHODCALLTYPE *GetContext )( ICorDebugObjectValue * This, /* [out] */ ICorDebugContext **ppContext); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, IsValueClass) HRESULT ( STDMETHODCALLTYPE *IsValueClass )( ICorDebugObjectValue * This, /* [out] */ BOOL *pbIsValueClass); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetManagedCopy) HRESULT ( STDMETHODCALLTYPE *GetManagedCopy )( ICorDebugObjectValue * This, /* [out] */ IUnknown **ppObject); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, SetFromManagedCopy) HRESULT ( STDMETHODCALLTYPE *SetFromManagedCopy )( ICorDebugObjectValue * This, /* [in] */ IUnknown *pObject); @@ -15108,59 +16099,59 @@ EXTERN_C const IID IID_ICorDebugObjectValue; #ifdef COBJMACROS -#define ICorDebugObjectValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugObjectValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugObjectValue_AddRef(This) \ +#define ICorDebugObjectValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugObjectValue_Release(This) \ +#define ICorDebugObjectValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugObjectValue_GetType(This,pType) \ +#define ICorDebugObjectValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugObjectValue_GetSize(This,pSize) \ +#define ICorDebugObjectValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugObjectValue_GetAddress(This,pAddress) \ +#define ICorDebugObjectValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugObjectValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugObjectValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugObjectValue_GetClass(This,ppClass) \ +#define ICorDebugObjectValue_GetClass(This,ppClass) \ ( (This)->lpVtbl -> GetClass(This,ppClass) ) -#define ICorDebugObjectValue_GetFieldValue(This,pClass,fieldDef,ppValue) \ +#define ICorDebugObjectValue_GetFieldValue(This,pClass,fieldDef,ppValue) \ ( (This)->lpVtbl -> GetFieldValue(This,pClass,fieldDef,ppValue) ) -#define ICorDebugObjectValue_GetVirtualMethod(This,memberRef,ppFunction) \ +#define ICorDebugObjectValue_GetVirtualMethod(This,memberRef,ppFunction) \ ( (This)->lpVtbl -> GetVirtualMethod(This,memberRef,ppFunction) ) -#define ICorDebugObjectValue_GetContext(This,ppContext) \ +#define ICorDebugObjectValue_GetContext(This,ppContext) \ ( (This)->lpVtbl -> GetContext(This,ppContext) ) -#define ICorDebugObjectValue_IsValueClass(This,pbIsValueClass) \ +#define ICorDebugObjectValue_IsValueClass(This,pbIsValueClass) \ ( (This)->lpVtbl -> IsValueClass(This,pbIsValueClass) ) -#define ICorDebugObjectValue_GetManagedCopy(This,ppObject) \ +#define ICorDebugObjectValue_GetManagedCopy(This,ppObject) \ ( (This)->lpVtbl -> GetManagedCopy(This,ppObject) ) -#define ICorDebugObjectValue_SetFromManagedCopy(This,pObject) \ +#define ICorDebugObjectValue_SetFromManagedCopy(This,pObject) \ ( (This)->lpVtbl -> SetFromManagedCopy(This,pObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugObjectValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugObjectValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugObjectValue2_INTERFACE_DEFINED__ @@ -15186,24 +16177,28 @@ EXTERN_C const IID IID_ICorDebugObjectValue2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugObjectValue2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugObjectValue2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugObjectValue2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugObjectValue2 * This); + DECLSPEC_XFGVIRT(ICorDebugObjectValue2, GetVirtualMethodAndType) HRESULT ( STDMETHODCALLTYPE *GetVirtualMethodAndType )( ICorDebugObjectValue2 * This, /* [in] */ mdMemberRef memberRef, @@ -15223,28 +16218,28 @@ EXTERN_C const IID IID_ICorDebugObjectValue2; #ifdef COBJMACROS -#define ICorDebugObjectValue2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugObjectValue2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugObjectValue2_AddRef(This) \ +#define ICorDebugObjectValue2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugObjectValue2_Release(This) \ +#define ICorDebugObjectValue2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugObjectValue2_GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) \ +#define ICorDebugObjectValue2_GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) \ ( (This)->lpVtbl -> GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugObjectValue2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugObjectValue2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__ @@ -15271,28 +16266,33 @@ EXTERN_C const IID IID_ICorDebugDelegateObjectValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugDelegateObjectValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugDelegateObjectValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugDelegateObjectValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugDelegateObjectValue * This); + DECLSPEC_XFGVIRT(ICorDebugDelegateObjectValue, GetTarget) HRESULT ( STDMETHODCALLTYPE *GetTarget )( ICorDebugDelegateObjectValue * This, /* [out] */ ICorDebugReferenceValue **ppObject); + DECLSPEC_XFGVIRT(ICorDebugDelegateObjectValue, GetFunction) HRESULT ( STDMETHODCALLTYPE *GetFunction )( ICorDebugDelegateObjectValue * This, /* [out] */ ICorDebugFunction **ppFunction); @@ -15310,31 +16310,31 @@ EXTERN_C const IID IID_ICorDebugDelegateObjectValue; #ifdef COBJMACROS -#define ICorDebugDelegateObjectValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugDelegateObjectValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugDelegateObjectValue_AddRef(This) \ +#define ICorDebugDelegateObjectValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugDelegateObjectValue_Release(This) \ +#define ICorDebugDelegateObjectValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugDelegateObjectValue_GetTarget(This,ppObject) \ +#define ICorDebugDelegateObjectValue_GetTarget(This,ppObject) \ ( (This)->lpVtbl -> GetTarget(This,ppObject) ) -#define ICorDebugDelegateObjectValue_GetFunction(This,ppFunction) \ +#define ICorDebugDelegateObjectValue_GetFunction(This,ppFunction) \ ( (This)->lpVtbl -> GetFunction(This,ppFunction) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugBoxValue_INTERFACE_DEFINED__ @@ -15358,48 +16358,58 @@ EXTERN_C const IID IID_ICorDebugBoxValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugBoxValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugBoxValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugBoxValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugBoxValue * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugBoxValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugBoxValue * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugBoxValue * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugBoxValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugHeapValue, IsValid) HRESULT ( STDMETHODCALLTYPE *IsValid )( ICorDebugBoxValue * This, /* [out] */ BOOL *pbValid); + DECLSPEC_XFGVIRT(ICorDebugHeapValue, CreateRelocBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateRelocBreakpoint )( ICorDebugBoxValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugBoxValue, GetObject) HRESULT ( STDMETHODCALLTYPE *GetObject )( ICorDebugBoxValue * This, /* [out] */ ICorDebugObjectValue **ppObject); @@ -15417,59 +16427,59 @@ EXTERN_C const IID IID_ICorDebugBoxValue; #ifdef COBJMACROS -#define ICorDebugBoxValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugBoxValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugBoxValue_AddRef(This) \ +#define ICorDebugBoxValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugBoxValue_Release(This) \ +#define ICorDebugBoxValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugBoxValue_GetType(This,pType) \ +#define ICorDebugBoxValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugBoxValue_GetSize(This,pSize) \ +#define ICorDebugBoxValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugBoxValue_GetAddress(This,pAddress) \ +#define ICorDebugBoxValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugBoxValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugBoxValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugBoxValue_IsValid(This,pbValid) \ +#define ICorDebugBoxValue_IsValid(This,pbValid) \ ( (This)->lpVtbl -> IsValid(This,pbValid) ) -#define ICorDebugBoxValue_CreateRelocBreakpoint(This,ppBreakpoint) \ +#define ICorDebugBoxValue_CreateRelocBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) ) -#define ICorDebugBoxValue_GetObject(This,ppObject) \ +#define ICorDebugBoxValue_GetObject(This,ppObject) \ ( (This)->lpVtbl -> GetObject(This,ppObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugBoxValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugBoxValue_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0105 */ +/* interface __MIDL_itf_cordebug_0000_0106 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0105_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0105_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0106_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0106_v0_0_s_ifspec; #ifndef __ICorDebugStringValue_INTERFACE_DEFINED__ #define __ICorDebugStringValue_INTERFACE_DEFINED__ @@ -15497,52 +16507,63 @@ EXTERN_C const IID IID_ICorDebugStringValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStringValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugStringValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugStringValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugStringValue * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugStringValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugStringValue * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugStringValue * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugStringValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugHeapValue, IsValid) HRESULT ( STDMETHODCALLTYPE *IsValid )( ICorDebugStringValue * This, /* [out] */ BOOL *pbValid); + DECLSPEC_XFGVIRT(ICorDebugHeapValue, CreateRelocBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateRelocBreakpoint )( ICorDebugStringValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugStringValue, GetLength) HRESULT ( STDMETHODCALLTYPE *GetLength )( ICorDebugStringValue * This, /* [out] */ ULONG32 *pcchString); + DECLSPEC_XFGVIRT(ICorDebugStringValue, GetString) HRESULT ( STDMETHODCALLTYPE *GetString )( ICorDebugStringValue * This, /* [in] */ ULONG32 cchString, @@ -15562,61 +16583,61 @@ EXTERN_C const IID IID_ICorDebugStringValue; #ifdef COBJMACROS -#define ICorDebugStringValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStringValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStringValue_AddRef(This) \ +#define ICorDebugStringValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStringValue_Release(This) \ +#define ICorDebugStringValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStringValue_GetType(This,pType) \ +#define ICorDebugStringValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugStringValue_GetSize(This,pSize) \ +#define ICorDebugStringValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugStringValue_GetAddress(This,pAddress) \ +#define ICorDebugStringValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugStringValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugStringValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugStringValue_IsValid(This,pbValid) \ +#define ICorDebugStringValue_IsValid(This,pbValid) \ ( (This)->lpVtbl -> IsValid(This,pbValid) ) -#define ICorDebugStringValue_CreateRelocBreakpoint(This,ppBreakpoint) \ +#define ICorDebugStringValue_CreateRelocBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) ) -#define ICorDebugStringValue_GetLength(This,pcchString) \ +#define ICorDebugStringValue_GetLength(This,pcchString) \ ( (This)->lpVtbl -> GetLength(This,pcchString) ) -#define ICorDebugStringValue_GetString(This,cchString,pcchString,szString) \ +#define ICorDebugStringValue_GetString(This,cchString,pcchString,szString) \ ( (This)->lpVtbl -> GetString(This,cchString,pcchString,szString) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStringValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStringValue_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0106 */ +/* interface __MIDL_itf_cordebug_0000_0107 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0106_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0106_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0107_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0107_v0_0_s_ifspec; #ifndef __ICorDebugArrayValue_INTERFACE_DEFINED__ #define __ICorDebugArrayValue_INTERFACE_DEFINED__ @@ -15651,7 +16672,7 @@ EXTERN_C const IID IID_ICorDebugArrayValue; virtual HRESULT STDMETHODCALLTYPE GetBaseIndicies( /* [in] */ ULONG32 cdim, - /* [length_is][size_is][out] */ ULONG32 indicies[ ]) = 0; + /* [length_is][size_is][out] */ ULONG32 indices[ ]) = 0; virtual HRESULT STDMETHODCALLTYPE GetElement( /* [in] */ ULONG32 cdim, @@ -15665,80 +16686,97 @@ EXTERN_C const IID IID_ICorDebugArrayValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugArrayValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugArrayValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugArrayValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugArrayValue * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugArrayValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugArrayValue * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugArrayValue * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugArrayValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugHeapValue, IsValid) HRESULT ( STDMETHODCALLTYPE *IsValid )( ICorDebugArrayValue * This, /* [out] */ BOOL *pbValid); + DECLSPEC_XFGVIRT(ICorDebugHeapValue, CreateRelocBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateRelocBreakpoint )( ICorDebugArrayValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugArrayValue, GetElementType) HRESULT ( STDMETHODCALLTYPE *GetElementType )( ICorDebugArrayValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugArrayValue, GetRank) HRESULT ( STDMETHODCALLTYPE *GetRank )( ICorDebugArrayValue * This, /* [out] */ ULONG32 *pnRank); + DECLSPEC_XFGVIRT(ICorDebugArrayValue, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugArrayValue * This, /* [out] */ ULONG32 *pnCount); + DECLSPEC_XFGVIRT(ICorDebugArrayValue, GetDimensions) HRESULT ( STDMETHODCALLTYPE *GetDimensions )( ICorDebugArrayValue * This, /* [in] */ ULONG32 cdim, /* [length_is][size_is][out] */ ULONG32 dims[ ]); + DECLSPEC_XFGVIRT(ICorDebugArrayValue, HasBaseIndicies) HRESULT ( STDMETHODCALLTYPE *HasBaseIndicies )( ICorDebugArrayValue * This, /* [out] */ BOOL *pbHasBaseIndicies); + DECLSPEC_XFGVIRT(ICorDebugArrayValue, GetBaseIndicies) HRESULT ( STDMETHODCALLTYPE *GetBaseIndicies )( ICorDebugArrayValue * This, /* [in] */ ULONG32 cdim, - /* [length_is][size_is][out] */ ULONG32 indicies[ ]); + /* [length_is][size_is][out] */ ULONG32 indices[ ]); + DECLSPEC_XFGVIRT(ICorDebugArrayValue, GetElement) HRESULT ( STDMETHODCALLTYPE *GetElement )( ICorDebugArrayValue * This, /* [in] */ ULONG32 cdim, /* [length_is][size_is][in] */ ULONG32 indices[ ], /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugArrayValue, GetElementAtPosition) HRESULT ( STDMETHODCALLTYPE *GetElementAtPosition )( ICorDebugArrayValue * This, /* [in] */ ULONG32 nPosition, @@ -15757,69 +16795,69 @@ EXTERN_C const IID IID_ICorDebugArrayValue; #ifdef COBJMACROS -#define ICorDebugArrayValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugArrayValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugArrayValue_AddRef(This) \ +#define ICorDebugArrayValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugArrayValue_Release(This) \ +#define ICorDebugArrayValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugArrayValue_GetType(This,pType) \ +#define ICorDebugArrayValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugArrayValue_GetSize(This,pSize) \ +#define ICorDebugArrayValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugArrayValue_GetAddress(This,pAddress) \ +#define ICorDebugArrayValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugArrayValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugArrayValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugArrayValue_IsValid(This,pbValid) \ +#define ICorDebugArrayValue_IsValid(This,pbValid) \ ( (This)->lpVtbl -> IsValid(This,pbValid) ) -#define ICorDebugArrayValue_CreateRelocBreakpoint(This,ppBreakpoint) \ +#define ICorDebugArrayValue_CreateRelocBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) ) -#define ICorDebugArrayValue_GetElementType(This,pType) \ +#define ICorDebugArrayValue_GetElementType(This,pType) \ ( (This)->lpVtbl -> GetElementType(This,pType) ) -#define ICorDebugArrayValue_GetRank(This,pnRank) \ +#define ICorDebugArrayValue_GetRank(This,pnRank) \ ( (This)->lpVtbl -> GetRank(This,pnRank) ) -#define ICorDebugArrayValue_GetCount(This,pnCount) \ +#define ICorDebugArrayValue_GetCount(This,pnCount) \ ( (This)->lpVtbl -> GetCount(This,pnCount) ) -#define ICorDebugArrayValue_GetDimensions(This,cdim,dims) \ +#define ICorDebugArrayValue_GetDimensions(This,cdim,dims) \ ( (This)->lpVtbl -> GetDimensions(This,cdim,dims) ) -#define ICorDebugArrayValue_HasBaseIndicies(This,pbHasBaseIndicies) \ +#define ICorDebugArrayValue_HasBaseIndicies(This,pbHasBaseIndicies) \ ( (This)->lpVtbl -> HasBaseIndicies(This,pbHasBaseIndicies) ) -#define ICorDebugArrayValue_GetBaseIndicies(This,cdim,indicies) \ - ( (This)->lpVtbl -> GetBaseIndicies(This,cdim,indicies) ) +#define ICorDebugArrayValue_GetBaseIndicies(This,cdim,indices) \ + ( (This)->lpVtbl -> GetBaseIndicies(This,cdim,indices) ) -#define ICorDebugArrayValue_GetElement(This,cdim,indices,ppValue) \ +#define ICorDebugArrayValue_GetElement(This,cdim,indices,ppValue) \ ( (This)->lpVtbl -> GetElement(This,cdim,indices,ppValue) ) -#define ICorDebugArrayValue_GetElementAtPosition(This,nPosition,ppValue) \ +#define ICorDebugArrayValue_GetElementAtPosition(This,nPosition,ppValue) \ ( (This)->lpVtbl -> GetElementAtPosition(This,nPosition,ppValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugArrayValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugArrayValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugVariableHome_INTERFACE_DEFINED__ @@ -15831,10 +16869,10 @@ EXTERN_C const IID IID_ICorDebugArrayValue; typedef enum VariableLocationType { - VLT_REGISTER = 0, - VLT_REGISTER_RELATIVE = ( VLT_REGISTER + 1 ) , - VLT_INVALID = ( VLT_REGISTER_RELATIVE + 1 ) - } VariableLocationType; + VLT_REGISTER = 0, + VLT_REGISTER_RELATIVE = ( VLT_REGISTER + 1 ) , + VLT_INVALID = ( VLT_REGISTER_RELATIVE + 1 ) + } VariableLocationType; EXTERN_C const IID IID_ICorDebugVariableHome; @@ -15870,49 +16908,59 @@ EXTERN_C const IID IID_ICorDebugVariableHome; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVariableHomeVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugVariableHome * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugVariableHome * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugVariableHome * This); + DECLSPEC_XFGVIRT(ICorDebugVariableHome, GetCode) HRESULT ( STDMETHODCALLTYPE *GetCode )( ICorDebugVariableHome * This, /* [out] */ ICorDebugCode **ppCode); + DECLSPEC_XFGVIRT(ICorDebugVariableHome, GetSlotIndex) HRESULT ( STDMETHODCALLTYPE *GetSlotIndex )( ICorDebugVariableHome * This, /* [out] */ ULONG32 *pSlotIndex); + DECLSPEC_XFGVIRT(ICorDebugVariableHome, GetArgumentIndex) HRESULT ( STDMETHODCALLTYPE *GetArgumentIndex )( ICorDebugVariableHome * This, /* [out] */ ULONG32 *pArgumentIndex); + DECLSPEC_XFGVIRT(ICorDebugVariableHome, GetLiveRange) HRESULT ( STDMETHODCALLTYPE *GetLiveRange )( ICorDebugVariableHome * This, /* [out] */ ULONG32 *pStartOffset, /* [out] */ ULONG32 *pEndOffset); + DECLSPEC_XFGVIRT(ICorDebugVariableHome, GetLocationType) HRESULT ( STDMETHODCALLTYPE *GetLocationType )( ICorDebugVariableHome * This, /* [out] */ VariableLocationType *pLocationType); + DECLSPEC_XFGVIRT(ICorDebugVariableHome, GetRegister) HRESULT ( STDMETHODCALLTYPE *GetRegister )( ICorDebugVariableHome * This, /* [out] */ CorDebugRegister *pRegister); + DECLSPEC_XFGVIRT(ICorDebugVariableHome, GetOffset) HRESULT ( STDMETHODCALLTYPE *GetOffset )( ICorDebugVariableHome * This, /* [out] */ LONG *pOffset); @@ -15930,46 +16978,46 @@ EXTERN_C const IID IID_ICorDebugVariableHome; #ifdef COBJMACROS -#define ICorDebugVariableHome_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugVariableHome_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugVariableHome_AddRef(This) \ +#define ICorDebugVariableHome_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugVariableHome_Release(This) \ +#define ICorDebugVariableHome_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugVariableHome_GetCode(This,ppCode) \ +#define ICorDebugVariableHome_GetCode(This,ppCode) \ ( (This)->lpVtbl -> GetCode(This,ppCode) ) -#define ICorDebugVariableHome_GetSlotIndex(This,pSlotIndex) \ +#define ICorDebugVariableHome_GetSlotIndex(This,pSlotIndex) \ ( (This)->lpVtbl -> GetSlotIndex(This,pSlotIndex) ) -#define ICorDebugVariableHome_GetArgumentIndex(This,pArgumentIndex) \ +#define ICorDebugVariableHome_GetArgumentIndex(This,pArgumentIndex) \ ( (This)->lpVtbl -> GetArgumentIndex(This,pArgumentIndex) ) -#define ICorDebugVariableHome_GetLiveRange(This,pStartOffset,pEndOffset) \ +#define ICorDebugVariableHome_GetLiveRange(This,pStartOffset,pEndOffset) \ ( (This)->lpVtbl -> GetLiveRange(This,pStartOffset,pEndOffset) ) -#define ICorDebugVariableHome_GetLocationType(This,pLocationType) \ +#define ICorDebugVariableHome_GetLocationType(This,pLocationType) \ ( (This)->lpVtbl -> GetLocationType(This,pLocationType) ) -#define ICorDebugVariableHome_GetRegister(This,pRegister) \ +#define ICorDebugVariableHome_GetRegister(This,pRegister) \ ( (This)->lpVtbl -> GetRegister(This,pRegister) ) -#define ICorDebugVariableHome_GetOffset(This,pOffset) \ +#define ICorDebugVariableHome_GetOffset(This,pOffset) \ ( (This)->lpVtbl -> GetOffset(This,pOffset) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugVariableHome_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugVariableHome_INTERFACE_DEFINED__ */ #ifndef __ICorDebugHandleValue_INTERFACE_DEFINED__ @@ -15995,64 +17043,78 @@ EXTERN_C const IID IID_ICorDebugHandleValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugHandleValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugHandleValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugHandleValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugHandleValue * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugHandleValue * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugHandleValue * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugHandleValue * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugHandleValue * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, IsNull) HRESULT ( STDMETHODCALLTYPE *IsNull )( ICorDebugHandleValue * This, /* [out] */ BOOL *pbNull); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, GetValue) HRESULT ( STDMETHODCALLTYPE *GetValue )( ICorDebugHandleValue * This, /* [out] */ CORDB_ADDRESS *pValue); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, SetValue) HRESULT ( STDMETHODCALLTYPE *SetValue )( ICorDebugHandleValue * This, /* [in] */ CORDB_ADDRESS value); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, Dereference) HRESULT ( STDMETHODCALLTYPE *Dereference )( ICorDebugHandleValue * This, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugReferenceValue, DereferenceStrong) HRESULT ( STDMETHODCALLTYPE *DereferenceStrong )( ICorDebugHandleValue * This, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugHandleValue, GetHandleType) HRESULT ( STDMETHODCALLTYPE *GetHandleType )( ICorDebugHandleValue * This, /* [out] */ CorDebugHandleType *pType); + DECLSPEC_XFGVIRT(ICorDebugHandleValue, Dispose) HRESULT ( STDMETHODCALLTYPE *Dispose )( ICorDebugHandleValue * This); @@ -16069,60 +17131,60 @@ EXTERN_C const IID IID_ICorDebugHandleValue; #ifdef COBJMACROS -#define ICorDebugHandleValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugHandleValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugHandleValue_AddRef(This) \ +#define ICorDebugHandleValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugHandleValue_Release(This) \ +#define ICorDebugHandleValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugHandleValue_GetType(This,pType) \ +#define ICorDebugHandleValue_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugHandleValue_GetSize(This,pSize) \ +#define ICorDebugHandleValue_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugHandleValue_GetAddress(This,pAddress) \ +#define ICorDebugHandleValue_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugHandleValue_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugHandleValue_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugHandleValue_IsNull(This,pbNull) \ +#define ICorDebugHandleValue_IsNull(This,pbNull) \ ( (This)->lpVtbl -> IsNull(This,pbNull) ) -#define ICorDebugHandleValue_GetValue(This,pValue) \ +#define ICorDebugHandleValue_GetValue(This,pValue) \ ( (This)->lpVtbl -> GetValue(This,pValue) ) -#define ICorDebugHandleValue_SetValue(This,value) \ +#define ICorDebugHandleValue_SetValue(This,value) \ ( (This)->lpVtbl -> SetValue(This,value) ) -#define ICorDebugHandleValue_Dereference(This,ppValue) \ +#define ICorDebugHandleValue_Dereference(This,ppValue) \ ( (This)->lpVtbl -> Dereference(This,ppValue) ) -#define ICorDebugHandleValue_DereferenceStrong(This,ppValue) \ +#define ICorDebugHandleValue_DereferenceStrong(This,ppValue) \ ( (This)->lpVtbl -> DereferenceStrong(This,ppValue) ) -#define ICorDebugHandleValue_GetHandleType(This,pType) \ +#define ICorDebugHandleValue_GetHandleType(This,pType) \ ( (This)->lpVtbl -> GetHandleType(This,pType) ) -#define ICorDebugHandleValue_Dispose(This) \ +#define ICorDebugHandleValue_Dispose(This) \ ( (This)->lpVtbl -> Dispose(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugHandleValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugHandleValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugContext_INTERFACE_DEFINED__ @@ -16143,67 +17205,81 @@ EXTERN_C const IID IID_ICorDebugContext; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugContextVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugContext * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugContext * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugContext * This); + DECLSPEC_XFGVIRT(ICorDebugValue, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugContext * This, /* [out] */ CorElementType *pType); + DECLSPEC_XFGVIRT(ICorDebugValue, GetSize) HRESULT ( STDMETHODCALLTYPE *GetSize )( ICorDebugContext * This, /* [out] */ ULONG32 *pSize); + DECLSPEC_XFGVIRT(ICorDebugValue, GetAddress) HRESULT ( STDMETHODCALLTYPE *GetAddress )( ICorDebugContext * This, /* [out] */ CORDB_ADDRESS *pAddress); + DECLSPEC_XFGVIRT(ICorDebugValue, CreateBreakpoint) HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )( ICorDebugContext * This, /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetClass) HRESULT ( STDMETHODCALLTYPE *GetClass )( ICorDebugContext * This, /* [out] */ ICorDebugClass **ppClass); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetFieldValue) HRESULT ( STDMETHODCALLTYPE *GetFieldValue )( ICorDebugContext * This, /* [in] */ ICorDebugClass *pClass, /* [in] */ mdFieldDef fieldDef, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetVirtualMethod) HRESULT ( STDMETHODCALLTYPE *GetVirtualMethod )( ICorDebugContext * This, /* [in] */ mdMemberRef memberRef, /* [out] */ ICorDebugFunction **ppFunction); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetContext) HRESULT ( STDMETHODCALLTYPE *GetContext )( ICorDebugContext * This, /* [out] */ ICorDebugContext **ppContext); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, IsValueClass) HRESULT ( STDMETHODCALLTYPE *IsValueClass )( ICorDebugContext * This, /* [out] */ BOOL *pbIsValueClass); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, GetManagedCopy) HRESULT ( STDMETHODCALLTYPE *GetManagedCopy )( ICorDebugContext * This, /* [out] */ IUnknown **ppObject); + DECLSPEC_XFGVIRT(ICorDebugObjectValue, SetFromManagedCopy) HRESULT ( STDMETHODCALLTYPE *SetFromManagedCopy )( ICorDebugContext * This, /* [in] */ IUnknown *pObject); @@ -16221,60 +17297,60 @@ EXTERN_C const IID IID_ICorDebugContext; #ifdef COBJMACROS -#define ICorDebugContext_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugContext_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugContext_AddRef(This) \ +#define ICorDebugContext_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugContext_Release(This) \ +#define ICorDebugContext_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugContext_GetType(This,pType) \ +#define ICorDebugContext_GetType(This,pType) \ ( (This)->lpVtbl -> GetType(This,pType) ) -#define ICorDebugContext_GetSize(This,pSize) \ +#define ICorDebugContext_GetSize(This,pSize) \ ( (This)->lpVtbl -> GetSize(This,pSize) ) -#define ICorDebugContext_GetAddress(This,pAddress) \ +#define ICorDebugContext_GetAddress(This,pAddress) \ ( (This)->lpVtbl -> GetAddress(This,pAddress) ) -#define ICorDebugContext_CreateBreakpoint(This,ppBreakpoint) \ +#define ICorDebugContext_CreateBreakpoint(This,ppBreakpoint) \ ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) ) -#define ICorDebugContext_GetClass(This,ppClass) \ +#define ICorDebugContext_GetClass(This,ppClass) \ ( (This)->lpVtbl -> GetClass(This,ppClass) ) -#define ICorDebugContext_GetFieldValue(This,pClass,fieldDef,ppValue) \ +#define ICorDebugContext_GetFieldValue(This,pClass,fieldDef,ppValue) \ ( (This)->lpVtbl -> GetFieldValue(This,pClass,fieldDef,ppValue) ) -#define ICorDebugContext_GetVirtualMethod(This,memberRef,ppFunction) \ +#define ICorDebugContext_GetVirtualMethod(This,memberRef,ppFunction) \ ( (This)->lpVtbl -> GetVirtualMethod(This,memberRef,ppFunction) ) -#define ICorDebugContext_GetContext(This,ppContext) \ +#define ICorDebugContext_GetContext(This,ppContext) \ ( (This)->lpVtbl -> GetContext(This,ppContext) ) -#define ICorDebugContext_IsValueClass(This,pbIsValueClass) \ +#define ICorDebugContext_IsValueClass(This,pbIsValueClass) \ ( (This)->lpVtbl -> IsValueClass(This,pbIsValueClass) ) -#define ICorDebugContext_GetManagedCopy(This,ppObject) \ +#define ICorDebugContext_GetManagedCopy(This,ppObject) \ ( (This)->lpVtbl -> GetManagedCopy(This,ppObject) ) -#define ICorDebugContext_SetFromManagedCopy(This,pObject) \ +#define ICorDebugContext_SetFromManagedCopy(This,pObject) \ ( (This)->lpVtbl -> SetFromManagedCopy(This,pObject) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugContext_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugContext_INTERFACE_DEFINED__ */ #ifndef __ICorDebugComObjectValue_INTERFACE_DEFINED__ @@ -16305,29 +17381,34 @@ EXTERN_C const IID IID_ICorDebugComObjectValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugComObjectValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugComObjectValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugComObjectValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugComObjectValue * This); + DECLSPEC_XFGVIRT(ICorDebugComObjectValue, GetCachedInterfaceTypes) HRESULT ( STDMETHODCALLTYPE *GetCachedInterfaceTypes )( ICorDebugComObjectValue * This, /* [in] */ BOOL bIInspectableOnly, /* [out] */ ICorDebugTypeEnum **ppInterfacesEnum); + DECLSPEC_XFGVIRT(ICorDebugComObjectValue, GetCachedInterfacePointers) HRESULT ( STDMETHODCALLTYPE *GetCachedInterfacePointers )( ICorDebugComObjectValue * This, /* [in] */ BOOL bIInspectableOnly, @@ -16348,31 +17429,31 @@ EXTERN_C const IID IID_ICorDebugComObjectValue; #ifdef COBJMACROS -#define ICorDebugComObjectValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugComObjectValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugComObjectValue_AddRef(This) \ +#define ICorDebugComObjectValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugComObjectValue_Release(This) \ +#define ICorDebugComObjectValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugComObjectValue_GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) \ +#define ICorDebugComObjectValue_GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) \ ( (This)->lpVtbl -> GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) ) -#define ICorDebugComObjectValue_GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) \ +#define ICorDebugComObjectValue_GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) \ ( (This)->lpVtbl -> GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugComObjectValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugComObjectValue_INTERFACE_DEFINED__ */ #ifndef __ICorDebugObjectEnum_INTERFACE_DEFINED__ @@ -16398,39 +17479,47 @@ EXTERN_C const IID IID_ICorDebugObjectEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugObjectEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugObjectEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugObjectEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugObjectEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugObjectEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugObjectEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugObjectEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugObjectEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugObjectEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugObjectEnum * This, /* [in] */ ULONG celt, @@ -16450,41 +17539,41 @@ EXTERN_C const IID IID_ICorDebugObjectEnum; #ifdef COBJMACROS -#define ICorDebugObjectEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugObjectEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugObjectEnum_AddRef(This) \ +#define ICorDebugObjectEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugObjectEnum_Release(This) \ +#define ICorDebugObjectEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugObjectEnum_Skip(This,celt) \ +#define ICorDebugObjectEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugObjectEnum_Reset(This) \ +#define ICorDebugObjectEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugObjectEnum_Clone(This,ppEnum) \ +#define ICorDebugObjectEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugObjectEnum_GetCount(This,pcelt) \ +#define ICorDebugObjectEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugObjectEnum_Next(This,celt,objects,pceltFetched) \ +#define ICorDebugObjectEnum_Next(This,celt,objects,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugObjectEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugObjectEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugBreakpointEnum_INTERFACE_DEFINED__ @@ -16510,39 +17599,47 @@ EXTERN_C const IID IID_ICorDebugBreakpointEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugBreakpointEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugBreakpointEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugBreakpointEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugBreakpointEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugBreakpointEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugBreakpointEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugBreakpointEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugBreakpointEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugBreakpointEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugBreakpointEnum * This, /* [in] */ ULONG celt, @@ -16562,41 +17659,41 @@ EXTERN_C const IID IID_ICorDebugBreakpointEnum; #ifdef COBJMACROS -#define ICorDebugBreakpointEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugBreakpointEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugBreakpointEnum_AddRef(This) \ +#define ICorDebugBreakpointEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugBreakpointEnum_Release(This) \ +#define ICorDebugBreakpointEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugBreakpointEnum_Skip(This,celt) \ +#define ICorDebugBreakpointEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugBreakpointEnum_Reset(This) \ +#define ICorDebugBreakpointEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugBreakpointEnum_Clone(This,ppEnum) \ +#define ICorDebugBreakpointEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugBreakpointEnum_GetCount(This,pcelt) \ +#define ICorDebugBreakpointEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugBreakpointEnum_Next(This,celt,breakpoints,pceltFetched) \ +#define ICorDebugBreakpointEnum_Next(This,celt,breakpoints,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,breakpoints,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugBreakpointEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugBreakpointEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugStepperEnum_INTERFACE_DEFINED__ @@ -16622,39 +17719,47 @@ EXTERN_C const IID IID_ICorDebugStepperEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugStepperEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugStepperEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugStepperEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugStepperEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugStepperEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugStepperEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugStepperEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugStepperEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugStepperEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugStepperEnum * This, /* [in] */ ULONG celt, @@ -16674,41 +17779,41 @@ EXTERN_C const IID IID_ICorDebugStepperEnum; #ifdef COBJMACROS -#define ICorDebugStepperEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugStepperEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugStepperEnum_AddRef(This) \ +#define ICorDebugStepperEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugStepperEnum_Release(This) \ +#define ICorDebugStepperEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugStepperEnum_Skip(This,celt) \ +#define ICorDebugStepperEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugStepperEnum_Reset(This) \ +#define ICorDebugStepperEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugStepperEnum_Clone(This,ppEnum) \ +#define ICorDebugStepperEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugStepperEnum_GetCount(This,pcelt) \ +#define ICorDebugStepperEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugStepperEnum_Next(This,celt,steppers,pceltFetched) \ +#define ICorDebugStepperEnum_Next(This,celt,steppers,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,steppers,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugStepperEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugStepperEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugProcessEnum_INTERFACE_DEFINED__ @@ -16734,39 +17839,47 @@ EXTERN_C const IID IID_ICorDebugProcessEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugProcessEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugProcessEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugProcessEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugProcessEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugProcessEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugProcessEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugProcessEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugProcessEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugProcessEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugProcessEnum * This, /* [in] */ ULONG celt, @@ -16786,41 +17899,41 @@ EXTERN_C const IID IID_ICorDebugProcessEnum; #ifdef COBJMACROS -#define ICorDebugProcessEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugProcessEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugProcessEnum_AddRef(This) \ +#define ICorDebugProcessEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugProcessEnum_Release(This) \ +#define ICorDebugProcessEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugProcessEnum_Skip(This,celt) \ +#define ICorDebugProcessEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugProcessEnum_Reset(This) \ +#define ICorDebugProcessEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugProcessEnum_Clone(This,ppEnum) \ +#define ICorDebugProcessEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugProcessEnum_GetCount(This,pcelt) \ +#define ICorDebugProcessEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugProcessEnum_Next(This,celt,processes,pceltFetched) \ +#define ICorDebugProcessEnum_Next(This,celt,processes,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,processes,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugProcessEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugProcessEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugThreadEnum_INTERFACE_DEFINED__ @@ -16846,39 +17959,47 @@ EXTERN_C const IID IID_ICorDebugThreadEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugThreadEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugThreadEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugThreadEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugThreadEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugThreadEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugThreadEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugThreadEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugThreadEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugThreadEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugThreadEnum * This, /* [in] */ ULONG celt, @@ -16898,41 +18019,41 @@ EXTERN_C const IID IID_ICorDebugThreadEnum; #ifdef COBJMACROS -#define ICorDebugThreadEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugThreadEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugThreadEnum_AddRef(This) \ +#define ICorDebugThreadEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugThreadEnum_Release(This) \ +#define ICorDebugThreadEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugThreadEnum_Skip(This,celt) \ +#define ICorDebugThreadEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugThreadEnum_Reset(This) \ +#define ICorDebugThreadEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugThreadEnum_Clone(This,ppEnum) \ +#define ICorDebugThreadEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugThreadEnum_GetCount(This,pcelt) \ +#define ICorDebugThreadEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugThreadEnum_Next(This,celt,threads,pceltFetched) \ +#define ICorDebugThreadEnum_Next(This,celt,threads,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,threads,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugThreadEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugThreadEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugFrameEnum_INTERFACE_DEFINED__ @@ -16958,39 +18079,47 @@ EXTERN_C const IID IID_ICorDebugFrameEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugFrameEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugFrameEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugFrameEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugFrameEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugFrameEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugFrameEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugFrameEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugFrameEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugFrameEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugFrameEnum * This, /* [in] */ ULONG celt, @@ -17010,41 +18139,41 @@ EXTERN_C const IID IID_ICorDebugFrameEnum; #ifdef COBJMACROS -#define ICorDebugFrameEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugFrameEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugFrameEnum_AddRef(This) \ +#define ICorDebugFrameEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugFrameEnum_Release(This) \ +#define ICorDebugFrameEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugFrameEnum_Skip(This,celt) \ +#define ICorDebugFrameEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugFrameEnum_Reset(This) \ +#define ICorDebugFrameEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugFrameEnum_Clone(This,ppEnum) \ +#define ICorDebugFrameEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugFrameEnum_GetCount(This,pcelt) \ +#define ICorDebugFrameEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugFrameEnum_Next(This,celt,frames,pceltFetched) \ +#define ICorDebugFrameEnum_Next(This,celt,frames,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,frames,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugFrameEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugFrameEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugChainEnum_INTERFACE_DEFINED__ @@ -17070,39 +18199,47 @@ EXTERN_C const IID IID_ICorDebugChainEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugChainEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugChainEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugChainEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugChainEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugChainEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugChainEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugChainEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugChainEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugChainEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugChainEnum * This, /* [in] */ ULONG celt, @@ -17122,41 +18259,41 @@ EXTERN_C const IID IID_ICorDebugChainEnum; #ifdef COBJMACROS -#define ICorDebugChainEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugChainEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugChainEnum_AddRef(This) \ +#define ICorDebugChainEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugChainEnum_Release(This) \ +#define ICorDebugChainEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugChainEnum_Skip(This,celt) \ +#define ICorDebugChainEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugChainEnum_Reset(This) \ +#define ICorDebugChainEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugChainEnum_Clone(This,ppEnum) \ +#define ICorDebugChainEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugChainEnum_GetCount(This,pcelt) \ +#define ICorDebugChainEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugChainEnum_Next(This,celt,chains,pceltFetched) \ +#define ICorDebugChainEnum_Next(This,celt,chains,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,chains,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugChainEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugChainEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugModuleEnum_INTERFACE_DEFINED__ @@ -17182,39 +18319,47 @@ EXTERN_C const IID IID_ICorDebugModuleEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugModuleEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugModuleEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugModuleEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugModuleEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugModuleEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugModuleEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugModuleEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugModuleEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugModuleEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugModuleEnum * This, /* [in] */ ULONG celt, @@ -17234,41 +18379,41 @@ EXTERN_C const IID IID_ICorDebugModuleEnum; #ifdef COBJMACROS -#define ICorDebugModuleEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugModuleEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugModuleEnum_AddRef(This) \ +#define ICorDebugModuleEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugModuleEnum_Release(This) \ +#define ICorDebugModuleEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugModuleEnum_Skip(This,celt) \ +#define ICorDebugModuleEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugModuleEnum_Reset(This) \ +#define ICorDebugModuleEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugModuleEnum_Clone(This,ppEnum) \ +#define ICorDebugModuleEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugModuleEnum_GetCount(This,pcelt) \ +#define ICorDebugModuleEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugModuleEnum_Next(This,celt,modules,pceltFetched) \ +#define ICorDebugModuleEnum_Next(This,celt,modules,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,modules,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugModuleEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugModuleEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugValueEnum_INTERFACE_DEFINED__ @@ -17294,39 +18439,47 @@ EXTERN_C const IID IID_ICorDebugValueEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugValueEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugValueEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugValueEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugValueEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugValueEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugValueEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugValueEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugValueEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugValueEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugValueEnum * This, /* [in] */ ULONG celt, @@ -17346,41 +18499,41 @@ EXTERN_C const IID IID_ICorDebugValueEnum; #ifdef COBJMACROS -#define ICorDebugValueEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugValueEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugValueEnum_AddRef(This) \ +#define ICorDebugValueEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugValueEnum_Release(This) \ +#define ICorDebugValueEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugValueEnum_Skip(This,celt) \ +#define ICorDebugValueEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugValueEnum_Reset(This) \ +#define ICorDebugValueEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugValueEnum_Clone(This,ppEnum) \ +#define ICorDebugValueEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugValueEnum_GetCount(This,pcelt) \ +#define ICorDebugValueEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugValueEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugValueEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugValueEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugValueEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ @@ -17406,39 +18559,47 @@ EXTERN_C const IID IID_ICorDebugVariableHomeEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugVariableHomeEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugVariableHomeEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugVariableHomeEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugVariableHomeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugVariableHomeEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugVariableHomeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugVariableHomeEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugVariableHomeEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugVariableHomeEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugVariableHomeEnum * This, /* [in] */ ULONG celt, @@ -17458,41 +18619,41 @@ EXTERN_C const IID IID_ICorDebugVariableHomeEnum; #ifdef COBJMACROS -#define ICorDebugVariableHomeEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugVariableHomeEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugVariableHomeEnum_AddRef(This) \ +#define ICorDebugVariableHomeEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugVariableHomeEnum_Release(This) \ +#define ICorDebugVariableHomeEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugVariableHomeEnum_Skip(This,celt) \ +#define ICorDebugVariableHomeEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugVariableHomeEnum_Reset(This) \ +#define ICorDebugVariableHomeEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugVariableHomeEnum_Clone(This,ppEnum) \ +#define ICorDebugVariableHomeEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugVariableHomeEnum_GetCount(This,pcelt) \ +#define ICorDebugVariableHomeEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugVariableHomeEnum_Next(This,celt,homes,pceltFetched) \ +#define ICorDebugVariableHomeEnum_Next(This,celt,homes,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,homes,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugCodeEnum_INTERFACE_DEFINED__ @@ -17518,39 +18679,47 @@ EXTERN_C const IID IID_ICorDebugCodeEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugCodeEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugCodeEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugCodeEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugCodeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugCodeEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugCodeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugCodeEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugCodeEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugCodeEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugCodeEnum * This, /* [in] */ ULONG celt, @@ -17570,41 +18739,41 @@ EXTERN_C const IID IID_ICorDebugCodeEnum; #ifdef COBJMACROS -#define ICorDebugCodeEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugCodeEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugCodeEnum_AddRef(This) \ +#define ICorDebugCodeEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugCodeEnum_Release(This) \ +#define ICorDebugCodeEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugCodeEnum_Skip(This,celt) \ +#define ICorDebugCodeEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugCodeEnum_Reset(This) \ +#define ICorDebugCodeEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugCodeEnum_Clone(This,ppEnum) \ +#define ICorDebugCodeEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugCodeEnum_GetCount(This,pcelt) \ +#define ICorDebugCodeEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugCodeEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugCodeEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugCodeEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugCodeEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugTypeEnum_INTERFACE_DEFINED__ @@ -17630,39 +18799,47 @@ EXTERN_C const IID IID_ICorDebugTypeEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugTypeEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugTypeEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugTypeEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugTypeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugTypeEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugTypeEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugTypeEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugTypeEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugTypeEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugTypeEnum * This, /* [in] */ ULONG celt, @@ -17682,41 +18859,41 @@ EXTERN_C const IID IID_ICorDebugTypeEnum; #ifdef COBJMACROS -#define ICorDebugTypeEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugTypeEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugTypeEnum_AddRef(This) \ +#define ICorDebugTypeEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugTypeEnum_Release(This) \ +#define ICorDebugTypeEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugTypeEnum_Skip(This,celt) \ +#define ICorDebugTypeEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugTypeEnum_Reset(This) \ +#define ICorDebugTypeEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugTypeEnum_Clone(This,ppEnum) \ +#define ICorDebugTypeEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugTypeEnum_GetCount(This,pcelt) \ +#define ICorDebugTypeEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugTypeEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugTypeEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugTypeEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugTypeEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugType_INTERFACE_DEFINED__ @@ -17760,50 +18937,60 @@ EXTERN_C const IID IID_ICorDebugType; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugTypeVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugType * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugType * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugType * This); + DECLSPEC_XFGVIRT(ICorDebugType, GetType) HRESULT ( STDMETHODCALLTYPE *GetType )( ICorDebugType * This, /* [out] */ CorElementType *ty); + DECLSPEC_XFGVIRT(ICorDebugType, GetClass) HRESULT ( STDMETHODCALLTYPE *GetClass )( ICorDebugType * This, /* [out] */ ICorDebugClass **ppClass); + DECLSPEC_XFGVIRT(ICorDebugType, EnumerateTypeParameters) HRESULT ( STDMETHODCALLTYPE *EnumerateTypeParameters )( ICorDebugType * This, /* [out] */ ICorDebugTypeEnum **ppTyParEnum); + DECLSPEC_XFGVIRT(ICorDebugType, GetFirstTypeParameter) HRESULT ( STDMETHODCALLTYPE *GetFirstTypeParameter )( ICorDebugType * This, /* [out] */ ICorDebugType **value); + DECLSPEC_XFGVIRT(ICorDebugType, GetBase) HRESULT ( STDMETHODCALLTYPE *GetBase )( ICorDebugType * This, /* [out] */ ICorDebugType **pBase); + DECLSPEC_XFGVIRT(ICorDebugType, GetStaticFieldValue) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldValue )( ICorDebugType * This, /* [in] */ mdFieldDef fieldDef, /* [in] */ ICorDebugFrame *pFrame, /* [out] */ ICorDebugValue **ppValue); + DECLSPEC_XFGVIRT(ICorDebugType, GetRank) HRESULT ( STDMETHODCALLTYPE *GetRank )( ICorDebugType * This, /* [out] */ ULONG32 *pnRank); @@ -17821,46 +19008,46 @@ EXTERN_C const IID IID_ICorDebugType; #ifdef COBJMACROS -#define ICorDebugType_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugType_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugType_AddRef(This) \ +#define ICorDebugType_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugType_Release(This) \ +#define ICorDebugType_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugType_GetType(This,ty) \ +#define ICorDebugType_GetType(This,ty) \ ( (This)->lpVtbl -> GetType(This,ty) ) -#define ICorDebugType_GetClass(This,ppClass) \ +#define ICorDebugType_GetClass(This,ppClass) \ ( (This)->lpVtbl -> GetClass(This,ppClass) ) -#define ICorDebugType_EnumerateTypeParameters(This,ppTyParEnum) \ +#define ICorDebugType_EnumerateTypeParameters(This,ppTyParEnum) \ ( (This)->lpVtbl -> EnumerateTypeParameters(This,ppTyParEnum) ) -#define ICorDebugType_GetFirstTypeParameter(This,value) \ +#define ICorDebugType_GetFirstTypeParameter(This,value) \ ( (This)->lpVtbl -> GetFirstTypeParameter(This,value) ) -#define ICorDebugType_GetBase(This,pBase) \ +#define ICorDebugType_GetBase(This,pBase) \ ( (This)->lpVtbl -> GetBase(This,pBase) ) -#define ICorDebugType_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \ +#define ICorDebugType_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \ ( (This)->lpVtbl -> GetStaticFieldValue(This,fieldDef,pFrame,ppValue) ) -#define ICorDebugType_GetRank(This,pnRank) \ +#define ICorDebugType_GetRank(This,pnRank) \ ( (This)->lpVtbl -> GetRank(This,pnRank) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugType_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugType_INTERFACE_DEFINED__ */ #ifndef __ICorDebugType2_INTERFACE_DEFINED__ @@ -17884,24 +19071,28 @@ EXTERN_C const IID IID_ICorDebugType2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugType2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugType2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugType2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugType2 * This); + DECLSPEC_XFGVIRT(ICorDebugType2, GetTypeID) HRESULT ( STDMETHODCALLTYPE *GetTypeID )( ICorDebugType2 * This, /* [out] */ COR_TYPEID *id); @@ -17919,28 +19110,28 @@ EXTERN_C const IID IID_ICorDebugType2; #ifdef COBJMACROS -#define ICorDebugType2_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugType2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugType2_AddRef(This) \ +#define ICorDebugType2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugType2_Release(This) \ +#define ICorDebugType2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugType2_GetTypeID(This,id) \ +#define ICorDebugType2_GetTypeID(This,id) \ ( (This)->lpVtbl -> GetTypeID(This,id) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugType2_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugType2_INTERFACE_DEFINED__ */ #ifndef __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__ @@ -17966,39 +19157,47 @@ EXTERN_C const IID IID_ICorDebugErrorInfoEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugErrorInfoEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugErrorInfoEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugErrorInfoEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugErrorInfoEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugErrorInfoEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugErrorInfoEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugErrorInfoEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugErrorInfoEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugErrorInfoEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugErrorInfoEnum * This, /* [in] */ ULONG celt, @@ -18018,41 +19217,41 @@ EXTERN_C const IID IID_ICorDebugErrorInfoEnum; #ifdef COBJMACROS -#define ICorDebugErrorInfoEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugErrorInfoEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugErrorInfoEnum_AddRef(This) \ +#define ICorDebugErrorInfoEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugErrorInfoEnum_Release(This) \ +#define ICorDebugErrorInfoEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugErrorInfoEnum_Skip(This,celt) \ +#define ICorDebugErrorInfoEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugErrorInfoEnum_Reset(This) \ +#define ICorDebugErrorInfoEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugErrorInfoEnum_Clone(This,ppEnum) \ +#define ICorDebugErrorInfoEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugErrorInfoEnum_GetCount(This,pcelt) \ +#define ICorDebugErrorInfoEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugErrorInfoEnum_Next(This,celt,errors,pceltFetched) \ +#define ICorDebugErrorInfoEnum_Next(This,celt,errors,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,errors,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAppDomainEnum_INTERFACE_DEFINED__ @@ -18078,39 +19277,47 @@ EXTERN_C const IID IID_ICorDebugAppDomainEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAppDomainEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugAppDomainEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugAppDomainEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAppDomainEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugAppDomainEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugAppDomainEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugAppDomainEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugAppDomainEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugAppDomainEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugAppDomainEnum * This, /* [in] */ ULONG celt, @@ -18130,41 +19337,41 @@ EXTERN_C const IID IID_ICorDebugAppDomainEnum; #ifdef COBJMACROS -#define ICorDebugAppDomainEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAppDomainEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAppDomainEnum_AddRef(This) \ +#define ICorDebugAppDomainEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAppDomainEnum_Release(This) \ +#define ICorDebugAppDomainEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAppDomainEnum_Skip(This,celt) \ +#define ICorDebugAppDomainEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugAppDomainEnum_Reset(This) \ +#define ICorDebugAppDomainEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugAppDomainEnum_Clone(This,ppEnum) \ +#define ICorDebugAppDomainEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugAppDomainEnum_GetCount(This,pcelt) \ +#define ICorDebugAppDomainEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugAppDomainEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugAppDomainEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAppDomainEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAppDomainEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugAssemblyEnum_INTERFACE_DEFINED__ @@ -18190,39 +19397,47 @@ EXTERN_C const IID IID_ICorDebugAssemblyEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugAssemblyEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugAssemblyEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugAssemblyEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAssemblyEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugAssemblyEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugAssemblyEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugAssemblyEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugAssemblyEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugAssemblyEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugAssemblyEnum * This, /* [in] */ ULONG celt, @@ -18242,41 +19457,41 @@ EXTERN_C const IID IID_ICorDebugAssemblyEnum; #ifdef COBJMACROS -#define ICorDebugAssemblyEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugAssemblyEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugAssemblyEnum_AddRef(This) \ +#define ICorDebugAssemblyEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugAssemblyEnum_Release(This) \ +#define ICorDebugAssemblyEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugAssemblyEnum_Skip(This,celt) \ +#define ICorDebugAssemblyEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugAssemblyEnum_Reset(This) \ +#define ICorDebugAssemblyEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugAssemblyEnum_Clone(This,ppEnum) \ +#define ICorDebugAssemblyEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugAssemblyEnum_GetCount(This,pcelt) \ +#define ICorDebugAssemblyEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugAssemblyEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugAssemblyEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugAssemblyEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugAssemblyEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ @@ -18302,39 +19517,47 @@ EXTERN_C const IID IID_ICorDebugBlockingObjectEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugBlockingObjectEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugBlockingObjectEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugBlockingObjectEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugBlockingObjectEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugBlockingObjectEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugBlockingObjectEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugBlockingObjectEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugBlockingObjectEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugBlockingObjectEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugBlockingObjectEnum * This, /* [in] */ ULONG celt, @@ -18354,52 +19577,52 @@ EXTERN_C const IID IID_ICorDebugBlockingObjectEnum; #ifdef COBJMACROS -#define ICorDebugBlockingObjectEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugBlockingObjectEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugBlockingObjectEnum_AddRef(This) \ +#define ICorDebugBlockingObjectEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugBlockingObjectEnum_Release(This) \ +#define ICorDebugBlockingObjectEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugBlockingObjectEnum_Skip(This,celt) \ +#define ICorDebugBlockingObjectEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugBlockingObjectEnum_Reset(This) \ +#define ICorDebugBlockingObjectEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugBlockingObjectEnum_Clone(This,ppEnum) \ +#define ICorDebugBlockingObjectEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugBlockingObjectEnum_GetCount(This,pcelt) \ +#define ICorDebugBlockingObjectEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugBlockingObjectEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugBlockingObjectEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0130 */ +/* interface __MIDL_itf_cordebug_0000_0131 */ /* [local] */ #pragma warning(push) #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0130_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0130_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0131_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0131_v0_0_s_ifspec; #ifndef __ICorDebugMDA_INTERFACE_DEFINED__ #define __ICorDebugMDA_INTERFACE_DEFINED__ @@ -18410,8 +19633,8 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0130_v0_0_s_ifspec; typedef enum CorDebugMDAFlags { - MDA_FLAG_SLIP = 0x2 - } CorDebugMDAFlags; + MDA_FLAG_SLIP = 0x2 + } CorDebugMDAFlags; EXTERN_C const IID IID_ICorDebugMDA; @@ -18446,46 +19669,54 @@ EXTERN_C const IID IID_ICorDebugMDA; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugMDAVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugMDA * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugMDA * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugMDA * This); + DECLSPEC_XFGVIRT(ICorDebugMDA, GetName) HRESULT ( STDMETHODCALLTYPE *GetName )( ICorDebugMDA * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugMDA, GetDescription) HRESULT ( STDMETHODCALLTYPE *GetDescription )( ICorDebugMDA * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugMDA, GetXML) HRESULT ( STDMETHODCALLTYPE *GetXML )( ICorDebugMDA * This, /* [in] */ ULONG32 cchName, /* [out] */ ULONG32 *pcchName, /* [length_is][size_is][out] */ WCHAR szName[ ]); + DECLSPEC_XFGVIRT(ICorDebugMDA, GetFlags) HRESULT ( STDMETHODCALLTYPE *GetFlags )( ICorDebugMDA * This, /* [in] */ CorDebugMDAFlags *pFlags); + DECLSPEC_XFGVIRT(ICorDebugMDA, GetOSThreadId) HRESULT ( STDMETHODCALLTYPE *GetOSThreadId )( ICorDebugMDA * This, /* [out] */ DWORD *pOsTid); @@ -18503,43 +19734,43 @@ EXTERN_C const IID IID_ICorDebugMDA; #ifdef COBJMACROS -#define ICorDebugMDA_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugMDA_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugMDA_AddRef(This) \ +#define ICorDebugMDA_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugMDA_Release(This) \ +#define ICorDebugMDA_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugMDA_GetName(This,cchName,pcchName,szName) \ +#define ICorDebugMDA_GetName(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) -#define ICorDebugMDA_GetDescription(This,cchName,pcchName,szName) \ +#define ICorDebugMDA_GetDescription(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetDescription(This,cchName,pcchName,szName) ) -#define ICorDebugMDA_GetXML(This,cchName,pcchName,szName) \ +#define ICorDebugMDA_GetXML(This,cchName,pcchName,szName) \ ( (This)->lpVtbl -> GetXML(This,cchName,pcchName,szName) ) -#define ICorDebugMDA_GetFlags(This,pFlags) \ +#define ICorDebugMDA_GetFlags(This,pFlags) \ ( (This)->lpVtbl -> GetFlags(This,pFlags) ) -#define ICorDebugMDA_GetOSThreadId(This,pOsTid) \ +#define ICorDebugMDA_GetOSThreadId(This,pOsTid) \ ( (This)->lpVtbl -> GetOSThreadId(This,pOsTid) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugMDA_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugMDA_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0131 */ +/* interface __MIDL_itf_cordebug_0000_0132 */ /* [local] */ #pragma warning(pop) @@ -18547,8 +19778,8 @@ EXTERN_C const IID IID_ICorDebugMDA; #pragma warning(disable:28718) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0131_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0131_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0132_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0132_v0_0_s_ifspec; #ifndef __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ #define __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ @@ -18582,36 +19813,43 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEditAndContinueErrorInfoVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugEditAndContinueErrorInfo * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugEditAndContinueErrorInfo * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugEditAndContinueErrorInfo * This); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueErrorInfo, GetModule) HRESULT ( STDMETHODCALLTYPE *GetModule )( ICorDebugEditAndContinueErrorInfo * This, /* [out] */ ICorDebugModule **ppModule); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueErrorInfo, GetToken) HRESULT ( STDMETHODCALLTYPE *GetToken )( ICorDebugEditAndContinueErrorInfo * This, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueErrorInfo, GetErrorCode) HRESULT ( STDMETHODCALLTYPE *GetErrorCode )( ICorDebugEditAndContinueErrorInfo * This, /* [out] */ HRESULT *pHr); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueErrorInfo, GetString) HRESULT ( STDMETHODCALLTYPE *GetString )( ICorDebugEditAndContinueErrorInfo * This, /* [in] */ ULONG32 cchString, @@ -18631,47 +19869,47 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo; #ifdef COBJMACROS -#define ICorDebugEditAndContinueErrorInfo_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEditAndContinueErrorInfo_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEditAndContinueErrorInfo_AddRef(This) \ +#define ICorDebugEditAndContinueErrorInfo_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEditAndContinueErrorInfo_Release(This) \ +#define ICorDebugEditAndContinueErrorInfo_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEditAndContinueErrorInfo_GetModule(This,ppModule) \ +#define ICorDebugEditAndContinueErrorInfo_GetModule(This,ppModule) \ ( (This)->lpVtbl -> GetModule(This,ppModule) ) -#define ICorDebugEditAndContinueErrorInfo_GetToken(This,pToken) \ +#define ICorDebugEditAndContinueErrorInfo_GetToken(This,pToken) \ ( (This)->lpVtbl -> GetToken(This,pToken) ) -#define ICorDebugEditAndContinueErrorInfo_GetErrorCode(This,pHr) \ +#define ICorDebugEditAndContinueErrorInfo_GetErrorCode(This,pHr) \ ( (This)->lpVtbl -> GetErrorCode(This,pHr) ) -#define ICorDebugEditAndContinueErrorInfo_GetString(This,cchString,pcchString,szString) \ +#define ICorDebugEditAndContinueErrorInfo_GetString(This,cchString,pcchString,szString) \ ( (This)->lpVtbl -> GetString(This,cchString,pcchString,szString) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */ -/* interface __MIDL_itf_cordebug_0000_0132 */ +/* interface __MIDL_itf_cordebug_0000_0133 */ /* [local] */ #pragma warning(pop) -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0132_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0132_v0_0_s_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0133_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0133_v0_0_s_ifspec; #ifndef __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ #define __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ @@ -18715,51 +19953,61 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueSnapshot; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugEditAndContinueSnapshotVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugEditAndContinueSnapshot * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugEditAndContinueSnapshot * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugEditAndContinueSnapshot * This); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueSnapshot, CopyMetaData) HRESULT ( STDMETHODCALLTYPE *CopyMetaData )( ICorDebugEditAndContinueSnapshot * This, /* [in] */ IStream *pIStream, /* [out] */ GUID *pMvid); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueSnapshot, GetMvid) HRESULT ( STDMETHODCALLTYPE *GetMvid )( ICorDebugEditAndContinueSnapshot * This, /* [out] */ GUID *pMvid); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueSnapshot, GetRoDataRVA) HRESULT ( STDMETHODCALLTYPE *GetRoDataRVA )( ICorDebugEditAndContinueSnapshot * This, /* [out] */ ULONG32 *pRoDataRVA); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueSnapshot, GetRwDataRVA) HRESULT ( STDMETHODCALLTYPE *GetRwDataRVA )( ICorDebugEditAndContinueSnapshot * This, /* [out] */ ULONG32 *pRwDataRVA); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueSnapshot, SetPEBytes) HRESULT ( STDMETHODCALLTYPE *SetPEBytes )( ICorDebugEditAndContinueSnapshot * This, /* [in] */ IStream *pIStream); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueSnapshot, SetILMap) HRESULT ( STDMETHODCALLTYPE *SetILMap )( ICorDebugEditAndContinueSnapshot * This, /* [in] */ mdToken mdFunction, /* [in] */ ULONG cMapSize, /* [size_is][in] */ COR_IL_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorDebugEditAndContinueSnapshot, SetPESymbolBytes) HRESULT ( STDMETHODCALLTYPE *SetPESymbolBytes )( ICorDebugEditAndContinueSnapshot * This, /* [in] */ IStream *pIStream); @@ -18777,46 +20025,46 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueSnapshot; #ifdef COBJMACROS -#define ICorDebugEditAndContinueSnapshot_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugEditAndContinueSnapshot_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugEditAndContinueSnapshot_AddRef(This) \ +#define ICorDebugEditAndContinueSnapshot_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugEditAndContinueSnapshot_Release(This) \ +#define ICorDebugEditAndContinueSnapshot_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugEditAndContinueSnapshot_CopyMetaData(This,pIStream,pMvid) \ +#define ICorDebugEditAndContinueSnapshot_CopyMetaData(This,pIStream,pMvid) \ ( (This)->lpVtbl -> CopyMetaData(This,pIStream,pMvid) ) -#define ICorDebugEditAndContinueSnapshot_GetMvid(This,pMvid) \ +#define ICorDebugEditAndContinueSnapshot_GetMvid(This,pMvid) \ ( (This)->lpVtbl -> GetMvid(This,pMvid) ) -#define ICorDebugEditAndContinueSnapshot_GetRoDataRVA(This,pRoDataRVA) \ +#define ICorDebugEditAndContinueSnapshot_GetRoDataRVA(This,pRoDataRVA) \ ( (This)->lpVtbl -> GetRoDataRVA(This,pRoDataRVA) ) -#define ICorDebugEditAndContinueSnapshot_GetRwDataRVA(This,pRwDataRVA) \ +#define ICorDebugEditAndContinueSnapshot_GetRwDataRVA(This,pRwDataRVA) \ ( (This)->lpVtbl -> GetRwDataRVA(This,pRwDataRVA) ) -#define ICorDebugEditAndContinueSnapshot_SetPEBytes(This,pIStream) \ +#define ICorDebugEditAndContinueSnapshot_SetPEBytes(This,pIStream) \ ( (This)->lpVtbl -> SetPEBytes(This,pIStream) ) -#define ICorDebugEditAndContinueSnapshot_SetILMap(This,mdFunction,cMapSize,map) \ +#define ICorDebugEditAndContinueSnapshot_SetILMap(This,mdFunction,cMapSize,map) \ ( (This)->lpVtbl -> SetILMap(This,mdFunction,cMapSize,map) ) -#define ICorDebugEditAndContinueSnapshot_SetPESymbolBytes(This,pIStream) \ +#define ICorDebugEditAndContinueSnapshot_SetPESymbolBytes(This,pIStream) \ ( (This)->lpVtbl -> SetPESymbolBytes(This,pIStream) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ */ #ifndef __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__ @@ -18842,39 +20090,47 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectCallStackEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugExceptionObjectCallStackEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugExceptionObjectCallStackEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugExceptionObjectCallStackEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugExceptionObjectCallStackEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorDebugExceptionObjectCallStackEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorDebugEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorDebugExceptionObjectCallStackEnum * This); + DECLSPEC_XFGVIRT(ICorDebugEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorDebugExceptionObjectCallStackEnum * This, /* [out] */ ICorDebugEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorDebugEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorDebugExceptionObjectCallStackEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorDebugExceptionObjectCallStackEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorDebugExceptionObjectCallStackEnum * This, /* [in] */ ULONG celt, @@ -18894,41 +20150,41 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectCallStackEnum; #ifdef COBJMACROS -#define ICorDebugExceptionObjectCallStackEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugExceptionObjectCallStackEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugExceptionObjectCallStackEnum_AddRef(This) \ +#define ICorDebugExceptionObjectCallStackEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugExceptionObjectCallStackEnum_Release(This) \ +#define ICorDebugExceptionObjectCallStackEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugExceptionObjectCallStackEnum_Skip(This,celt) \ +#define ICorDebugExceptionObjectCallStackEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorDebugExceptionObjectCallStackEnum_Reset(This) \ +#define ICorDebugExceptionObjectCallStackEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorDebugExceptionObjectCallStackEnum_Clone(This,ppEnum) \ +#define ICorDebugExceptionObjectCallStackEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorDebugExceptionObjectCallStackEnum_GetCount(This,pcelt) \ +#define ICorDebugExceptionObjectCallStackEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorDebugExceptionObjectCallStackEnum_Next(This,celt,values,pceltFetched) \ +#define ICorDebugExceptionObjectCallStackEnum_Next(This,celt,values,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__ */ #ifndef __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__ @@ -18952,24 +20208,28 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectValue; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorDebugExceptionObjectValueVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorDebugExceptionObjectValue * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorDebugExceptionObjectValue * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugExceptionObjectValue * This); + DECLSPEC_XFGVIRT(ICorDebugExceptionObjectValue, EnumerateExceptionCallStack) HRESULT ( STDMETHODCALLTYPE *EnumerateExceptionCallStack )( ICorDebugExceptionObjectValue * This, /* [out] */ ICorDebugExceptionObjectCallStackEnum **ppCallStackEnum); @@ -18987,28 +20247,112 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectValue; #ifdef COBJMACROS -#define ICorDebugExceptionObjectValue_QueryInterface(This,riid,ppvObject) \ +#define ICorDebugExceptionObjectValue_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorDebugExceptionObjectValue_AddRef(This) \ +#define ICorDebugExceptionObjectValue_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorDebugExceptionObjectValue_Release(This) \ +#define ICorDebugExceptionObjectValue_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorDebugExceptionObjectValue_EnumerateExceptionCallStack(This,ppCallStackEnum) \ +#define ICorDebugExceptionObjectValue_EnumerateExceptionCallStack(This,ppCallStackEnum) \ ( (This)->lpVtbl -> EnumerateExceptionCallStack(This,ppCallStackEnum) ) #endif /* COBJMACROS */ +#endif /* C style interface */ + + + + +#endif /* __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__ */ + + +#ifndef __ICorDebugExceptionObjectValue2_INTERFACE_DEFINED__ +#define __ICorDebugExceptionObjectValue2_INTERFACE_DEFINED__ + +/* interface ICorDebugExceptionObjectValue2 */ +/* [unique][uuid][local][object] */ + + +EXTERN_C const IID IID_ICorDebugExceptionObjectValue2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e3b2f332-cc46-4f1e-ab4e-5400e332195e") + ICorDebugExceptionObjectValue2 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE ForceCatchHandlerFoundEvents( + /* [in] */ BOOL enableEvents) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorDebugExceptionObjectValue2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorDebugExceptionObjectValue2 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorDebugExceptionObjectValue2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ICorDebugExceptionObjectValue2 * This); + + DECLSPEC_XFGVIRT(ICorDebugExceptionObjectValue2, ForceCatchHandlerFoundEvents) + HRESULT ( STDMETHODCALLTYPE *ForceCatchHandlerFoundEvents )( + ICorDebugExceptionObjectValue2 * This, + /* [in] */ BOOL enableEvents); + + END_INTERFACE + } ICorDebugExceptionObjectValue2Vtbl; + + interface ICorDebugExceptionObjectValue2 + { + CONST_VTBL struct ICorDebugExceptionObjectValue2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorDebugExceptionObjectValue2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorDebugExceptionObjectValue2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorDebugExceptionObjectValue2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorDebugExceptionObjectValue2_ForceCatchHandlerFoundEvents(This,enableEvents) \ + ( (This)->lpVtbl -> ForceCatchHandlerFoundEvents(This,enableEvents) ) + +#endif /* COBJMACROS */ + + #endif /* C style interface */ -#endif /* __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__ */ +#endif /* __ICorDebugExceptionObjectValue2_INTERFACE_DEFINED__ */ @@ -19077,3 +20421,5 @@ EmbeddedCLRCorDebug; #endif #endif + + diff --git a/src/shared/pal/prebuilt/inc/corerror.h b/src/shared/pal/prebuilt/inc/corerror.h index d1ba2e7f52..0b47567905 100644 --- a/src/shared/pal/prebuilt/inc/corerror.h +++ b/src/shared/pal/prebuilt/inc/corerror.h @@ -31,39 +31,19 @@ #define CORDBG_S_FUNC_EVAL_ABORTED SMAKEHR(0x1319) #define CORDBG_S_AT_END_OF_STACK SMAKEHR(0x1324) #define CORDBG_S_NOT_ALL_BITS_SET SMAKEHR(0x1c13) -#define CEE_E_CVTRES_NOT_FOUND EMAKEHR(0x1001) #define COR_E_TYPEUNLOADED EMAKEHR(0x1013) #define COR_E_APPDOMAINUNLOADED EMAKEHR(0x1014) #define COR_E_CANNOTUNLOADAPPDOMAIN EMAKEHR(0x1015) #define MSEE_E_ASSEMBLYLOADINPROGRESS EMAKEHR(0x1016) #define COR_E_ASSEMBLYEXPECTED EMAKEHR(0x1018) -#define COR_E_FIXUPSINEXE EMAKEHR(0x1019) #define COR_E_NEWER_RUNTIME EMAKEHR(0x101b) #define COR_E_MULTIMODULEASSEMBLIESDIALLOWED EMAKEHR(0x101e) -#define HOST_E_DEADLOCK EMAKEHR(0x1020) #define HOST_E_INVALIDOPERATION EMAKEHR(0x1022) #define HOST_E_CLRNOTAVAILABLE EMAKEHR(0x1023) -#define HOST_E_EXITPROCESS_THREADABORT EMAKEHR(0x1027) -#define HOST_E_EXITPROCESS_ADUNLOAD EMAKEHR(0x1028) -#define HOST_E_EXITPROCESS_TIMEOUT EMAKEHR(0x1029) -#define HOST_E_EXITPROCESS_OUTOFMEMORY EMAKEHR(0x102a) -#define COR_E_MODULE_HASH_CHECK_FAILED EMAKEHR(0x1039) #define FUSION_E_REF_DEF_MISMATCH EMAKEHR(0x1040) -#define FUSION_E_INVALID_PRIVATE_ASM_LOCATION EMAKEHR(0x1041) -#define FUSION_E_ASM_MODULE_MISSING EMAKEHR(0x1042) -#define FUSION_E_PRIVATE_ASM_DISALLOWED EMAKEHR(0x1044) -#define FUSION_E_SIGNATURE_CHECK_FAILED EMAKEHR(0x1045) #define FUSION_E_INVALID_NAME EMAKEHR(0x1047) -#define FUSION_E_CODE_DOWNLOAD_DISABLED EMAKEHR(0x1048) -#define FUSION_E_HOST_GAC_ASM_MISMATCH EMAKEHR(0x1050) -#define FUSION_E_LOADFROM_BLOCKED EMAKEHR(0x1051) -#define FUSION_E_CACHEFILE_FAILED EMAKEHR(0x1052) #define FUSION_E_APP_DOMAIN_LOCKED EMAKEHR(0x1053) -#define FUSION_E_CONFIGURATION_ERROR EMAKEHR(0x1054) -#define FUSION_E_MANIFEST_PARSE_ERROR EMAKEHR(0x1055) #define COR_E_LOADING_REFERENCE_ASSEMBLY EMAKEHR(0x1058) -#define COR_E_NI_AND_RUNTIME_VERSION_MISMATCH EMAKEHR(0x1059) -#define COR_E_LOADING_WINMD_REFERENCE_ASSEMBLY EMAKEHR(0x1069) #define COR_E_AMBIGUOUSIMPLEMENTATION EMAKEHR(0x106a) #define CLDB_E_FILE_BADREAD EMAKEHR(0x1100) #define CLDB_E_FILE_BADWRITE EMAKEHR(0x1101) @@ -232,21 +212,18 @@ #define CORDIAGIPC_E_UNKNOWN_MAGIC EMAKEHR(0x1386) #define CORDIAGIPC_E_UNKNOWN_ERROR EMAKEHR(0x1387) #define CORPROF_E_SUSPENSION_IN_PROGRESS EMAKEHR(0x1388) -#define SECURITY_E_INCOMPATIBLE_SHARE EMAKEHR(0x1401) -#define SECURITY_E_UNVERIFIABLE EMAKEHR(0x1402) -#define SECURITY_E_INCOMPATIBLE_EVIDENCE EMAKEHR(0x1403) +#define CORPROF_E_NOT_GC_OBJECT EMAKEHR(0x1389) +#define CORPROF_E_MODULE_IS_ENC EMAKEHR(0x138A) #define CORSEC_E_POLICY_EXCEPTION EMAKEHR(0x1416) #define CORSEC_E_MIN_GRANT_FAIL EMAKEHR(0x1417) #define CORSEC_E_NO_EXEC_PERM EMAKEHR(0x1418) #define CORSEC_E_XMLSYNTAX EMAKEHR(0x1419) #define CORSEC_E_INVALID_STRONGNAME EMAKEHR(0x141a) -#define CORSEC_E_MISSING_STRONGNAME EMAKEHR(0x141b) #define CORSEC_E_INVALID_IMAGE_FORMAT EMAKEHR(0x141d) #define CORSEC_E_INVALID_PUBLICKEY EMAKEHR(0x141e) #define CORSEC_E_SIGNATURE_MISMATCH EMAKEHR(0x1420) #define CORSEC_E_CRYPTO EMAKEHR(0x1430) #define CORSEC_E_CRYPTO_UNEX_OPER EMAKEHR(0x1431) -#define CORSECATTR_E_BAD_ACTION EMAKEHR(0x1442) #define COR_E_EXCEPTION EMAKEHR(0x1500) #define COR_E_SYSTEM EMAKEHR(0x1501) #define COR_E_ARGUMENTOUTOFRANGE EMAKEHR(0x1502) @@ -354,7 +331,7 @@ #define CORDBG_E_ILLEGAL_IN_OPTIMIZED_CODE EMAKEHR(0x1c26) #define CORDBG_E_APPDOMAIN_MISMATCH EMAKEHR(0x1c28) #define CORDBG_E_CONTEXT_UNVAILABLE EMAKEHR(0x1c29) -#define CORDBG_E_UNCOMPATIBLE_PLATFORMS EMAKEHR(0x1c30) +#define CORDBG_E_INCOMPATIBLE_PLATFORMS EMAKEHR(0x1c30) #define CORDBG_E_DEBUGGING_DISABLED EMAKEHR(0x1c31) #define CORDBG_E_DETACH_FAILED_ON_ENC EMAKEHR(0x1c32) #define CORDBG_E_CURRENT_EXCEPTION_IS_OUTSIDE_CURRENT_EXECUTION_SCOPE EMAKEHR(0x1c33) @@ -381,27 +358,18 @@ #define CORDBG_E_UNSUPPORTED EMAKEHR(0x1c4e) #define CORDBG_E_MISSING_DEBUGGER_EXPORTS EMAKEHR(0x1c4f) #define CORDBG_E_DATA_TARGET_ERROR EMAKEHR(0x1c61) -#define CORDBG_E_NO_IMAGE_AVAILABLE EMAKEHR(0x1c64) #define CORDBG_E_UNSUPPORTED_DELEGATE EMAKEHR(0x1c68) #define CORDBG_E_ASSEMBLY_UPDATES_APPLIED EMAKEHR(0x1c69) #define PEFMT_E_64BIT EMAKEHR(0x1d02) #define PEFMT_E_32BIT EMAKEHR(0x1d0b) #define CLDB_E_INTERNALERROR EMAKEHR(0x1fff) -#define CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW EMAKEHR(0x2000) -#define CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH EMAKEHR(0x2001) -#define CLR_E_BIND_IMAGE_UNAVAILABLE EMAKEHR(0x2002) -#define CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT EMAKEHR(0x2003) -#define CLR_E_BIND_ASSEMBLY_NOT_FOUND EMAKEHR(0x2004) -#define CLR_E_BIND_TYPE_NOT_FOUND EMAKEHR(0x2005) -#define CLR_E_BIND_SYS_ASM_NI_MISSING EMAKEHR(0x2006) -#define CLR_E_BIND_NI_SECURITY_FAILURE EMAKEHR(0x2007) -#define CLR_E_BIND_NI_DEP_IDENTITY_MISMATCH EMAKEHR(0x2008) +#define CLR_E_BIND_ARCHITECTURE_MISMATCH EMAKEHR(0x2006) #define CLR_E_GC_OOM EMAKEHR(0x2009) #define CLR_E_GC_BAD_AFFINITY_CONFIG EMAKEHR(0x200a) #define CLR_E_GC_BAD_AFFINITY_CONFIG_FORMAT EMAKEHR(0x200b) -#define CLR_E_CROSSGEN_NO_IBC_DATA_FOUND EMAKEHR(0x200c) -#define CLR_E_GC_BAD_HARD_LIMIT EMAKEHR(0x200d) -#define CLR_E_GC_LARGE_PAGE_MISSING_HARD_LIMIT EMAKEHR(0x200e) +#define CLR_E_GC_BAD_HARD_LIMIT EMAKEHR(0x200d) +#define CLR_E_GC_LARGE_PAGE_MISSING_HARD_LIMIT EMAKEHR(0x200e) +#define CLR_E_GC_BAD_REGION_SIZE EMAKEHR(0x200f) #define COR_E_UNAUTHORIZEDACCESS E_ACCESSDENIED #define COR_E_ARGUMENT E_INVALIDARG #define COR_E_INVALIDCAST E_NOINTERFACE diff --git a/src/shared/pal/prebuilt/inc/corprof.h b/src/shared/pal/prebuilt/inc/corprof.h index 196eddb784..ad54c4e6b8 100644 --- a/src/shared/pal/prebuilt/inc/corprof.h +++ b/src/shared/pal/prebuilt/inc/corprof.h @@ -3,9 +3,9 @@ /* this ALWAYS GENERATED file contains the definitions for the interfaces */ - /* File created by MIDL compiler version 8.01.0622 */ + /* File created by MIDL compiler version 8.01.0628 */ /* Compiler settings for corprof.idl: - Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0622 + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628 protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: @@ -41,223 +41,252 @@ #pragma once #endif +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + /* Forward Declarations */ #ifndef __ICorProfilerCallback_FWD_DEFINED__ #define __ICorProfilerCallback_FWD_DEFINED__ typedef interface ICorProfilerCallback ICorProfilerCallback; -#endif /* __ICorProfilerCallback_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback2_FWD_DEFINED__ #define __ICorProfilerCallback2_FWD_DEFINED__ typedef interface ICorProfilerCallback2 ICorProfilerCallback2; -#endif /* __ICorProfilerCallback2_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback2_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback3_FWD_DEFINED__ #define __ICorProfilerCallback3_FWD_DEFINED__ typedef interface ICorProfilerCallback3 ICorProfilerCallback3; -#endif /* __ICorProfilerCallback3_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback3_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback4_FWD_DEFINED__ #define __ICorProfilerCallback4_FWD_DEFINED__ typedef interface ICorProfilerCallback4 ICorProfilerCallback4; -#endif /* __ICorProfilerCallback4_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback4_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback5_FWD_DEFINED__ #define __ICorProfilerCallback5_FWD_DEFINED__ typedef interface ICorProfilerCallback5 ICorProfilerCallback5; -#endif /* __ICorProfilerCallback5_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback5_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback6_FWD_DEFINED__ #define __ICorProfilerCallback6_FWD_DEFINED__ typedef interface ICorProfilerCallback6 ICorProfilerCallback6; -#endif /* __ICorProfilerCallback6_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback6_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback7_FWD_DEFINED__ #define __ICorProfilerCallback7_FWD_DEFINED__ typedef interface ICorProfilerCallback7 ICorProfilerCallback7; -#endif /* __ICorProfilerCallback7_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback7_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback8_FWD_DEFINED__ #define __ICorProfilerCallback8_FWD_DEFINED__ typedef interface ICorProfilerCallback8 ICorProfilerCallback8; -#endif /* __ICorProfilerCallback8_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback8_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback9_FWD_DEFINED__ #define __ICorProfilerCallback9_FWD_DEFINED__ typedef interface ICorProfilerCallback9 ICorProfilerCallback9; -#endif /* __ICorProfilerCallback9_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback9_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback10_FWD_DEFINED__ #define __ICorProfilerCallback10_FWD_DEFINED__ typedef interface ICorProfilerCallback10 ICorProfilerCallback10; -#endif /* __ICorProfilerCallback10_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback10_FWD_DEFINED__ */ #ifndef __ICorProfilerCallback11_FWD_DEFINED__ #define __ICorProfilerCallback11_FWD_DEFINED__ typedef interface ICorProfilerCallback11 ICorProfilerCallback11; -#endif /* __ICorProfilerCallback11_FWD_DEFINED__ */ +#endif /* __ICorProfilerCallback11_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo_FWD_DEFINED__ #define __ICorProfilerInfo_FWD_DEFINED__ typedef interface ICorProfilerInfo ICorProfilerInfo; -#endif /* __ICorProfilerInfo_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo2_FWD_DEFINED__ #define __ICorProfilerInfo2_FWD_DEFINED__ typedef interface ICorProfilerInfo2 ICorProfilerInfo2; -#endif /* __ICorProfilerInfo2_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo2_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo3_FWD_DEFINED__ #define __ICorProfilerInfo3_FWD_DEFINED__ typedef interface ICorProfilerInfo3 ICorProfilerInfo3; -#endif /* __ICorProfilerInfo3_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo3_FWD_DEFINED__ */ #ifndef __ICorProfilerObjectEnum_FWD_DEFINED__ #define __ICorProfilerObjectEnum_FWD_DEFINED__ typedef interface ICorProfilerObjectEnum ICorProfilerObjectEnum; -#endif /* __ICorProfilerObjectEnum_FWD_DEFINED__ */ +#endif /* __ICorProfilerObjectEnum_FWD_DEFINED__ */ #ifndef __ICorProfilerFunctionEnum_FWD_DEFINED__ #define __ICorProfilerFunctionEnum_FWD_DEFINED__ typedef interface ICorProfilerFunctionEnum ICorProfilerFunctionEnum; -#endif /* __ICorProfilerFunctionEnum_FWD_DEFINED__ */ +#endif /* __ICorProfilerFunctionEnum_FWD_DEFINED__ */ #ifndef __ICorProfilerModuleEnum_FWD_DEFINED__ #define __ICorProfilerModuleEnum_FWD_DEFINED__ typedef interface ICorProfilerModuleEnum ICorProfilerModuleEnum; -#endif /* __ICorProfilerModuleEnum_FWD_DEFINED__ */ +#endif /* __ICorProfilerModuleEnum_FWD_DEFINED__ */ #ifndef __IMethodMalloc_FWD_DEFINED__ #define __IMethodMalloc_FWD_DEFINED__ typedef interface IMethodMalloc IMethodMalloc; -#endif /* __IMethodMalloc_FWD_DEFINED__ */ +#endif /* __IMethodMalloc_FWD_DEFINED__ */ #ifndef __ICorProfilerFunctionControl_FWD_DEFINED__ #define __ICorProfilerFunctionControl_FWD_DEFINED__ typedef interface ICorProfilerFunctionControl ICorProfilerFunctionControl; -#endif /* __ICorProfilerFunctionControl_FWD_DEFINED__ */ +#endif /* __ICorProfilerFunctionControl_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo4_FWD_DEFINED__ #define __ICorProfilerInfo4_FWD_DEFINED__ typedef interface ICorProfilerInfo4 ICorProfilerInfo4; -#endif /* __ICorProfilerInfo4_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo4_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo5_FWD_DEFINED__ #define __ICorProfilerInfo5_FWD_DEFINED__ typedef interface ICorProfilerInfo5 ICorProfilerInfo5; -#endif /* __ICorProfilerInfo5_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo5_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo6_FWD_DEFINED__ #define __ICorProfilerInfo6_FWD_DEFINED__ typedef interface ICorProfilerInfo6 ICorProfilerInfo6; -#endif /* __ICorProfilerInfo6_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo6_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo7_FWD_DEFINED__ #define __ICorProfilerInfo7_FWD_DEFINED__ typedef interface ICorProfilerInfo7 ICorProfilerInfo7; -#endif /* __ICorProfilerInfo7_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo7_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo8_FWD_DEFINED__ #define __ICorProfilerInfo8_FWD_DEFINED__ typedef interface ICorProfilerInfo8 ICorProfilerInfo8; -#endif /* __ICorProfilerInfo8_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo8_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo9_FWD_DEFINED__ #define __ICorProfilerInfo9_FWD_DEFINED__ typedef interface ICorProfilerInfo9 ICorProfilerInfo9; -#endif /* __ICorProfilerInfo9_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo9_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo10_FWD_DEFINED__ #define __ICorProfilerInfo10_FWD_DEFINED__ typedef interface ICorProfilerInfo10 ICorProfilerInfo10; -#endif /* __ICorProfilerInfo10_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo10_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo11_FWD_DEFINED__ #define __ICorProfilerInfo11_FWD_DEFINED__ typedef interface ICorProfilerInfo11 ICorProfilerInfo11; -#endif /* __ICorProfilerInfo11_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo11_FWD_DEFINED__ */ #ifndef __ICorProfilerInfo12_FWD_DEFINED__ #define __ICorProfilerInfo12_FWD_DEFINED__ typedef interface ICorProfilerInfo12 ICorProfilerInfo12; -#endif /* __ICorProfilerInfo12_FWD_DEFINED__ */ +#endif /* __ICorProfilerInfo12_FWD_DEFINED__ */ + + +#ifndef __ICorProfilerInfo13_FWD_DEFINED__ +#define __ICorProfilerInfo13_FWD_DEFINED__ +typedef interface ICorProfilerInfo13 ICorProfilerInfo13; + +#endif /* __ICorProfilerInfo13_FWD_DEFINED__ */ + + +#ifndef __ICorProfilerInfo14_FWD_DEFINED__ +#define __ICorProfilerInfo14_FWD_DEFINED__ +typedef interface ICorProfilerInfo14 ICorProfilerInfo14; + +#endif /* __ICorProfilerInfo14_FWD_DEFINED__ */ + + +#ifndef __ICorProfilerInfo15_FWD_DEFINED__ +#define __ICorProfilerInfo15_FWD_DEFINED__ +typedef interface ICorProfilerInfo15 ICorProfilerInfo15; + +#endif /* __ICorProfilerInfo15_FWD_DEFINED__ */ #ifndef __ICorProfilerMethodEnum_FWD_DEFINED__ #define __ICorProfilerMethodEnum_FWD_DEFINED__ typedef interface ICorProfilerMethodEnum ICorProfilerMethodEnum; -#endif /* __ICorProfilerMethodEnum_FWD_DEFINED__ */ +#endif /* __ICorProfilerMethodEnum_FWD_DEFINED__ */ #ifndef __ICorProfilerThreadEnum_FWD_DEFINED__ #define __ICorProfilerThreadEnum_FWD_DEFINED__ typedef interface ICorProfilerThreadEnum ICorProfilerThreadEnum; -#endif /* __ICorProfilerThreadEnum_FWD_DEFINED__ */ +#endif /* __ICorProfilerThreadEnum_FWD_DEFINED__ */ #ifndef __ICorProfilerAssemblyReferenceProvider_FWD_DEFINED__ #define __ICorProfilerAssemblyReferenceProvider_FWD_DEFINED__ typedef interface ICorProfilerAssemblyReferenceProvider ICorProfilerAssemblyReferenceProvider; -#endif /* __ICorProfilerAssemblyReferenceProvider_FWD_DEFINED__ */ +#endif /* __ICorProfilerAssemblyReferenceProvider_FWD_DEFINED__ */ /* header files for imported files */ @@ -271,8 +300,6 @@ extern "C"{ /* interface __MIDL_itf_corprof_0000_0000 */ /* [local] */ -#define CorDB_CONTROL_Profiling "Cor_Enable_Profiling" -#define CorDB_CONTROL_ProfilingL L"Cor_Enable_Profiling" #if 0 typedef LONG32 mdToken; @@ -292,7 +319,7 @@ typedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_corprof_ DWORD dwOSPlatformId; DWORD dwOSMajorVersion; DWORD dwOSMinorVersion; - } OSINFO; + } OSINFO; typedef /* [public][public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0002 { @@ -306,7 +333,7 @@ typedef /* [public][public][public] */ struct __MIDL___MIDL_itf_corprof_0000_000 ULONG ulProcessor; OSINFO *rOS; ULONG ulOS; - } ASSEMBLYMETADATA; + } ASSEMBLYMETADATA; #endif typedef const BYTE *LPCBYTE; @@ -326,7 +353,7 @@ typedef struct _COR_IL_MAP ULONG32 oldOffset; ULONG32 newOffset; BOOL fAccurate; - } COR_IL_MAP; + } COR_IL_MAP; #endif //_COR_IL_MAP #ifndef _COR_DEBUG_IL_TO_NATIVE_MAP_ @@ -334,17 +361,17 @@ typedef struct _COR_IL_MAP typedef enum CorDebugIlToNativeMappingTypes { - NO_MAPPING = -1, - PROLOG = -2, - EPILOG = -3 - } CorDebugIlToNativeMappingTypes; + NO_MAPPING = -1, + PROLOG = -2, + EPILOG = -3 + } CorDebugIlToNativeMappingTypes; typedef struct COR_DEBUG_IL_TO_NATIVE_MAP { ULONG32 ilOffset; ULONG32 nativeStartOffset; ULONG32 nativeEndOffset; - } COR_DEBUG_IL_TO_NATIVE_MAP; + } COR_DEBUG_IL_TO_NATIVE_MAP; #endif // _COR_DEBUG_IL_TO_NATIVE_MAP_ #ifndef _COR_FIELD_OFFSET_ @@ -353,7 +380,7 @@ typedef struct _COR_FIELD_OFFSET { mdFieldDef ridOfField; ULONG ulOffset; - } COR_FIELD_OFFSET; + } COR_FIELD_OFFSET; #endif // _COR_FIELD_OFFSET_ typedef UINT_PTR ProcessID; @@ -384,7 +411,7 @@ typedef /* [public][public][public][public][public][public][public][public][publ { FunctionID functionID; UINT_PTR clientID; - } FunctionIDOrClientID; + } FunctionIDOrClientID; typedef UINT_PTR __stdcall __stdcall FunctionIDMapper( FunctionID funcId, @@ -398,10 +425,10 @@ typedef UINT_PTR __stdcall __stdcall FunctionIDMapper2( typedef enum _COR_PRF_SNAPSHOT_INFO { - COR_PRF_SNAPSHOT_DEFAULT = 0, - COR_PRF_SNAPSHOT_REGISTER_CONTEXT = 0x1, - COR_PRF_SNAPSHOT_X86_OPTIMIZED = 0x2 - } COR_PRF_SNAPSHOT_INFO; + COR_PRF_SNAPSHOT_DEFAULT = 0, + COR_PRF_SNAPSHOT_REGISTER_CONTEXT = 0x1, + COR_PRF_SNAPSHOT_X86_OPTIMIZED = 0x2 + } COR_PRF_SNAPSHOT_INFO; typedef UINT_PTR COR_PRF_FRAME_INFO; @@ -409,36 +436,36 @@ typedef struct _COR_PRF_FUNCTION_ARGUMENT_RANGE { UINT_PTR startAddress; ULONG length; - } COR_PRF_FUNCTION_ARGUMENT_RANGE; + } COR_PRF_FUNCTION_ARGUMENT_RANGE; typedef struct _COR_PRF_FUNCTION_ARGUMENT_INFO { ULONG numRanges; ULONG totalArgumentSize; COR_PRF_FUNCTION_ARGUMENT_RANGE ranges[ 1 ]; - } COR_PRF_FUNCTION_ARGUMENT_INFO; + } COR_PRF_FUNCTION_ARGUMENT_INFO; typedef struct _COR_PRF_CODE_INFO { UINT_PTR startAddress; SIZE_T size; - } COR_PRF_CODE_INFO; + } COR_PRF_CODE_INFO; typedef /* [public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0004 { - COR_PRF_FIELD_NOT_A_STATIC = 0, - COR_PRF_FIELD_APP_DOMAIN_STATIC = 0x1, - COR_PRF_FIELD_THREAD_STATIC = 0x2, - COR_PRF_FIELD_CONTEXT_STATIC = 0x4, - COR_PRF_FIELD_RVA_STATIC = 0x8 - } COR_PRF_STATIC_TYPE; + COR_PRF_FIELD_NOT_A_STATIC = 0, + COR_PRF_FIELD_APP_DOMAIN_STATIC = 0x1, + COR_PRF_FIELD_THREAD_STATIC = 0x2, + COR_PRF_FIELD_CONTEXT_STATIC = 0x4, + COR_PRF_FIELD_RVA_STATIC = 0x8 + } COR_PRF_STATIC_TYPE; typedef struct _COR_PRF_FUNCTION { FunctionID functionId; ReJITID reJitId; - } COR_PRF_FUNCTION; + } COR_PRF_FUNCTION; typedef struct _COR_PRF_ASSEMBLY_REFERENCE_INFO { @@ -449,13 +476,13 @@ typedef struct _COR_PRF_ASSEMBLY_REFERENCE_INFO void *pbHashValue; ULONG cbHashValue; DWORD dwAssemblyRefFlags; - } COR_PRF_ASSEMBLY_REFERENCE_INFO; + } COR_PRF_ASSEMBLY_REFERENCE_INFO; typedef struct _COR_PRF_METHOD { ModuleID moduleId; mdMethodDef methodId; - } COR_PRF_METHOD; + } COR_PRF_METHOD; typedef void FunctionEnter( FunctionID funcID); @@ -520,115 +547,115 @@ typedef BOOL ObjectReferenceCallback( typedef /* [public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0005 { - COR_PRF_MONITOR_NONE = 0, - COR_PRF_MONITOR_FUNCTION_UNLOADS = 0x1, - COR_PRF_MONITOR_CLASS_LOADS = 0x2, - COR_PRF_MONITOR_MODULE_LOADS = 0x4, - COR_PRF_MONITOR_ASSEMBLY_LOADS = 0x8, - COR_PRF_MONITOR_APPDOMAIN_LOADS = 0x10, - COR_PRF_MONITOR_JIT_COMPILATION = 0x20, - COR_PRF_MONITOR_EXCEPTIONS = 0x40, - COR_PRF_MONITOR_GC = 0x80, - COR_PRF_MONITOR_OBJECT_ALLOCATED = 0x100, - COR_PRF_MONITOR_THREADS = 0x200, - COR_PRF_MONITOR_REMOTING = 0x400, - COR_PRF_MONITOR_CODE_TRANSITIONS = 0x800, - COR_PRF_MONITOR_ENTERLEAVE = 0x1000, - COR_PRF_MONITOR_CCW = 0x2000, - COR_PRF_MONITOR_REMOTING_COOKIE = ( 0x4000 | COR_PRF_MONITOR_REMOTING ) , - COR_PRF_MONITOR_REMOTING_ASYNC = ( 0x8000 | COR_PRF_MONITOR_REMOTING ) , - COR_PRF_MONITOR_SUSPENDS = 0x10000, - COR_PRF_MONITOR_CACHE_SEARCHES = 0x20000, - COR_PRF_ENABLE_REJIT = 0x40000, - COR_PRF_ENABLE_INPROC_DEBUGGING = 0x80000, - COR_PRF_ENABLE_JIT_MAPS = 0x100000, - COR_PRF_DISABLE_INLINING = 0x200000, - COR_PRF_DISABLE_OPTIMIZATIONS = 0x400000, - COR_PRF_ENABLE_OBJECT_ALLOCATED = 0x800000, - COR_PRF_MONITOR_CLR_EXCEPTIONS = 0x1000000, - COR_PRF_MONITOR_ALL = 0x107ffff, - COR_PRF_ENABLE_FUNCTION_ARGS = 0x2000000, - COR_PRF_ENABLE_FUNCTION_RETVAL = 0x4000000, - COR_PRF_ENABLE_FRAME_INFO = 0x8000000, - COR_PRF_ENABLE_STACK_SNAPSHOT = 0x10000000, - COR_PRF_USE_PROFILE_IMAGES = 0x20000000, - COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST = 0x40000000, - COR_PRF_DISABLE_ALL_NGEN_IMAGES = 0x80000000, - COR_PRF_ALL = 0x8fffffff, - COR_PRF_REQUIRE_PROFILE_IMAGE = ( ( COR_PRF_USE_PROFILE_IMAGES | COR_PRF_MONITOR_CODE_TRANSITIONS ) | COR_PRF_MONITOR_ENTERLEAVE ) , - COR_PRF_ALLOWABLE_AFTER_ATTACH = ( ( ( ( ( ( ( ( ( ( COR_PRF_MONITOR_THREADS | COR_PRF_MONITOR_MODULE_LOADS ) | COR_PRF_MONITOR_ASSEMBLY_LOADS ) | COR_PRF_MONITOR_APPDOMAIN_LOADS ) | COR_PRF_ENABLE_STACK_SNAPSHOT ) | COR_PRF_MONITOR_GC ) | COR_PRF_MONITOR_SUSPENDS ) | COR_PRF_MONITOR_CLASS_LOADS ) | COR_PRF_MONITOR_EXCEPTIONS ) | COR_PRF_MONITOR_JIT_COMPILATION ) | COR_PRF_ENABLE_REJIT ) , - COR_PRF_ALLOWABLE_NOTIFICATION_PROFILER = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( COR_PRF_MONITOR_FUNCTION_UNLOADS | COR_PRF_MONITOR_CLASS_LOADS ) | COR_PRF_MONITOR_MODULE_LOADS ) | COR_PRF_MONITOR_ASSEMBLY_LOADS ) | COR_PRF_MONITOR_APPDOMAIN_LOADS ) | COR_PRF_MONITOR_JIT_COMPILATION ) | COR_PRF_MONITOR_EXCEPTIONS ) | COR_PRF_MONITOR_OBJECT_ALLOCATED ) | COR_PRF_MONITOR_THREADS ) | COR_PRF_MONITOR_CODE_TRANSITIONS ) | COR_PRF_MONITOR_CCW ) | COR_PRF_MONITOR_SUSPENDS ) | COR_PRF_MONITOR_CACHE_SEARCHES ) | COR_PRF_DISABLE_INLINING ) | COR_PRF_DISABLE_OPTIMIZATIONS ) | COR_PRF_ENABLE_OBJECT_ALLOCATED ) | COR_PRF_MONITOR_CLR_EXCEPTIONS ) | COR_PRF_ENABLE_STACK_SNAPSHOT ) | COR_PRF_USE_PROFILE_IMAGES ) | COR_PRF_DISABLE_ALL_NGEN_IMAGES ) , - COR_PRF_MONITOR_IMMUTABLE = ( ( ( ( ( ( ( ( ( ( ( ( ( ( COR_PRF_MONITOR_CODE_TRANSITIONS | COR_PRF_MONITOR_REMOTING ) | COR_PRF_MONITOR_REMOTING_COOKIE ) | COR_PRF_MONITOR_REMOTING_ASYNC ) | COR_PRF_ENABLE_INPROC_DEBUGGING ) | COR_PRF_ENABLE_JIT_MAPS ) | COR_PRF_DISABLE_OPTIMIZATIONS ) | COR_PRF_DISABLE_INLINING ) | COR_PRF_ENABLE_OBJECT_ALLOCATED ) | COR_PRF_ENABLE_FUNCTION_ARGS ) | COR_PRF_ENABLE_FUNCTION_RETVAL ) | COR_PRF_ENABLE_FRAME_INFO ) | COR_PRF_USE_PROFILE_IMAGES ) | COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST ) | COR_PRF_DISABLE_ALL_NGEN_IMAGES ) - } COR_PRF_MONITOR; + COR_PRF_MONITOR_NONE = 0, + COR_PRF_MONITOR_FUNCTION_UNLOADS = 0x1, + COR_PRF_MONITOR_CLASS_LOADS = 0x2, + COR_PRF_MONITOR_MODULE_LOADS = 0x4, + COR_PRF_MONITOR_ASSEMBLY_LOADS = 0x8, + COR_PRF_MONITOR_APPDOMAIN_LOADS = 0x10, + COR_PRF_MONITOR_JIT_COMPILATION = 0x20, + COR_PRF_MONITOR_EXCEPTIONS = 0x40, + COR_PRF_MONITOR_GC = 0x80, + COR_PRF_MONITOR_OBJECT_ALLOCATED = 0x100, + COR_PRF_MONITOR_THREADS = 0x200, + COR_PRF_MONITOR_REMOTING = 0x400, + COR_PRF_MONITOR_CODE_TRANSITIONS = 0x800, + COR_PRF_MONITOR_ENTERLEAVE = 0x1000, + COR_PRF_MONITOR_CCW = 0x2000, + COR_PRF_MONITOR_REMOTING_COOKIE = ( 0x4000 | COR_PRF_MONITOR_REMOTING ) , + COR_PRF_MONITOR_REMOTING_ASYNC = ( 0x8000 | COR_PRF_MONITOR_REMOTING ) , + COR_PRF_MONITOR_SUSPENDS = 0x10000, + COR_PRF_MONITOR_CACHE_SEARCHES = 0x20000, + COR_PRF_ENABLE_REJIT = 0x40000, + COR_PRF_ENABLE_INPROC_DEBUGGING = 0x80000, + COR_PRF_ENABLE_JIT_MAPS = 0x100000, + COR_PRF_DISABLE_INLINING = 0x200000, + COR_PRF_DISABLE_OPTIMIZATIONS = 0x400000, + COR_PRF_ENABLE_OBJECT_ALLOCATED = 0x800000, + COR_PRF_MONITOR_CLR_EXCEPTIONS = 0x1000000, + COR_PRF_MONITOR_ALL = 0x107ffff, + COR_PRF_ENABLE_FUNCTION_ARGS = 0x2000000, + COR_PRF_ENABLE_FUNCTION_RETVAL = 0x4000000, + COR_PRF_ENABLE_FRAME_INFO = 0x8000000, + COR_PRF_ENABLE_STACK_SNAPSHOT = 0x10000000, + COR_PRF_USE_PROFILE_IMAGES = 0x20000000, + COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST = 0x40000000, + COR_PRF_DISABLE_ALL_NGEN_IMAGES = 0x80000000, + COR_PRF_ALL = 0x8fffffff, + COR_PRF_REQUIRE_PROFILE_IMAGE = ( ( COR_PRF_USE_PROFILE_IMAGES | COR_PRF_MONITOR_CODE_TRANSITIONS ) | COR_PRF_MONITOR_ENTERLEAVE ) , + COR_PRF_ALLOWABLE_AFTER_ATTACH = ( ( ( ( ( ( ( ( ( ( COR_PRF_MONITOR_THREADS | COR_PRF_MONITOR_MODULE_LOADS ) | COR_PRF_MONITOR_ASSEMBLY_LOADS ) | COR_PRF_MONITOR_APPDOMAIN_LOADS ) | COR_PRF_ENABLE_STACK_SNAPSHOT ) | COR_PRF_MONITOR_GC ) | COR_PRF_MONITOR_SUSPENDS ) | COR_PRF_MONITOR_CLASS_LOADS ) | COR_PRF_MONITOR_EXCEPTIONS ) | COR_PRF_MONITOR_JIT_COMPILATION ) | COR_PRF_ENABLE_REJIT ) , + COR_PRF_ALLOWABLE_NOTIFICATION_PROFILER = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( COR_PRF_MONITOR_FUNCTION_UNLOADS | COR_PRF_MONITOR_CLASS_LOADS ) | COR_PRF_MONITOR_MODULE_LOADS ) | COR_PRF_MONITOR_ASSEMBLY_LOADS ) | COR_PRF_MONITOR_APPDOMAIN_LOADS ) | COR_PRF_MONITOR_JIT_COMPILATION ) | COR_PRF_MONITOR_EXCEPTIONS ) | COR_PRF_MONITOR_OBJECT_ALLOCATED ) | COR_PRF_MONITOR_THREADS ) | COR_PRF_MONITOR_CODE_TRANSITIONS ) | COR_PRF_MONITOR_CCW ) | COR_PRF_MONITOR_SUSPENDS ) | COR_PRF_MONITOR_CACHE_SEARCHES ) | COR_PRF_DISABLE_INLINING ) | COR_PRF_DISABLE_OPTIMIZATIONS ) | COR_PRF_ENABLE_OBJECT_ALLOCATED ) | COR_PRF_MONITOR_CLR_EXCEPTIONS ) | COR_PRF_ENABLE_STACK_SNAPSHOT ) | COR_PRF_USE_PROFILE_IMAGES ) | COR_PRF_DISABLE_ALL_NGEN_IMAGES ) , + COR_PRF_MONITOR_IMMUTABLE = ( ( ( ( ( ( ( ( ( ( ( ( ( ( COR_PRF_MONITOR_CODE_TRANSITIONS | COR_PRF_MONITOR_REMOTING ) | COR_PRF_MONITOR_REMOTING_COOKIE ) | COR_PRF_MONITOR_REMOTING_ASYNC ) | COR_PRF_ENABLE_INPROC_DEBUGGING ) | COR_PRF_ENABLE_JIT_MAPS ) | COR_PRF_DISABLE_OPTIMIZATIONS ) | COR_PRF_DISABLE_INLINING ) | COR_PRF_ENABLE_OBJECT_ALLOCATED ) | COR_PRF_ENABLE_FUNCTION_ARGS ) | COR_PRF_ENABLE_FUNCTION_RETVAL ) | COR_PRF_ENABLE_FRAME_INFO ) | COR_PRF_USE_PROFILE_IMAGES ) | COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST ) | COR_PRF_DISABLE_ALL_NGEN_IMAGES ) + } COR_PRF_MONITOR; typedef /* [public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0006 { - COR_PRF_HIGH_MONITOR_NONE = 0, - COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES = 0x1, - COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED = 0x2, - COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS = 0x4, - COR_PRF_HIGH_DISABLE_TIERED_COMPILATION = 0x8, - COR_PRF_HIGH_BASIC_GC = 0x10, - COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS = 0x20, - COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE = 0, - COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED = 0x40, - COR_PRF_HIGH_MONITOR_EVENT_PIPE = 0x80, - COR_PRF_HIGH_MONITOR_PINNEDOBJECT_ALLOCATED = 0x100, - COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = ( ( ( ( ( COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS ) | COR_PRF_HIGH_BASIC_GC ) | COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS ) | COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED ) | COR_PRF_HIGH_MONITOR_EVENT_PIPE ) , - COR_PRF_HIGH_ALLOWABLE_NOTIFICATION_PROFILER = ( ( ( ( ( ( COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS ) | COR_PRF_HIGH_DISABLE_TIERED_COMPILATION ) | COR_PRF_HIGH_BASIC_GC ) | COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS ) | COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED ) | COR_PRF_HIGH_MONITOR_EVENT_PIPE ) , - COR_PRF_HIGH_MONITOR_IMMUTABLE = COR_PRF_HIGH_DISABLE_TIERED_COMPILATION - } COR_PRF_HIGH_MONITOR; + COR_PRF_HIGH_MONITOR_NONE = 0, + COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES = 0x1, + COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED = 0x2, + COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS = 0x4, + COR_PRF_HIGH_DISABLE_TIERED_COMPILATION = 0x8, + COR_PRF_HIGH_BASIC_GC = 0x10, + COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS = 0x20, + COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE = 0, + COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED = 0x40, + COR_PRF_HIGH_MONITOR_EVENT_PIPE = 0x80, + COR_PRF_HIGH_MONITOR_PINNEDOBJECT_ALLOCATED = 0x100, + COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = ( ( ( ( ( COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS ) | COR_PRF_HIGH_BASIC_GC ) | COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS ) | COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED ) | COR_PRF_HIGH_MONITOR_EVENT_PIPE ) , + COR_PRF_HIGH_ALLOWABLE_NOTIFICATION_PROFILER = ( ( ( ( ( ( COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS ) | COR_PRF_HIGH_DISABLE_TIERED_COMPILATION ) | COR_PRF_HIGH_BASIC_GC ) | COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS ) | COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED ) | COR_PRF_HIGH_MONITOR_EVENT_PIPE ) , + COR_PRF_HIGH_MONITOR_IMMUTABLE = COR_PRF_HIGH_DISABLE_TIERED_COMPILATION + } COR_PRF_HIGH_MONITOR; typedef /* [public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0007 { - PROFILER_PARENT_UNKNOWN = 0xfffffffd, - PROFILER_GLOBAL_CLASS = 0xfffffffe, - PROFILER_GLOBAL_MODULE = 0xffffffff - } COR_PRF_MISC; + PROFILER_PARENT_UNKNOWN = 0xfffffffd, + PROFILER_GLOBAL_CLASS = 0xfffffffe, + PROFILER_GLOBAL_MODULE = 0xffffffff + } COR_PRF_MISC; typedef /* [public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0008 { - COR_PRF_CACHED_FUNCTION_FOUND = 0, - COR_PRF_CACHED_FUNCTION_NOT_FOUND = ( COR_PRF_CACHED_FUNCTION_FOUND + 1 ) - } COR_PRF_JIT_CACHE; + COR_PRF_CACHED_FUNCTION_FOUND = 0, + COR_PRF_CACHED_FUNCTION_NOT_FOUND = ( COR_PRF_CACHED_FUNCTION_FOUND + 1 ) + } COR_PRF_JIT_CACHE; typedef /* [public][public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0009 { - COR_PRF_TRANSITION_CALL = 0, - COR_PRF_TRANSITION_RETURN = ( COR_PRF_TRANSITION_CALL + 1 ) - } COR_PRF_TRANSITION_REASON; + COR_PRF_TRANSITION_CALL = 0, + COR_PRF_TRANSITION_RETURN = ( COR_PRF_TRANSITION_CALL + 1 ) + } COR_PRF_TRANSITION_REASON; typedef /* [public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0010 { - COR_PRF_SUSPEND_OTHER = 0, - COR_PRF_SUSPEND_FOR_GC = 1, - COR_PRF_SUSPEND_FOR_APPDOMAIN_SHUTDOWN = 2, - COR_PRF_SUSPEND_FOR_CODE_PITCHING = 3, - COR_PRF_SUSPEND_FOR_SHUTDOWN = 4, - COR_PRF_SUSPEND_FOR_INPROC_DEBUGGER = 6, - COR_PRF_SUSPEND_FOR_GC_PREP = 7, - COR_PRF_SUSPEND_FOR_REJIT = 8, - COR_PRF_SUSPEND_FOR_PROFILER = 9 - } COR_PRF_SUSPEND_REASON; + COR_PRF_SUSPEND_OTHER = 0, + COR_PRF_SUSPEND_FOR_GC = 1, + COR_PRF_SUSPEND_FOR_APPDOMAIN_SHUTDOWN = 2, + COR_PRF_SUSPEND_FOR_CODE_PITCHING = 3, + COR_PRF_SUSPEND_FOR_SHUTDOWN = 4, + COR_PRF_SUSPEND_FOR_INPROC_DEBUGGER = 6, + COR_PRF_SUSPEND_FOR_GC_PREP = 7, + COR_PRF_SUSPEND_FOR_REJIT = 8, + COR_PRF_SUSPEND_FOR_PROFILER = 9 + } COR_PRF_SUSPEND_REASON; typedef /* [public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0011 { - COR_PRF_DESKTOP_CLR = 0x1, - COR_PRF_CORE_CLR = 0x2 - } COR_PRF_RUNTIME_TYPE; + COR_PRF_DESKTOP_CLR = 0x1, + COR_PRF_CORE_CLR = 0x2 + } COR_PRF_RUNTIME_TYPE; typedef /* [public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0012 { - COR_PRF_REJIT_BLOCK_INLINING = 0x1, - COR_PRF_REJIT_INLINING_CALLBACKS = 0x2 - } COR_PRF_REJIT_FLAGS; + COR_PRF_REJIT_BLOCK_INLINING = 0x1, + COR_PRF_REJIT_INLINING_CALLBACKS = 0x2 + } COR_PRF_REJIT_FLAGS; typedef UINT_PTR EVENTPIPE_PROVIDER; @@ -639,36 +666,36 @@ typedef UINT64 EVENTPIPE_SESSION; typedef /* [public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0013 { - COR_PRF_EVENTPIPE_OBJECT = 1, - COR_PRF_EVENTPIPE_BOOLEAN = 3, - COR_PRF_EVENTPIPE_CHAR = 4, - COR_PRF_EVENTPIPE_SBYTE = 5, - COR_PRF_EVENTPIPE_BYTE = 6, - COR_PRF_EVENTPIPE_INT16 = 7, - COR_PRF_EVENTPIPE_UINT16 = 8, - COR_PRF_EVENTPIPE_INT32 = 9, - COR_PRF_EVENTPIPE_UINT32 = 10, - COR_PRF_EVENTPIPE_INT64 = 11, - COR_PRF_EVENTPIPE_UINT64 = 12, - COR_PRF_EVENTPIPE_SINGLE = 13, - COR_PRF_EVENTPIPE_DOUBLE = 14, - COR_PRF_EVENTPIPE_DECIMAL = 15, - COR_PRF_EVENTPIPE_DATETIME = 16, - COR_PRF_EVENTPIPE_GUID = 17, - COR_PRF_EVENTPIPE_STRING = 18, - COR_PRF_EVENTPIPE_ARRAY = 19 - } COR_PRF_EVENTPIPE_PARAM_TYPE; + COR_PRF_EVENTPIPE_OBJECT = 1, + COR_PRF_EVENTPIPE_BOOLEAN = 3, + COR_PRF_EVENTPIPE_CHAR = 4, + COR_PRF_EVENTPIPE_SBYTE = 5, + COR_PRF_EVENTPIPE_BYTE = 6, + COR_PRF_EVENTPIPE_INT16 = 7, + COR_PRF_EVENTPIPE_UINT16 = 8, + COR_PRF_EVENTPIPE_INT32 = 9, + COR_PRF_EVENTPIPE_UINT32 = 10, + COR_PRF_EVENTPIPE_INT64 = 11, + COR_PRF_EVENTPIPE_UINT64 = 12, + COR_PRF_EVENTPIPE_SINGLE = 13, + COR_PRF_EVENTPIPE_DOUBLE = 14, + COR_PRF_EVENTPIPE_DECIMAL = 15, + COR_PRF_EVENTPIPE_DATETIME = 16, + COR_PRF_EVENTPIPE_GUID = 17, + COR_PRF_EVENTPIPE_STRING = 18, + COR_PRF_EVENTPIPE_ARRAY = 19 + } COR_PRF_EVENTPIPE_PARAM_TYPE; typedef /* [public] */ enum __MIDL___MIDL_itf_corprof_0000_0000_0014 { - COR_PRF_EVENTPIPE_LOGALWAYS = 0, - COR_PRF_EVENTPIPE_CRITICAL = 1, - COR_PRF_EVENTPIPE_ERROR = 2, - COR_PRF_EVENTPIPE_WARNING = 3, - COR_PRF_EVENTPIPE_INFORMATIONAL = 4, - COR_PRF_EVENTPIPE_VERBOSE = 5 - } COR_PRF_EVENTPIPE_LEVEL; + COR_PRF_EVENTPIPE_LOGALWAYS = 0, + COR_PRF_EVENTPIPE_CRITICAL = 1, + COR_PRF_EVENTPIPE_ERROR = 2, + COR_PRF_EVENTPIPE_WARNING = 3, + COR_PRF_EVENTPIPE_INFORMATIONAL = 4, + COR_PRF_EVENTPIPE_VERBOSE = 5 + } COR_PRF_EVENTPIPE_LEVEL; typedef /* [public][public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0015 { @@ -676,21 +703,51 @@ typedef /* [public][public][public] */ struct __MIDL___MIDL_itf_corprof_0000_000 UINT64 keywords; UINT32 loggingLevel; const WCHAR *filterData; - } COR_PRF_EVENTPIPE_PROVIDER_CONFIG; + } COR_PRF_EVENTPIPE_PROVIDER_CONFIG; typedef /* [public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0016 { UINT32 type; UINT32 elementType; const WCHAR *name; - } COR_PRF_EVENTPIPE_PARAM_DESC; + } COR_PRF_EVENTPIPE_PARAM_DESC; typedef /* [public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0017 { UINT64 ptr; UINT32 size; UINT32 reserved; - } COR_PRF_EVENT_DATA; + } COR_PRF_EVENT_DATA; + +typedef /* [public][public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0018 + { + UINT64 Ptr; + UINT32 Size; + UINT32 Type; + } COR_PRF_FILTER_DATA; + +typedef void EventPipeProviderCallback( + const UINT8 *source_id, + UINT32 is_enabled, + UINT8 level, + UINT64 match_any_keywords, + UINT64 match_all_keywords, + COR_PRF_FILTER_DATA *filter_data, + void *callback_data); + +typedef +enum _COR_PRF_HANDLE_TYPE + { + COR_PRF_HANDLE_TYPE_WEAK = 0x1, + COR_PRF_HANDLE_TYPE_STRONG = 0x2, + COR_PRF_HANDLE_TYPE_PINNED = 0x3 + } COR_PRF_HANDLE_TYPE; + +typedef void **ObjectHandleID; + +typedef BOOL ( *ObjectCallback )( + ObjectID object, + void *callbackState); @@ -961,222 +1018,272 @@ EXTERN_C const IID IID_ICorProfilerCallback; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallbackVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -1184,17 +1291,20 @@ EXTERN_C const IID IID_ICorProfilerCallback; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback * This, /* [in] */ ObjectID objectId, @@ -1202,63 +1312,79 @@ EXTERN_C const IID IID_ICorProfilerCallback; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback * This, /* [in] */ ClassID wrappedClassId, @@ -1266,15 +1392,18 @@ EXTERN_C const IID IID_ICorProfilerCallback; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback * This); @@ -1291,232 +1420,232 @@ EXTERN_C const IID IID_ICorProfilerCallback; #ifdef COBJMACROS -#define ICorProfilerCallback_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback_AddRef(This) \ +#define ICorProfilerCallback_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback_Release(This) \ +#define ICorProfilerCallback_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback_Shutdown(This) \ +#define ICorProfilerCallback_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_corprof_0000_0001 */ @@ -1525,36 +1654,36 @@ EXTERN_C const IID IID_ICorProfilerCallback; typedef /* [public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0001_0001 { - COR_PRF_GC_ROOT_STACK = 1, - COR_PRF_GC_ROOT_FINALIZER = 2, - COR_PRF_GC_ROOT_HANDLE = 3, - COR_PRF_GC_ROOT_OTHER = 0 - } COR_PRF_GC_ROOT_KIND; + COR_PRF_GC_ROOT_STACK = 1, + COR_PRF_GC_ROOT_FINALIZER = 2, + COR_PRF_GC_ROOT_HANDLE = 3, + COR_PRF_GC_ROOT_OTHER = 0 + } COR_PRF_GC_ROOT_KIND; typedef /* [public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0001_0002 { - COR_PRF_GC_ROOT_PINNING = 0x1, - COR_PRF_GC_ROOT_WEAKREF = 0x2, - COR_PRF_GC_ROOT_INTERIOR = 0x4, - COR_PRF_GC_ROOT_REFCOUNTED = 0x8 - } COR_PRF_GC_ROOT_FLAGS; + COR_PRF_GC_ROOT_PINNING = 0x1, + COR_PRF_GC_ROOT_WEAKREF = 0x2, + COR_PRF_GC_ROOT_INTERIOR = 0x4, + COR_PRF_GC_ROOT_REFCOUNTED = 0x8 + } COR_PRF_GC_ROOT_FLAGS; typedef /* [public] */ enum __MIDL___MIDL_itf_corprof_0000_0001_0003 { - COR_PRF_FINALIZER_CRITICAL = 0x1 - } COR_PRF_FINALIZER_FLAGS; + COR_PRF_FINALIZER_CRITICAL = 0x1 + } COR_PRF_FINALIZER_FLAGS; typedef /* [public][public][public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0001_0004 { - COR_PRF_GC_GEN_0 = 0, - COR_PRF_GC_GEN_1 = 1, - COR_PRF_GC_GEN_2 = 2, - COR_PRF_GC_LARGE_OBJECT_HEAP = 3, - COR_PRF_GC_PINNED_OBJECT_HEAP = 4 - } COR_PRF_GC_GENERATION; + COR_PRF_GC_GEN_0 = 0, + COR_PRF_GC_GEN_1 = 1, + COR_PRF_GC_GEN_2 = 2, + COR_PRF_GC_LARGE_OBJECT_HEAP = 3, + COR_PRF_GC_PINNED_OBJECT_HEAP = 4 + } COR_PRF_GC_GENERATION; typedef struct COR_PRF_GC_GENERATION_RANGE { @@ -1562,16 +1691,23 @@ typedef struct COR_PRF_GC_GENERATION_RANGE ObjectID rangeStart; UINT_PTR rangeLength; UINT_PTR rangeLengthReserved; - } COR_PRF_GC_GENERATION_RANGE; + } COR_PRF_GC_GENERATION_RANGE; + +typedef struct COR_PRF_NONGC_HEAP_RANGE + { + ObjectID rangeStart; + UINT_PTR rangeLength; + UINT_PTR rangeLengthReserved; + } COR_PRF_NONGC_HEAP_RANGE; typedef /* [public][public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0001_0005 { - COR_PRF_CLAUSE_NONE = 0, - COR_PRF_CLAUSE_FILTER = 1, - COR_PRF_CLAUSE_CATCH = 2, - COR_PRF_CLAUSE_FINALLY = 3 - } COR_PRF_CLAUSE_TYPE; + COR_PRF_CLAUSE_NONE = 0, + COR_PRF_CLAUSE_FILTER = 1, + COR_PRF_CLAUSE_CATCH = 2, + COR_PRF_CLAUSE_FINALLY = 3 + } COR_PRF_CLAUSE_TYPE; typedef struct COR_PRF_EX_CLAUSE_INFO { @@ -1579,26 +1715,26 @@ typedef struct COR_PRF_EX_CLAUSE_INFO UINT_PTR programCounter; UINT_PTR framePointer; UINT_PTR shadowStackPointer; - } COR_PRF_EX_CLAUSE_INFO; + } COR_PRF_EX_CLAUSE_INFO; typedef /* [public][public] */ enum __MIDL___MIDL_itf_corprof_0000_0001_0006 { - COR_PRF_GC_INDUCED = 1, - COR_PRF_GC_OTHER = 0 - } COR_PRF_GC_REASON; + COR_PRF_GC_INDUCED = 1, + COR_PRF_GC_OTHER = 0 + } COR_PRF_GC_REASON; typedef /* [public] */ enum __MIDL___MIDL_itf_corprof_0000_0001_0007 { - COR_PRF_MODULE_DISK = 0x1, - COR_PRF_MODULE_NGEN = 0x2, - COR_PRF_MODULE_DYNAMIC = 0x4, - COR_PRF_MODULE_COLLECTIBLE = 0x8, - COR_PRF_MODULE_RESOURCE = 0x10, - COR_PRF_MODULE_FLAT_LAYOUT = 0x20, - COR_PRF_MODULE_WINDOWS_RUNTIME = 0x40 - } COR_PRF_MODULE_FLAGS; + COR_PRF_MODULE_DISK = 0x1, + COR_PRF_MODULE_NGEN = 0x2, + COR_PRF_MODULE_DYNAMIC = 0x4, + COR_PRF_MODULE_COLLECTIBLE = 0x8, + COR_PRF_MODULE_RESOURCE = 0x10, + COR_PRF_MODULE_FLAT_LAYOUT = 0x20, + COR_PRF_MODULE_WINDOWS_RUNTIME = 0x40 + } COR_PRF_MODULE_FLAGS; @@ -1659,222 +1795,272 @@ EXTERN_C const IID IID_ICorProfilerCallback2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback2 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback2 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback2 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback2 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback2 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback2 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback2 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback2 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback2 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback2 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback2 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback2 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback2 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback2 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback2 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback2 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback2 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback2 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback2 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback2 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback2 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback2 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback2 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback2 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback2 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback2 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback2 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback2 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback2 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback2 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -1882,17 +2068,20 @@ EXTERN_C const IID IID_ICorProfilerCallback2; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback2 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback2 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback2 * This, /* [in] */ ObjectID objectId, @@ -1900,63 +2089,79 @@ EXTERN_C const IID IID_ICorProfilerCallback2; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback2 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback2 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback2 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback2 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback2 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback2 * This, /* [in] */ ClassID wrappedClassId, @@ -1964,18 +2169,22 @@ EXTERN_C const IID IID_ICorProfilerCallback2; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback2 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback2 * This, /* [in] */ ThreadID threadId, @@ -1983,26 +2192,31 @@ EXTERN_C const IID IID_ICorProfilerCallback2; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback2 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback2 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback2 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback2 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback2 * This, /* [in] */ ULONG cRootRefs, @@ -2011,11 +2225,13 @@ EXTERN_C const IID IID_ICorProfilerCallback2; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback2 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback2 * This, /* [in] */ GCHandleID handleId); @@ -2033,257 +2249,257 @@ EXTERN_C const IID IID_ICorProfilerCallback2; #ifdef COBJMACROS -#define ICorProfilerCallback2_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback2_AddRef(This) \ +#define ICorProfilerCallback2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback2_Release(This) \ +#define ICorProfilerCallback2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback2_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback2_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback2_Shutdown(This) \ +#define ICorProfilerCallback2_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback2_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback2_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback2_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback2_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback2_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback2_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback2_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback2_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback2_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback2_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback2_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback2_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback2_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback2_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback2_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback2_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback2_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback2_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback2_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback2_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback2_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback2_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback2_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback2_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback2_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback2_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback2_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback2_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback2_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback2_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback2_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback2_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback2_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback2_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback2_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback2_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback2_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback2_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback2_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback2_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback2_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback2_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback2_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback2_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback2_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback2_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback2_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback2_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback2_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback2_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback2_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback2_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback2_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback2_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback2_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback2_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback2_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback2_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback2_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback2_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback2_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback2_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback2_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback2_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback2_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback2_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback2_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback2_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback2_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback2_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback2_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback2_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback2_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback2_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback2_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback2_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback2_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback2_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback2_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback2_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback2_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback2_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback2_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback2_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback2_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback2_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback2_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback2_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback2_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback2_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback2_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback2_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback2_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback2_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback2_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback2_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback2_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback2_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback2_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback2_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback2_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback2_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback2_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback2_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback2_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback2_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback2_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback2_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback2_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback2_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback2_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback2_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback2_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback2_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback2_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback2_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback2_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback2_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback2_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback2_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback2_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback2_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback2_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback2_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback2_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback2_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback2_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback2_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback2_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback2_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback2_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback2_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback2_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback2_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback2_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback2_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback2_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback2_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback2_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback2_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback2_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback2_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback2_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback2_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback2_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback2_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback2_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback2_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback2_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback2_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback2_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback2_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerCallback3_INTERFACE_DEFINED__ @@ -2313,222 +2529,272 @@ EXTERN_C const IID IID_ICorProfilerCallback3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback3 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback3 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback3 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback3 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback3 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback3 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback3 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback3 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback3 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback3 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback3 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback3 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback3 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback3 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback3 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback3 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback3 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback3 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback3 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback3 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback3 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback3 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback3 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback3 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback3 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback3 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback3 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback3 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback3 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback3 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -2536,17 +2802,20 @@ EXTERN_C const IID IID_ICorProfilerCallback3; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback3 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback3 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback3 * This, /* [in] */ ObjectID objectId, @@ -2554,63 +2823,79 @@ EXTERN_C const IID IID_ICorProfilerCallback3; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback3 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback3 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback3 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback3 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback3 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback3 * This, /* [in] */ ClassID wrappedClassId, @@ -2618,18 +2903,22 @@ EXTERN_C const IID IID_ICorProfilerCallback3; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback3 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback3 * This, /* [in] */ ThreadID threadId, @@ -2637,26 +2926,31 @@ EXTERN_C const IID IID_ICorProfilerCallback3; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback3 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback3 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback3 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback3 * This, /* [in] */ ULONG cRootRefs, @@ -2665,24 +2959,29 @@ EXTERN_C const IID IID_ICorProfilerCallback3; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback3 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback3 * This, /* [in] */ GCHandleID handleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, InitializeForAttach) HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )( ICorProfilerCallback3 * This, /* [in] */ IUnknown *pCorProfilerInfoUnk, /* [in] */ void *pvClientData, /* [in] */ UINT cbClientData); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerAttachComplete) HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )( ICorProfilerCallback3 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerDetachSucceeded) HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )( ICorProfilerCallback3 * This); @@ -2699,267 +2998,267 @@ EXTERN_C const IID IID_ICorProfilerCallback3; #ifdef COBJMACROS -#define ICorProfilerCallback3_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback3_AddRef(This) \ +#define ICorProfilerCallback3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback3_Release(This) \ +#define ICorProfilerCallback3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback3_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback3_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback3_Shutdown(This) \ +#define ICorProfilerCallback3_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback3_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback3_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback3_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback3_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback3_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback3_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback3_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback3_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback3_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback3_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback3_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback3_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback3_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback3_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback3_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback3_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback3_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback3_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback3_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback3_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback3_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback3_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback3_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback3_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback3_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback3_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback3_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback3_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback3_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback3_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback3_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback3_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback3_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback3_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback3_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback3_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback3_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback3_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback3_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback3_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback3_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback3_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback3_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback3_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback3_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback3_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback3_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback3_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback3_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback3_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback3_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback3_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback3_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback3_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback3_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback3_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback3_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback3_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback3_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback3_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback3_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback3_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback3_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback3_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback3_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback3_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback3_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback3_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback3_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback3_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback3_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback3_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback3_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback3_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback3_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback3_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback3_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback3_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback3_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback3_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback3_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback3_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback3_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback3_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback3_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback3_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback3_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback3_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback3_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback3_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback3_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback3_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback3_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback3_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback3_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback3_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback3_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback3_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback3_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback3_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback3_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback3_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback3_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback3_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback3_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback3_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback3_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback3_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback3_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback3_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback3_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback3_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback3_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback3_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback3_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback3_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback3_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback3_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback3_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback3_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback3_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback3_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback3_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback3_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback3_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback3_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback3_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback3_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback3_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback3_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback3_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback3_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback3_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback3_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback3_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback3_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback3_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback3_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback3_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback3_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback3_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback3_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback3_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback3_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback3_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback3_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback3_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback3_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback3_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback3_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) -#define ICorProfilerCallback3_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ +#define ICorProfilerCallback3_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) ) -#define ICorProfilerCallback3_ProfilerAttachComplete(This) \ +#define ICorProfilerCallback3_ProfilerAttachComplete(This) \ ( (This)->lpVtbl -> ProfilerAttachComplete(This) ) -#define ICorProfilerCallback3_ProfilerDetachSucceeded(This) \ +#define ICorProfilerCallback3_ProfilerDetachSucceeded(This) \ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback3_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback3_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerCallback4_INTERFACE_DEFINED__ @@ -3013,222 +3312,272 @@ EXTERN_C const IID IID_ICorProfilerCallback4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback4 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback4 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback4 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback4 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback4 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback4 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback4 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback4 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback4 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback4 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback4 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback4 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback4 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback4 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback4 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback4 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback4 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback4 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback4 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback4 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback4 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback4 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback4 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback4 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback4 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback4 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback4 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback4 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback4 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback4 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -3236,17 +3585,20 @@ EXTERN_C const IID IID_ICorProfilerCallback4; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback4 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback4 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback4 * This, /* [in] */ ObjectID objectId, @@ -3254,63 +3606,79 @@ EXTERN_C const IID IID_ICorProfilerCallback4; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback4 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback4 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback4 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback4 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback4 * This, /* [in] */ ClassID wrappedClassId, @@ -3318,18 +3686,22 @@ EXTERN_C const IID IID_ICorProfilerCallback4; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback4 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback4 * This, /* [in] */ ThreadID threadId, @@ -3337,26 +3709,31 @@ EXTERN_C const IID IID_ICorProfilerCallback4; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback4 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback4 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback4 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback4 * This, /* [in] */ ULONG cRootRefs, @@ -3365,39 +3742,47 @@ EXTERN_C const IID IID_ICorProfilerCallback4; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback4 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback4 * This, /* [in] */ GCHandleID handleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, InitializeForAttach) HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )( ICorProfilerCallback4 * This, /* [in] */ IUnknown *pCorProfilerInfoUnk, /* [in] */ void *pvClientData, /* [in] */ UINT cbClientData); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerAttachComplete) HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerDetachSucceeded) HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )( ICorProfilerCallback4 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId, /* [in] */ ReJITID rejitId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, GetReJITParameters) HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )( ICorProfilerCallback4 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodId, /* [in] */ ICorProfilerFunctionControl *pFunctionControl); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )( ICorProfilerCallback4 * This, /* [in] */ FunctionID functionId, @@ -3405,6 +3790,7 @@ EXTERN_C const IID IID_ICorProfilerCallback4; /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITError) HRESULT ( STDMETHODCALLTYPE *ReJITError )( ICorProfilerCallback4 * This, /* [in] */ ModuleID moduleId, @@ -3412,6 +3798,7 @@ EXTERN_C const IID IID_ICorProfilerCallback4; /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, MovedReferences2) HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )( ICorProfilerCallback4 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -3419,6 +3806,7 @@ EXTERN_C const IID IID_ICorProfilerCallback4; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, SurvivingReferences2) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )( ICorProfilerCallback4 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, @@ -3438,286 +3826,286 @@ EXTERN_C const IID IID_ICorProfilerCallback4; #ifdef COBJMACROS -#define ICorProfilerCallback4_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback4_AddRef(This) \ +#define ICorProfilerCallback4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback4_Release(This) \ +#define ICorProfilerCallback4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback4_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback4_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback4_Shutdown(This) \ +#define ICorProfilerCallback4_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback4_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback4_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback4_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback4_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback4_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback4_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback4_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback4_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback4_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback4_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback4_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback4_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback4_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback4_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback4_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback4_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback4_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback4_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback4_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback4_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback4_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback4_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback4_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback4_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback4_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback4_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback4_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback4_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback4_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback4_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback4_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback4_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback4_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback4_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback4_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback4_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback4_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback4_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback4_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback4_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback4_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback4_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback4_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback4_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback4_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback4_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback4_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback4_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback4_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback4_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback4_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback4_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback4_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback4_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback4_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback4_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback4_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback4_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback4_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback4_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback4_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback4_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback4_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback4_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback4_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback4_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback4_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback4_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback4_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback4_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback4_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback4_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback4_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback4_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback4_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback4_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback4_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback4_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback4_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback4_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback4_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback4_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback4_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback4_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback4_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback4_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback4_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback4_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback4_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback4_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback4_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback4_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback4_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback4_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback4_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback4_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback4_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback4_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback4_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback4_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback4_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback4_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback4_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback4_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback4_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback4_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback4_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback4_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback4_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback4_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback4_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback4_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback4_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback4_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback4_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback4_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback4_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback4_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback4_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback4_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback4_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback4_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback4_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback4_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback4_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback4_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback4_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback4_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback4_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback4_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback4_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback4_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback4_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback4_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback4_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback4_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback4_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback4_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback4_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback4_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback4_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback4_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback4_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback4_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback4_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback4_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback4_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback4_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback4_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback4_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) -#define ICorProfilerCallback4_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ +#define ICorProfilerCallback4_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) ) -#define ICorProfilerCallback4_ProfilerAttachComplete(This) \ +#define ICorProfilerCallback4_ProfilerAttachComplete(This) \ ( (This)->lpVtbl -> ProfilerAttachComplete(This) ) -#define ICorProfilerCallback4_ProfilerDetachSucceeded(This) \ +#define ICorProfilerCallback4_ProfilerDetachSucceeded(This) \ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) ) -#define ICorProfilerCallback4_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ +#define ICorProfilerCallback4_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) ) -#define ICorProfilerCallback4_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ +#define ICorProfilerCallback4_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) ) -#define ICorProfilerCallback4_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback4_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback4_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ +#define ICorProfilerCallback4_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) ) -#define ICorProfilerCallback4_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback4_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback4_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback4_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback4_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback4_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerCallback5_INTERFACE_DEFINED__ @@ -3744,222 +4132,272 @@ EXTERN_C const IID IID_ICorProfilerCallback5; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback5Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback5 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback5 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback5 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback5 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback5 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback5 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback5 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback5 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback5 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback5 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback5 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback5 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback5 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback5 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback5 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback5 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback5 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback5 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback5 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback5 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback5 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback5 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback5 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback5 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback5 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback5 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback5 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback5 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback5 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback5 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback5 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -3967,17 +4405,20 @@ EXTERN_C const IID IID_ICorProfilerCallback5; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback5 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback5 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback5 * This, /* [in] */ ObjectID objectId, @@ -3985,63 +4426,79 @@ EXTERN_C const IID IID_ICorProfilerCallback5; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback5 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback5 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback5 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback5 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback5 * This, /* [in] */ ClassID wrappedClassId, @@ -4049,18 +4506,22 @@ EXTERN_C const IID IID_ICorProfilerCallback5; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback5 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback5 * This, /* [in] */ ThreadID threadId, @@ -4068,26 +4529,31 @@ EXTERN_C const IID IID_ICorProfilerCallback5; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback5 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback5 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback5 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback5 * This, /* [in] */ ULONG cRootRefs, @@ -4096,39 +4562,47 @@ EXTERN_C const IID IID_ICorProfilerCallback5; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback5 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback5 * This, /* [in] */ GCHandleID handleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, InitializeForAttach) HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )( ICorProfilerCallback5 * This, /* [in] */ IUnknown *pCorProfilerInfoUnk, /* [in] */ void *pvClientData, /* [in] */ UINT cbClientData); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerAttachComplete) HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerDetachSucceeded) HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )( ICorProfilerCallback5 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId, /* [in] */ ReJITID rejitId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, GetReJITParameters) HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )( ICorProfilerCallback5 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodId, /* [in] */ ICorProfilerFunctionControl *pFunctionControl); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )( ICorProfilerCallback5 * This, /* [in] */ FunctionID functionId, @@ -4136,6 +4610,7 @@ EXTERN_C const IID IID_ICorProfilerCallback5; /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITError) HRESULT ( STDMETHODCALLTYPE *ReJITError )( ICorProfilerCallback5 * This, /* [in] */ ModuleID moduleId, @@ -4143,6 +4618,7 @@ EXTERN_C const IID IID_ICorProfilerCallback5; /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, MovedReferences2) HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )( ICorProfilerCallback5 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -4150,12 +4626,14 @@ EXTERN_C const IID IID_ICorProfilerCallback5; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, SurvivingReferences2) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )( ICorProfilerCallback5 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback5, ConditionalWeakTableElementReferences) HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )( ICorProfilerCallback5 * This, /* [in] */ ULONG cRootRefs, @@ -4176,290 +4654,290 @@ EXTERN_C const IID IID_ICorProfilerCallback5; #ifdef COBJMACROS -#define ICorProfilerCallback5_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback5_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback5_AddRef(This) \ +#define ICorProfilerCallback5_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback5_Release(This) \ +#define ICorProfilerCallback5_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback5_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback5_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback5_Shutdown(This) \ +#define ICorProfilerCallback5_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback5_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback5_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback5_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback5_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback5_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback5_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback5_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback5_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback5_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback5_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback5_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback5_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback5_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback5_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback5_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback5_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback5_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback5_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback5_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback5_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback5_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback5_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback5_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback5_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback5_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback5_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback5_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback5_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback5_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback5_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback5_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback5_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback5_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback5_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback5_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback5_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback5_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback5_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback5_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback5_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback5_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback5_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback5_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback5_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback5_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback5_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback5_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback5_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback5_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback5_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback5_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback5_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback5_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback5_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback5_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback5_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback5_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback5_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback5_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback5_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback5_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback5_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback5_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback5_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback5_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback5_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback5_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback5_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback5_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback5_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback5_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback5_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback5_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback5_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback5_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback5_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback5_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback5_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback5_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback5_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback5_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback5_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback5_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback5_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback5_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback5_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback5_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback5_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback5_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback5_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback5_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback5_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback5_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback5_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback5_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback5_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback5_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback5_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback5_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback5_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback5_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback5_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback5_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback5_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback5_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback5_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback5_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback5_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback5_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback5_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback5_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback5_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback5_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback5_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback5_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback5_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback5_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback5_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback5_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback5_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback5_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback5_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback5_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback5_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback5_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback5_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback5_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback5_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback5_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback5_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback5_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback5_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback5_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback5_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback5_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback5_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback5_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback5_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback5_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback5_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback5_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback5_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback5_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback5_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback5_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback5_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback5_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback5_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback5_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback5_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) -#define ICorProfilerCallback5_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ +#define ICorProfilerCallback5_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) ) -#define ICorProfilerCallback5_ProfilerAttachComplete(This) \ +#define ICorProfilerCallback5_ProfilerAttachComplete(This) \ ( (This)->lpVtbl -> ProfilerAttachComplete(This) ) -#define ICorProfilerCallback5_ProfilerDetachSucceeded(This) \ +#define ICorProfilerCallback5_ProfilerDetachSucceeded(This) \ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) ) -#define ICorProfilerCallback5_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ +#define ICorProfilerCallback5_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) ) -#define ICorProfilerCallback5_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ +#define ICorProfilerCallback5_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) ) -#define ICorProfilerCallback5_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback5_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback5_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ +#define ICorProfilerCallback5_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) ) -#define ICorProfilerCallback5_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback5_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback5_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback5_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback5_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ +#define ICorProfilerCallback5_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback5_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback5_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerCallback6_INTERFACE_DEFINED__ @@ -4484,222 +4962,272 @@ EXTERN_C const IID IID_ICorProfilerCallback6; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback6Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback6 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback6 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback6 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback6 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback6 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback6 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback6 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback6 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback6 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback6 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback6 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback6 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback6 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback6 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback6 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback6 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback6 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback6 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback6 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback6 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback6 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback6 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback6 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback6 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback6 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback6 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback6 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback6 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback6 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback6 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback6 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -4707,17 +5235,20 @@ EXTERN_C const IID IID_ICorProfilerCallback6; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback6 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback6 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback6 * This, /* [in] */ ObjectID objectId, @@ -4725,63 +5256,79 @@ EXTERN_C const IID IID_ICorProfilerCallback6; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback6 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback6 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback6 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback6 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback6 * This, /* [in] */ ClassID wrappedClassId, @@ -4789,18 +5336,22 @@ EXTERN_C const IID IID_ICorProfilerCallback6; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback6 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback6 * This, /* [in] */ ThreadID threadId, @@ -4808,26 +5359,31 @@ EXTERN_C const IID IID_ICorProfilerCallback6; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback6 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback6 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback6 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback6 * This, /* [in] */ ULONG cRootRefs, @@ -4836,39 +5392,47 @@ EXTERN_C const IID IID_ICorProfilerCallback6; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback6 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback6 * This, /* [in] */ GCHandleID handleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, InitializeForAttach) HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )( ICorProfilerCallback6 * This, /* [in] */ IUnknown *pCorProfilerInfoUnk, /* [in] */ void *pvClientData, /* [in] */ UINT cbClientData); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerAttachComplete) HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerDetachSucceeded) HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )( ICorProfilerCallback6 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId, /* [in] */ ReJITID rejitId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, GetReJITParameters) HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )( ICorProfilerCallback6 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodId, /* [in] */ ICorProfilerFunctionControl *pFunctionControl); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )( ICorProfilerCallback6 * This, /* [in] */ FunctionID functionId, @@ -4876,6 +5440,7 @@ EXTERN_C const IID IID_ICorProfilerCallback6; /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITError) HRESULT ( STDMETHODCALLTYPE *ReJITError )( ICorProfilerCallback6 * This, /* [in] */ ModuleID moduleId, @@ -4883,6 +5448,7 @@ EXTERN_C const IID IID_ICorProfilerCallback6; /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, MovedReferences2) HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )( ICorProfilerCallback6 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -4890,12 +5456,14 @@ EXTERN_C const IID IID_ICorProfilerCallback6; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, SurvivingReferences2) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )( ICorProfilerCallback6 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback5, ConditionalWeakTableElementReferences) HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )( ICorProfilerCallback6 * This, /* [in] */ ULONG cRootRefs, @@ -4903,6 +5471,7 @@ EXTERN_C const IID IID_ICorProfilerCallback6; /* [size_is][in] */ ObjectID valueRefIds[ ], /* [size_is][in] */ GCHandleID rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback6, GetAssemblyReferences) HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )( ICorProfilerCallback6 * This, /* [string][in] */ const WCHAR *wszAssemblyPath, @@ -4921,294 +5490,294 @@ EXTERN_C const IID IID_ICorProfilerCallback6; #ifdef COBJMACROS -#define ICorProfilerCallback6_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback6_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback6_AddRef(This) \ +#define ICorProfilerCallback6_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback6_Release(This) \ +#define ICorProfilerCallback6_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback6_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback6_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback6_Shutdown(This) \ +#define ICorProfilerCallback6_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback6_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback6_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback6_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback6_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback6_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback6_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback6_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback6_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback6_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback6_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback6_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback6_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback6_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback6_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback6_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback6_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback6_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback6_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback6_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback6_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback6_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback6_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback6_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback6_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback6_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback6_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback6_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback6_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback6_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback6_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback6_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback6_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback6_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback6_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback6_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback6_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback6_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback6_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback6_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback6_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback6_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback6_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback6_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback6_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback6_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback6_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback6_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback6_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback6_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback6_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback6_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback6_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback6_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback6_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback6_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback6_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback6_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback6_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback6_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback6_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback6_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback6_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback6_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback6_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback6_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback6_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback6_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback6_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback6_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback6_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback6_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback6_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback6_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback6_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback6_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback6_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback6_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback6_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback6_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback6_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback6_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback6_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback6_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback6_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback6_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback6_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback6_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback6_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback6_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback6_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback6_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback6_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback6_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback6_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback6_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback6_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback6_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback6_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback6_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback6_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback6_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback6_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback6_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback6_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback6_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback6_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback6_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback6_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback6_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback6_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback6_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback6_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback6_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback6_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback6_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback6_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback6_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback6_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback6_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback6_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback6_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback6_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback6_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback6_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback6_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback6_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback6_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback6_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback6_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback6_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback6_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback6_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback6_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback6_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback6_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback6_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback6_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback6_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback6_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback6_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback6_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback6_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback6_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback6_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback6_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback6_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback6_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback6_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback6_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback6_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) -#define ICorProfilerCallback6_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ +#define ICorProfilerCallback6_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) ) -#define ICorProfilerCallback6_ProfilerAttachComplete(This) \ +#define ICorProfilerCallback6_ProfilerAttachComplete(This) \ ( (This)->lpVtbl -> ProfilerAttachComplete(This) ) -#define ICorProfilerCallback6_ProfilerDetachSucceeded(This) \ +#define ICorProfilerCallback6_ProfilerDetachSucceeded(This) \ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) ) -#define ICorProfilerCallback6_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ +#define ICorProfilerCallback6_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) ) -#define ICorProfilerCallback6_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ +#define ICorProfilerCallback6_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) ) -#define ICorProfilerCallback6_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback6_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback6_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ +#define ICorProfilerCallback6_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) ) -#define ICorProfilerCallback6_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback6_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback6_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback6_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback6_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ +#define ICorProfilerCallback6_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) ) -#define ICorProfilerCallback6_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ +#define ICorProfilerCallback6_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback6_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback6_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerCallback7_INTERFACE_DEFINED__ @@ -5232,222 +5801,272 @@ EXTERN_C const IID IID_ICorProfilerCallback7; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback7Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback7 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback7 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback7 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback7 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback7 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback7 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback7 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback7 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback7 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback7 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback7 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback7 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback7 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback7 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback7 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback7 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback7 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback7 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback7 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback7 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback7 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback7 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback7 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback7 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback7 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback7 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback7 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback7 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback7 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback7 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback7 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -5455,17 +6074,20 @@ EXTERN_C const IID IID_ICorProfilerCallback7; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback7 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback7 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback7 * This, /* [in] */ ObjectID objectId, @@ -5473,63 +6095,79 @@ EXTERN_C const IID IID_ICorProfilerCallback7; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback7 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback7 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback7 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback7 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback7 * This, /* [in] */ ClassID wrappedClassId, @@ -5537,18 +6175,22 @@ EXTERN_C const IID IID_ICorProfilerCallback7; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback7 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback7 * This, /* [in] */ ThreadID threadId, @@ -5556,26 +6198,31 @@ EXTERN_C const IID IID_ICorProfilerCallback7; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback7 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback7 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback7 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback7 * This, /* [in] */ ULONG cRootRefs, @@ -5584,39 +6231,47 @@ EXTERN_C const IID IID_ICorProfilerCallback7; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback7 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback7 * This, /* [in] */ GCHandleID handleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, InitializeForAttach) HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )( ICorProfilerCallback7 * This, /* [in] */ IUnknown *pCorProfilerInfoUnk, /* [in] */ void *pvClientData, /* [in] */ UINT cbClientData); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerAttachComplete) HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerDetachSucceeded) HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )( ICorProfilerCallback7 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId, /* [in] */ ReJITID rejitId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, GetReJITParameters) HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )( ICorProfilerCallback7 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodId, /* [in] */ ICorProfilerFunctionControl *pFunctionControl); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )( ICorProfilerCallback7 * This, /* [in] */ FunctionID functionId, @@ -5624,6 +6279,7 @@ EXTERN_C const IID IID_ICorProfilerCallback7; /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITError) HRESULT ( STDMETHODCALLTYPE *ReJITError )( ICorProfilerCallback7 * This, /* [in] */ ModuleID moduleId, @@ -5631,6 +6287,7 @@ EXTERN_C const IID IID_ICorProfilerCallback7; /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, MovedReferences2) HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )( ICorProfilerCallback7 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -5638,12 +6295,14 @@ EXTERN_C const IID IID_ICorProfilerCallback7; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, SurvivingReferences2) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )( ICorProfilerCallback7 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback5, ConditionalWeakTableElementReferences) HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )( ICorProfilerCallback7 * This, /* [in] */ ULONG cRootRefs, @@ -5651,11 +6310,13 @@ EXTERN_C const IID IID_ICorProfilerCallback7; /* [size_is][in] */ ObjectID valueRefIds[ ], /* [size_is][in] */ GCHandleID rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback6, GetAssemblyReferences) HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )( ICorProfilerCallback7 * This, /* [string][in] */ const WCHAR *wszAssemblyPath, /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider); + DECLSPEC_XFGVIRT(ICorProfilerCallback7, ModuleInMemorySymbolsUpdated) HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )( ICorProfilerCallback7 * This, ModuleID moduleId); @@ -5673,298 +6334,298 @@ EXTERN_C const IID IID_ICorProfilerCallback7; #ifdef COBJMACROS -#define ICorProfilerCallback7_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback7_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback7_AddRef(This) \ +#define ICorProfilerCallback7_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback7_Release(This) \ +#define ICorProfilerCallback7_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback7_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback7_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback7_Shutdown(This) \ +#define ICorProfilerCallback7_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback7_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback7_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback7_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback7_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback7_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback7_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback7_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback7_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback7_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback7_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback7_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback7_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback7_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback7_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback7_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback7_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback7_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback7_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback7_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback7_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback7_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback7_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback7_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback7_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback7_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback7_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback7_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback7_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback7_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback7_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback7_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback7_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback7_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback7_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback7_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback7_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback7_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback7_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback7_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback7_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback7_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback7_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback7_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback7_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback7_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback7_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback7_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback7_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback7_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback7_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback7_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback7_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback7_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback7_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback7_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback7_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback7_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback7_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback7_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback7_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback7_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback7_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback7_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback7_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback7_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback7_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback7_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback7_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback7_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback7_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback7_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback7_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback7_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback7_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback7_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback7_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback7_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback7_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback7_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback7_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback7_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback7_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback7_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback7_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback7_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback7_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback7_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback7_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback7_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback7_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback7_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback7_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback7_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback7_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback7_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback7_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback7_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback7_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback7_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback7_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback7_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback7_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback7_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback7_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback7_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback7_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback7_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback7_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback7_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback7_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback7_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback7_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback7_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback7_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback7_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback7_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback7_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback7_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback7_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback7_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback7_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback7_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback7_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback7_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback7_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback7_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback7_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback7_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback7_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback7_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback7_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback7_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback7_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback7_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback7_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback7_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback7_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback7_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback7_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback7_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback7_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback7_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback7_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback7_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback7_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback7_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback7_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback7_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback7_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback7_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) -#define ICorProfilerCallback7_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ +#define ICorProfilerCallback7_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) ) -#define ICorProfilerCallback7_ProfilerAttachComplete(This) \ +#define ICorProfilerCallback7_ProfilerAttachComplete(This) \ ( (This)->lpVtbl -> ProfilerAttachComplete(This) ) -#define ICorProfilerCallback7_ProfilerDetachSucceeded(This) \ +#define ICorProfilerCallback7_ProfilerDetachSucceeded(This) \ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) ) -#define ICorProfilerCallback7_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ +#define ICorProfilerCallback7_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) ) -#define ICorProfilerCallback7_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ +#define ICorProfilerCallback7_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) ) -#define ICorProfilerCallback7_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback7_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback7_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ +#define ICorProfilerCallback7_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) ) -#define ICorProfilerCallback7_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback7_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback7_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback7_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback7_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ +#define ICorProfilerCallback7_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) ) -#define ICorProfilerCallback7_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ +#define ICorProfilerCallback7_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) ) -#define ICorProfilerCallback7_ModuleInMemorySymbolsUpdated(This,moduleId) \ +#define ICorProfilerCallback7_ModuleInMemorySymbolsUpdated(This,moduleId) \ ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback7_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback7_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerCallback8_INTERFACE_DEFINED__ @@ -5996,222 +6657,272 @@ EXTERN_C const IID IID_ICorProfilerCallback8; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback8Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback8 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback8 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback8 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback8 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback8 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback8 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback8 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback8 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback8 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback8 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback8 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback8 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback8 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback8 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback8 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback8 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback8 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback8 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback8 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback8 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback8 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback8 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback8 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback8 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback8 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback8 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback8 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback8 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback8 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback8 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback8 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -6219,17 +6930,20 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback8 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback8 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback8 * This, /* [in] */ ObjectID objectId, @@ -6237,63 +6951,79 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback8 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback8 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback8 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback8 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback8 * This, /* [in] */ ClassID wrappedClassId, @@ -6301,18 +7031,22 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback8 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback8 * This, /* [in] */ ThreadID threadId, @@ -6320,26 +7054,31 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback8 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback8 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback8 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback8 * This, /* [in] */ ULONG cRootRefs, @@ -6348,39 +7087,47 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback8 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback8 * This, /* [in] */ GCHandleID handleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, InitializeForAttach) HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )( ICorProfilerCallback8 * This, /* [in] */ IUnknown *pCorProfilerInfoUnk, /* [in] */ void *pvClientData, /* [in] */ UINT cbClientData); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerAttachComplete) HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerDetachSucceeded) HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )( ICorProfilerCallback8 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, /* [in] */ ReJITID rejitId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, GetReJITParameters) HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )( ICorProfilerCallback8 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodId, /* [in] */ ICorProfilerFunctionControl *pFunctionControl); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, @@ -6388,6 +7135,7 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITError) HRESULT ( STDMETHODCALLTYPE *ReJITError )( ICorProfilerCallback8 * This, /* [in] */ ModuleID moduleId, @@ -6395,6 +7143,7 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, MovedReferences2) HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )( ICorProfilerCallback8 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -6402,12 +7151,14 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, SurvivingReferences2) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )( ICorProfilerCallback8 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback5, ConditionalWeakTableElementReferences) HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )( ICorProfilerCallback8 * This, /* [in] */ ULONG cRootRefs, @@ -6415,15 +7166,18 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [size_is][in] */ ObjectID valueRefIds[ ], /* [size_is][in] */ GCHandleID rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback6, GetAssemblyReferences) HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )( ICorProfilerCallback8 * This, /* [string][in] */ const WCHAR *wszAssemblyPath, /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider); + DECLSPEC_XFGVIRT(ICorProfilerCallback7, ModuleInMemorySymbolsUpdated) HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )( ICorProfilerCallback8 * This, ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback8, DynamicMethodJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, @@ -6431,6 +7185,7 @@ EXTERN_C const IID IID_ICorProfilerCallback8; /* [in] */ LPCBYTE pILHeader, /* [in] */ ULONG cbILHeader); + DECLSPEC_XFGVIRT(ICorProfilerCallback8, DynamicMethodJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )( ICorProfilerCallback8 * This, /* [in] */ FunctionID functionId, @@ -6450,305 +7205,305 @@ EXTERN_C const IID IID_ICorProfilerCallback8; #ifdef COBJMACROS -#define ICorProfilerCallback8_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback8_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback8_AddRef(This) \ +#define ICorProfilerCallback8_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback8_Release(This) \ +#define ICorProfilerCallback8_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback8_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback8_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback8_Shutdown(This) \ +#define ICorProfilerCallback8_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback8_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback8_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback8_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback8_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback8_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback8_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback8_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback8_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback8_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback8_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback8_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback8_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback8_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback8_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback8_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback8_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback8_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback8_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback8_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback8_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback8_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback8_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback8_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback8_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback8_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback8_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback8_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback8_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback8_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback8_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback8_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback8_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback8_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback8_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback8_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback8_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback8_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback8_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback8_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback8_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback8_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback8_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback8_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback8_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback8_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback8_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback8_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback8_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback8_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback8_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback8_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback8_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback8_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback8_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback8_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback8_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback8_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback8_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback8_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback8_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback8_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback8_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback8_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback8_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback8_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback8_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback8_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback8_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback8_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback8_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback8_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback8_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback8_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback8_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback8_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback8_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback8_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback8_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback8_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback8_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback8_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback8_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback8_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback8_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback8_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback8_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback8_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback8_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback8_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback8_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback8_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback8_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback8_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback8_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback8_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback8_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback8_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback8_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback8_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback8_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback8_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback8_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback8_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback8_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback8_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback8_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback8_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback8_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback8_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback8_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback8_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback8_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback8_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback8_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback8_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback8_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback8_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback8_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback8_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback8_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback8_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback8_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback8_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback8_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback8_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback8_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback8_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback8_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback8_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback8_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback8_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback8_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback8_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback8_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback8_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback8_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback8_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback8_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback8_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback8_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback8_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback8_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback8_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback8_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback8_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback8_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback8_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback8_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback8_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback8_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) -#define ICorProfilerCallback8_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ +#define ICorProfilerCallback8_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) ) -#define ICorProfilerCallback8_ProfilerAttachComplete(This) \ +#define ICorProfilerCallback8_ProfilerAttachComplete(This) \ ( (This)->lpVtbl -> ProfilerAttachComplete(This) ) -#define ICorProfilerCallback8_ProfilerDetachSucceeded(This) \ +#define ICorProfilerCallback8_ProfilerDetachSucceeded(This) \ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) ) -#define ICorProfilerCallback8_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ +#define ICorProfilerCallback8_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) ) -#define ICorProfilerCallback8_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ +#define ICorProfilerCallback8_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) ) -#define ICorProfilerCallback8_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback8_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback8_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ +#define ICorProfilerCallback8_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) ) -#define ICorProfilerCallback8_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback8_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback8_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback8_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback8_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ +#define ICorProfilerCallback8_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) ) -#define ICorProfilerCallback8_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ +#define ICorProfilerCallback8_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) ) -#define ICorProfilerCallback8_ModuleInMemorySymbolsUpdated(This,moduleId) \ +#define ICorProfilerCallback8_ModuleInMemorySymbolsUpdated(This,moduleId) \ ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) ) -#define ICorProfilerCallback8_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \ +#define ICorProfilerCallback8_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \ ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) ) -#define ICorProfilerCallback8_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback8_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback8_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback8_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerCallback9_INTERFACE_DEFINED__ @@ -6772,222 +7527,272 @@ EXTERN_C const IID IID_ICorProfilerCallback9; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback9Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback9 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback9 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback9 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback9 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback9 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback9 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback9 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback9 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback9 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback9 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback9 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback9 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback9 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback9 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback9 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback9 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback9 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback9 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback9 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback9 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback9 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback9 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback9 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback9 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback9 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback9 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback9 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback9 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback9 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback9 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback9 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -6995,17 +7800,20 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback9 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback9 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback9 * This, /* [in] */ ObjectID objectId, @@ -7013,63 +7821,79 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback9 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback9 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback9 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback9 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback9 * This, /* [in] */ ClassID wrappedClassId, @@ -7077,18 +7901,22 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback9 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback9 * This, /* [in] */ ThreadID threadId, @@ -7096,26 +7924,31 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback9 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback9 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback9 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback9 * This, /* [in] */ ULONG cRootRefs, @@ -7124,39 +7957,47 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback9 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback9 * This, /* [in] */ GCHandleID handleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, InitializeForAttach) HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )( ICorProfilerCallback9 * This, /* [in] */ IUnknown *pCorProfilerInfoUnk, /* [in] */ void *pvClientData, /* [in] */ UINT cbClientData); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerAttachComplete) HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerDetachSucceeded) HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )( ICorProfilerCallback9 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, /* [in] */ ReJITID rejitId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, GetReJITParameters) HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )( ICorProfilerCallback9 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodId, /* [in] */ ICorProfilerFunctionControl *pFunctionControl); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, @@ -7164,6 +8005,7 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITError) HRESULT ( STDMETHODCALLTYPE *ReJITError )( ICorProfilerCallback9 * This, /* [in] */ ModuleID moduleId, @@ -7171,6 +8013,7 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, MovedReferences2) HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )( ICorProfilerCallback9 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -7178,12 +8021,14 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, SurvivingReferences2) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )( ICorProfilerCallback9 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback5, ConditionalWeakTableElementReferences) HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )( ICorProfilerCallback9 * This, /* [in] */ ULONG cRootRefs, @@ -7191,15 +8036,18 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [size_is][in] */ ObjectID valueRefIds[ ], /* [size_is][in] */ GCHandleID rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback6, GetAssemblyReferences) HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )( ICorProfilerCallback9 * This, /* [string][in] */ const WCHAR *wszAssemblyPath, /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider); + DECLSPEC_XFGVIRT(ICorProfilerCallback7, ModuleInMemorySymbolsUpdated) HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )( ICorProfilerCallback9 * This, ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback8, DynamicMethodJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, @@ -7207,12 +8055,14 @@ EXTERN_C const IID IID_ICorProfilerCallback9; /* [in] */ LPCBYTE pILHeader, /* [in] */ ULONG cbILHeader); + DECLSPEC_XFGVIRT(ICorProfilerCallback8, DynamicMethodJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback9, DynamicMethodUnloaded) HRESULT ( STDMETHODCALLTYPE *DynamicMethodUnloaded )( ICorProfilerCallback9 * This, /* [in] */ FunctionID functionId); @@ -7230,309 +8080,309 @@ EXTERN_C const IID IID_ICorProfilerCallback9; #ifdef COBJMACROS -#define ICorProfilerCallback9_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback9_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback9_AddRef(This) \ +#define ICorProfilerCallback9_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback9_Release(This) \ +#define ICorProfilerCallback9_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback9_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback9_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback9_Shutdown(This) \ +#define ICorProfilerCallback9_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback9_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback9_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback9_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback9_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback9_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback9_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback9_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback9_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback9_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback9_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback9_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback9_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback9_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback9_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback9_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback9_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback9_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback9_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback9_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback9_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback9_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback9_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback9_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback9_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback9_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback9_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback9_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback9_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback9_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback9_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback9_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback9_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback9_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback9_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback9_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback9_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback9_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback9_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback9_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback9_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback9_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback9_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback9_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback9_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback9_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback9_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback9_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback9_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback9_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback9_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback9_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback9_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback9_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback9_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback9_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback9_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback9_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback9_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback9_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback9_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback9_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback9_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback9_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback9_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback9_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback9_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback9_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback9_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback9_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback9_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback9_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback9_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback9_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback9_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback9_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback9_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback9_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback9_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback9_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback9_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback9_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback9_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback9_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback9_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback9_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback9_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback9_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback9_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback9_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback9_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback9_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback9_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback9_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback9_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback9_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback9_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback9_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback9_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback9_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback9_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback9_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback9_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback9_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback9_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback9_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback9_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback9_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback9_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback9_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback9_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback9_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback9_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback9_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback9_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback9_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback9_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback9_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback9_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback9_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback9_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback9_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback9_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback9_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback9_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback9_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback9_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback9_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback9_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback9_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback9_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback9_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback9_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback9_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback9_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback9_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback9_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback9_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback9_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback9_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback9_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback9_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback9_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback9_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback9_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback9_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback9_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback9_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback9_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback9_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback9_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) -#define ICorProfilerCallback9_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ +#define ICorProfilerCallback9_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) ) -#define ICorProfilerCallback9_ProfilerAttachComplete(This) \ +#define ICorProfilerCallback9_ProfilerAttachComplete(This) \ ( (This)->lpVtbl -> ProfilerAttachComplete(This) ) -#define ICorProfilerCallback9_ProfilerDetachSucceeded(This) \ +#define ICorProfilerCallback9_ProfilerDetachSucceeded(This) \ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) ) -#define ICorProfilerCallback9_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ +#define ICorProfilerCallback9_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) ) -#define ICorProfilerCallback9_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ +#define ICorProfilerCallback9_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) ) -#define ICorProfilerCallback9_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback9_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback9_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ +#define ICorProfilerCallback9_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) ) -#define ICorProfilerCallback9_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback9_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback9_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback9_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback9_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ +#define ICorProfilerCallback9_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) ) -#define ICorProfilerCallback9_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ +#define ICorProfilerCallback9_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) ) -#define ICorProfilerCallback9_ModuleInMemorySymbolsUpdated(This,moduleId) \ +#define ICorProfilerCallback9_ModuleInMemorySymbolsUpdated(This,moduleId) \ ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) ) -#define ICorProfilerCallback9_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \ +#define ICorProfilerCallback9_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \ ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) ) -#define ICorProfilerCallback9_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback9_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback9_DynamicMethodUnloaded(This,functionId) \ +#define ICorProfilerCallback9_DynamicMethodUnloaded(This,functionId) \ ( (This)->lpVtbl -> DynamicMethodUnloaded(This,functionId) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback9_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback9_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerCallback10_INTERFACE_DEFINED__ @@ -7570,222 +8420,272 @@ EXTERN_C const IID IID_ICorProfilerCallback10; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback10Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback10 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback10 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback10 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback10 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback10 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback10 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback10 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback10 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback10 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback10 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback10 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback10 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback10 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback10 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback10 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback10 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback10 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback10 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback10 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback10 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback10 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback10 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback10 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback10 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback10 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback10 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback10 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback10 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback10 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback10 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback10 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -7793,17 +8693,20 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback10 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback10 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback10 * This, /* [in] */ ObjectID objectId, @@ -7811,63 +8714,79 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback10 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback10 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback10 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback10 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback10 * This, /* [in] */ ClassID wrappedClassId, @@ -7875,18 +8794,22 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback10 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback10 * This, /* [in] */ ThreadID threadId, @@ -7894,26 +8817,31 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback10 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback10 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback10 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback10 * This, /* [in] */ ULONG cRootRefs, @@ -7922,39 +8850,47 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback10 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback10 * This, /* [in] */ GCHandleID handleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, InitializeForAttach) HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )( ICorProfilerCallback10 * This, /* [in] */ IUnknown *pCorProfilerInfoUnk, /* [in] */ void *pvClientData, /* [in] */ UINT cbClientData); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerAttachComplete) HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerDetachSucceeded) HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )( ICorProfilerCallback10 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, /* [in] */ ReJITID rejitId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, GetReJITParameters) HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )( ICorProfilerCallback10 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodId, /* [in] */ ICorProfilerFunctionControl *pFunctionControl); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, @@ -7962,6 +8898,7 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITError) HRESULT ( STDMETHODCALLTYPE *ReJITError )( ICorProfilerCallback10 * This, /* [in] */ ModuleID moduleId, @@ -7969,6 +8906,7 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, MovedReferences2) HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )( ICorProfilerCallback10 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -7976,12 +8914,14 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, SurvivingReferences2) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )( ICorProfilerCallback10 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback5, ConditionalWeakTableElementReferences) HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )( ICorProfilerCallback10 * This, /* [in] */ ULONG cRootRefs, @@ -7989,15 +8929,18 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [size_is][in] */ ObjectID valueRefIds[ ], /* [size_is][in] */ GCHandleID rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback6, GetAssemblyReferences) HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )( ICorProfilerCallback10 * This, /* [string][in] */ const WCHAR *wszAssemblyPath, /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider); + DECLSPEC_XFGVIRT(ICorProfilerCallback7, ModuleInMemorySymbolsUpdated) HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )( ICorProfilerCallback10 * This, ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback8, DynamicMethodJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, @@ -8005,16 +8948,19 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [in] */ LPCBYTE pILHeader, /* [in] */ ULONG cbILHeader); + DECLSPEC_XFGVIRT(ICorProfilerCallback8, DynamicMethodJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback9, DynamicMethodUnloaded) HRESULT ( STDMETHODCALLTYPE *DynamicMethodUnloaded )( ICorProfilerCallback10 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback10, EventPipeEventDelivered) HRESULT ( STDMETHODCALLTYPE *EventPipeEventDelivered )( ICorProfilerCallback10 * This, /* [in] */ EVENTPIPE_PROVIDER provider, @@ -8030,6 +8976,7 @@ EXTERN_C const IID IID_ICorProfilerCallback10; /* [in] */ ULONG numStackFrames, /* [length_is][in] */ UINT_PTR stackFrames[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback10, EventPipeProviderCreated) HRESULT ( STDMETHODCALLTYPE *EventPipeProviderCreated )( ICorProfilerCallback10 * This, /* [in] */ EVENTPIPE_PROVIDER provider); @@ -8047,316 +8994,316 @@ EXTERN_C const IID IID_ICorProfilerCallback10; #ifdef COBJMACROS -#define ICorProfilerCallback10_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback10_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback10_AddRef(This) \ +#define ICorProfilerCallback10_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback10_Release(This) \ +#define ICorProfilerCallback10_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback10_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback10_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback10_Shutdown(This) \ +#define ICorProfilerCallback10_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback10_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback10_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback10_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback10_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback10_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback10_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback10_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback10_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback10_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback10_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback10_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback10_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback10_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback10_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback10_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback10_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback10_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback10_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback10_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback10_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback10_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback10_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback10_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback10_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback10_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback10_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback10_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback10_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback10_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback10_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback10_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback10_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback10_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback10_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback10_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback10_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback10_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback10_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback10_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback10_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback10_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback10_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback10_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback10_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback10_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback10_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback10_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback10_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback10_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback10_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback10_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback10_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback10_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback10_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback10_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback10_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback10_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback10_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback10_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback10_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback10_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback10_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback10_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback10_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback10_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback10_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback10_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback10_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback10_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback10_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback10_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback10_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback10_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback10_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback10_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback10_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback10_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback10_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback10_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback10_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback10_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback10_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback10_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback10_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback10_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback10_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback10_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback10_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback10_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback10_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback10_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback10_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback10_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback10_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback10_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback10_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback10_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback10_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback10_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback10_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback10_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback10_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback10_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback10_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback10_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback10_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback10_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback10_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback10_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback10_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback10_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback10_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback10_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback10_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback10_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback10_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback10_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback10_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback10_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback10_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback10_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback10_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback10_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback10_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback10_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback10_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback10_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback10_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback10_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback10_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback10_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback10_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback10_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback10_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback10_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback10_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback10_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback10_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback10_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback10_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback10_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback10_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback10_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback10_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback10_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback10_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback10_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback10_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback10_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback10_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) -#define ICorProfilerCallback10_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ +#define ICorProfilerCallback10_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) ) -#define ICorProfilerCallback10_ProfilerAttachComplete(This) \ +#define ICorProfilerCallback10_ProfilerAttachComplete(This) \ ( (This)->lpVtbl -> ProfilerAttachComplete(This) ) -#define ICorProfilerCallback10_ProfilerDetachSucceeded(This) \ +#define ICorProfilerCallback10_ProfilerDetachSucceeded(This) \ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) ) -#define ICorProfilerCallback10_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ +#define ICorProfilerCallback10_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) ) -#define ICorProfilerCallback10_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ +#define ICorProfilerCallback10_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) ) -#define ICorProfilerCallback10_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback10_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback10_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ +#define ICorProfilerCallback10_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) ) -#define ICorProfilerCallback10_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback10_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback10_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback10_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback10_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ +#define ICorProfilerCallback10_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) ) -#define ICorProfilerCallback10_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ +#define ICorProfilerCallback10_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) ) -#define ICorProfilerCallback10_ModuleInMemorySymbolsUpdated(This,moduleId) \ +#define ICorProfilerCallback10_ModuleInMemorySymbolsUpdated(This,moduleId) \ ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) ) -#define ICorProfilerCallback10_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \ +#define ICorProfilerCallback10_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \ ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) ) -#define ICorProfilerCallback10_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback10_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback10_DynamicMethodUnloaded(This,functionId) \ +#define ICorProfilerCallback10_DynamicMethodUnloaded(This,functionId) \ ( (This)->lpVtbl -> DynamicMethodUnloaded(This,functionId) ) -#define ICorProfilerCallback10_EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames) \ +#define ICorProfilerCallback10_EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames) \ ( (This)->lpVtbl -> EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames) ) -#define ICorProfilerCallback10_EventPipeProviderCreated(This,provider) \ +#define ICorProfilerCallback10_EventPipeProviderCreated(This,provider) \ ( (This)->lpVtbl -> EventPipeProviderCreated(This,provider) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback10_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback10_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerCallback11_INTERFACE_DEFINED__ @@ -8380,222 +9327,272 @@ EXTERN_C const IID IID_ICorProfilerCallback11; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerCallback11Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerCallback11 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Initialize) HRESULT ( STDMETHODCALLTYPE *Initialize )( ICorProfilerCallback11 * This, /* [in] */ IUnknown *pICorProfilerInfoUnk); + DECLSPEC_XFGVIRT(ICorProfilerCallback, Shutdown) HRESULT ( STDMETHODCALLTYPE *Shutdown )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )( ICorProfilerCallback11 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainCreationFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )( ICorProfilerCallback11 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownStarted) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )( ICorProfilerCallback11 * This, /* [in] */ AppDomainID appDomainId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AppDomainShutdownFinished) HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )( ICorProfilerCallback11 * This, /* [in] */ AppDomainID appDomainId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )( ICorProfilerCallback11 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyLoadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )( ICorProfilerCallback11 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadStarted) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )( ICorProfilerCallback11 * This, /* [in] */ AssemblyID assemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, AssemblyUnloadFinished) HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )( ICorProfilerCallback11 * This, /* [in] */ AssemblyID assemblyId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )( ICorProfilerCallback11 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleLoadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )( ICorProfilerCallback11 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )( ICorProfilerCallback11 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )( ICorProfilerCallback11 * This, /* [in] */ ModuleID moduleId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ModuleAttachedToAssembly) HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )( ICorProfilerCallback11 * This, /* [in] */ ModuleID moduleId, /* [in] */ AssemblyID AssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadStarted) HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )( ICorProfilerCallback11 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassLoadFinished) HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )( ICorProfilerCallback11 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadStarted) HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )( ICorProfilerCallback11 * This, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ClassUnloadFinished) HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )( ICorProfilerCallback11 * This, /* [in] */ ClassID classId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback, FunctionUnloadStarted) HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchStarted) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *pbUseCachedFunction); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITCachedFunctionSearchFinished) HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_JIT_CACHE result); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITFunctionPitched) HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, JITInlining) HRESULT ( STDMETHODCALLTYPE *JITInlining )( ICorProfilerCallback11 * This, /* [in] */ FunctionID callerId, /* [in] */ FunctionID calleeId, /* [out] */ BOOL *pfShouldInline); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadCreated) HRESULT ( STDMETHODCALLTYPE *ThreadCreated )( ICorProfilerCallback11 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadDestroyed) HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )( ICorProfilerCallback11 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ThreadAssignedToOSThread) HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )( ICorProfilerCallback11 * This, /* [in] */ ThreadID managedThreadId, /* [in] */ DWORD osThreadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientSendingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )( ICorProfilerCallback11 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientReceivingReply) HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )( ICorProfilerCallback11 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingClientInvocationFinished) HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerReceivingMessage) HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )( ICorProfilerCallback11 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationStarted) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerInvocationReturned) HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RemotingServerSendingReply) HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )( ICorProfilerCallback11 * This, /* [in] */ GUID *pCookie, /* [in] */ BOOL fIsAsync); + DECLSPEC_XFGVIRT(ICorProfilerCallback, UnmanagedToManagedTransition) HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ManagedToUnmanagedTransition) HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_TRANSITION_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )( ICorProfilerCallback11 * This, /* [in] */ COR_PRF_SUSPEND_REASON suspendReason); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeSuspendAborted) HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeStarted) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeResumeFinished) HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadSuspended) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )( ICorProfilerCallback11 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RuntimeThreadResumed) HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )( ICorProfilerCallback11 * This, /* [in] */ ThreadID threadId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, MovedReferences) HRESULT ( STDMETHODCALLTYPE *MovedReferences )( ICorProfilerCallback11 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -8603,17 +9600,20 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectAllocated) HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )( ICorProfilerCallback11 * This, /* [in] */ ObjectID objectId, /* [in] */ ClassID classId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectsAllocatedByClass) HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )( ICorProfilerCallback11 * This, /* [in] */ ULONG cClassCount, /* [size_is][in] */ ClassID classIds[ ], /* [size_is][in] */ ULONG cObjects[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ObjectReferences) HRESULT ( STDMETHODCALLTYPE *ObjectReferences )( ICorProfilerCallback11 * This, /* [in] */ ObjectID objectId, @@ -8621,63 +9621,79 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [in] */ ULONG cObjectRefs, /* [size_is][in] */ ObjectID objectRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, RootReferences) HRESULT ( STDMETHODCALLTYPE *RootReferences )( ICorProfilerCallback11 * This, /* [in] */ ULONG cRootRefs, /* [size_is][in] */ ObjectID rootRefIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionThrown) HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )( ICorProfilerCallback11 * This, /* [in] */ ObjectID thrownObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchFilterLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionSearchCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )( ICorProfilerCallback11 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionOSHandlerLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )( ICorProfilerCallback11 * This, /* [in] */ UINT_PTR __unused); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFunctionLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionUnwindFinallyLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherEnter) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, /* [in] */ ObjectID objectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCatcherLeave) HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableCreated) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )( ICorProfilerCallback11 * This, /* [in] */ ClassID wrappedClassId, @@ -8685,18 +9701,22 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [in] */ void *pVTable, /* [in] */ ULONG cSlots); + DECLSPEC_XFGVIRT(ICorProfilerCallback, COMClassicVTableDestroyed) HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )( ICorProfilerCallback11 * This, /* [in] */ ClassID wrappedClassId, /* [in] */ REFGUID implementedIID, /* [in] */ void *pVTable); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherFound) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback, ExceptionCLRCatcherExecute) HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, ThreadNameChanged) HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )( ICorProfilerCallback11 * This, /* [in] */ ThreadID threadId, @@ -8704,26 +9724,31 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [annotation][in] */ _In_reads_opt_(cchName) WCHAR name[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionStarted) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )( ICorProfilerCallback11 * This, /* [in] */ int cGenerations, /* [size_is][in] */ BOOL generationCollected[ ], /* [in] */ COR_PRF_GC_REASON reason); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, SurvivingReferences) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )( ICorProfilerCallback11 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, GarbageCollectionFinished) HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, FinalizeableObjectQueued) HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )( ICorProfilerCallback11 * This, /* [in] */ DWORD finalizerFlags, /* [in] */ ObjectID objectID); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, RootReferences2) HRESULT ( STDMETHODCALLTYPE *RootReferences2 )( ICorProfilerCallback11 * This, /* [in] */ ULONG cRootRefs, @@ -8732,39 +9757,47 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ], /* [size_is][in] */ UINT_PTR rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleCreated) HRESULT ( STDMETHODCALLTYPE *HandleCreated )( ICorProfilerCallback11 * This, /* [in] */ GCHandleID handleId, /* [in] */ ObjectID initialObjectId); + DECLSPEC_XFGVIRT(ICorProfilerCallback2, HandleDestroyed) HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )( ICorProfilerCallback11 * This, /* [in] */ GCHandleID handleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, InitializeForAttach) HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )( ICorProfilerCallback11 * This, /* [in] */ IUnknown *pCorProfilerInfoUnk, /* [in] */ void *pvClientData, /* [in] */ UINT cbClientData); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerAttachComplete) HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback3, ProfilerDetachSucceeded) HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )( ICorProfilerCallback11 * This); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, /* [in] */ ReJITID rejitId, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, GetReJITParameters) HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )( ICorProfilerCallback11 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodId, /* [in] */ ICorProfilerFunctionControl *pFunctionControl); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, @@ -8772,6 +9805,7 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, ReJITError) HRESULT ( STDMETHODCALLTYPE *ReJITError )( ICorProfilerCallback11 * This, /* [in] */ ModuleID moduleId, @@ -8779,6 +9813,7 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, MovedReferences2) HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )( ICorProfilerCallback11 * This, /* [in] */ ULONG cMovedObjectIDRanges, @@ -8786,12 +9821,14 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback4, SurvivingReferences2) HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )( ICorProfilerCallback11 * This, /* [in] */ ULONG cSurvivingObjectIDRanges, /* [size_is][in] */ ObjectID objectIDRangeStart[ ], /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback5, ConditionalWeakTableElementReferences) HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )( ICorProfilerCallback11 * This, /* [in] */ ULONG cRootRefs, @@ -8799,15 +9836,18 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [size_is][in] */ ObjectID valueRefIds[ ], /* [size_is][in] */ GCHandleID rootIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback6, GetAssemblyReferences) HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )( ICorProfilerCallback11 * This, /* [string][in] */ const WCHAR *wszAssemblyPath, /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider); + DECLSPEC_XFGVIRT(ICorProfilerCallback7, ModuleInMemorySymbolsUpdated) HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )( ICorProfilerCallback11 * This, ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerCallback8, DynamicMethodJITCompilationStarted) HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, @@ -8815,16 +9855,19 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [in] */ LPCBYTE pILHeader, /* [in] */ ULONG cbILHeader); + DECLSPEC_XFGVIRT(ICorProfilerCallback8, DynamicMethodJITCompilationFinished) HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId, /* [in] */ HRESULT hrStatus, /* [in] */ BOOL fIsSafeToBlock); + DECLSPEC_XFGVIRT(ICorProfilerCallback9, DynamicMethodUnloaded) HRESULT ( STDMETHODCALLTYPE *DynamicMethodUnloaded )( ICorProfilerCallback11 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerCallback10, EventPipeEventDelivered) HRESULT ( STDMETHODCALLTYPE *EventPipeEventDelivered )( ICorProfilerCallback11 * This, /* [in] */ EVENTPIPE_PROVIDER provider, @@ -8840,10 +9883,12 @@ EXTERN_C const IID IID_ICorProfilerCallback11; /* [in] */ ULONG numStackFrames, /* [length_is][in] */ UINT_PTR stackFrames[ ]); + DECLSPEC_XFGVIRT(ICorProfilerCallback10, EventPipeProviderCreated) HRESULT ( STDMETHODCALLTYPE *EventPipeProviderCreated )( ICorProfilerCallback11 * This, /* [in] */ EVENTPIPE_PROVIDER provider); + DECLSPEC_XFGVIRT(ICorProfilerCallback11, LoadAsNotificationOnly) HRESULT ( STDMETHODCALLTYPE *LoadAsNotificationOnly )( ICorProfilerCallback11 * This, BOOL *pbNotificationOnly); @@ -8861,320 +9906,320 @@ EXTERN_C const IID IID_ICorProfilerCallback11; #ifdef COBJMACROS -#define ICorProfilerCallback11_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerCallback11_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerCallback11_AddRef(This) \ +#define ICorProfilerCallback11_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerCallback11_Release(This) \ +#define ICorProfilerCallback11_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerCallback11_Initialize(This,pICorProfilerInfoUnk) \ +#define ICorProfilerCallback11_Initialize(This,pICorProfilerInfoUnk) \ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) ) -#define ICorProfilerCallback11_Shutdown(This) \ +#define ICorProfilerCallback11_Shutdown(This) \ ( (This)->lpVtbl -> Shutdown(This) ) -#define ICorProfilerCallback11_AppDomainCreationStarted(This,appDomainId) \ +#define ICorProfilerCallback11_AppDomainCreationStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) ) -#define ICorProfilerCallback11_AppDomainCreationFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback11_AppDomainCreationFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback11_AppDomainShutdownStarted(This,appDomainId) \ +#define ICorProfilerCallback11_AppDomainShutdownStarted(This,appDomainId) \ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) ) -#define ICorProfilerCallback11_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ +#define ICorProfilerCallback11_AppDomainShutdownFinished(This,appDomainId,hrStatus) \ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) ) -#define ICorProfilerCallback11_AssemblyLoadStarted(This,assemblyId) \ +#define ICorProfilerCallback11_AssemblyLoadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) ) -#define ICorProfilerCallback11_AssemblyLoadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback11_AssemblyLoadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback11_AssemblyUnloadStarted(This,assemblyId) \ +#define ICorProfilerCallback11_AssemblyUnloadStarted(This,assemblyId) \ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) ) -#define ICorProfilerCallback11_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ +#define ICorProfilerCallback11_AssemblyUnloadFinished(This,assemblyId,hrStatus) \ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) ) -#define ICorProfilerCallback11_ModuleLoadStarted(This,moduleId) \ +#define ICorProfilerCallback11_ModuleLoadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) ) -#define ICorProfilerCallback11_ModuleLoadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback11_ModuleLoadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback11_ModuleUnloadStarted(This,moduleId) \ +#define ICorProfilerCallback11_ModuleUnloadStarted(This,moduleId) \ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) ) -#define ICorProfilerCallback11_ModuleUnloadFinished(This,moduleId,hrStatus) \ +#define ICorProfilerCallback11_ModuleUnloadFinished(This,moduleId,hrStatus) \ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) ) -#define ICorProfilerCallback11_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ +#define ICorProfilerCallback11_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) ) -#define ICorProfilerCallback11_ClassLoadStarted(This,classId) \ +#define ICorProfilerCallback11_ClassLoadStarted(This,classId) \ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) ) -#define ICorProfilerCallback11_ClassLoadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback11_ClassLoadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback11_ClassUnloadStarted(This,classId) \ +#define ICorProfilerCallback11_ClassUnloadStarted(This,classId) \ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) ) -#define ICorProfilerCallback11_ClassUnloadFinished(This,classId,hrStatus) \ +#define ICorProfilerCallback11_ClassUnloadFinished(This,classId,hrStatus) \ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) ) -#define ICorProfilerCallback11_FunctionUnloadStarted(This,functionId) \ +#define ICorProfilerCallback11_FunctionUnloadStarted(This,functionId) \ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) ) -#define ICorProfilerCallback11_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ +#define ICorProfilerCallback11_JITCompilationStarted(This,functionId,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) ) -#define ICorProfilerCallback11_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback11_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback11_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ +#define ICorProfilerCallback11_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) ) -#define ICorProfilerCallback11_JITCachedFunctionSearchFinished(This,functionId,result) \ +#define ICorProfilerCallback11_JITCachedFunctionSearchFinished(This,functionId,result) \ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) ) -#define ICorProfilerCallback11_JITFunctionPitched(This,functionId) \ +#define ICorProfilerCallback11_JITFunctionPitched(This,functionId) \ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) ) -#define ICorProfilerCallback11_JITInlining(This,callerId,calleeId,pfShouldInline) \ +#define ICorProfilerCallback11_JITInlining(This,callerId,calleeId,pfShouldInline) \ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) ) -#define ICorProfilerCallback11_ThreadCreated(This,threadId) \ +#define ICorProfilerCallback11_ThreadCreated(This,threadId) \ ( (This)->lpVtbl -> ThreadCreated(This,threadId) ) -#define ICorProfilerCallback11_ThreadDestroyed(This,threadId) \ +#define ICorProfilerCallback11_ThreadDestroyed(This,threadId) \ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) ) -#define ICorProfilerCallback11_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ +#define ICorProfilerCallback11_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) ) -#define ICorProfilerCallback11_RemotingClientInvocationStarted(This) \ +#define ICorProfilerCallback11_RemotingClientInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) ) -#define ICorProfilerCallback11_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback11_RemotingClientSendingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback11_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback11_RemotingClientReceivingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback11_RemotingClientInvocationFinished(This) \ +#define ICorProfilerCallback11_RemotingClientInvocationFinished(This) \ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) ) -#define ICorProfilerCallback11_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback11_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback11_RemotingServerInvocationStarted(This) \ +#define ICorProfilerCallback11_RemotingServerInvocationStarted(This) \ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) ) -#define ICorProfilerCallback11_RemotingServerInvocationReturned(This) \ +#define ICorProfilerCallback11_RemotingServerInvocationReturned(This) \ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) ) -#define ICorProfilerCallback11_RemotingServerSendingReply(This,pCookie,fIsAsync) \ +#define ICorProfilerCallback11_RemotingServerSendingReply(This,pCookie,fIsAsync) \ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) ) -#define ICorProfilerCallback11_UnmanagedToManagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback11_UnmanagedToManagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback11_ManagedToUnmanagedTransition(This,functionId,reason) \ +#define ICorProfilerCallback11_ManagedToUnmanagedTransition(This,functionId,reason) \ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) ) -#define ICorProfilerCallback11_RuntimeSuspendStarted(This,suspendReason) \ +#define ICorProfilerCallback11_RuntimeSuspendStarted(This,suspendReason) \ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) ) -#define ICorProfilerCallback11_RuntimeSuspendFinished(This) \ +#define ICorProfilerCallback11_RuntimeSuspendFinished(This) \ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) ) -#define ICorProfilerCallback11_RuntimeSuspendAborted(This) \ +#define ICorProfilerCallback11_RuntimeSuspendAborted(This) \ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) ) -#define ICorProfilerCallback11_RuntimeResumeStarted(This) \ +#define ICorProfilerCallback11_RuntimeResumeStarted(This) \ ( (This)->lpVtbl -> RuntimeResumeStarted(This) ) -#define ICorProfilerCallback11_RuntimeResumeFinished(This) \ +#define ICorProfilerCallback11_RuntimeResumeFinished(This) \ ( (This)->lpVtbl -> RuntimeResumeFinished(This) ) -#define ICorProfilerCallback11_RuntimeThreadSuspended(This,threadId) \ +#define ICorProfilerCallback11_RuntimeThreadSuspended(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) ) -#define ICorProfilerCallback11_RuntimeThreadResumed(This,threadId) \ +#define ICorProfilerCallback11_RuntimeThreadResumed(This,threadId) \ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) ) -#define ICorProfilerCallback11_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback11_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback11_ObjectAllocated(This,objectId,classId) \ +#define ICorProfilerCallback11_ObjectAllocated(This,objectId,classId) \ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) ) -#define ICorProfilerCallback11_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ +#define ICorProfilerCallback11_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) ) -#define ICorProfilerCallback11_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ +#define ICorProfilerCallback11_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) ) -#define ICorProfilerCallback11_RootReferences(This,cRootRefs,rootRefIds) \ +#define ICorProfilerCallback11_RootReferences(This,cRootRefs,rootRefIds) \ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) ) -#define ICorProfilerCallback11_ExceptionThrown(This,thrownObjectId) \ +#define ICorProfilerCallback11_ExceptionThrown(This,thrownObjectId) \ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) ) -#define ICorProfilerCallback11_ExceptionSearchFunctionEnter(This,functionId) \ +#define ICorProfilerCallback11_ExceptionSearchFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) ) -#define ICorProfilerCallback11_ExceptionSearchFunctionLeave(This) \ +#define ICorProfilerCallback11_ExceptionSearchFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) ) -#define ICorProfilerCallback11_ExceptionSearchFilterEnter(This,functionId) \ +#define ICorProfilerCallback11_ExceptionSearchFilterEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) ) -#define ICorProfilerCallback11_ExceptionSearchFilterLeave(This) \ +#define ICorProfilerCallback11_ExceptionSearchFilterLeave(This) \ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) ) -#define ICorProfilerCallback11_ExceptionSearchCatcherFound(This,functionId) \ +#define ICorProfilerCallback11_ExceptionSearchCatcherFound(This,functionId) \ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) ) -#define ICorProfilerCallback11_ExceptionOSHandlerEnter(This,__unused) \ +#define ICorProfilerCallback11_ExceptionOSHandlerEnter(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) ) -#define ICorProfilerCallback11_ExceptionOSHandlerLeave(This,__unused) \ +#define ICorProfilerCallback11_ExceptionOSHandlerLeave(This,__unused) \ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) ) -#define ICorProfilerCallback11_ExceptionUnwindFunctionEnter(This,functionId) \ +#define ICorProfilerCallback11_ExceptionUnwindFunctionEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) ) -#define ICorProfilerCallback11_ExceptionUnwindFunctionLeave(This) \ +#define ICorProfilerCallback11_ExceptionUnwindFunctionLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) ) -#define ICorProfilerCallback11_ExceptionUnwindFinallyEnter(This,functionId) \ +#define ICorProfilerCallback11_ExceptionUnwindFinallyEnter(This,functionId) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) ) -#define ICorProfilerCallback11_ExceptionUnwindFinallyLeave(This) \ +#define ICorProfilerCallback11_ExceptionUnwindFinallyLeave(This) \ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) ) -#define ICorProfilerCallback11_ExceptionCatcherEnter(This,functionId,objectId) \ +#define ICorProfilerCallback11_ExceptionCatcherEnter(This,functionId,objectId) \ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) ) -#define ICorProfilerCallback11_ExceptionCatcherLeave(This) \ +#define ICorProfilerCallback11_ExceptionCatcherLeave(This) \ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) ) -#define ICorProfilerCallback11_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ +#define ICorProfilerCallback11_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) ) -#define ICorProfilerCallback11_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ +#define ICorProfilerCallback11_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) ) -#define ICorProfilerCallback11_ExceptionCLRCatcherFound(This) \ +#define ICorProfilerCallback11_ExceptionCLRCatcherFound(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) ) -#define ICorProfilerCallback11_ExceptionCLRCatcherExecute(This) \ +#define ICorProfilerCallback11_ExceptionCLRCatcherExecute(This) \ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) ) -#define ICorProfilerCallback11_ThreadNameChanged(This,threadId,cchName,name) \ +#define ICorProfilerCallback11_ThreadNameChanged(This,threadId,cchName,name) \ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) ) -#define ICorProfilerCallback11_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ +#define ICorProfilerCallback11_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) ) -#define ICorProfilerCallback11_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback11_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback11_GarbageCollectionFinished(This) \ +#define ICorProfilerCallback11_GarbageCollectionFinished(This) \ ( (This)->lpVtbl -> GarbageCollectionFinished(This) ) -#define ICorProfilerCallback11_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ +#define ICorProfilerCallback11_FinalizeableObjectQueued(This,finalizerFlags,objectID) \ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) ) -#define ICorProfilerCallback11_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ +#define ICorProfilerCallback11_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) ) -#define ICorProfilerCallback11_HandleCreated(This,handleId,initialObjectId) \ +#define ICorProfilerCallback11_HandleCreated(This,handleId,initialObjectId) \ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) ) -#define ICorProfilerCallback11_HandleDestroyed(This,handleId) \ +#define ICorProfilerCallback11_HandleDestroyed(This,handleId) \ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) ) -#define ICorProfilerCallback11_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ +#define ICorProfilerCallback11_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) ) -#define ICorProfilerCallback11_ProfilerAttachComplete(This) \ +#define ICorProfilerCallback11_ProfilerAttachComplete(This) \ ( (This)->lpVtbl -> ProfilerAttachComplete(This) ) -#define ICorProfilerCallback11_ProfilerDetachSucceeded(This) \ +#define ICorProfilerCallback11_ProfilerDetachSucceeded(This) \ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) ) -#define ICorProfilerCallback11_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ +#define ICorProfilerCallback11_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) ) -#define ICorProfilerCallback11_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ +#define ICorProfilerCallback11_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) ) -#define ICorProfilerCallback11_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback11_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback11_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ +#define ICorProfilerCallback11_ReJITError(This,moduleId,methodId,functionId,hrStatus) \ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) ) -#define ICorProfilerCallback11_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback11_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback11_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ +#define ICorProfilerCallback11_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) ) -#define ICorProfilerCallback11_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ +#define ICorProfilerCallback11_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \ ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) ) -#define ICorProfilerCallback11_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ +#define ICorProfilerCallback11_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \ ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) ) -#define ICorProfilerCallback11_ModuleInMemorySymbolsUpdated(This,moduleId) \ +#define ICorProfilerCallback11_ModuleInMemorySymbolsUpdated(This,moduleId) \ ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) ) -#define ICorProfilerCallback11_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \ +#define ICorProfilerCallback11_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \ ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) ) -#define ICorProfilerCallback11_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ +#define ICorProfilerCallback11_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \ ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) ) -#define ICorProfilerCallback11_DynamicMethodUnloaded(This,functionId) \ +#define ICorProfilerCallback11_DynamicMethodUnloaded(This,functionId) \ ( (This)->lpVtbl -> DynamicMethodUnloaded(This,functionId) ) -#define ICorProfilerCallback11_EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames) \ +#define ICorProfilerCallback11_EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames) \ ( (This)->lpVtbl -> EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames) ) -#define ICorProfilerCallback11_EventPipeProviderCreated(This,provider) \ +#define ICorProfilerCallback11_EventPipeProviderCreated(This,provider) \ ( (This)->lpVtbl -> EventPipeProviderCreated(This,provider) ) -#define ICorProfilerCallback11_LoadAsNotificationOnly(This,pbNotificationOnly) \ +#define ICorProfilerCallback11_LoadAsNotificationOnly(This,pbNotificationOnly) \ ( (This)->lpVtbl -> LoadAsNotificationOnly(This,pbNotificationOnly) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerCallback11_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerCallback11_INTERFACE_DEFINED__ */ /* interface __MIDL_itf_corprof_0000_0011 */ @@ -9183,9 +10228,10 @@ EXTERN_C const IID IID_ICorProfilerCallback11; typedef /* [public] */ enum __MIDL___MIDL_itf_corprof_0000_0011_0001 { - COR_PRF_CODEGEN_DISABLE_INLINING = 0x1, - COR_PRF_CODEGEN_DISABLE_ALL_OPTIMIZATIONS = 0x2 - } COR_PRF_CODEGEN_FLAGS; + COR_PRF_CODEGEN_DISABLE_INLINING = 0x1, + COR_PRF_CODEGEN_DISABLE_ALL_OPTIMIZATIONS = 0x2, + COR_PRF_CODEGEN_DEBUG_INFO = 0x3 + } COR_PRF_CODEGEN_FLAGS; @@ -9366,66 +10412,78 @@ EXTERN_C const IID IID_ICorProfilerInfo; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfoVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo * This, /* [in] */ ClassID classId, @@ -9433,21 +10491,25 @@ EXTERN_C const IID IID_ICorProfilerInfo; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo * This, /* [in] */ FunctionID functionId, @@ -9455,20 +10517,24 @@ EXTERN_C const IID IID_ICorProfilerInfo; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo * This, /* [in] */ FunctionID functionId, @@ -9476,6 +10542,7 @@ EXTERN_C const IID IID_ICorProfilerInfo; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo * This, /* [in] */ ModuleID moduleId, @@ -9486,6 +10553,7 @@ EXTERN_C const IID IID_ICorProfilerInfo; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo * This, /* [in] */ ModuleID moduleId, @@ -9493,6 +10561,7 @@ EXTERN_C const IID IID_ICorProfilerInfo; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo * This, /* [in] */ ModuleID moduleId, @@ -9500,17 +10569,20 @@ EXTERN_C const IID IID_ICorProfilerInfo; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo * This, /* [in] */ AppDomainID appDomainId, @@ -9520,6 +10592,7 @@ EXTERN_C const IID IID_ICorProfilerInfo; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo * This, /* [in] */ AssemblyID assemblyId, @@ -9530,13 +10603,16 @@ EXTERN_C const IID IID_ICorProfilerInfo; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo * This, /* [in] */ FunctionID functionId, @@ -9544,28 +10620,34 @@ EXTERN_C const IID IID_ICorProfilerInfo; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo * This, /* [in] */ FunctionID functionId, @@ -9586,124 +10668,124 @@ EXTERN_C const IID IID_ICorProfilerInfo; #ifdef COBJMACROS -#define ICorProfilerInfo_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo_AddRef(This) \ +#define ICorProfilerInfo_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo_Release(This) \ +#define ICorProfilerInfo_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo_ForceGC(This) \ +#define ICorProfilerInfo_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo2_INTERFACE_DEFINED__ @@ -9848,66 +10930,78 @@ EXTERN_C const IID IID_ICorProfilerInfo2; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo2Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo2 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo2 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo2 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo2 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo2 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo2 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo2 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo2 * This, /* [in] */ ClassID classId, @@ -9915,21 +11009,25 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo2 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo2 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo2 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo2 * This, /* [in] */ FunctionID functionId, @@ -9937,20 +11035,24 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo2 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo2 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo2 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo2 * This, /* [in] */ FunctionID functionId, @@ -9958,6 +11060,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleId, @@ -9968,6 +11071,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleId, @@ -9975,6 +11079,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleId, @@ -9982,17 +11087,20 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo2 * This, /* [in] */ AppDomainID appDomainId, @@ -10002,6 +11110,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo2 * This, /* [in] */ AssemblyID assemblyId, @@ -10012,13 +11121,16 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo2 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo2 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo2 * This, /* [in] */ FunctionID functionId, @@ -10026,28 +11138,34 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo2 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo2 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo2 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo2 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo2 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo2 * This, /* [in] */ FunctionID functionId, @@ -10055,6 +11173,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo2 * This, /* [in] */ ThreadID thread, @@ -10064,12 +11183,14 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo2 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo2 * This, /* [in] */ FunctionID funcId, @@ -10081,12 +11202,14 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo2 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo2 * This, /* [in] */ ClassID classID, @@ -10095,6 +11218,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo2 * This, /* [in] */ ClassID classId, @@ -10105,6 +11229,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo2 * This, /* [in] */ FunctionID functionID, @@ -10112,6 +11237,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleID, @@ -10120,6 +11246,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleID, @@ -10129,11 +11256,13 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo2 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo2 * This, /* [in] */ ObjectID objectId, @@ -10142,22 +11271,26 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo2 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo2 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo2 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo2 * This, /* [in] */ ClassID classId, @@ -10165,6 +11298,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo2 * This, /* [in] */ ClassID classId, @@ -10172,6 +11306,7 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo2 * This, /* [in] */ ClassID classId, @@ -10179,23 +11314,27 @@ EXTERN_C const IID IID_ICorProfilerInfo2; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo2 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo2 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo2 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo2 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); @@ -10213,188 +11352,188 @@ EXTERN_C const IID IID_ICorProfilerInfo2; #ifdef COBJMACROS -#define ICorProfilerInfo2_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo2_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo2_AddRef(This) \ +#define ICorProfilerInfo2_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo2_Release(This) \ +#define ICorProfilerInfo2_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo2_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo2_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo2_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo2_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo2_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo2_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo2_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo2_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo2_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo2_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo2_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo2_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo2_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo2_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo2_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo2_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo2_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo2_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo2_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo2_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo2_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo2_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo2_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo2_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo2_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo2_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo2_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo2_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo2_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo2_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo2_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo2_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo2_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo2_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo2_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo2_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo2_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo2_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo2_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo2_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo2_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo2_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo2_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo2_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo2_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo2_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo2_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo2_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo2_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo2_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo2_ForceGC(This) \ +#define ICorProfilerInfo2_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo2_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo2_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo2_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo2_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo2_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo2_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo2_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo2_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo2_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo2_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo2_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo2_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo2_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo2_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo2_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo2_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo2_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo2_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo2_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo2_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo2_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo2_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo2_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo2_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo2_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo2_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo2_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo2_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo2_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo2_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo2_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo2_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo2_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo2_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo2_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo2_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo2_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo2_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo2_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo2_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo2_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo2_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo2_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo2_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo2_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo2_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo2_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo2_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo2_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo2_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo2_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo2_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo2_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo2_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo2_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo2_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo2_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo2_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo3_INTERFACE_DEFINED__ @@ -10495,66 +11634,78 @@ EXTERN_C const IID IID_ICorProfilerInfo3; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo3Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo3 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo3 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo3 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo3 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo3 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo3 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, @@ -10562,21 +11713,25 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo3 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo3 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionId, @@ -10584,20 +11739,24 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo3 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo3 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo3 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionId, @@ -10605,6 +11764,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleId, @@ -10615,6 +11775,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleId, @@ -10622,6 +11783,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleId, @@ -10629,17 +11791,20 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo3 * This, /* [in] */ AppDomainID appDomainId, @@ -10649,6 +11814,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo3 * This, /* [in] */ AssemblyID assemblyId, @@ -10659,13 +11825,16 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo3 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionId, @@ -10673,28 +11842,34 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo3 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo3 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo3 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo3 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo3 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionId, @@ -10702,6 +11877,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo3 * This, /* [in] */ ThreadID thread, @@ -10711,12 +11887,14 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo3 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo3 * This, /* [in] */ FunctionID funcId, @@ -10728,12 +11906,14 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo3 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo3 * This, /* [in] */ ClassID classID, @@ -10742,6 +11922,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, @@ -10752,6 +11933,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionID, @@ -10759,6 +11941,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleID, @@ -10767,6 +11950,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleID, @@ -10776,11 +11960,13 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo3 * This, /* [in] */ ObjectID objectId, @@ -10789,22 +11975,26 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo3 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, @@ -10812,6 +12002,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, @@ -10819,6 +12010,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, @@ -10826,57 +12018,68 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo3 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo3 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo3 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo3 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo3 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo3 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo3 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo3 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo3 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionId, @@ -10885,6 +12088,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionId, @@ -10892,16 +12096,19 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo3 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo3 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo3 * This, /* [out] */ USHORT *pClrInstanceId, @@ -10915,6 +12122,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo3 * This, /* [in] */ ClassID classId, @@ -10923,6 +12131,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleId, @@ -10930,6 +12139,7 @@ EXTERN_C const IID IID_ICorProfilerInfo3; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo3 * This, /* [in] */ ModuleID moduleId, @@ -10954,231 +12164,231 @@ EXTERN_C const IID IID_ICorProfilerInfo3; #ifdef COBJMACROS -#define ICorProfilerInfo3_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo3_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo3_AddRef(This) \ +#define ICorProfilerInfo3_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo3_Release(This) \ +#define ICorProfilerInfo3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo3_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo3_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo3_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo3_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo3_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo3_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo3_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo3_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo3_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo3_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo3_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo3_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo3_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo3_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo3_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo3_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo3_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo3_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo3_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo3_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo3_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo3_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo3_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo3_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo3_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo3_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo3_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo3_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo3_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo3_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo3_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo3_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo3_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo3_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo3_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo3_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo3_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo3_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo3_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo3_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo3_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo3_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo3_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo3_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo3_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo3_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo3_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo3_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo3_ForceGC(This) \ +#define ICorProfilerInfo3_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo3_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo3_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo3_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo3_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo3_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo3_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo3_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo3_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo3_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo3_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo3_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo3_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo3_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo3_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo3_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo3_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo3_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo3_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo3_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo3_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo3_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo3_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo3_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo3_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo3_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo3_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo3_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo3_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo3_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo3_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo3_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo3_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo3_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo3_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo3_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo3_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo3_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo3_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo3_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo3_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo3_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo3_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo3_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo3_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo3_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo3_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo3_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo3_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo3_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo3_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo3_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo3_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo3_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo3_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo3_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo3_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo3_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo3_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo3_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo3_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo3_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo3_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo3_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo3_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo3_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo3_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo3_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo3_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo3_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo3_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo3_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo3_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo3_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo3_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo3_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo3_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo3_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo3_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo3_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo3_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerObjectEnum_INTERFACE_DEFINED__ @@ -11215,39 +12425,47 @@ EXTERN_C const IID IID_ICorProfilerObjectEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerObjectEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerObjectEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerObjectEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerObjectEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerObjectEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorProfilerObjectEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorProfilerObjectEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorProfilerObjectEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerObjectEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorProfilerObjectEnum * This, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerObjectEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorProfilerObjectEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorProfilerObjectEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorProfilerObjectEnum * This, /* [in] */ ULONG celt, @@ -11267,40 +12485,40 @@ EXTERN_C const IID IID_ICorProfilerObjectEnum; #ifdef COBJMACROS -#define ICorProfilerObjectEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerObjectEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerObjectEnum_AddRef(This) \ +#define ICorProfilerObjectEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerObjectEnum_Release(This) \ +#define ICorProfilerObjectEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerObjectEnum_Skip(This,celt) \ +#define ICorProfilerObjectEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorProfilerObjectEnum_Reset(This) \ +#define ICorProfilerObjectEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorProfilerObjectEnum_Clone(This,ppEnum) \ +#define ICorProfilerObjectEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorProfilerObjectEnum_GetCount(This,pcelt) \ +#define ICorProfilerObjectEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorProfilerObjectEnum_Next(This,celt,objects,pceltFetched) \ +#define ICorProfilerObjectEnum_Next(This,celt,objects,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerObjectEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerObjectEnum_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerFunctionEnum_INTERFACE_DEFINED__ @@ -11337,39 +12555,47 @@ EXTERN_C const IID IID_ICorProfilerFunctionEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerFunctionEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerFunctionEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerFunctionEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerFunctionEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerFunctionEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorProfilerFunctionEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorProfilerFunctionEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorProfilerFunctionEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerFunctionEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorProfilerFunctionEnum * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerFunctionEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorProfilerFunctionEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorProfilerFunctionEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorProfilerFunctionEnum * This, /* [in] */ ULONG celt, @@ -11389,40 +12615,40 @@ EXTERN_C const IID IID_ICorProfilerFunctionEnum; #ifdef COBJMACROS -#define ICorProfilerFunctionEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerFunctionEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerFunctionEnum_AddRef(This) \ +#define ICorProfilerFunctionEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerFunctionEnum_Release(This) \ +#define ICorProfilerFunctionEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerFunctionEnum_Skip(This,celt) \ +#define ICorProfilerFunctionEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorProfilerFunctionEnum_Reset(This) \ +#define ICorProfilerFunctionEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorProfilerFunctionEnum_Clone(This,ppEnum) \ +#define ICorProfilerFunctionEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorProfilerFunctionEnum_GetCount(This,pcelt) \ +#define ICorProfilerFunctionEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorProfilerFunctionEnum_Next(This,celt,ids,pceltFetched) \ +#define ICorProfilerFunctionEnum_Next(This,celt,ids,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,ids,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerFunctionEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerFunctionEnum_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerModuleEnum_INTERFACE_DEFINED__ @@ -11459,39 +12685,47 @@ EXTERN_C const IID IID_ICorProfilerModuleEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerModuleEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerModuleEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerModuleEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerModuleEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerModuleEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorProfilerModuleEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorProfilerModuleEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorProfilerModuleEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerModuleEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorProfilerModuleEnum * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerModuleEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorProfilerModuleEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorProfilerModuleEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorProfilerModuleEnum * This, /* [in] */ ULONG celt, @@ -11511,40 +12745,40 @@ EXTERN_C const IID IID_ICorProfilerModuleEnum; #ifdef COBJMACROS -#define ICorProfilerModuleEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerModuleEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerModuleEnum_AddRef(This) \ +#define ICorProfilerModuleEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerModuleEnum_Release(This) \ +#define ICorProfilerModuleEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerModuleEnum_Skip(This,celt) \ +#define ICorProfilerModuleEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorProfilerModuleEnum_Reset(This) \ +#define ICorProfilerModuleEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorProfilerModuleEnum_Clone(This,ppEnum) \ +#define ICorProfilerModuleEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorProfilerModuleEnum_GetCount(This,pcelt) \ +#define ICorProfilerModuleEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorProfilerModuleEnum_Next(This,celt,ids,pceltFetched) \ +#define ICorProfilerModuleEnum_Next(This,celt,ids,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,ids,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerModuleEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerModuleEnum_INTERFACE_DEFINED__ */ #ifndef __IMethodMalloc_INTERFACE_DEFINED__ @@ -11568,24 +12802,28 @@ EXTERN_C const IID IID_IMethodMalloc; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct IMethodMallocVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( IMethodMalloc * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( IMethodMalloc * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( IMethodMalloc * This); + DECLSPEC_XFGVIRT(IMethodMalloc, Alloc) PVOID ( STDMETHODCALLTYPE *Alloc )( IMethodMalloc * This, /* [in] */ ULONG cb); @@ -11603,28 +12841,28 @@ EXTERN_C const IID IID_IMethodMalloc; #ifdef COBJMACROS -#define IMethodMalloc_QueryInterface(This,riid,ppvObject) \ +#define IMethodMalloc_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define IMethodMalloc_AddRef(This) \ +#define IMethodMalloc_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define IMethodMalloc_Release(This) \ +#define IMethodMalloc_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define IMethodMalloc_Alloc(This,cb) \ +#define IMethodMalloc_Alloc(This,cb) \ ( (This)->lpVtbl -> Alloc(This,cb) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __IMethodMalloc_INTERFACE_DEFINED__ */ +#endif /* __IMethodMalloc_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerFunctionControl_INTERFACE_DEFINED__ @@ -11656,33 +12894,39 @@ EXTERN_C const IID IID_ICorProfilerFunctionControl; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerFunctionControlVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerFunctionControl * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerFunctionControl * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerFunctionControl * This); + DECLSPEC_XFGVIRT(ICorProfilerFunctionControl, SetCodegenFlags) HRESULT ( STDMETHODCALLTYPE *SetCodegenFlags )( ICorProfilerFunctionControl * This, /* [in] */ DWORD flags); + DECLSPEC_XFGVIRT(ICorProfilerFunctionControl, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerFunctionControl * This, /* [in] */ ULONG cbNewILMethodHeader, /* [size_is][in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerFunctionControl, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerFunctionControl * This, /* [in] */ ULONG cILMapEntries, @@ -11701,34 +12945,34 @@ EXTERN_C const IID IID_ICorProfilerFunctionControl; #ifdef COBJMACROS -#define ICorProfilerFunctionControl_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerFunctionControl_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerFunctionControl_AddRef(This) \ +#define ICorProfilerFunctionControl_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerFunctionControl_Release(This) \ +#define ICorProfilerFunctionControl_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerFunctionControl_SetCodegenFlags(This,flags) \ +#define ICorProfilerFunctionControl_SetCodegenFlags(This,flags) \ ( (This)->lpVtbl -> SetCodegenFlags(This,flags) ) -#define ICorProfilerFunctionControl_SetILFunctionBody(This,cbNewILMethodHeader,pbNewILMethodHeader) \ +#define ICorProfilerFunctionControl_SetILFunctionBody(This,cbNewILMethodHeader,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,cbNewILMethodHeader,pbNewILMethodHeader) ) -#define ICorProfilerFunctionControl_SetILInstrumentedCodeMap(This,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerFunctionControl_SetILInstrumentedCodeMap(This,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,cILMapEntries,rgILMapEntries) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerFunctionControl_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerFunctionControl_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo4_INTERFACE_DEFINED__ @@ -11797,66 +13041,78 @@ EXTERN_C const IID IID_ICorProfilerInfo4; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo4Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo4 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo4 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo4 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo4 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo4 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo4 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo4 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo4 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, @@ -11864,21 +13120,25 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo4 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo4 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, @@ -11886,20 +13146,24 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo4 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo4 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo4 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, @@ -11907,6 +13171,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleId, @@ -11917,6 +13182,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleId, @@ -11924,6 +13190,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleId, @@ -11931,17 +13198,20 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo4 * This, /* [in] */ AppDomainID appDomainId, @@ -11951,6 +13221,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo4 * This, /* [in] */ AssemblyID assemblyId, @@ -11961,13 +13232,16 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo4 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, @@ -11975,28 +13249,34 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo4 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo4 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo4 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo4 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo4 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, @@ -12004,6 +13284,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo4 * This, /* [in] */ ThreadID thread, @@ -12013,12 +13294,14 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo4 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo4 * This, /* [in] */ FunctionID funcId, @@ -12030,12 +13313,14 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo4 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo4 * This, /* [in] */ ClassID classID, @@ -12044,6 +13329,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, @@ -12054,6 +13340,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionID, @@ -12061,6 +13348,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleID, @@ -12069,6 +13357,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleID, @@ -12078,11 +13367,13 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo4 * This, /* [in] */ ObjectID objectId, @@ -12091,22 +13382,26 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo4 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, @@ -12114,6 +13409,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, @@ -12121,6 +13417,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, @@ -12128,57 +13425,68 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo4 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo4 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo4 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo4 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo4 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo4 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo4 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo4 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo4 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, @@ -12187,6 +13495,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, @@ -12194,16 +13503,19 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo4 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo4 * This, /* [out] */ USHORT *pClrInstanceId, @@ -12217,6 +13529,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo4 * This, /* [in] */ ClassID classId, @@ -12225,6 +13538,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleId, @@ -12232,6 +13546,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo4 * This, /* [in] */ ModuleID moduleId, @@ -12243,19 +13558,23 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ AssemblyID *pAssemblyId, /* [out] */ DWORD *pdwModuleFlags); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) HRESULT ( STDMETHODCALLTYPE *EnumThreads )( ICorProfilerInfo4 * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( ICorProfilerInfo4 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( ICorProfilerInfo4 * This, /* [in] */ ULONG cFunctions, /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) HRESULT ( STDMETHODCALLTYPE *RequestRevert )( ICorProfilerInfo4 * This, /* [in] */ ULONG cFunctions, @@ -12263,6 +13582,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [size_is][in] */ mdMethodDef methodIds[ ], /* [size_is][out] */ HRESULT status[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionID, @@ -12271,12 +13591,14 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( ICorProfilerInfo4 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, @@ -12284,6 +13606,7 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ULONG *pcReJitIds, /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( ICorProfilerInfo4 * This, /* [in] */ FunctionID functionId, @@ -12292,10 +13615,12 @@ EXTERN_C const IID IID_ICorProfilerInfo4; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( ICorProfilerInfo4 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( ICorProfilerInfo4 * This, /* [in] */ ObjectID objectId, @@ -12314,262 +13639,262 @@ EXTERN_C const IID IID_ICorProfilerInfo4; #ifdef COBJMACROS -#define ICorProfilerInfo4_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo4_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo4_AddRef(This) \ +#define ICorProfilerInfo4_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo4_Release(This) \ +#define ICorProfilerInfo4_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo4_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo4_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo4_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo4_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo4_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo4_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo4_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo4_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo4_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo4_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo4_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo4_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo4_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo4_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo4_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo4_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo4_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo4_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo4_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo4_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo4_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo4_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo4_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo4_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo4_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo4_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo4_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo4_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo4_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo4_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo4_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo4_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo4_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo4_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo4_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo4_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo4_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo4_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo4_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo4_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo4_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo4_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo4_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo4_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo4_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo4_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo4_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo4_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo4_ForceGC(This) \ +#define ICorProfilerInfo4_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo4_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo4_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo4_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo4_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo4_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo4_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo4_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo4_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo4_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo4_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo4_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo4_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo4_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo4_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo4_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo4_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo4_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo4_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo4_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo4_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo4_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo4_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo4_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo4_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo4_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo4_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo4_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo4_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo4_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo4_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo4_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo4_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo4_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo4_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo4_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo4_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo4_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo4_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo4_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo4_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo4_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo4_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo4_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo4_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo4_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo4_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo4_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo4_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo4_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo4_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo4_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo4_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo4_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo4_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo4_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo4_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo4_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo4_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo4_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo4_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo4_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo4_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo4_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo4_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo4_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo4_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo4_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo4_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo4_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo4_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo4_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo4_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo4_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo4_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo4_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo4_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo4_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo4_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) -#define ICorProfilerInfo4_EnumThreads(This,ppEnum) \ +#define ICorProfilerInfo4_EnumThreads(This,ppEnum) \ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) -#define ICorProfilerInfo4_InitializeCurrentThread(This) \ +#define ICorProfilerInfo4_InitializeCurrentThread(This) \ ( (This)->lpVtbl -> InitializeCurrentThread(This) ) -#define ICorProfilerInfo4_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo4_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo4_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ +#define ICorProfilerInfo4_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) -#define ICorProfilerInfo4_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo4_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo4_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ +#define ICorProfilerInfo4_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) -#define ICorProfilerInfo4_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ +#define ICorProfilerInfo4_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) -#define ICorProfilerInfo4_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ +#define ICorProfilerInfo4_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) -#define ICorProfilerInfo4_EnumJITedFunctions2(This,ppEnum) \ +#define ICorProfilerInfo4_EnumJITedFunctions2(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) -#define ICorProfilerInfo4_GetObjectSize2(This,objectId,pcSize) \ +#define ICorProfilerInfo4_GetObjectSize2(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo4_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo4_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo5_INTERFACE_DEFINED__ @@ -12598,66 +13923,78 @@ EXTERN_C const IID IID_ICorProfilerInfo5; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo5Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo5 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo5 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo5 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo5 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo5 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo5 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo5 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo5 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, @@ -12665,21 +14002,25 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo5 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo5 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, @@ -12687,20 +14028,24 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo5 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo5 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo5 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, @@ -12708,6 +14053,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleId, @@ -12718,6 +14064,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleId, @@ -12725,6 +14072,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleId, @@ -12732,17 +14080,20 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo5 * This, /* [in] */ AppDomainID appDomainId, @@ -12752,6 +14103,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo5 * This, /* [in] */ AssemblyID assemblyId, @@ -12762,13 +14114,16 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo5 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, @@ -12776,28 +14131,34 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo5 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo5 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo5 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo5 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo5 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, @@ -12805,6 +14166,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo5 * This, /* [in] */ ThreadID thread, @@ -12814,12 +14176,14 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo5 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo5 * This, /* [in] */ FunctionID funcId, @@ -12831,12 +14195,14 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo5 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo5 * This, /* [in] */ ClassID classID, @@ -12845,6 +14211,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, @@ -12855,6 +14222,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionID, @@ -12862,6 +14230,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleID, @@ -12870,6 +14239,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleID, @@ -12879,11 +14249,13 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo5 * This, /* [in] */ ObjectID objectId, @@ -12892,22 +14264,26 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo5 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, @@ -12915,6 +14291,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, @@ -12922,6 +14299,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, @@ -12929,57 +14307,68 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo5 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo5 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo5 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo5 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo5 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo5 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo5 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo5 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo5 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, @@ -12988,6 +14377,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, @@ -12995,16 +14385,19 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo5 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo5 * This, /* [out] */ USHORT *pClrInstanceId, @@ -13018,6 +14411,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo5 * This, /* [in] */ ClassID classId, @@ -13026,6 +14420,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleId, @@ -13033,6 +14428,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo5 * This, /* [in] */ ModuleID moduleId, @@ -13044,19 +14440,23 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ AssemblyID *pAssemblyId, /* [out] */ DWORD *pdwModuleFlags); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) HRESULT ( STDMETHODCALLTYPE *EnumThreads )( ICorProfilerInfo5 * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( ICorProfilerInfo5 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( ICorProfilerInfo5 * This, /* [in] */ ULONG cFunctions, /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) HRESULT ( STDMETHODCALLTYPE *RequestRevert )( ICorProfilerInfo5 * This, /* [in] */ ULONG cFunctions, @@ -13064,6 +14464,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [size_is][in] */ mdMethodDef methodIds[ ], /* [size_is][out] */ HRESULT status[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionID, @@ -13072,12 +14473,14 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( ICorProfilerInfo5 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, @@ -13085,6 +14488,7 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ULONG *pcReJitIds, /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( ICorProfilerInfo5 * This, /* [in] */ FunctionID functionId, @@ -13093,20 +14497,24 @@ EXTERN_C const IID IID_ICorProfilerInfo5; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( ICorProfilerInfo5 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( ICorProfilerInfo5 * This, /* [in] */ ObjectID objectId, /* [out] */ SIZE_T *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( ICorProfilerInfo5 * This, /* [out] */ DWORD *pdwEventsLow, /* [out] */ DWORD *pdwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( ICorProfilerInfo5 * This, /* [in] */ DWORD dwEventsLow, @@ -13125,269 +14533,269 @@ EXTERN_C const IID IID_ICorProfilerInfo5; #ifdef COBJMACROS -#define ICorProfilerInfo5_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo5_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo5_AddRef(This) \ +#define ICorProfilerInfo5_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo5_Release(This) \ +#define ICorProfilerInfo5_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo5_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo5_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo5_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo5_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo5_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo5_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo5_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo5_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo5_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo5_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo5_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo5_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo5_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo5_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo5_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo5_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo5_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo5_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo5_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo5_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo5_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo5_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo5_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo5_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo5_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo5_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo5_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo5_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo5_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo5_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo5_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo5_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo5_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo5_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo5_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo5_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo5_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo5_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo5_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo5_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo5_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo5_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo5_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo5_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo5_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo5_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo5_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo5_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo5_ForceGC(This) \ +#define ICorProfilerInfo5_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo5_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo5_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo5_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo5_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo5_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo5_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo5_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo5_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo5_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo5_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo5_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo5_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo5_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo5_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo5_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo5_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo5_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo5_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo5_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo5_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo5_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo5_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo5_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo5_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo5_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo5_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo5_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo5_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo5_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo5_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo5_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo5_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo5_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo5_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo5_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo5_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo5_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo5_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo5_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo5_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo5_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo5_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo5_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo5_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo5_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo5_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo5_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo5_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo5_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo5_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo5_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo5_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo5_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo5_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo5_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo5_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo5_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo5_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo5_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo5_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo5_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo5_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo5_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo5_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo5_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo5_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo5_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo5_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo5_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo5_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo5_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo5_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo5_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo5_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo5_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo5_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo5_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo5_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) -#define ICorProfilerInfo5_EnumThreads(This,ppEnum) \ +#define ICorProfilerInfo5_EnumThreads(This,ppEnum) \ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) -#define ICorProfilerInfo5_InitializeCurrentThread(This) \ +#define ICorProfilerInfo5_InitializeCurrentThread(This) \ ( (This)->lpVtbl -> InitializeCurrentThread(This) ) -#define ICorProfilerInfo5_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo5_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo5_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ +#define ICorProfilerInfo5_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) -#define ICorProfilerInfo5_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo5_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo5_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ +#define ICorProfilerInfo5_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) -#define ICorProfilerInfo5_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ +#define ICorProfilerInfo5_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) -#define ICorProfilerInfo5_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ +#define ICorProfilerInfo5_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) -#define ICorProfilerInfo5_EnumJITedFunctions2(This,ppEnum) \ +#define ICorProfilerInfo5_EnumJITedFunctions2(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) -#define ICorProfilerInfo5_GetObjectSize2(This,objectId,pcSize) \ +#define ICorProfilerInfo5_GetObjectSize2(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) -#define ICorProfilerInfo5_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ +#define ICorProfilerInfo5_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) -#define ICorProfilerInfo5_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ +#define ICorProfilerInfo5_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo5_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo5_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo6_INTERFACE_DEFINED__ @@ -13415,66 +14823,78 @@ EXTERN_C const IID IID_ICorProfilerInfo6; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo6Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo6 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo6 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo6 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo6 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo6 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo6 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo6 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo6 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, @@ -13482,21 +14902,25 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo6 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo6 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, @@ -13504,20 +14928,24 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo6 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo6 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo6 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, @@ -13525,6 +14953,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleId, @@ -13535,6 +14964,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleId, @@ -13542,6 +14972,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleId, @@ -13549,17 +14980,20 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo6 * This, /* [in] */ AppDomainID appDomainId, @@ -13569,6 +15003,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo6 * This, /* [in] */ AssemblyID assemblyId, @@ -13579,13 +15014,16 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo6 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, @@ -13593,28 +15031,34 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo6 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo6 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo6 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo6 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo6 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, @@ -13622,6 +15066,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo6 * This, /* [in] */ ThreadID thread, @@ -13631,12 +15076,14 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo6 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo6 * This, /* [in] */ FunctionID funcId, @@ -13648,12 +15095,14 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo6 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo6 * This, /* [in] */ ClassID classID, @@ -13662,6 +15111,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, @@ -13672,6 +15122,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionID, @@ -13679,6 +15130,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleID, @@ -13687,6 +15139,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleID, @@ -13696,11 +15149,13 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo6 * This, /* [in] */ ObjectID objectId, @@ -13709,22 +15164,26 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo6 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, @@ -13732,6 +15191,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, @@ -13739,6 +15199,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, @@ -13746,57 +15207,68 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo6 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo6 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo6 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo6 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo6 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo6 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo6 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo6 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo6 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, @@ -13805,6 +15277,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, @@ -13812,16 +15285,19 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo6 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo6 * This, /* [out] */ USHORT *pClrInstanceId, @@ -13835,6 +15311,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo6 * This, /* [in] */ ClassID classId, @@ -13843,6 +15320,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleId, @@ -13850,6 +15328,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo6 * This, /* [in] */ ModuleID moduleId, @@ -13861,19 +15340,23 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ AssemblyID *pAssemblyId, /* [out] */ DWORD *pdwModuleFlags); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) HRESULT ( STDMETHODCALLTYPE *EnumThreads )( ICorProfilerInfo6 * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( ICorProfilerInfo6 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( ICorProfilerInfo6 * This, /* [in] */ ULONG cFunctions, /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) HRESULT ( STDMETHODCALLTYPE *RequestRevert )( ICorProfilerInfo6 * This, /* [in] */ ULONG cFunctions, @@ -13881,6 +15364,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [size_is][in] */ mdMethodDef methodIds[ ], /* [size_is][out] */ HRESULT status[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionID, @@ -13889,12 +15373,14 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( ICorProfilerInfo6 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, @@ -13902,6 +15388,7 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ULONG *pcReJitIds, /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( ICorProfilerInfo6 * This, /* [in] */ FunctionID functionId, @@ -13910,25 +15397,30 @@ EXTERN_C const IID IID_ICorProfilerInfo6; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( ICorProfilerInfo6 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( ICorProfilerInfo6 * This, /* [in] */ ObjectID objectId, /* [out] */ SIZE_T *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( ICorProfilerInfo6 * This, /* [out] */ DWORD *pdwEventsLow, /* [out] */ DWORD *pdwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( ICorProfilerInfo6 * This, /* [in] */ DWORD dwEventsLow, /* [in] */ DWORD dwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( ICorProfilerInfo6 * This, /* [in] */ ModuleID inlinersModuleId, @@ -13950,273 +15442,273 @@ EXTERN_C const IID IID_ICorProfilerInfo6; #ifdef COBJMACROS -#define ICorProfilerInfo6_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo6_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo6_AddRef(This) \ +#define ICorProfilerInfo6_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo6_Release(This) \ +#define ICorProfilerInfo6_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo6_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo6_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo6_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo6_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo6_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo6_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo6_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo6_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo6_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo6_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo6_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo6_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo6_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo6_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo6_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo6_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo6_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo6_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo6_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo6_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo6_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo6_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo6_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo6_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo6_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo6_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo6_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo6_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo6_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo6_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo6_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo6_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo6_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo6_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo6_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo6_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo6_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo6_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo6_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo6_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo6_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo6_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo6_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo6_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo6_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo6_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo6_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo6_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo6_ForceGC(This) \ +#define ICorProfilerInfo6_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo6_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo6_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo6_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo6_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo6_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo6_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo6_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo6_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo6_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo6_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo6_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo6_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo6_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo6_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo6_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo6_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo6_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo6_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo6_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo6_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo6_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo6_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo6_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo6_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo6_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo6_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo6_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo6_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo6_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo6_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo6_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo6_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo6_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo6_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo6_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo6_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo6_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo6_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo6_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo6_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo6_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo6_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo6_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo6_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo6_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo6_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo6_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo6_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo6_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo6_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo6_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo6_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo6_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo6_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo6_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo6_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo6_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo6_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo6_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo6_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo6_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo6_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo6_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo6_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo6_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo6_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo6_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo6_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo6_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo6_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo6_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo6_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo6_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo6_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo6_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo6_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo6_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo6_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) -#define ICorProfilerInfo6_EnumThreads(This,ppEnum) \ +#define ICorProfilerInfo6_EnumThreads(This,ppEnum) \ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) -#define ICorProfilerInfo6_InitializeCurrentThread(This) \ +#define ICorProfilerInfo6_InitializeCurrentThread(This) \ ( (This)->lpVtbl -> InitializeCurrentThread(This) ) -#define ICorProfilerInfo6_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo6_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo6_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ +#define ICorProfilerInfo6_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) -#define ICorProfilerInfo6_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo6_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo6_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ +#define ICorProfilerInfo6_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) -#define ICorProfilerInfo6_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ +#define ICorProfilerInfo6_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) -#define ICorProfilerInfo6_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ +#define ICorProfilerInfo6_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) -#define ICorProfilerInfo6_EnumJITedFunctions2(This,ppEnum) \ +#define ICorProfilerInfo6_EnumJITedFunctions2(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) -#define ICorProfilerInfo6_GetObjectSize2(This,objectId,pcSize) \ +#define ICorProfilerInfo6_GetObjectSize2(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) -#define ICorProfilerInfo6_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ +#define ICorProfilerInfo6_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) -#define ICorProfilerInfo6_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ +#define ICorProfilerInfo6_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) -#define ICorProfilerInfo6_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ +#define ICorProfilerInfo6_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo6_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo6_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo7_INTERFACE_DEFINED__ @@ -14251,66 +15743,78 @@ EXTERN_C const IID IID_ICorProfilerInfo7; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo7Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo7 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo7 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo7 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo7 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo7 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo7 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo7 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo7 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, @@ -14318,21 +15822,25 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo7 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo7 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, @@ -14340,20 +15848,24 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo7 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo7 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo7 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, @@ -14361,6 +15873,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, @@ -14371,6 +15884,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, @@ -14378,6 +15892,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, @@ -14385,17 +15900,20 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo7 * This, /* [in] */ AppDomainID appDomainId, @@ -14405,6 +15923,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo7 * This, /* [in] */ AssemblyID assemblyId, @@ -14415,13 +15934,16 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo7 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, @@ -14429,28 +15951,34 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo7 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo7 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo7 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo7 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo7 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, @@ -14458,6 +15986,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo7 * This, /* [in] */ ThreadID thread, @@ -14467,12 +15996,14 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo7 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo7 * This, /* [in] */ FunctionID funcId, @@ -14484,12 +16015,14 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo7 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo7 * This, /* [in] */ ClassID classID, @@ -14498,6 +16031,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, @@ -14508,6 +16042,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionID, @@ -14515,6 +16050,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleID, @@ -14523,6 +16059,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleID, @@ -14532,11 +16069,13 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo7 * This, /* [in] */ ObjectID objectId, @@ -14545,22 +16084,26 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo7 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, @@ -14568,6 +16111,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, @@ -14575,6 +16119,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, @@ -14582,57 +16127,68 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo7 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo7 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo7 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo7 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo7 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo7 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo7 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo7 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo7 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, @@ -14641,6 +16197,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, @@ -14648,16 +16205,19 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo7 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo7 * This, /* [out] */ USHORT *pClrInstanceId, @@ -14671,6 +16231,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo7 * This, /* [in] */ ClassID classId, @@ -14679,6 +16240,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, @@ -14686,6 +16248,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, @@ -14697,19 +16260,23 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ AssemblyID *pAssemblyId, /* [out] */ DWORD *pdwModuleFlags); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) HRESULT ( STDMETHODCALLTYPE *EnumThreads )( ICorProfilerInfo7 * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( ICorProfilerInfo7 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( ICorProfilerInfo7 * This, /* [in] */ ULONG cFunctions, /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) HRESULT ( STDMETHODCALLTYPE *RequestRevert )( ICorProfilerInfo7 * This, /* [in] */ ULONG cFunctions, @@ -14717,6 +16284,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [size_is][in] */ mdMethodDef methodIds[ ], /* [size_is][out] */ HRESULT status[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionID, @@ -14725,12 +16293,14 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( ICorProfilerInfo7 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, @@ -14738,6 +16308,7 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ULONG *pcReJitIds, /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( ICorProfilerInfo7 * This, /* [in] */ FunctionID functionId, @@ -14746,25 +16317,30 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( ICorProfilerInfo7 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( ICorProfilerInfo7 * This, /* [in] */ ObjectID objectId, /* [out] */ SIZE_T *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( ICorProfilerInfo7 * This, /* [out] */ DWORD *pdwEventsLow, /* [out] */ DWORD *pdwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( ICorProfilerInfo7 * This, /* [in] */ DWORD dwEventsLow, /* [in] */ DWORD dwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( ICorProfilerInfo7 * This, /* [in] */ ModuleID inlinersModuleId, @@ -14773,15 +16349,18 @@ EXTERN_C const IID IID_ICorProfilerInfo7; /* [out] */ BOOL *incompleteData, /* [out] */ ICorProfilerMethodEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ApplyMetaData) HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, GetInMemorySymbolsLength) HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, /* [out] */ DWORD *pCountSymbolBytes); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ReadInMemorySymbols) HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( ICorProfilerInfo7 * This, /* [in] */ ModuleID moduleId, @@ -14803,283 +16382,283 @@ EXTERN_C const IID IID_ICorProfilerInfo7; #ifdef COBJMACROS -#define ICorProfilerInfo7_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo7_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo7_AddRef(This) \ +#define ICorProfilerInfo7_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo7_Release(This) \ +#define ICorProfilerInfo7_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo7_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo7_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo7_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo7_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo7_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo7_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo7_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo7_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo7_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo7_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo7_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo7_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo7_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo7_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo7_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo7_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo7_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo7_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo7_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo7_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo7_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo7_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo7_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo7_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo7_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo7_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo7_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo7_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo7_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo7_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo7_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo7_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo7_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo7_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo7_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo7_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo7_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo7_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo7_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo7_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo7_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo7_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo7_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo7_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo7_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo7_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo7_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo7_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo7_ForceGC(This) \ +#define ICorProfilerInfo7_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo7_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo7_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo7_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo7_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo7_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo7_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo7_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo7_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo7_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo7_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo7_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo7_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo7_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo7_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo7_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo7_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo7_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo7_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo7_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo7_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo7_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo7_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo7_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo7_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo7_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo7_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo7_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo7_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo7_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo7_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo7_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo7_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo7_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo7_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo7_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo7_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo7_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo7_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo7_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo7_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo7_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo7_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo7_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo7_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo7_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo7_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo7_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo7_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo7_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo7_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo7_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo7_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo7_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo7_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo7_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo7_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo7_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo7_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo7_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo7_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo7_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo7_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo7_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo7_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo7_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo7_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo7_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo7_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo7_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo7_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo7_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo7_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo7_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo7_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo7_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo7_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo7_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo7_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) -#define ICorProfilerInfo7_EnumThreads(This,ppEnum) \ +#define ICorProfilerInfo7_EnumThreads(This,ppEnum) \ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) -#define ICorProfilerInfo7_InitializeCurrentThread(This) \ +#define ICorProfilerInfo7_InitializeCurrentThread(This) \ ( (This)->lpVtbl -> InitializeCurrentThread(This) ) -#define ICorProfilerInfo7_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo7_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo7_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ +#define ICorProfilerInfo7_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) -#define ICorProfilerInfo7_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo7_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo7_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ +#define ICorProfilerInfo7_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) -#define ICorProfilerInfo7_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ +#define ICorProfilerInfo7_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) -#define ICorProfilerInfo7_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ +#define ICorProfilerInfo7_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) -#define ICorProfilerInfo7_EnumJITedFunctions2(This,ppEnum) \ +#define ICorProfilerInfo7_EnumJITedFunctions2(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) -#define ICorProfilerInfo7_GetObjectSize2(This,objectId,pcSize) \ +#define ICorProfilerInfo7_GetObjectSize2(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) -#define ICorProfilerInfo7_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ +#define ICorProfilerInfo7_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) -#define ICorProfilerInfo7_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ +#define ICorProfilerInfo7_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) -#define ICorProfilerInfo7_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ +#define ICorProfilerInfo7_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) -#define ICorProfilerInfo7_ApplyMetaData(This,moduleId) \ +#define ICorProfilerInfo7_ApplyMetaData(This,moduleId) \ ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) -#define ICorProfilerInfo7_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ +#define ICorProfilerInfo7_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) -#define ICorProfilerInfo7_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ +#define ICorProfilerInfo7_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo7_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo7_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo8_INTERFACE_DEFINED__ @@ -15118,66 +16697,78 @@ EXTERN_C const IID IID_ICorProfilerInfo8; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo8Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo8 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo8 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo8 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo8 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo8 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo8 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo8 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo8 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, @@ -15185,21 +16776,25 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo8 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo8 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, @@ -15207,20 +16802,24 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo8 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo8 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo8 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, @@ -15228,6 +16827,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, @@ -15238,6 +16838,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, @@ -15245,6 +16846,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, @@ -15252,17 +16854,20 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo8 * This, /* [in] */ AppDomainID appDomainId, @@ -15272,6 +16877,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo8 * This, /* [in] */ AssemblyID assemblyId, @@ -15282,13 +16888,16 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo8 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, @@ -15296,28 +16905,34 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo8 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo8 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo8 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo8 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo8 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, @@ -15325,6 +16940,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo8 * This, /* [in] */ ThreadID thread, @@ -15334,12 +16950,14 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo8 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo8 * This, /* [in] */ FunctionID funcId, @@ -15351,12 +16969,14 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo8 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo8 * This, /* [in] */ ClassID classID, @@ -15365,6 +16985,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, @@ -15375,6 +16996,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionID, @@ -15382,6 +17004,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleID, @@ -15390,6 +17013,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleID, @@ -15399,11 +17023,13 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo8 * This, /* [in] */ ObjectID objectId, @@ -15412,22 +17038,26 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo8 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, @@ -15435,6 +17065,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, @@ -15442,6 +17073,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, @@ -15449,57 +17081,68 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo8 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo8 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo8 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo8 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo8 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo8 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo8 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo8 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo8 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, @@ -15508,6 +17151,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, @@ -15515,16 +17159,19 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo8 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo8 * This, /* [out] */ USHORT *pClrInstanceId, @@ -15538,6 +17185,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo8 * This, /* [in] */ ClassID classId, @@ -15546,6 +17194,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, @@ -15553,6 +17202,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, @@ -15564,19 +17214,23 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ AssemblyID *pAssemblyId, /* [out] */ DWORD *pdwModuleFlags); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) HRESULT ( STDMETHODCALLTYPE *EnumThreads )( ICorProfilerInfo8 * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( ICorProfilerInfo8 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( ICorProfilerInfo8 * This, /* [in] */ ULONG cFunctions, /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) HRESULT ( STDMETHODCALLTYPE *RequestRevert )( ICorProfilerInfo8 * This, /* [in] */ ULONG cFunctions, @@ -15584,6 +17238,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [size_is][in] */ mdMethodDef methodIds[ ], /* [size_is][out] */ HRESULT status[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionID, @@ -15592,12 +17247,14 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( ICorProfilerInfo8 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, @@ -15605,6 +17262,7 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ULONG *pcReJitIds, /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, @@ -15613,25 +17271,30 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( ICorProfilerInfo8 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( ICorProfilerInfo8 * This, /* [in] */ ObjectID objectId, /* [out] */ SIZE_T *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( ICorProfilerInfo8 * This, /* [out] */ DWORD *pdwEventsLow, /* [out] */ DWORD *pdwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( ICorProfilerInfo8 * This, /* [in] */ DWORD dwEventsLow, /* [in] */ DWORD dwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( ICorProfilerInfo8 * This, /* [in] */ ModuleID inlinersModuleId, @@ -15640,15 +17303,18 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [out] */ BOOL *incompleteData, /* [out] */ ICorProfilerMethodEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ApplyMetaData) HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, GetInMemorySymbolsLength) HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, /* [out] */ DWORD *pCountSymbolBytes); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ReadInMemorySymbols) HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( ICorProfilerInfo8 * This, /* [in] */ ModuleID moduleId, @@ -15657,17 +17323,20 @@ EXTERN_C const IID IID_ICorProfilerInfo8; /* [in] */ DWORD countSymbolBytes, /* [out] */ DWORD *pCountSymbolBytesRead); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, IsFunctionDynamic) HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *isDynamic); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetFunctionFromIP3) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )( ICorProfilerInfo8 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *functionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetDynamicFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )( ICorProfilerInfo8 * This, /* [in] */ FunctionID functionId, @@ -15691,293 +17360,293 @@ EXTERN_C const IID IID_ICorProfilerInfo8; #ifdef COBJMACROS -#define ICorProfilerInfo8_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo8_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo8_AddRef(This) \ +#define ICorProfilerInfo8_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo8_Release(This) \ +#define ICorProfilerInfo8_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo8_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo8_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo8_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo8_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo8_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo8_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo8_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo8_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo8_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo8_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo8_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo8_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo8_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo8_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo8_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo8_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo8_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo8_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo8_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo8_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo8_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo8_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo8_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo8_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo8_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo8_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo8_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo8_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo8_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo8_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo8_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo8_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo8_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo8_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo8_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo8_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo8_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo8_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo8_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo8_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo8_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo8_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo8_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo8_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo8_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo8_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo8_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo8_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo8_ForceGC(This) \ +#define ICorProfilerInfo8_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo8_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo8_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo8_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo8_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo8_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo8_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo8_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo8_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo8_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo8_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo8_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo8_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo8_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo8_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo8_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo8_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo8_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo8_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo8_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo8_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo8_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo8_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo8_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo8_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo8_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo8_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo8_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo8_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo8_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo8_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo8_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo8_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo8_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo8_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo8_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo8_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo8_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo8_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo8_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo8_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo8_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo8_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo8_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo8_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo8_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo8_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo8_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo8_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo8_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo8_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo8_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo8_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo8_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo8_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo8_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo8_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo8_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo8_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo8_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo8_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo8_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo8_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo8_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo8_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo8_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo8_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo8_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo8_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo8_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo8_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo8_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo8_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo8_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo8_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo8_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo8_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo8_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo8_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) -#define ICorProfilerInfo8_EnumThreads(This,ppEnum) \ +#define ICorProfilerInfo8_EnumThreads(This,ppEnum) \ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) -#define ICorProfilerInfo8_InitializeCurrentThread(This) \ +#define ICorProfilerInfo8_InitializeCurrentThread(This) \ ( (This)->lpVtbl -> InitializeCurrentThread(This) ) -#define ICorProfilerInfo8_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo8_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo8_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ +#define ICorProfilerInfo8_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) -#define ICorProfilerInfo8_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo8_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo8_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ +#define ICorProfilerInfo8_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) -#define ICorProfilerInfo8_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ +#define ICorProfilerInfo8_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) -#define ICorProfilerInfo8_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ +#define ICorProfilerInfo8_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) -#define ICorProfilerInfo8_EnumJITedFunctions2(This,ppEnum) \ +#define ICorProfilerInfo8_EnumJITedFunctions2(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) -#define ICorProfilerInfo8_GetObjectSize2(This,objectId,pcSize) \ +#define ICorProfilerInfo8_GetObjectSize2(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) -#define ICorProfilerInfo8_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ +#define ICorProfilerInfo8_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) -#define ICorProfilerInfo8_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ +#define ICorProfilerInfo8_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) -#define ICorProfilerInfo8_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ +#define ICorProfilerInfo8_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) -#define ICorProfilerInfo8_ApplyMetaData(This,moduleId) \ +#define ICorProfilerInfo8_ApplyMetaData(This,moduleId) \ ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) -#define ICorProfilerInfo8_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ +#define ICorProfilerInfo8_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) -#define ICorProfilerInfo8_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ +#define ICorProfilerInfo8_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) -#define ICorProfilerInfo8_IsFunctionDynamic(This,functionId,isDynamic) \ +#define ICorProfilerInfo8_IsFunctionDynamic(This,functionId,isDynamic) \ ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) ) -#define ICorProfilerInfo8_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ +#define ICorProfilerInfo8_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) ) -#define ICorProfilerInfo8_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ +#define ICorProfilerInfo8_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo8_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo8_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo9_INTERFACE_DEFINED__ @@ -16017,66 +17686,78 @@ EXTERN_C const IID IID_ICorProfilerInfo9; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo9Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo9 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo9 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo9 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo9 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo9 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo9 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo9 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo9 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, @@ -16084,21 +17765,25 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo9 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo9 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, @@ -16106,20 +17791,24 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo9 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo9 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo9 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, @@ -16127,6 +17816,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, @@ -16137,6 +17827,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, @@ -16144,6 +17835,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, @@ -16151,17 +17843,20 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo9 * This, /* [in] */ AppDomainID appDomainId, @@ -16171,6 +17866,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo9 * This, /* [in] */ AssemblyID assemblyId, @@ -16181,13 +17877,16 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo9 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, @@ -16195,28 +17894,34 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo9 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo9 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo9 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo9 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo9 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, @@ -16224,6 +17929,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo9 * This, /* [in] */ ThreadID thread, @@ -16233,12 +17939,14 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo9 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo9 * This, /* [in] */ FunctionID funcId, @@ -16250,12 +17958,14 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo9 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo9 * This, /* [in] */ ClassID classID, @@ -16264,6 +17974,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, @@ -16274,6 +17985,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionID, @@ -16281,6 +17993,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleID, @@ -16289,6 +18002,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleID, @@ -16298,11 +18012,13 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo9 * This, /* [in] */ ObjectID objectId, @@ -16311,22 +18027,26 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo9 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, @@ -16334,6 +18054,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, @@ -16341,6 +18062,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, @@ -16348,57 +18070,68 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo9 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo9 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo9 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo9 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo9 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo9 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo9 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo9 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo9 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, @@ -16407,6 +18140,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, @@ -16414,16 +18148,19 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo9 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo9 * This, /* [out] */ USHORT *pClrInstanceId, @@ -16437,6 +18174,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo9 * This, /* [in] */ ClassID classId, @@ -16445,6 +18183,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, @@ -16452,6 +18191,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, @@ -16463,19 +18203,23 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ AssemblyID *pAssemblyId, /* [out] */ DWORD *pdwModuleFlags); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) HRESULT ( STDMETHODCALLTYPE *EnumThreads )( ICorProfilerInfo9 * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( ICorProfilerInfo9 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( ICorProfilerInfo9 * This, /* [in] */ ULONG cFunctions, /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) HRESULT ( STDMETHODCALLTYPE *RequestRevert )( ICorProfilerInfo9 * This, /* [in] */ ULONG cFunctions, @@ -16483,6 +18227,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [size_is][in] */ mdMethodDef methodIds[ ], /* [size_is][out] */ HRESULT status[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionID, @@ -16491,12 +18236,14 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( ICorProfilerInfo9 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, @@ -16504,6 +18251,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG *pcReJitIds, /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, @@ -16512,25 +18260,30 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( ICorProfilerInfo9 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( ICorProfilerInfo9 * This, /* [in] */ ObjectID objectId, /* [out] */ SIZE_T *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( ICorProfilerInfo9 * This, /* [out] */ DWORD *pdwEventsLow, /* [out] */ DWORD *pdwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( ICorProfilerInfo9 * This, /* [in] */ DWORD dwEventsLow, /* [in] */ DWORD dwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( ICorProfilerInfo9 * This, /* [in] */ ModuleID inlinersModuleId, @@ -16539,15 +18292,18 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ BOOL *incompleteData, /* [out] */ ICorProfilerMethodEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ApplyMetaData) HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, GetInMemorySymbolsLength) HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, /* [out] */ DWORD *pCountSymbolBytes); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ReadInMemorySymbols) HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( ICorProfilerInfo9 * This, /* [in] */ ModuleID moduleId, @@ -16556,17 +18312,20 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [in] */ DWORD countSymbolBytes, /* [out] */ DWORD *pCountSymbolBytesRead); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, IsFunctionDynamic) HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *isDynamic); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetFunctionFromIP3) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )( ICorProfilerInfo9 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *functionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetDynamicFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )( ICorProfilerInfo9 * This, /* [in] */ FunctionID functionId, @@ -16577,6 +18336,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; /* [out] */ ULONG *pcchName, /* [out] */ WCHAR wszName[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetNativeCodeStartAddresses) HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )( ICorProfilerInfo9 * This, FunctionID functionID, @@ -16585,6 +18345,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; ULONG32 *pcCodeStartAddresses, UINT_PTR codeStartAddresses[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetILToNativeMapping3) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )( ICorProfilerInfo9 * This, UINT_PTR pNativeCodeStartAddress, @@ -16592,6 +18353,7 @@ EXTERN_C const IID IID_ICorProfilerInfo9; ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetCodeInfo4) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )( ICorProfilerInfo9 * This, UINT_PTR pNativeCodeStartAddress, @@ -16612,303 +18374,303 @@ EXTERN_C const IID IID_ICorProfilerInfo9; #ifdef COBJMACROS -#define ICorProfilerInfo9_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo9_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo9_AddRef(This) \ +#define ICorProfilerInfo9_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo9_Release(This) \ +#define ICorProfilerInfo9_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo9_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo9_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo9_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo9_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo9_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo9_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo9_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo9_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo9_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo9_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo9_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo9_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo9_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo9_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo9_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo9_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo9_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo9_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo9_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo9_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo9_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo9_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo9_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo9_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo9_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo9_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo9_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo9_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo9_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo9_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo9_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo9_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo9_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo9_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo9_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo9_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo9_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo9_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo9_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo9_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo9_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo9_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo9_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo9_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo9_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo9_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo9_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo9_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo9_ForceGC(This) \ +#define ICorProfilerInfo9_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo9_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo9_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo9_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo9_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo9_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo9_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo9_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo9_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo9_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo9_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo9_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo9_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo9_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo9_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo9_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo9_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo9_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo9_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo9_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo9_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo9_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo9_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo9_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo9_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo9_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo9_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo9_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo9_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo9_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo9_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo9_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo9_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo9_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo9_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo9_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo9_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo9_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo9_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo9_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo9_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo9_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo9_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo9_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo9_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo9_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo9_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo9_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo9_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo9_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo9_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo9_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo9_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo9_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo9_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo9_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo9_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo9_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo9_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo9_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo9_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo9_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo9_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo9_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo9_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo9_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo9_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo9_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo9_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo9_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo9_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo9_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo9_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo9_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo9_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo9_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo9_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo9_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo9_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) -#define ICorProfilerInfo9_EnumThreads(This,ppEnum) \ +#define ICorProfilerInfo9_EnumThreads(This,ppEnum) \ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) -#define ICorProfilerInfo9_InitializeCurrentThread(This) \ +#define ICorProfilerInfo9_InitializeCurrentThread(This) \ ( (This)->lpVtbl -> InitializeCurrentThread(This) ) -#define ICorProfilerInfo9_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo9_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo9_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ +#define ICorProfilerInfo9_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) -#define ICorProfilerInfo9_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo9_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo9_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ +#define ICorProfilerInfo9_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) -#define ICorProfilerInfo9_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ +#define ICorProfilerInfo9_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) -#define ICorProfilerInfo9_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ +#define ICorProfilerInfo9_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) -#define ICorProfilerInfo9_EnumJITedFunctions2(This,ppEnum) \ +#define ICorProfilerInfo9_EnumJITedFunctions2(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) -#define ICorProfilerInfo9_GetObjectSize2(This,objectId,pcSize) \ +#define ICorProfilerInfo9_GetObjectSize2(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) -#define ICorProfilerInfo9_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ +#define ICorProfilerInfo9_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) -#define ICorProfilerInfo9_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ +#define ICorProfilerInfo9_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) -#define ICorProfilerInfo9_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ +#define ICorProfilerInfo9_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) -#define ICorProfilerInfo9_ApplyMetaData(This,moduleId) \ +#define ICorProfilerInfo9_ApplyMetaData(This,moduleId) \ ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) -#define ICorProfilerInfo9_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ +#define ICorProfilerInfo9_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) -#define ICorProfilerInfo9_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ +#define ICorProfilerInfo9_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) -#define ICorProfilerInfo9_IsFunctionDynamic(This,functionId,isDynamic) \ +#define ICorProfilerInfo9_IsFunctionDynamic(This,functionId,isDynamic) \ ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) ) -#define ICorProfilerInfo9_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ +#define ICorProfilerInfo9_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) ) -#define ICorProfilerInfo9_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ +#define ICorProfilerInfo9_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) ) -#define ICorProfilerInfo9_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ +#define ICorProfilerInfo9_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) ) -#define ICorProfilerInfo9_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ +#define ICorProfilerInfo9_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) ) -#define ICorProfilerInfo9_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo9_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo9_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo9_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo10_INTERFACE_DEFINED__ @@ -16951,66 +18713,78 @@ EXTERN_C const IID IID_ICorProfilerInfo10; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo10Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo10 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo10 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo10 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo10 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo10 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo10 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo10 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo10 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, @@ -17018,21 +18792,25 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo10 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo10 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, @@ -17040,20 +18818,24 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo10 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo10 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo10 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, @@ -17061,6 +18843,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, @@ -17071,6 +18854,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, @@ -17078,6 +18862,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, @@ -17085,17 +18870,20 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo10 * This, /* [in] */ AppDomainID appDomainId, @@ -17105,6 +18893,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo10 * This, /* [in] */ AssemblyID assemblyId, @@ -17115,13 +18904,16 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo10 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, @@ -17129,28 +18921,34 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo10 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo10 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo10 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo10 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo10 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, @@ -17158,6 +18956,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo10 * This, /* [in] */ ThreadID thread, @@ -17167,12 +18966,14 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo10 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo10 * This, /* [in] */ FunctionID funcId, @@ -17184,12 +18985,14 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo10 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo10 * This, /* [in] */ ClassID classID, @@ -17198,6 +19001,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, @@ -17208,6 +19012,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionID, @@ -17215,6 +19020,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleID, @@ -17223,6 +19029,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleID, @@ -17232,11 +19039,13 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo10 * This, /* [in] */ ObjectID objectId, @@ -17245,22 +19054,26 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo10 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, @@ -17268,6 +19081,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, @@ -17275,6 +19089,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, @@ -17282,57 +19097,68 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo10 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo10 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo10 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo10 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo10 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo10 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo10 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo10 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo10 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, @@ -17341,6 +19167,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, @@ -17348,16 +19175,19 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo10 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo10 * This, /* [out] */ USHORT *pClrInstanceId, @@ -17371,6 +19201,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo10 * This, /* [in] */ ClassID classId, @@ -17379,6 +19210,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, @@ -17386,6 +19218,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, @@ -17397,19 +19230,23 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ AssemblyID *pAssemblyId, /* [out] */ DWORD *pdwModuleFlags); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) HRESULT ( STDMETHODCALLTYPE *EnumThreads )( ICorProfilerInfo10 * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( ICorProfilerInfo10 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( ICorProfilerInfo10 * This, /* [in] */ ULONG cFunctions, /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) HRESULT ( STDMETHODCALLTYPE *RequestRevert )( ICorProfilerInfo10 * This, /* [in] */ ULONG cFunctions, @@ -17417,6 +19254,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [size_is][in] */ mdMethodDef methodIds[ ], /* [size_is][out] */ HRESULT status[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionID, @@ -17425,12 +19263,14 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( ICorProfilerInfo10 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, @@ -17438,6 +19278,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG *pcReJitIds, /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, @@ -17446,25 +19287,30 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( ICorProfilerInfo10 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( ICorProfilerInfo10 * This, /* [in] */ ObjectID objectId, /* [out] */ SIZE_T *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( ICorProfilerInfo10 * This, /* [out] */ DWORD *pdwEventsLow, /* [out] */ DWORD *pdwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( ICorProfilerInfo10 * This, /* [in] */ DWORD dwEventsLow, /* [in] */ DWORD dwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( ICorProfilerInfo10 * This, /* [in] */ ModuleID inlinersModuleId, @@ -17473,15 +19319,18 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ BOOL *incompleteData, /* [out] */ ICorProfilerMethodEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ApplyMetaData) HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, GetInMemorySymbolsLength) HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, /* [out] */ DWORD *pCountSymbolBytes); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ReadInMemorySymbols) HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( ICorProfilerInfo10 * This, /* [in] */ ModuleID moduleId, @@ -17490,17 +19339,20 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [in] */ DWORD countSymbolBytes, /* [out] */ DWORD *pCountSymbolBytesRead); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, IsFunctionDynamic) HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *isDynamic); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetFunctionFromIP3) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )( ICorProfilerInfo10 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *functionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetDynamicFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )( ICorProfilerInfo10 * This, /* [in] */ FunctionID functionId, @@ -17511,6 +19363,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [out] */ ULONG *pcchName, /* [out] */ WCHAR wszName[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetNativeCodeStartAddresses) HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )( ICorProfilerInfo10 * This, FunctionID functionID, @@ -17519,6 +19372,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; ULONG32 *pcCodeStartAddresses, UINT_PTR codeStartAddresses[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetILToNativeMapping3) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )( ICorProfilerInfo10 * This, UINT_PTR pNativeCodeStartAddress, @@ -17526,6 +19380,7 @@ EXTERN_C const IID IID_ICorProfilerInfo10; ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetCodeInfo4) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )( ICorProfilerInfo10 * This, UINT_PTR pNativeCodeStartAddress, @@ -17533,21 +19388,25 @@ EXTERN_C const IID IID_ICorProfilerInfo10; ULONG32 *pcCodeInfos, COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, EnumerateObjectReferences) HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )( ICorProfilerInfo10 * This, ObjectID objectId, ObjectReferenceCallback callback, void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, IsFrozenObject) HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )( ICorProfilerInfo10 * This, ObjectID objectId, BOOL *pbFrozen); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, GetLOHObjectSizeThreshold) HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )( ICorProfilerInfo10 * This, DWORD *pThreshold); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, RequestReJITWithInliners) HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )( ICorProfilerInfo10 * This, /* [in] */ DWORD dwRejitFlags, @@ -17555,9 +19414,11 @@ EXTERN_C const IID IID_ICorProfilerInfo10; /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, SuspendRuntime) HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )( ICorProfilerInfo10 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, ResumeRuntime) HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )( ICorProfilerInfo10 * This); @@ -17574,322 +19435,322 @@ EXTERN_C const IID IID_ICorProfilerInfo10; #ifdef COBJMACROS -#define ICorProfilerInfo10_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo10_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo10_AddRef(This) \ +#define ICorProfilerInfo10_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo10_Release(This) \ +#define ICorProfilerInfo10_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo10_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo10_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo10_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo10_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo10_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo10_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo10_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo10_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo10_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo10_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo10_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo10_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo10_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo10_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo10_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo10_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo10_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo10_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo10_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo10_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo10_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo10_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo10_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo10_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo10_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo10_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo10_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo10_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo10_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo10_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo10_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo10_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo10_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo10_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo10_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo10_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo10_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo10_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo10_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo10_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo10_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo10_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo10_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo10_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo10_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo10_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo10_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo10_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo10_ForceGC(This) \ +#define ICorProfilerInfo10_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo10_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo10_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo10_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo10_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo10_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo10_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo10_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo10_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo10_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo10_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo10_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo10_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo10_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo10_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo10_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo10_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo10_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo10_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo10_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo10_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo10_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo10_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo10_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo10_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo10_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo10_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo10_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo10_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo10_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo10_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo10_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo10_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo10_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo10_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo10_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo10_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo10_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo10_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo10_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo10_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo10_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo10_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo10_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo10_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo10_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo10_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo10_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo10_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo10_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo10_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo10_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo10_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo10_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo10_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo10_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo10_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo10_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo10_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo10_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo10_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo10_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo10_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo10_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo10_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo10_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo10_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo10_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo10_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo10_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo10_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo10_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo10_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo10_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo10_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo10_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo10_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo10_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo10_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) -#define ICorProfilerInfo10_EnumThreads(This,ppEnum) \ +#define ICorProfilerInfo10_EnumThreads(This,ppEnum) \ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) -#define ICorProfilerInfo10_InitializeCurrentThread(This) \ +#define ICorProfilerInfo10_InitializeCurrentThread(This) \ ( (This)->lpVtbl -> InitializeCurrentThread(This) ) -#define ICorProfilerInfo10_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo10_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo10_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ +#define ICorProfilerInfo10_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) -#define ICorProfilerInfo10_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo10_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo10_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ +#define ICorProfilerInfo10_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) -#define ICorProfilerInfo10_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ +#define ICorProfilerInfo10_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) -#define ICorProfilerInfo10_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ +#define ICorProfilerInfo10_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) -#define ICorProfilerInfo10_EnumJITedFunctions2(This,ppEnum) \ +#define ICorProfilerInfo10_EnumJITedFunctions2(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) -#define ICorProfilerInfo10_GetObjectSize2(This,objectId,pcSize) \ +#define ICorProfilerInfo10_GetObjectSize2(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) -#define ICorProfilerInfo10_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ +#define ICorProfilerInfo10_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) -#define ICorProfilerInfo10_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ +#define ICorProfilerInfo10_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) -#define ICorProfilerInfo10_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ +#define ICorProfilerInfo10_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) -#define ICorProfilerInfo10_ApplyMetaData(This,moduleId) \ +#define ICorProfilerInfo10_ApplyMetaData(This,moduleId) \ ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) -#define ICorProfilerInfo10_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ +#define ICorProfilerInfo10_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) -#define ICorProfilerInfo10_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ +#define ICorProfilerInfo10_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) -#define ICorProfilerInfo10_IsFunctionDynamic(This,functionId,isDynamic) \ +#define ICorProfilerInfo10_IsFunctionDynamic(This,functionId,isDynamic) \ ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) ) -#define ICorProfilerInfo10_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ +#define ICorProfilerInfo10_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) ) -#define ICorProfilerInfo10_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ +#define ICorProfilerInfo10_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) ) -#define ICorProfilerInfo10_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ +#define ICorProfilerInfo10_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) ) -#define ICorProfilerInfo10_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ +#define ICorProfilerInfo10_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) ) -#define ICorProfilerInfo10_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo10_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo10_EnumerateObjectReferences(This,objectId,callback,clientData) \ +#define ICorProfilerInfo10_EnumerateObjectReferences(This,objectId,callback,clientData) \ ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) ) -#define ICorProfilerInfo10_IsFrozenObject(This,objectId,pbFrozen) \ +#define ICorProfilerInfo10_IsFrozenObject(This,objectId,pbFrozen) \ ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) ) -#define ICorProfilerInfo10_GetLOHObjectSizeThreshold(This,pThreshold) \ +#define ICorProfilerInfo10_GetLOHObjectSizeThreshold(This,pThreshold) \ ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) ) -#define ICorProfilerInfo10_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo10_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo10_SuspendRuntime(This) \ +#define ICorProfilerInfo10_SuspendRuntime(This) \ ( (This)->lpVtbl -> SuspendRuntime(This) ) -#define ICorProfilerInfo10_ResumeRuntime(This) \ +#define ICorProfilerInfo10_ResumeRuntime(This) \ ( (This)->lpVtbl -> ResumeRuntime(This) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo10_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo10_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo11_INTERFACE_DEFINED__ @@ -17921,66 +19782,78 @@ EXTERN_C const IID IID_ICorProfilerInfo11; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo11Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo11 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo11 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo11 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo11 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo11 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo11 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo11 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo11 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, @@ -17988,21 +19861,25 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo11 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo11 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, @@ -18010,20 +19887,24 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo11 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo11 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo11 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, @@ -18031,6 +19912,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, @@ -18041,6 +19923,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, @@ -18048,6 +19931,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, @@ -18055,17 +19939,20 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo11 * This, /* [in] */ AppDomainID appDomainId, @@ -18075,6 +19962,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo11 * This, /* [in] */ AssemblyID assemblyId, @@ -18085,13 +19973,16 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo11 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, @@ -18099,28 +19990,34 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo11 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo11 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo11 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo11 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo11 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, @@ -18128,6 +20025,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo11 * This, /* [in] */ ThreadID thread, @@ -18137,12 +20035,14 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo11 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo11 * This, /* [in] */ FunctionID funcId, @@ -18154,12 +20054,14 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo11 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo11 * This, /* [in] */ ClassID classID, @@ -18168,6 +20070,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, @@ -18178,6 +20081,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionID, @@ -18185,6 +20089,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleID, @@ -18193,6 +20098,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleID, @@ -18202,11 +20108,13 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo11 * This, /* [in] */ ObjectID objectId, @@ -18215,22 +20123,26 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo11 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, @@ -18238,6 +20150,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, @@ -18245,6 +20158,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, @@ -18252,57 +20166,68 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo11 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo11 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo11 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo11 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo11 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo11 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo11 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo11 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo11 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, @@ -18311,6 +20236,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, @@ -18318,16 +20244,19 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo11 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo11 * This, /* [out] */ USHORT *pClrInstanceId, @@ -18341,6 +20270,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo11 * This, /* [in] */ ClassID classId, @@ -18349,6 +20279,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, @@ -18356,6 +20287,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, @@ -18367,19 +20299,23 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ AssemblyID *pAssemblyId, /* [out] */ DWORD *pdwModuleFlags); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) HRESULT ( STDMETHODCALLTYPE *EnumThreads )( ICorProfilerInfo11 * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( ICorProfilerInfo11 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( ICorProfilerInfo11 * This, /* [in] */ ULONG cFunctions, /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) HRESULT ( STDMETHODCALLTYPE *RequestRevert )( ICorProfilerInfo11 * This, /* [in] */ ULONG cFunctions, @@ -18387,6 +20323,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [size_is][in] */ mdMethodDef methodIds[ ], /* [size_is][out] */ HRESULT status[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionID, @@ -18395,12 +20332,14 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( ICorProfilerInfo11 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, @@ -18408,6 +20347,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG *pcReJitIds, /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, @@ -18416,25 +20356,30 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( ICorProfilerInfo11 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( ICorProfilerInfo11 * This, /* [in] */ ObjectID objectId, /* [out] */ SIZE_T *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( ICorProfilerInfo11 * This, /* [out] */ DWORD *pdwEventsLow, /* [out] */ DWORD *pdwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( ICorProfilerInfo11 * This, /* [in] */ DWORD dwEventsLow, /* [in] */ DWORD dwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( ICorProfilerInfo11 * This, /* [in] */ ModuleID inlinersModuleId, @@ -18443,15 +20388,18 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ BOOL *incompleteData, /* [out] */ ICorProfilerMethodEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ApplyMetaData) HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, GetInMemorySymbolsLength) HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, /* [out] */ DWORD *pCountSymbolBytes); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ReadInMemorySymbols) HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( ICorProfilerInfo11 * This, /* [in] */ ModuleID moduleId, @@ -18460,17 +20408,20 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [in] */ DWORD countSymbolBytes, /* [out] */ DWORD *pCountSymbolBytesRead); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, IsFunctionDynamic) HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *isDynamic); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetFunctionFromIP3) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )( ICorProfilerInfo11 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *functionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetDynamicFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )( ICorProfilerInfo11 * This, /* [in] */ FunctionID functionId, @@ -18481,6 +20432,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [out] */ ULONG *pcchName, /* [out] */ WCHAR wszName[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetNativeCodeStartAddresses) HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )( ICorProfilerInfo11 * This, FunctionID functionID, @@ -18489,6 +20441,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; ULONG32 *pcCodeStartAddresses, UINT_PTR codeStartAddresses[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetILToNativeMapping3) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )( ICorProfilerInfo11 * This, UINT_PTR pNativeCodeStartAddress, @@ -18496,6 +20449,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetCodeInfo4) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )( ICorProfilerInfo11 * This, UINT_PTR pNativeCodeStartAddress, @@ -18503,21 +20457,25 @@ EXTERN_C const IID IID_ICorProfilerInfo11; ULONG32 *pcCodeInfos, COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, EnumerateObjectReferences) HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )( ICorProfilerInfo11 * This, ObjectID objectId, ObjectReferenceCallback callback, void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, IsFrozenObject) HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )( ICorProfilerInfo11 * This, ObjectID objectId, BOOL *pbFrozen); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, GetLOHObjectSizeThreshold) HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )( ICorProfilerInfo11 * This, DWORD *pThreshold); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, RequestReJITWithInliners) HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )( ICorProfilerInfo11 * This, /* [in] */ DWORD dwRejitFlags, @@ -18525,12 +20483,15 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, SuspendRuntime) HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )( ICorProfilerInfo11 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, ResumeRuntime) HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )( ICorProfilerInfo11 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo11, GetEnvironmentVariable) HRESULT ( STDMETHODCALLTYPE *GetEnvironmentVariable )( ICorProfilerInfo11 * This, /* [string][in] */ const WCHAR *szName, @@ -18539,6 +20500,7 @@ EXTERN_C const IID IID_ICorProfilerInfo11; /* [annotation][out] */ _Out_writes_to_(cchValue, *pcchValue) WCHAR szValue[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo11, SetEnvironmentVariable) HRESULT ( STDMETHODCALLTYPE *SetEnvironmentVariable )( ICorProfilerInfo11 * This, /* [string][in] */ const WCHAR *szName, @@ -18557,329 +20519,329 @@ EXTERN_C const IID IID_ICorProfilerInfo11; #ifdef COBJMACROS -#define ICorProfilerInfo11_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo11_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo11_AddRef(This) \ +#define ICorProfilerInfo11_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo11_Release(This) \ +#define ICorProfilerInfo11_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo11_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo11_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo11_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo11_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo11_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo11_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo11_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo11_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo11_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo11_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo11_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo11_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo11_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo11_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo11_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo11_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo11_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo11_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo11_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo11_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo11_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo11_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo11_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo11_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo11_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo11_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo11_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo11_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo11_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo11_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo11_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo11_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo11_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo11_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo11_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo11_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo11_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo11_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo11_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo11_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo11_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo11_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo11_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo11_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo11_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo11_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo11_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo11_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo11_ForceGC(This) \ +#define ICorProfilerInfo11_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo11_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo11_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo11_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo11_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo11_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo11_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo11_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo11_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo11_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo11_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo11_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo11_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo11_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo11_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo11_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo11_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo11_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo11_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo11_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo11_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo11_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo11_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo11_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo11_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo11_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo11_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo11_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo11_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo11_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo11_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo11_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo11_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo11_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo11_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo11_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo11_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo11_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo11_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo11_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo11_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo11_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo11_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo11_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo11_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo11_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo11_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo11_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo11_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo11_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo11_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo11_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo11_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo11_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo11_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo11_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo11_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo11_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo11_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo11_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo11_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo11_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo11_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo11_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo11_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo11_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo11_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo11_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo11_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo11_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo11_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo11_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo11_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo11_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo11_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo11_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo11_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo11_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo11_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) -#define ICorProfilerInfo11_EnumThreads(This,ppEnum) \ +#define ICorProfilerInfo11_EnumThreads(This,ppEnum) \ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) -#define ICorProfilerInfo11_InitializeCurrentThread(This) \ +#define ICorProfilerInfo11_InitializeCurrentThread(This) \ ( (This)->lpVtbl -> InitializeCurrentThread(This) ) -#define ICorProfilerInfo11_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo11_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo11_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ +#define ICorProfilerInfo11_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) -#define ICorProfilerInfo11_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo11_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo11_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ +#define ICorProfilerInfo11_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) -#define ICorProfilerInfo11_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ +#define ICorProfilerInfo11_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) -#define ICorProfilerInfo11_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ +#define ICorProfilerInfo11_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) -#define ICorProfilerInfo11_EnumJITedFunctions2(This,ppEnum) \ +#define ICorProfilerInfo11_EnumJITedFunctions2(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) -#define ICorProfilerInfo11_GetObjectSize2(This,objectId,pcSize) \ +#define ICorProfilerInfo11_GetObjectSize2(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) -#define ICorProfilerInfo11_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ +#define ICorProfilerInfo11_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) -#define ICorProfilerInfo11_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ +#define ICorProfilerInfo11_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) -#define ICorProfilerInfo11_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ +#define ICorProfilerInfo11_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) -#define ICorProfilerInfo11_ApplyMetaData(This,moduleId) \ +#define ICorProfilerInfo11_ApplyMetaData(This,moduleId) \ ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) -#define ICorProfilerInfo11_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ +#define ICorProfilerInfo11_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) -#define ICorProfilerInfo11_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ +#define ICorProfilerInfo11_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) -#define ICorProfilerInfo11_IsFunctionDynamic(This,functionId,isDynamic) \ +#define ICorProfilerInfo11_IsFunctionDynamic(This,functionId,isDynamic) \ ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) ) -#define ICorProfilerInfo11_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ +#define ICorProfilerInfo11_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) ) -#define ICorProfilerInfo11_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ +#define ICorProfilerInfo11_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) ) -#define ICorProfilerInfo11_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ +#define ICorProfilerInfo11_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) ) -#define ICorProfilerInfo11_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ +#define ICorProfilerInfo11_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) ) -#define ICorProfilerInfo11_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo11_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo11_EnumerateObjectReferences(This,objectId,callback,clientData) \ +#define ICorProfilerInfo11_EnumerateObjectReferences(This,objectId,callback,clientData) \ ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) ) -#define ICorProfilerInfo11_IsFrozenObject(This,objectId,pbFrozen) \ +#define ICorProfilerInfo11_IsFrozenObject(This,objectId,pbFrozen) \ ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) ) -#define ICorProfilerInfo11_GetLOHObjectSizeThreshold(This,pThreshold) \ +#define ICorProfilerInfo11_GetLOHObjectSizeThreshold(This,pThreshold) \ ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) ) -#define ICorProfilerInfo11_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo11_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo11_SuspendRuntime(This) \ +#define ICorProfilerInfo11_SuspendRuntime(This) \ ( (This)->lpVtbl -> SuspendRuntime(This) ) -#define ICorProfilerInfo11_ResumeRuntime(This) \ +#define ICorProfilerInfo11_ResumeRuntime(This) \ ( (This)->lpVtbl -> ResumeRuntime(This) ) -#define ICorProfilerInfo11_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) \ +#define ICorProfilerInfo11_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) \ ( (This)->lpVtbl -> GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) ) -#define ICorProfilerInfo11_SetEnvironmentVariable(This,szName,szValue) \ +#define ICorProfilerInfo11_SetEnvironmentVariable(This,szName,szValue) \ ( (This)->lpVtbl -> SetEnvironmentVariable(This,szName,szValue) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerInfo11_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo11_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerInfo12_INTERFACE_DEFINED__ @@ -18944,66 +20906,78 @@ EXTERN_C const IID IID_ICorProfilerInfo12; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerInfo12Vtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerInfo12 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerInfo12 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerInfo12 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( ICorProfilerInfo12 * This, /* [in] */ ObjectID objectId, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdTypeDef typeDef, /* [out] */ ClassID *pClassId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, /* [out] */ LPCBYTE *pStart, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) HRESULT ( STDMETHODCALLTYPE *GetEventMask )( ICorProfilerInfo12 * This, /* [out] */ DWORD *pdwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( ICorProfilerInfo12 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdToken token, /* [out] */ FunctionID *pFunctionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( ICorProfilerInfo12 * This, /* [in] */ ThreadID threadId, /* [out] */ HANDLE *phThread); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( ICorProfilerInfo12 * This, /* [in] */ ObjectID objectId, /* [out] */ ULONG *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, @@ -19011,21 +20985,25 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ClassID *pBaseClassId, /* [out] */ ULONG *pcRank); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( ICorProfilerInfo12 * This, /* [in] */ ThreadID threadId, /* [out] */ DWORD *pdwWin32ThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( ICorProfilerInfo12 * This, /* [out] */ ThreadID *pThreadId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, /* [out] */ ModuleID *pModuleId, /* [out] */ mdTypeDef *pTypeDefToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, @@ -19033,20 +21011,24 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ModuleID *pModuleId, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) HRESULT ( STDMETHODCALLTYPE *SetEventMask )( ICorProfilerInfo12 * This, /* [in] */ DWORD dwEvents); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( ICorProfilerInfo12 * This, /* [in] */ FunctionEnter *pFuncEnter, /* [in] */ FunctionLeave *pFuncLeave, /* [in] */ FunctionTailcall *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( ICorProfilerInfo12 * This, /* [in] */ FunctionIDMapper *pFunc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, @@ -19054,6 +21036,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ IUnknown **ppImport, /* [out] */ mdToken *pToken); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, @@ -19064,6 +21047,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ AssemblyID *pAssemblyId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, @@ -19071,6 +21055,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [in] */ REFIID riid, /* [out] */ IUnknown **ppOut); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, @@ -19078,17 +21063,20 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ LPCBYTE *ppMethodHeader, /* [out] */ ULONG *pcbMethodSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, /* [out] */ IMethodMalloc **ppMalloc); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, /* [in] */ mdMethodDef methodid, /* [in] */ LPCBYTE pbNewILMethodHeader); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( ICorProfilerInfo12 * This, /* [in] */ AppDomainID appDomainId, @@ -19098,6 +21086,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], /* [out] */ ProcessID *pProcessId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( ICorProfilerInfo12 * This, /* [in] */ AssemblyID assemblyId, @@ -19108,13 +21097,16 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ AppDomainID *pAppDomainId, /* [out] */ ModuleID *pModuleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) HRESULT ( STDMETHODCALLTYPE *ForceGC )( ICorProfilerInfo12 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, @@ -19122,28 +21114,34 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [in] */ ULONG cILMapEntries, /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( ICorProfilerInfo12 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( ICorProfilerInfo12 * This, /* [out] */ IUnknown **ppicd); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( ICorProfilerInfo12 * This, /* [in] */ ThreadID threadId, /* [out] */ ContextID *pContextId); + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( ICorProfilerInfo12 * This, /* [in] */ BOOL fThisThreadOnly, /* [out] */ DWORD *pdwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( ICorProfilerInfo12 * This, /* [in] */ DWORD dwProfilerContext); + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, @@ -19151,6 +21149,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( ICorProfilerInfo12 * This, /* [in] */ ThreadID thread, @@ -19160,12 +21159,14 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [size_is][in] */ BYTE context[ ], /* [in] */ ULONG32 contextSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( ICorProfilerInfo12 * This, /* [in] */ FunctionEnter2 *pFuncEnter, /* [in] */ FunctionLeave2 *pFuncLeave, /* [in] */ FunctionTailcall2 *pFuncTailcall); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( ICorProfilerInfo12 * This, /* [in] */ FunctionID funcId, @@ -19177,12 +21178,14 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG32 *pcTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( ICorProfilerInfo12 * This, /* [out] */ ULONG *pBufferLengthOffset, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( ICorProfilerInfo12 * This, /* [in] */ ClassID classID, @@ -19191,6 +21194,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG *pcFieldOffset, /* [out] */ ULONG *pulClassSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, @@ -19201,6 +21205,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG32 *pcNumTypeArgs, /* [out] */ ClassID typeArgs[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionID, @@ -19208,6 +21213,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleID, @@ -19216,6 +21222,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ ClassID *pClassID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleID, @@ -19225,11 +21232,13 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [size_is][in] */ ClassID typeArgs[ ], /* [out] */ FunctionID *pFunctionID); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleID, /* [out] */ ICorProfilerObjectEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( ICorProfilerInfo12 * This, /* [in] */ ObjectID objectId, @@ -19238,22 +21247,26 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [size_is][out] */ int pDimensionLowerBounds[ ], /* [out] */ BYTE **ppData); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, /* [out] */ ULONG32 *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( ICorProfilerInfo12 * This, /* [in] */ ThreadID threadId, /* [out] */ AppDomainID *pAppDomainId); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, @@ -19261,6 +21274,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [in] */ AppDomainID appDomainId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, @@ -19268,6 +21282,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, @@ -19275,57 +21290,68 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [in] */ ContextID contextId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, /* [in] */ mdFieldDef fieldToken, /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( ICorProfilerInfo12 * This, /* [in] */ ULONG cObjectRanges, /* [out] */ ULONG *pcObjectRanges, /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( ICorProfilerInfo12 * This, /* [in] */ ObjectID objectId, /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( ICorProfilerInfo12 * This, /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( ICorProfilerInfo12 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( ICorProfilerInfo12 * This, /* [in] */ DWORD dwExpectedCompletionMilliseconds); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( ICorProfilerInfo12 * This, /* [in] */ FunctionIDMapper2 *pFunc, /* [in] */ void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( ICorProfilerInfo12 * This, /* [out] */ ULONG *pStringLengthOffset, /* [out] */ ULONG *pBufferOffset); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( ICorProfilerInfo12 * This, /* [in] */ FunctionEnter3 *pFuncEnter3, /* [in] */ FunctionLeave3 *pFuncLeave3, /* [in] */ FunctionTailcall3 *pFuncTailcall3); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( ICorProfilerInfo12 * This, /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, @@ -19334,6 +21360,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out][in] */ ULONG *pcbArgumentInfo, /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, @@ -19341,16 +21368,19 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, /* [in] */ COR_PRF_ELT_INFO eltInfo, /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) HRESULT ( STDMETHODCALLTYPE *EnumModules )( ICorProfilerInfo12 * This, /* [out] */ ICorProfilerModuleEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( ICorProfilerInfo12 * This, /* [out] */ USHORT *pClrInstanceId, @@ -19364,6 +21394,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [annotation][out] */ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( ICorProfilerInfo12 * This, /* [in] */ ClassID classId, @@ -19372,6 +21403,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [in] */ ThreadID threadId, /* [out] */ void **ppAddress); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, @@ -19379,6 +21411,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG32 *pcAppDomainIds, /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, @@ -19390,19 +21423,23 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ AssemblyID *pAssemblyId, /* [out] */ DWORD *pdwModuleFlags); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) HRESULT ( STDMETHODCALLTYPE *EnumThreads )( ICorProfilerInfo12 * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( ICorProfilerInfo12 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( ICorProfilerInfo12 * This, /* [in] */ ULONG cFunctions, /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) HRESULT ( STDMETHODCALLTYPE *RequestRevert )( ICorProfilerInfo12 * This, /* [in] */ ULONG cFunctions, @@ -19410,6 +21447,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [size_is][in] */ mdMethodDef methodIds[ ], /* [size_is][out] */ HRESULT status[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionID, @@ -19418,12 +21456,14 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG32 *pcCodeInfos, /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( ICorProfilerInfo12 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *pFunctionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, @@ -19431,6 +21471,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG *pcReJitIds, /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, @@ -19439,25 +21480,30 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG32 *pcMap, /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( ICorProfilerInfo12 * This, /* [out] */ ICorProfilerFunctionEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( ICorProfilerInfo12 * This, /* [in] */ ObjectID objectId, /* [out] */ SIZE_T *pcSize); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( ICorProfilerInfo12 * This, /* [out] */ DWORD *pdwEventsLow, /* [out] */ DWORD *pdwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( ICorProfilerInfo12 * This, /* [in] */ DWORD dwEventsLow, /* [in] */ DWORD dwEventsHigh); + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( ICorProfilerInfo12 * This, /* [in] */ ModuleID inlinersModuleId, @@ -19466,15 +21512,18 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ BOOL *incompleteData, /* [out] */ ICorProfilerMethodEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ApplyMetaData) HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, GetInMemorySymbolsLength) HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, /* [out] */ DWORD *pCountSymbolBytes); + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ReadInMemorySymbols) HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( ICorProfilerInfo12 * This, /* [in] */ ModuleID moduleId, @@ -19483,17 +21532,20 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [in] */ DWORD countSymbolBytes, /* [out] */ DWORD *pCountSymbolBytesRead); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, IsFunctionDynamic) HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, /* [out] */ BOOL *isDynamic); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetFunctionFromIP3) HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )( ICorProfilerInfo12 * This, /* [in] */ LPCBYTE ip, /* [out] */ FunctionID *functionId, /* [out] */ ReJITID *pReJitId); + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetDynamicFunctionInfo) HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )( ICorProfilerInfo12 * This, /* [in] */ FunctionID functionId, @@ -19504,6 +21556,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [out] */ ULONG *pcchName, /* [out] */ WCHAR wszName[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetNativeCodeStartAddresses) HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )( ICorProfilerInfo12 * This, FunctionID functionID, @@ -19512,6 +21565,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; ULONG32 *pcCodeStartAddresses, UINT_PTR codeStartAddresses[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetILToNativeMapping3) HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )( ICorProfilerInfo12 * This, UINT_PTR pNativeCodeStartAddress, @@ -19519,6 +21573,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetCodeInfo4) HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )( ICorProfilerInfo12 * This, UINT_PTR pNativeCodeStartAddress, @@ -19526,21 +21581,25 @@ EXTERN_C const IID IID_ICorProfilerInfo12; ULONG32 *pcCodeInfos, COR_PRF_CODE_INFO codeInfos[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, EnumerateObjectReferences) HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )( ICorProfilerInfo12 * This, ObjectID objectId, ObjectReferenceCallback callback, void *clientData); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, IsFrozenObject) HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )( ICorProfilerInfo12 * This, ObjectID objectId, BOOL *pbFrozen); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, GetLOHObjectSizeThreshold) HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )( ICorProfilerInfo12 * This, DWORD *pThreshold); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, RequestReJITWithInliners) HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )( ICorProfilerInfo12 * This, /* [in] */ DWORD dwRejitFlags, @@ -19548,12 +21607,15 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [size_is][in] */ ModuleID moduleIds[ ], /* [size_is][in] */ mdMethodDef methodIds[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, SuspendRuntime) HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )( ICorProfilerInfo12 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo10, ResumeRuntime) HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )( ICorProfilerInfo12 * This); + DECLSPEC_XFGVIRT(ICorProfilerInfo11, GetEnvironmentVariable) HRESULT ( STDMETHODCALLTYPE *GetEnvironmentVariable )( ICorProfilerInfo12 * This, /* [string][in] */ const WCHAR *szName, @@ -19562,11 +21624,13 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [annotation][out] */ _Out_writes_to_(cchValue, *pcchValue) WCHAR szValue[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo11, SetEnvironmentVariable) HRESULT ( STDMETHODCALLTYPE *SetEnvironmentVariable )( ICorProfilerInfo12 * This, /* [string][in] */ const WCHAR *szName, /* [string][in] */ const WCHAR *szValue); + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeStartSession) HRESULT ( STDMETHODCALLTYPE *EventPipeStartSession )( ICorProfilerInfo12 * This, /* [in] */ UINT32 cProviderConfigs, @@ -19574,20 +21638,24 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [in] */ BOOL requestRundown, /* [out] */ EVENTPIPE_SESSION *pSession); + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeAddProviderToSession) HRESULT ( STDMETHODCALLTYPE *EventPipeAddProviderToSession )( ICorProfilerInfo12 * This, /* [in] */ EVENTPIPE_SESSION session, /* [in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG providerConfig); + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeStopSession) HRESULT ( STDMETHODCALLTYPE *EventPipeStopSession )( ICorProfilerInfo12 * This, /* [in] */ EVENTPIPE_SESSION session); + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeCreateProvider) HRESULT ( STDMETHODCALLTYPE *EventPipeCreateProvider )( ICorProfilerInfo12 * This, /* [string][in] */ const WCHAR *providerName, /* [out] */ EVENTPIPE_PROVIDER *pProvider); + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeGetProviderInfo) HRESULT ( STDMETHODCALLTYPE *EventPipeGetProviderInfo )( ICorProfilerInfo12 * This, /* [in] */ EVENTPIPE_PROVIDER provider, @@ -19596,6 +21664,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [annotation][out] */ _Out_writes_to_(cchName, *pcchName) WCHAR providerName[ ]); + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeDefineEvent) HRESULT ( STDMETHODCALLTYPE *EventPipeDefineEvent )( ICorProfilerInfo12 * This, /* [in] */ EVENTPIPE_PROVIDER provider, @@ -19610,6 +21679,7 @@ EXTERN_C const IID IID_ICorProfilerInfo12; /* [size_is][in] */ COR_PRF_EVENTPIPE_PARAM_DESC pParamDescs[ ], /* [out] */ EVENTPIPE_EVENT *pEvent); + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeWriteEvent) HRESULT ( STDMETHODCALLTYPE *EventPipeWriteEvent )( ICorProfilerInfo12 * This, /* [in] */ EVENTPIPE_EVENT event, @@ -19631,351 +21701,4012 @@ EXTERN_C const IID IID_ICorProfilerInfo12; #ifdef COBJMACROS -#define ICorProfilerInfo12_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerInfo12_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerInfo12_AddRef(This) \ +#define ICorProfilerInfo12_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerInfo12_Release(This) \ +#define ICorProfilerInfo12_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerInfo12_GetClassFromObject(This,objectId,pClassId) \ +#define ICorProfilerInfo12_GetClassFromObject(This,objectId,pClassId) \ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) -#define ICorProfilerInfo12_GetClassFromToken(This,moduleId,typeDef,pClassId) \ +#define ICorProfilerInfo12_GetClassFromToken(This,moduleId,typeDef,pClassId) \ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) -#define ICorProfilerInfo12_GetCodeInfo(This,functionId,pStart,pcSize) \ +#define ICorProfilerInfo12_GetCodeInfo(This,functionId,pStart,pcSize) \ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) -#define ICorProfilerInfo12_GetEventMask(This,pdwEvents) \ +#define ICorProfilerInfo12_GetEventMask(This,pdwEvents) \ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) -#define ICorProfilerInfo12_GetFunctionFromIP(This,ip,pFunctionId) \ +#define ICorProfilerInfo12_GetFunctionFromIP(This,ip,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) -#define ICorProfilerInfo12_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ +#define ICorProfilerInfo12_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) -#define ICorProfilerInfo12_GetHandleFromThread(This,threadId,phThread) \ +#define ICorProfilerInfo12_GetHandleFromThread(This,threadId,phThread) \ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) -#define ICorProfilerInfo12_GetObjectSize(This,objectId,pcSize) \ +#define ICorProfilerInfo12_GetObjectSize(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) -#define ICorProfilerInfo12_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ +#define ICorProfilerInfo12_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) -#define ICorProfilerInfo12_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ +#define ICorProfilerInfo12_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) -#define ICorProfilerInfo12_GetCurrentThreadID(This,pThreadId) \ +#define ICorProfilerInfo12_GetCurrentThreadID(This,pThreadId) \ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) -#define ICorProfilerInfo12_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ +#define ICorProfilerInfo12_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) -#define ICorProfilerInfo12_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ +#define ICorProfilerInfo12_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) -#define ICorProfilerInfo12_SetEventMask(This,dwEvents) \ +#define ICorProfilerInfo12_SetEventMask(This,dwEvents) \ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) -#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo12_SetFunctionIDMapper(This,pFunc) \ +#define ICorProfilerInfo12_SetFunctionIDMapper(This,pFunc) \ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) -#define ICorProfilerInfo12_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ +#define ICorProfilerInfo12_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) -#define ICorProfilerInfo12_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ +#define ICorProfilerInfo12_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) -#define ICorProfilerInfo12_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ +#define ICorProfilerInfo12_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) -#define ICorProfilerInfo12_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ +#define ICorProfilerInfo12_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) -#define ICorProfilerInfo12_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ +#define ICorProfilerInfo12_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) -#define ICorProfilerInfo12_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ +#define ICorProfilerInfo12_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) -#define ICorProfilerInfo12_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ +#define ICorProfilerInfo12_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) -#define ICorProfilerInfo12_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ +#define ICorProfilerInfo12_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) -#define ICorProfilerInfo12_SetFunctionReJIT(This,functionId) \ +#define ICorProfilerInfo12_SetFunctionReJIT(This,functionId) \ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) -#define ICorProfilerInfo12_ForceGC(This) \ +#define ICorProfilerInfo12_ForceGC(This) \ ( (This)->lpVtbl -> ForceGC(This) ) -#define ICorProfilerInfo12_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ +#define ICorProfilerInfo12_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) -#define ICorProfilerInfo12_GetInprocInspectionInterface(This,ppicd) \ +#define ICorProfilerInfo12_GetInprocInspectionInterface(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) -#define ICorProfilerInfo12_GetInprocInspectionIThisThread(This,ppicd) \ +#define ICorProfilerInfo12_GetInprocInspectionIThisThread(This,ppicd) \ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) -#define ICorProfilerInfo12_GetThreadContext(This,threadId,pContextId) \ +#define ICorProfilerInfo12_GetThreadContext(This,threadId,pContextId) \ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) -#define ICorProfilerInfo12_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ +#define ICorProfilerInfo12_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) -#define ICorProfilerInfo12_EndInprocDebugging(This,dwProfilerContext) \ +#define ICorProfilerInfo12_EndInprocDebugging(This,dwProfilerContext) \ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) -#define ICorProfilerInfo12_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ +#define ICorProfilerInfo12_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) -#define ICorProfilerInfo12_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ +#define ICorProfilerInfo12_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) -#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ +#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) -#define ICorProfilerInfo12_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ +#define ICorProfilerInfo12_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) -#define ICorProfilerInfo12_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo12_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo12_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ +#define ICorProfilerInfo12_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) -#define ICorProfilerInfo12_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ +#define ICorProfilerInfo12_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) -#define ICorProfilerInfo12_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo12_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo12_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ +#define ICorProfilerInfo12_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) -#define ICorProfilerInfo12_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ +#define ICorProfilerInfo12_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) -#define ICorProfilerInfo12_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ +#define ICorProfilerInfo12_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) -#define ICorProfilerInfo12_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ +#define ICorProfilerInfo12_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) -#define ICorProfilerInfo12_GetBoxClassLayout(This,classId,pBufferOffset) \ +#define ICorProfilerInfo12_GetBoxClassLayout(This,classId,pBufferOffset) \ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) -#define ICorProfilerInfo12_GetThreadAppDomain(This,threadId,pAppDomainId) \ +#define ICorProfilerInfo12_GetThreadAppDomain(This,threadId,pAppDomainId) \ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) -#define ICorProfilerInfo12_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ +#define ICorProfilerInfo12_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) -#define ICorProfilerInfo12_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ +#define ICorProfilerInfo12_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) -#define ICorProfilerInfo12_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ +#define ICorProfilerInfo12_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) -#define ICorProfilerInfo12_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ +#define ICorProfilerInfo12_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) -#define ICorProfilerInfo12_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ +#define ICorProfilerInfo12_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) -#define ICorProfilerInfo12_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ +#define ICorProfilerInfo12_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) -#define ICorProfilerInfo12_GetObjectGeneration(This,objectId,range) \ +#define ICorProfilerInfo12_GetObjectGeneration(This,objectId,range) \ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) -#define ICorProfilerInfo12_GetNotifiedExceptionClauseInfo(This,pinfo) \ +#define ICorProfilerInfo12_GetNotifiedExceptionClauseInfo(This,pinfo) \ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) -#define ICorProfilerInfo12_EnumJITedFunctions(This,ppEnum) \ +#define ICorProfilerInfo12_EnumJITedFunctions(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) -#define ICorProfilerInfo12_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ +#define ICorProfilerInfo12_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) -#define ICorProfilerInfo12_SetFunctionIDMapper2(This,pFunc,clientData) \ +#define ICorProfilerInfo12_SetFunctionIDMapper2(This,pFunc,clientData) \ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) -#define ICorProfilerInfo12_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ +#define ICorProfilerInfo12_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) -#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ +#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) -#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ +#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) -#define ICorProfilerInfo12_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ +#define ICorProfilerInfo12_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) -#define ICorProfilerInfo12_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ +#define ICorProfilerInfo12_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) -#define ICorProfilerInfo12_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ +#define ICorProfilerInfo12_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) -#define ICorProfilerInfo12_EnumModules(This,ppEnum) \ +#define ICorProfilerInfo12_EnumModules(This,ppEnum) \ ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) -#define ICorProfilerInfo12_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ +#define ICorProfilerInfo12_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) -#define ICorProfilerInfo12_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ +#define ICorProfilerInfo12_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) -#define ICorProfilerInfo12_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ +#define ICorProfilerInfo12_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) -#define ICorProfilerInfo12_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ +#define ICorProfilerInfo12_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) -#define ICorProfilerInfo12_EnumThreads(This,ppEnum) \ +#define ICorProfilerInfo12_EnumThreads(This,ppEnum) \ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) -#define ICorProfilerInfo12_InitializeCurrentThread(This) \ +#define ICorProfilerInfo12_InitializeCurrentThread(This) \ ( (This)->lpVtbl -> InitializeCurrentThread(This) ) -#define ICorProfilerInfo12_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo12_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo12_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ +#define ICorProfilerInfo12_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) -#define ICorProfilerInfo12_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo12_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo12_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ +#define ICorProfilerInfo12_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) -#define ICorProfilerInfo12_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ +#define ICorProfilerInfo12_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) -#define ICorProfilerInfo12_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ +#define ICorProfilerInfo12_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) -#define ICorProfilerInfo12_EnumJITedFunctions2(This,ppEnum) \ +#define ICorProfilerInfo12_EnumJITedFunctions2(This,ppEnum) \ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) -#define ICorProfilerInfo12_GetObjectSize2(This,objectId,pcSize) \ +#define ICorProfilerInfo12_GetObjectSize2(This,objectId,pcSize) \ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) -#define ICorProfilerInfo12_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ +#define ICorProfilerInfo12_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) -#define ICorProfilerInfo12_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ +#define ICorProfilerInfo12_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) -#define ICorProfilerInfo12_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ +#define ICorProfilerInfo12_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) -#define ICorProfilerInfo12_ApplyMetaData(This,moduleId) \ +#define ICorProfilerInfo12_ApplyMetaData(This,moduleId) \ ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) -#define ICorProfilerInfo12_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ +#define ICorProfilerInfo12_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) -#define ICorProfilerInfo12_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ +#define ICorProfilerInfo12_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) -#define ICorProfilerInfo12_IsFunctionDynamic(This,functionId,isDynamic) \ +#define ICorProfilerInfo12_IsFunctionDynamic(This,functionId,isDynamic) \ ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) ) -#define ICorProfilerInfo12_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ +#define ICorProfilerInfo12_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) ) -#define ICorProfilerInfo12_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ +#define ICorProfilerInfo12_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) ) -#define ICorProfilerInfo12_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ +#define ICorProfilerInfo12_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) ) -#define ICorProfilerInfo12_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ +#define ICorProfilerInfo12_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) ) -#define ICorProfilerInfo12_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ +#define ICorProfilerInfo12_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) ) -#define ICorProfilerInfo12_EnumerateObjectReferences(This,objectId,callback,clientData) \ +#define ICorProfilerInfo12_EnumerateObjectReferences(This,objectId,callback,clientData) \ ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) ) -#define ICorProfilerInfo12_IsFrozenObject(This,objectId,pbFrozen) \ +#define ICorProfilerInfo12_IsFrozenObject(This,objectId,pbFrozen) \ ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) ) -#define ICorProfilerInfo12_GetLOHObjectSizeThreshold(This,pThreshold) \ +#define ICorProfilerInfo12_GetLOHObjectSizeThreshold(This,pThreshold) \ ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) ) -#define ICorProfilerInfo12_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) \ +#define ICorProfilerInfo12_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) \ ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) ) -#define ICorProfilerInfo12_SuspendRuntime(This) \ +#define ICorProfilerInfo12_SuspendRuntime(This) \ ( (This)->lpVtbl -> SuspendRuntime(This) ) -#define ICorProfilerInfo12_ResumeRuntime(This) \ +#define ICorProfilerInfo12_ResumeRuntime(This) \ ( (This)->lpVtbl -> ResumeRuntime(This) ) -#define ICorProfilerInfo12_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) \ +#define ICorProfilerInfo12_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) \ ( (This)->lpVtbl -> GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) ) -#define ICorProfilerInfo12_SetEnvironmentVariable(This,szName,szValue) \ +#define ICorProfilerInfo12_SetEnvironmentVariable(This,szName,szValue) \ ( (This)->lpVtbl -> SetEnvironmentVariable(This,szName,szValue) ) -#define ICorProfilerInfo12_EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) \ +#define ICorProfilerInfo12_EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) \ ( (This)->lpVtbl -> EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) ) -#define ICorProfilerInfo12_EventPipeAddProviderToSession(This,session,providerConfig) \ +#define ICorProfilerInfo12_EventPipeAddProviderToSession(This,session,providerConfig) \ ( (This)->lpVtbl -> EventPipeAddProviderToSession(This,session,providerConfig) ) -#define ICorProfilerInfo12_EventPipeStopSession(This,session) \ +#define ICorProfilerInfo12_EventPipeStopSession(This,session) \ ( (This)->lpVtbl -> EventPipeStopSession(This,session) ) -#define ICorProfilerInfo12_EventPipeCreateProvider(This,providerName,pProvider) \ +#define ICorProfilerInfo12_EventPipeCreateProvider(This,providerName,pProvider) \ ( (This)->lpVtbl -> EventPipeCreateProvider(This,providerName,pProvider) ) -#define ICorProfilerInfo12_EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) \ +#define ICorProfilerInfo12_EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) \ ( (This)->lpVtbl -> EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) ) -#define ICorProfilerInfo12_EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) \ +#define ICorProfilerInfo12_EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) \ ( (This)->lpVtbl -> EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) ) -#define ICorProfilerInfo12_EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) \ +#define ICorProfilerInfo12_EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) \ ( (This)->lpVtbl -> EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ + + + + +#endif /* __ICorProfilerInfo12_INTERFACE_DEFINED__ */ + + +#ifndef __ICorProfilerInfo13_INTERFACE_DEFINED__ +#define __ICorProfilerInfo13_INTERFACE_DEFINED__ + +/* interface ICorProfilerInfo13 */ +/* [local][unique][uuid][object] */ + + +EXTERN_C const IID IID_ICorProfilerInfo13; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6E6C7EE2-0701-4EC2-9D29-2E8733B66934") + ICorProfilerInfo13 : public ICorProfilerInfo12 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateHandle( + /* [in] */ ObjectID object, + /* [in] */ COR_PRF_HANDLE_TYPE type, + /* [out] */ ObjectHandleID *pHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE DestroyHandle( + /* [in] */ ObjectHandleID handle) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetObjectIDFromHandle( + /* [in] */ ObjectHandleID handle, + /* [out] */ ObjectID *pObject) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorProfilerInfo13Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorProfilerInfo13 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorProfilerInfo13 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ICorProfilerInfo13 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) + HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( + ICorProfilerInfo13 * This, + /* [in] */ ObjectID objectId, + /* [out] */ ClassID *pClassId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) + HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdTypeDef typeDef, + /* [out] */ ClassID *pClassId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [out] */ LPCBYTE *pStart, + /* [out] */ ULONG *pcSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) + HRESULT ( STDMETHODCALLTYPE *GetEventMask )( + ICorProfilerInfo13 * This, + /* [out] */ DWORD *pdwEvents); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( + ICorProfilerInfo13 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *pFunctionId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdToken token, + /* [out] */ FunctionID *pFunctionId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) + HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( + ICorProfilerInfo13 * This, + /* [in] */ ThreadID threadId, + /* [out] */ HANDLE *phThread); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + ICorProfilerInfo13 * This, + /* [in] */ ObjectID objectId, + /* [out] */ ULONG *pcSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) + HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [out] */ CorElementType *pBaseElemType, + /* [out] */ ClassID *pBaseClassId, + /* [out] */ ULONG *pcRank); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) + HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( + ICorProfilerInfo13 * This, + /* [in] */ ThreadID threadId, + /* [out] */ DWORD *pdwWin32ThreadId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) + HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( + ICorProfilerInfo13 * This, + /* [out] */ ThreadID *pThreadId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) + HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdTypeDef *pTypeDefToken); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) + HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [out] */ ClassID *pClassId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdToken *pToken); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) + HRESULT ( STDMETHODCALLTYPE *SetEventMask )( + ICorProfilerInfo13 * This, + /* [in] */ DWORD dwEvents); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionEnter *pFuncEnter, + /* [in] */ FunctionLeave *pFuncLeave, + /* [in] */ FunctionTailcall *pFuncTailcall); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) + HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionIDMapper *pFunc); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) + HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [in] */ REFIID riid, + /* [out] */ IUnknown **ppImport, + /* [out] */ mdToken *pToken); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) + HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ LPCBYTE *ppBaseLoadAddress, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AssemblyID *pAssemblyId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) + HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ DWORD dwOpenFlags, + /* [in] */ REFIID riid, + /* [out] */ IUnknown **ppOut); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) + HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdMethodDef methodId, + /* [out] */ LPCBYTE *ppMethodHeader, + /* [out] */ ULONG *pcbMethodSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) + HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ IMethodMalloc **ppMalloc); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) + HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdMethodDef methodid, + /* [in] */ LPCBYTE pbNewILMethodHeader); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) + HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( + ICorProfilerInfo13 * This, + /* [in] */ AppDomainID appDomainId, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ ProcessID *pProcessId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) + HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( + ICorProfilerInfo13 * This, + /* [in] */ AssemblyID assemblyId, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AppDomainID *pAppDomainId, + /* [out] */ ModuleID *pModuleId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) + HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) + HRESULT ( STDMETHODCALLTYPE *ForceGC )( + ICorProfilerInfo13 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) + HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [in] */ BOOL fStartJit, + /* [in] */ ULONG cILMapEntries, + /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) + HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( + ICorProfilerInfo13 * This, + /* [out] */ IUnknown **ppicd); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) + HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( + ICorProfilerInfo13 * This, + /* [out] */ IUnknown **ppicd); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) + HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( + ICorProfilerInfo13 * This, + /* [in] */ ThreadID threadId, + /* [out] */ ContextID *pContextId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) + HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( + ICorProfilerInfo13 * This, + /* [in] */ BOOL fThisThreadOnly, + /* [out] */ DWORD *pdwProfilerContext); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) + HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( + ICorProfilerInfo13 * This, + /* [in] */ DWORD dwProfilerContext); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ULONG32 cMap, + /* [out] */ ULONG32 *pcMap, + /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) + HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( + ICorProfilerInfo13 * This, + /* [in] */ ThreadID thread, + /* [in] */ StackSnapshotCallback *callback, + /* [in] */ ULONG32 infoFlags, + /* [in] */ void *clientData, + /* [size_is][in] */ BYTE context[ ], + /* [in] */ ULONG32 contextSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionEnter2 *pFuncEnter, + /* [in] */ FunctionLeave2 *pFuncLeave, + /* [in] */ FunctionTailcall2 *pFuncTailcall); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) + HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID funcId, + /* [in] */ COR_PRF_FRAME_INFO frameInfo, + /* [out] */ ClassID *pClassId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdToken *pToken, + /* [in] */ ULONG32 cTypeArgs, + /* [out] */ ULONG32 *pcTypeArgs, + /* [out] */ ClassID typeArgs[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) + HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( + ICorProfilerInfo13 * This, + /* [out] */ ULONG *pBufferLengthOffset, + /* [out] */ ULONG *pStringLengthOffset, + /* [out] */ ULONG *pBufferOffset); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) + HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classID, + /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[ ], + /* [in] */ ULONG cFieldOffset, + /* [out] */ ULONG *pcFieldOffset, + /* [out] */ ULONG *pulClassSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) + HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdTypeDef *pTypeDefToken, + /* [out] */ ClassID *pParentClassId, + /* [in] */ ULONG32 cNumTypeArgs, + /* [out] */ ULONG32 *pcNumTypeArgs, + /* [out] */ ClassID typeArgs[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionID, + /* [in] */ ULONG32 cCodeInfos, + /* [out] */ ULONG32 *pcCodeInfos, + /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) + HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleID, + /* [in] */ mdTypeDef typeDef, + /* [in] */ ULONG32 cTypeArgs, + /* [size_is][in] */ ClassID typeArgs[ ], + /* [out] */ ClassID *pClassID); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleID, + /* [in] */ mdMethodDef funcDef, + /* [in] */ ClassID classId, + /* [in] */ ULONG32 cTypeArgs, + /* [size_is][in] */ ClassID typeArgs[ ], + /* [out] */ FunctionID *pFunctionID); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) + HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleID, + /* [out] */ ICorProfilerObjectEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) + HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( + ICorProfilerInfo13 * This, + /* [in] */ ObjectID objectId, + /* [in] */ ULONG32 cDimensions, + /* [size_is][out] */ ULONG32 pDimensionSizes[ ], + /* [size_is][out] */ int pDimensionLowerBounds[ ], + /* [out] */ BYTE **ppData); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) + HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [out] */ ULONG32 *pBufferOffset); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) + HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( + ICorProfilerInfo13 * This, + /* [in] */ ThreadID threadId, + /* [out] */ AppDomainID *pAppDomainId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ AppDomainID appDomainId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ ThreadID threadId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ ContextID contextId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) + HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) + HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( + ICorProfilerInfo13 * This, + /* [in] */ ULONG cObjectRanges, + /* [out] */ ULONG *pcObjectRanges, + /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) + HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( + ICorProfilerInfo13 * This, + /* [in] */ ObjectID objectId, + /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) + HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( + ICorProfilerInfo13 * This, + /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) + HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( + ICorProfilerInfo13 * This, + /* [out] */ ICorProfilerFunctionEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) + HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( + ICorProfilerInfo13 * This, + /* [in] */ DWORD dwExpectedCompletionMilliseconds); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) + HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionIDMapper2 *pFunc, + /* [in] */ void *clientData); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) + HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( + ICorProfilerInfo13 * This, + /* [out] */ ULONG *pStringLengthOffset, + /* [out] */ ULONG *pBufferOffset); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionEnter3 *pFuncEnter3, + /* [in] */ FunctionLeave3 *pFuncLeave3, + /* [in] */ FunctionTailcall3 *pFuncTailcall3); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, + /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, + /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) + HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, + /* [out][in] */ ULONG *pcbArgumentInfo, + /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) + HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, + /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) + HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) + HRESULT ( STDMETHODCALLTYPE *EnumModules )( + ICorProfilerInfo13 * This, + /* [out] */ ICorProfilerModuleEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) + HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( + ICorProfilerInfo13 * This, + /* [out] */ USHORT *pClrInstanceId, + /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType, + /* [out] */ USHORT *pMajorVersion, + /* [out] */ USHORT *pMinorVersion, + /* [out] */ USHORT *pBuildNumber, + /* [out] */ USHORT *pQFEVersion, + /* [in] */ ULONG cchVersionString, + /* [out] */ ULONG *pcchVersionString, + /* [annotation][out] */ + _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) + HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( + ICorProfilerInfo13 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ AppDomainID appDomainId, + /* [in] */ ThreadID threadId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) + HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ ULONG32 cAppDomainIds, + /* [out] */ ULONG32 *pcAppDomainIds, + /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) + HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ LPCBYTE *ppBaseLoadAddress, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AssemblyID *pAssemblyId, + /* [out] */ DWORD *pdwModuleFlags); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) + HRESULT ( STDMETHODCALLTYPE *EnumThreads )( + ICorProfilerInfo13 * This, + /* [out] */ ICorProfilerThreadEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) + HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( + ICorProfilerInfo13 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) + HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( + ICorProfilerInfo13 * This, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) + HRESULT ( STDMETHODCALLTYPE *RequestRevert )( + ICorProfilerInfo13 * This, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ], + /* [size_is][out] */ HRESULT status[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionID, + /* [in] */ ReJITID reJitId, + /* [in] */ ULONG32 cCodeInfos, + /* [out] */ ULONG32 *pcCodeInfos, + /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( + ICorProfilerInfo13 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *pFunctionId, + /* [out] */ ReJITID *pReJitId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) + HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ULONG cReJitIds, + /* [out] */ ULONG *pcReJitIds, + /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ReJITID reJitId, + /* [in] */ ULONG32 cMap, + /* [out] */ ULONG32 *pcMap, + /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) + HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( + ICorProfilerInfo13 * This, + /* [out] */ ICorProfilerFunctionEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) + HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( + ICorProfilerInfo13 * This, + /* [in] */ ObjectID objectId, + /* [out] */ SIZE_T *pcSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) + HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( + ICorProfilerInfo13 * This, + /* [out] */ DWORD *pdwEventsLow, + /* [out] */ DWORD *pdwEventsHigh); + + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) + HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( + ICorProfilerInfo13 * This, + /* [in] */ DWORD dwEventsLow, + /* [in] */ DWORD dwEventsHigh); + + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) + HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID inlinersModuleId, + /* [in] */ ModuleID inlineeModuleId, + /* [in] */ mdMethodDef inlineeMethodId, + /* [out] */ BOOL *incompleteData, + /* [out] */ ICorProfilerMethodEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ApplyMetaData) + HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo7, GetInMemorySymbolsLength) + HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ DWORD *pCountSymbolBytes); + + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ReadInMemorySymbols) + HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( + ICorProfilerInfo13 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ DWORD symbolsReadOffset, + /* [out] */ BYTE *pSymbolBytes, + /* [in] */ DWORD countSymbolBytes, + /* [out] */ DWORD *pCountSymbolBytesRead); + + DECLSPEC_XFGVIRT(ICorProfilerInfo8, IsFunctionDynamic) + HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [out] */ BOOL *isDynamic); + + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetFunctionFromIP3) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )( + ICorProfilerInfo13 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *functionId, + /* [out] */ ReJITID *pReJitId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetDynamicFunctionInfo) + HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )( + ICorProfilerInfo13 * This, + /* [in] */ FunctionID functionId, + /* [out] */ ModuleID *moduleId, + /* [out] */ PCCOR_SIGNATURE *ppvSig, + /* [out] */ ULONG *pbSig, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [out] */ WCHAR wszName[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetNativeCodeStartAddresses) + HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )( + ICorProfilerInfo13 * This, + FunctionID functionID, + ReJITID reJitId, + ULONG32 cCodeStartAddresses, + ULONG32 *pcCodeStartAddresses, + UINT_PTR codeStartAddresses[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetILToNativeMapping3) + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )( + ICorProfilerInfo13 * This, + UINT_PTR pNativeCodeStartAddress, + ULONG32 cMap, + ULONG32 *pcMap, + COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetCodeInfo4) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )( + ICorProfilerInfo13 * This, + UINT_PTR pNativeCodeStartAddress, + ULONG32 cCodeInfos, + ULONG32 *pcCodeInfos, + COR_PRF_CODE_INFO codeInfos[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, EnumerateObjectReferences) + HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )( + ICorProfilerInfo13 * This, + ObjectID objectId, + ObjectReferenceCallback callback, + void *clientData); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, IsFrozenObject) + HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )( + ICorProfilerInfo13 * This, + ObjectID objectId, + BOOL *pbFrozen); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, GetLOHObjectSizeThreshold) + HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )( + ICorProfilerInfo13 * This, + DWORD *pThreshold); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, RequestReJITWithInliners) + HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )( + ICorProfilerInfo13 * This, + /* [in] */ DWORD dwRejitFlags, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, SuspendRuntime) + HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )( + ICorProfilerInfo13 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, ResumeRuntime) + HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )( + ICorProfilerInfo13 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo11, GetEnvironmentVariable) + HRESULT ( STDMETHODCALLTYPE *GetEnvironmentVariable )( + ICorProfilerInfo13 * This, + /* [string][in] */ const WCHAR *szName, + /* [in] */ ULONG cchValue, + /* [out] */ ULONG *pcchValue, + /* [annotation][out] */ + _Out_writes_to_(cchValue, *pcchValue) WCHAR szValue[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo11, SetEnvironmentVariable) + HRESULT ( STDMETHODCALLTYPE *SetEnvironmentVariable )( + ICorProfilerInfo13 * This, + /* [string][in] */ const WCHAR *szName, + /* [string][in] */ const WCHAR *szValue); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeStartSession) + HRESULT ( STDMETHODCALLTYPE *EventPipeStartSession )( + ICorProfilerInfo13 * This, + /* [in] */ UINT32 cProviderConfigs, + /* [size_is][in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG pProviderConfigs[ ], + /* [in] */ BOOL requestRundown, + /* [out] */ EVENTPIPE_SESSION *pSession); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeAddProviderToSession) + HRESULT ( STDMETHODCALLTYPE *EventPipeAddProviderToSession )( + ICorProfilerInfo13 * This, + /* [in] */ EVENTPIPE_SESSION session, + /* [in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG providerConfig); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeStopSession) + HRESULT ( STDMETHODCALLTYPE *EventPipeStopSession )( + ICorProfilerInfo13 * This, + /* [in] */ EVENTPIPE_SESSION session); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeCreateProvider) + HRESULT ( STDMETHODCALLTYPE *EventPipeCreateProvider )( + ICorProfilerInfo13 * This, + /* [string][in] */ const WCHAR *providerName, + /* [out] */ EVENTPIPE_PROVIDER *pProvider); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeGetProviderInfo) + HRESULT ( STDMETHODCALLTYPE *EventPipeGetProviderInfo )( + ICorProfilerInfo13 * This, + /* [in] */ EVENTPIPE_PROVIDER provider, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR providerName[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeDefineEvent) + HRESULT ( STDMETHODCALLTYPE *EventPipeDefineEvent )( + ICorProfilerInfo13 * This, + /* [in] */ EVENTPIPE_PROVIDER provider, + /* [string][in] */ const WCHAR *eventName, + /* [in] */ UINT32 eventID, + /* [in] */ UINT64 keywords, + /* [in] */ UINT32 eventVersion, + /* [in] */ UINT32 level, + /* [in] */ UINT8 opcode, + /* [in] */ BOOL needStack, + /* [in] */ UINT32 cParamDescs, + /* [size_is][in] */ COR_PRF_EVENTPIPE_PARAM_DESC pParamDescs[ ], + /* [out] */ EVENTPIPE_EVENT *pEvent); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeWriteEvent) + HRESULT ( STDMETHODCALLTYPE *EventPipeWriteEvent )( + ICorProfilerInfo13 * This, + /* [in] */ EVENTPIPE_EVENT event, + /* [in] */ UINT32 cData, + /* [size_is][in] */ COR_PRF_EVENT_DATA data[ ], + /* [in] */ LPCGUID pActivityId, + /* [in] */ LPCGUID pRelatedActivityId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo13, CreateHandle) + HRESULT ( STDMETHODCALLTYPE *CreateHandle )( + ICorProfilerInfo13 * This, + /* [in] */ ObjectID object, + /* [in] */ COR_PRF_HANDLE_TYPE type, + /* [out] */ ObjectHandleID *pHandle); + + DECLSPEC_XFGVIRT(ICorProfilerInfo13, DestroyHandle) + HRESULT ( STDMETHODCALLTYPE *DestroyHandle )( + ICorProfilerInfo13 * This, + /* [in] */ ObjectHandleID handle); + + DECLSPEC_XFGVIRT(ICorProfilerInfo13, GetObjectIDFromHandle) + HRESULT ( STDMETHODCALLTYPE *GetObjectIDFromHandle )( + ICorProfilerInfo13 * This, + /* [in] */ ObjectHandleID handle, + /* [out] */ ObjectID *pObject); + + END_INTERFACE + } ICorProfilerInfo13Vtbl; + + interface ICorProfilerInfo13 + { + CONST_VTBL struct ICorProfilerInfo13Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorProfilerInfo13_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorProfilerInfo13_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorProfilerInfo13_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorProfilerInfo13_GetClassFromObject(This,objectId,pClassId) \ + ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) + +#define ICorProfilerInfo13_GetClassFromToken(This,moduleId,typeDef,pClassId) \ + ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) + +#define ICorProfilerInfo13_GetCodeInfo(This,functionId,pStart,pcSize) \ + ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) + +#define ICorProfilerInfo13_GetEventMask(This,pdwEvents) \ + ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) + +#define ICorProfilerInfo13_GetFunctionFromIP(This,ip,pFunctionId) \ + ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) + +#define ICorProfilerInfo13_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ + ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) + +#define ICorProfilerInfo13_GetHandleFromThread(This,threadId,phThread) \ + ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) + +#define ICorProfilerInfo13_GetObjectSize(This,objectId,pcSize) \ + ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) + +#define ICorProfilerInfo13_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ + ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) + +#define ICorProfilerInfo13_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ + ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) + +#define ICorProfilerInfo13_GetCurrentThreadID(This,pThreadId) \ + ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) + +#define ICorProfilerInfo13_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ + ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) + +#define ICorProfilerInfo13_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ + ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) + +#define ICorProfilerInfo13_SetEventMask(This,dwEvents) \ + ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) + +#define ICorProfilerInfo13_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) + +#define ICorProfilerInfo13_SetFunctionIDMapper(This,pFunc) \ + ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) + +#define ICorProfilerInfo13_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ + ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) + +#define ICorProfilerInfo13_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ + ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) + +#define ICorProfilerInfo13_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ + ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) + +#define ICorProfilerInfo13_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ + ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) + +#define ICorProfilerInfo13_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ + ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) + +#define ICorProfilerInfo13_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ + ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) + +#define ICorProfilerInfo13_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ + ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) + +#define ICorProfilerInfo13_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ + ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) + +#define ICorProfilerInfo13_SetFunctionReJIT(This,functionId) \ + ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) + +#define ICorProfilerInfo13_ForceGC(This) \ + ( (This)->lpVtbl -> ForceGC(This) ) + +#define ICorProfilerInfo13_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ + ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) + +#define ICorProfilerInfo13_GetInprocInspectionInterface(This,ppicd) \ + ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) + +#define ICorProfilerInfo13_GetInprocInspectionIThisThread(This,ppicd) \ + ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) + +#define ICorProfilerInfo13_GetThreadContext(This,threadId,pContextId) \ + ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) + +#define ICorProfilerInfo13_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ + ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) + +#define ICorProfilerInfo13_EndInprocDebugging(This,dwProfilerContext) \ + ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) + +#define ICorProfilerInfo13_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) + + +#define ICorProfilerInfo13_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ + ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) + +#define ICorProfilerInfo13_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) + +#define ICorProfilerInfo13_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ + ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) + +#define ICorProfilerInfo13_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ + ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) + +#define ICorProfilerInfo13_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ + ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) + +#define ICorProfilerInfo13_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ + ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) + +#define ICorProfilerInfo13_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) + +#define ICorProfilerInfo13_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ + ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) + +#define ICorProfilerInfo13_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ + ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) + +#define ICorProfilerInfo13_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ + ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) + +#define ICorProfilerInfo13_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ + ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) + +#define ICorProfilerInfo13_GetBoxClassLayout(This,classId,pBufferOffset) \ + ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) + +#define ICorProfilerInfo13_GetThreadAppDomain(This,threadId,pAppDomainId) \ + ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) + +#define ICorProfilerInfo13_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ + ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) + +#define ICorProfilerInfo13_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ + ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) + +#define ICorProfilerInfo13_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ + ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) + +#define ICorProfilerInfo13_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ + ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) + +#define ICorProfilerInfo13_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ + ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) + +#define ICorProfilerInfo13_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ + ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) + +#define ICorProfilerInfo13_GetObjectGeneration(This,objectId,range) \ + ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) + +#define ICorProfilerInfo13_GetNotifiedExceptionClauseInfo(This,pinfo) \ + ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) + + +#define ICorProfilerInfo13_EnumJITedFunctions(This,ppEnum) \ + ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) + +#define ICorProfilerInfo13_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ + ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) + +#define ICorProfilerInfo13_SetFunctionIDMapper2(This,pFunc,clientData) \ + ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) + +#define ICorProfilerInfo13_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ + ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) + +#define ICorProfilerInfo13_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) + +#define ICorProfilerInfo13_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) + +#define ICorProfilerInfo13_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ + ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) + +#define ICorProfilerInfo13_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ + ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) + +#define ICorProfilerInfo13_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ + ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) + +#define ICorProfilerInfo13_EnumModules(This,ppEnum) \ + ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) + +#define ICorProfilerInfo13_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ + ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) + +#define ICorProfilerInfo13_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ + ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) + +#define ICorProfilerInfo13_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ + ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) + +#define ICorProfilerInfo13_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ + ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) + + +#define ICorProfilerInfo13_EnumThreads(This,ppEnum) \ + ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) + +#define ICorProfilerInfo13_InitializeCurrentThread(This) \ + ( (This)->lpVtbl -> InitializeCurrentThread(This) ) + +#define ICorProfilerInfo13_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ + ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) + +#define ICorProfilerInfo13_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ + ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) + +#define ICorProfilerInfo13_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) + +#define ICorProfilerInfo13_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ + ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) + +#define ICorProfilerInfo13_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ + ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) + +#define ICorProfilerInfo13_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) + +#define ICorProfilerInfo13_EnumJITedFunctions2(This,ppEnum) \ + ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) + +#define ICorProfilerInfo13_GetObjectSize2(This,objectId,pcSize) \ + ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) + + +#define ICorProfilerInfo13_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ + ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) + +#define ICorProfilerInfo13_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ + ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) + + +#define ICorProfilerInfo13_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ + ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) + + +#define ICorProfilerInfo13_ApplyMetaData(This,moduleId) \ + ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) + +#define ICorProfilerInfo13_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ + ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) + +#define ICorProfilerInfo13_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ + ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) + + +#define ICorProfilerInfo13_IsFunctionDynamic(This,functionId,isDynamic) \ + ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) ) + +#define ICorProfilerInfo13_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ + ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) ) + +#define ICorProfilerInfo13_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ + ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) ) + + +#define ICorProfilerInfo13_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ + ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) ) + +#define ICorProfilerInfo13_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) ) + +#define ICorProfilerInfo13_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) ) + + +#define ICorProfilerInfo13_EnumerateObjectReferences(This,objectId,callback,clientData) \ + ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) ) + +#define ICorProfilerInfo13_IsFrozenObject(This,objectId,pbFrozen) \ + ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) ) + +#define ICorProfilerInfo13_GetLOHObjectSizeThreshold(This,pThreshold) \ + ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) ) + +#define ICorProfilerInfo13_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) \ + ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) ) + +#define ICorProfilerInfo13_SuspendRuntime(This) \ + ( (This)->lpVtbl -> SuspendRuntime(This) ) + +#define ICorProfilerInfo13_ResumeRuntime(This) \ + ( (This)->lpVtbl -> ResumeRuntime(This) ) + + +#define ICorProfilerInfo13_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) \ + ( (This)->lpVtbl -> GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) ) + +#define ICorProfilerInfo13_SetEnvironmentVariable(This,szName,szValue) \ + ( (This)->lpVtbl -> SetEnvironmentVariable(This,szName,szValue) ) + + +#define ICorProfilerInfo13_EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) \ + ( (This)->lpVtbl -> EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) ) + +#define ICorProfilerInfo13_EventPipeAddProviderToSession(This,session,providerConfig) \ + ( (This)->lpVtbl -> EventPipeAddProviderToSession(This,session,providerConfig) ) + +#define ICorProfilerInfo13_EventPipeStopSession(This,session) \ + ( (This)->lpVtbl -> EventPipeStopSession(This,session) ) + +#define ICorProfilerInfo13_EventPipeCreateProvider(This,providerName,pProvider) \ + ( (This)->lpVtbl -> EventPipeCreateProvider(This,providerName,pProvider) ) + +#define ICorProfilerInfo13_EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) \ + ( (This)->lpVtbl -> EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) ) + +#define ICorProfilerInfo13_EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) \ + ( (This)->lpVtbl -> EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) ) + +#define ICorProfilerInfo13_EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) \ + ( (This)->lpVtbl -> EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) ) + + +#define ICorProfilerInfo13_CreateHandle(This,object,type,pHandle) \ + ( (This)->lpVtbl -> CreateHandle(This,object,type,pHandle) ) + +#define ICorProfilerInfo13_DestroyHandle(This,handle) \ + ( (This)->lpVtbl -> DestroyHandle(This,handle) ) + +#define ICorProfilerInfo13_GetObjectIDFromHandle(This,handle,pObject) \ + ( (This)->lpVtbl -> GetObjectIDFromHandle(This,handle,pObject) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ICorProfilerInfo13_INTERFACE_DEFINED__ */ + + +#ifndef __ICorProfilerInfo14_INTERFACE_DEFINED__ +#define __ICorProfilerInfo14_INTERFACE_DEFINED__ + +/* interface ICorProfilerInfo14 */ +/* [local][unique][uuid][object] */ + + +EXTERN_C const IID IID_ICorProfilerInfo14; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F460E352-D76D-4FE9-835F-F6AF9D6E862D") + ICorProfilerInfo14 : public ICorProfilerInfo13 + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumerateNonGCObjects( + /* [out] */ ICorProfilerObjectEnum **ppEnum) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetNonGCHeapBounds( + /* [in] */ ULONG cObjectRanges, + /* [out] */ ULONG *pcObjectRanges, + /* [length_is][size_is][out] */ COR_PRF_NONGC_HEAP_RANGE ranges[ ]) = 0; + + virtual HRESULT STDMETHODCALLTYPE EventPipeCreateProvider2( + /* [string][in] */ const WCHAR *providerName, + /* [in] */ EventPipeProviderCallback *pCallback, + /* [out] */ EVENTPIPE_PROVIDER *pProvider) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorProfilerInfo14Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorProfilerInfo14 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorProfilerInfo14 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ICorProfilerInfo14 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) + HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( + ICorProfilerInfo14 * This, + /* [in] */ ObjectID objectId, + /* [out] */ ClassID *pClassId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) + HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdTypeDef typeDef, + /* [out] */ ClassID *pClassId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [out] */ LPCBYTE *pStart, + /* [out] */ ULONG *pcSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) + HRESULT ( STDMETHODCALLTYPE *GetEventMask )( + ICorProfilerInfo14 * This, + /* [out] */ DWORD *pdwEvents); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( + ICorProfilerInfo14 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *pFunctionId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdToken token, + /* [out] */ FunctionID *pFunctionId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) + HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( + ICorProfilerInfo14 * This, + /* [in] */ ThreadID threadId, + /* [out] */ HANDLE *phThread); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + ICorProfilerInfo14 * This, + /* [in] */ ObjectID objectId, + /* [out] */ ULONG *pcSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) + HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [out] */ CorElementType *pBaseElemType, + /* [out] */ ClassID *pBaseClassId, + /* [out] */ ULONG *pcRank); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) + HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( + ICorProfilerInfo14 * This, + /* [in] */ ThreadID threadId, + /* [out] */ DWORD *pdwWin32ThreadId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) + HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( + ICorProfilerInfo14 * This, + /* [out] */ ThreadID *pThreadId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) + HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdTypeDef *pTypeDefToken); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) + HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [out] */ ClassID *pClassId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdToken *pToken); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) + HRESULT ( STDMETHODCALLTYPE *SetEventMask )( + ICorProfilerInfo14 * This, + /* [in] */ DWORD dwEvents); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionEnter *pFuncEnter, + /* [in] */ FunctionLeave *pFuncLeave, + /* [in] */ FunctionTailcall *pFuncTailcall); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) + HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionIDMapper *pFunc); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) + HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [in] */ REFIID riid, + /* [out] */ IUnknown **ppImport, + /* [out] */ mdToken *pToken); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) + HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ LPCBYTE *ppBaseLoadAddress, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AssemblyID *pAssemblyId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) + HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ DWORD dwOpenFlags, + /* [in] */ REFIID riid, + /* [out] */ IUnknown **ppOut); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) + HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdMethodDef methodId, + /* [out] */ LPCBYTE *ppMethodHeader, + /* [out] */ ULONG *pcbMethodSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) + HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ IMethodMalloc **ppMalloc); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) + HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdMethodDef methodid, + /* [in] */ LPCBYTE pbNewILMethodHeader); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) + HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( + ICorProfilerInfo14 * This, + /* [in] */ AppDomainID appDomainId, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ ProcessID *pProcessId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) + HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( + ICorProfilerInfo14 * This, + /* [in] */ AssemblyID assemblyId, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AppDomainID *pAppDomainId, + /* [out] */ ModuleID *pModuleId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) + HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) + HRESULT ( STDMETHODCALLTYPE *ForceGC )( + ICorProfilerInfo14 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) + HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [in] */ BOOL fStartJit, + /* [in] */ ULONG cILMapEntries, + /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) + HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( + ICorProfilerInfo14 * This, + /* [out] */ IUnknown **ppicd); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) + HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( + ICorProfilerInfo14 * This, + /* [out] */ IUnknown **ppicd); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) + HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( + ICorProfilerInfo14 * This, + /* [in] */ ThreadID threadId, + /* [out] */ ContextID *pContextId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) + HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( + ICorProfilerInfo14 * This, + /* [in] */ BOOL fThisThreadOnly, + /* [out] */ DWORD *pdwProfilerContext); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) + HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( + ICorProfilerInfo14 * This, + /* [in] */ DWORD dwProfilerContext); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ULONG32 cMap, + /* [out] */ ULONG32 *pcMap, + /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) + HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( + ICorProfilerInfo14 * This, + /* [in] */ ThreadID thread, + /* [in] */ StackSnapshotCallback *callback, + /* [in] */ ULONG32 infoFlags, + /* [in] */ void *clientData, + /* [size_is][in] */ BYTE context[ ], + /* [in] */ ULONG32 contextSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionEnter2 *pFuncEnter, + /* [in] */ FunctionLeave2 *pFuncLeave, + /* [in] */ FunctionTailcall2 *pFuncTailcall); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) + HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID funcId, + /* [in] */ COR_PRF_FRAME_INFO frameInfo, + /* [out] */ ClassID *pClassId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdToken *pToken, + /* [in] */ ULONG32 cTypeArgs, + /* [out] */ ULONG32 *pcTypeArgs, + /* [out] */ ClassID typeArgs[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) + HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( + ICorProfilerInfo14 * This, + /* [out] */ ULONG *pBufferLengthOffset, + /* [out] */ ULONG *pStringLengthOffset, + /* [out] */ ULONG *pBufferOffset); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) + HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classID, + /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[ ], + /* [in] */ ULONG cFieldOffset, + /* [out] */ ULONG *pcFieldOffset, + /* [out] */ ULONG *pulClassSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) + HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdTypeDef *pTypeDefToken, + /* [out] */ ClassID *pParentClassId, + /* [in] */ ULONG32 cNumTypeArgs, + /* [out] */ ULONG32 *pcNumTypeArgs, + /* [out] */ ClassID typeArgs[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionID, + /* [in] */ ULONG32 cCodeInfos, + /* [out] */ ULONG32 *pcCodeInfos, + /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) + HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleID, + /* [in] */ mdTypeDef typeDef, + /* [in] */ ULONG32 cTypeArgs, + /* [size_is][in] */ ClassID typeArgs[ ], + /* [out] */ ClassID *pClassID); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleID, + /* [in] */ mdMethodDef funcDef, + /* [in] */ ClassID classId, + /* [in] */ ULONG32 cTypeArgs, + /* [size_is][in] */ ClassID typeArgs[ ], + /* [out] */ FunctionID *pFunctionID); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) + HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleID, + /* [out] */ ICorProfilerObjectEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) + HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( + ICorProfilerInfo14 * This, + /* [in] */ ObjectID objectId, + /* [in] */ ULONG32 cDimensions, + /* [size_is][out] */ ULONG32 pDimensionSizes[ ], + /* [size_is][out] */ int pDimensionLowerBounds[ ], + /* [out] */ BYTE **ppData); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) + HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [out] */ ULONG32 *pBufferOffset); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) + HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( + ICorProfilerInfo14 * This, + /* [in] */ ThreadID threadId, + /* [out] */ AppDomainID *pAppDomainId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ AppDomainID appDomainId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ ThreadID threadId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ ContextID contextId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) + HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) + HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( + ICorProfilerInfo14 * This, + /* [in] */ ULONG cObjectRanges, + /* [out] */ ULONG *pcObjectRanges, + /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) + HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( + ICorProfilerInfo14 * This, + /* [in] */ ObjectID objectId, + /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) + HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( + ICorProfilerInfo14 * This, + /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) + HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( + ICorProfilerInfo14 * This, + /* [out] */ ICorProfilerFunctionEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) + HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( + ICorProfilerInfo14 * This, + /* [in] */ DWORD dwExpectedCompletionMilliseconds); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) + HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionIDMapper2 *pFunc, + /* [in] */ void *clientData); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) + HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( + ICorProfilerInfo14 * This, + /* [out] */ ULONG *pStringLengthOffset, + /* [out] */ ULONG *pBufferOffset); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionEnter3 *pFuncEnter3, + /* [in] */ FunctionLeave3 *pFuncLeave3, + /* [in] */ FunctionTailcall3 *pFuncTailcall3); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, + /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, + /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) + HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, + /* [out][in] */ ULONG *pcbArgumentInfo, + /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) + HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, + /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) + HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) + HRESULT ( STDMETHODCALLTYPE *EnumModules )( + ICorProfilerInfo14 * This, + /* [out] */ ICorProfilerModuleEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) + HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( + ICorProfilerInfo14 * This, + /* [out] */ USHORT *pClrInstanceId, + /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType, + /* [out] */ USHORT *pMajorVersion, + /* [out] */ USHORT *pMinorVersion, + /* [out] */ USHORT *pBuildNumber, + /* [out] */ USHORT *pQFEVersion, + /* [in] */ ULONG cchVersionString, + /* [out] */ ULONG *pcchVersionString, + /* [annotation][out] */ + _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) + HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( + ICorProfilerInfo14 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ AppDomainID appDomainId, + /* [in] */ ThreadID threadId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) + HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ ULONG32 cAppDomainIds, + /* [out] */ ULONG32 *pcAppDomainIds, + /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) + HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ LPCBYTE *ppBaseLoadAddress, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AssemblyID *pAssemblyId, + /* [out] */ DWORD *pdwModuleFlags); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) + HRESULT ( STDMETHODCALLTYPE *EnumThreads )( + ICorProfilerInfo14 * This, + /* [out] */ ICorProfilerThreadEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) + HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( + ICorProfilerInfo14 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) + HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( + ICorProfilerInfo14 * This, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) + HRESULT ( STDMETHODCALLTYPE *RequestRevert )( + ICorProfilerInfo14 * This, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ], + /* [size_is][out] */ HRESULT status[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionID, + /* [in] */ ReJITID reJitId, + /* [in] */ ULONG32 cCodeInfos, + /* [out] */ ULONG32 *pcCodeInfos, + /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( + ICorProfilerInfo14 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *pFunctionId, + /* [out] */ ReJITID *pReJitId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) + HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ULONG cReJitIds, + /* [out] */ ULONG *pcReJitIds, + /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ReJITID reJitId, + /* [in] */ ULONG32 cMap, + /* [out] */ ULONG32 *pcMap, + /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) + HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( + ICorProfilerInfo14 * This, + /* [out] */ ICorProfilerFunctionEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) + HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( + ICorProfilerInfo14 * This, + /* [in] */ ObjectID objectId, + /* [out] */ SIZE_T *pcSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) + HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( + ICorProfilerInfo14 * This, + /* [out] */ DWORD *pdwEventsLow, + /* [out] */ DWORD *pdwEventsHigh); + + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) + HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( + ICorProfilerInfo14 * This, + /* [in] */ DWORD dwEventsLow, + /* [in] */ DWORD dwEventsHigh); + + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) + HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID inlinersModuleId, + /* [in] */ ModuleID inlineeModuleId, + /* [in] */ mdMethodDef inlineeMethodId, + /* [out] */ BOOL *incompleteData, + /* [out] */ ICorProfilerMethodEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ApplyMetaData) + HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo7, GetInMemorySymbolsLength) + HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ DWORD *pCountSymbolBytes); + + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ReadInMemorySymbols) + HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( + ICorProfilerInfo14 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ DWORD symbolsReadOffset, + /* [out] */ BYTE *pSymbolBytes, + /* [in] */ DWORD countSymbolBytes, + /* [out] */ DWORD *pCountSymbolBytesRead); + + DECLSPEC_XFGVIRT(ICorProfilerInfo8, IsFunctionDynamic) + HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [out] */ BOOL *isDynamic); + + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetFunctionFromIP3) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )( + ICorProfilerInfo14 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *functionId, + /* [out] */ ReJITID *pReJitId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetDynamicFunctionInfo) + HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )( + ICorProfilerInfo14 * This, + /* [in] */ FunctionID functionId, + /* [out] */ ModuleID *moduleId, + /* [out] */ PCCOR_SIGNATURE *ppvSig, + /* [out] */ ULONG *pbSig, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [out] */ WCHAR wszName[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetNativeCodeStartAddresses) + HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )( + ICorProfilerInfo14 * This, + FunctionID functionID, + ReJITID reJitId, + ULONG32 cCodeStartAddresses, + ULONG32 *pcCodeStartAddresses, + UINT_PTR codeStartAddresses[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetILToNativeMapping3) + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )( + ICorProfilerInfo14 * This, + UINT_PTR pNativeCodeStartAddress, + ULONG32 cMap, + ULONG32 *pcMap, + COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetCodeInfo4) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )( + ICorProfilerInfo14 * This, + UINT_PTR pNativeCodeStartAddress, + ULONG32 cCodeInfos, + ULONG32 *pcCodeInfos, + COR_PRF_CODE_INFO codeInfos[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, EnumerateObjectReferences) + HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )( + ICorProfilerInfo14 * This, + ObjectID objectId, + ObjectReferenceCallback callback, + void *clientData); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, IsFrozenObject) + HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )( + ICorProfilerInfo14 * This, + ObjectID objectId, + BOOL *pbFrozen); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, GetLOHObjectSizeThreshold) + HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )( + ICorProfilerInfo14 * This, + DWORD *pThreshold); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, RequestReJITWithInliners) + HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )( + ICorProfilerInfo14 * This, + /* [in] */ DWORD dwRejitFlags, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, SuspendRuntime) + HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )( + ICorProfilerInfo14 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, ResumeRuntime) + HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )( + ICorProfilerInfo14 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo11, GetEnvironmentVariable) + HRESULT ( STDMETHODCALLTYPE *GetEnvironmentVariable )( + ICorProfilerInfo14 * This, + /* [string][in] */ const WCHAR *szName, + /* [in] */ ULONG cchValue, + /* [out] */ ULONG *pcchValue, + /* [annotation][out] */ + _Out_writes_to_(cchValue, *pcchValue) WCHAR szValue[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo11, SetEnvironmentVariable) + HRESULT ( STDMETHODCALLTYPE *SetEnvironmentVariable )( + ICorProfilerInfo14 * This, + /* [string][in] */ const WCHAR *szName, + /* [string][in] */ const WCHAR *szValue); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeStartSession) + HRESULT ( STDMETHODCALLTYPE *EventPipeStartSession )( + ICorProfilerInfo14 * This, + /* [in] */ UINT32 cProviderConfigs, + /* [size_is][in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG pProviderConfigs[ ], + /* [in] */ BOOL requestRundown, + /* [out] */ EVENTPIPE_SESSION *pSession); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeAddProviderToSession) + HRESULT ( STDMETHODCALLTYPE *EventPipeAddProviderToSession )( + ICorProfilerInfo14 * This, + /* [in] */ EVENTPIPE_SESSION session, + /* [in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG providerConfig); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeStopSession) + HRESULT ( STDMETHODCALLTYPE *EventPipeStopSession )( + ICorProfilerInfo14 * This, + /* [in] */ EVENTPIPE_SESSION session); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeCreateProvider) + HRESULT ( STDMETHODCALLTYPE *EventPipeCreateProvider )( + ICorProfilerInfo14 * This, + /* [string][in] */ const WCHAR *providerName, + /* [out] */ EVENTPIPE_PROVIDER *pProvider); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeGetProviderInfo) + HRESULT ( STDMETHODCALLTYPE *EventPipeGetProviderInfo )( + ICorProfilerInfo14 * This, + /* [in] */ EVENTPIPE_PROVIDER provider, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR providerName[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeDefineEvent) + HRESULT ( STDMETHODCALLTYPE *EventPipeDefineEvent )( + ICorProfilerInfo14 * This, + /* [in] */ EVENTPIPE_PROVIDER provider, + /* [string][in] */ const WCHAR *eventName, + /* [in] */ UINT32 eventID, + /* [in] */ UINT64 keywords, + /* [in] */ UINT32 eventVersion, + /* [in] */ UINT32 level, + /* [in] */ UINT8 opcode, + /* [in] */ BOOL needStack, + /* [in] */ UINT32 cParamDescs, + /* [size_is][in] */ COR_PRF_EVENTPIPE_PARAM_DESC pParamDescs[ ], + /* [out] */ EVENTPIPE_EVENT *pEvent); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeWriteEvent) + HRESULT ( STDMETHODCALLTYPE *EventPipeWriteEvent )( + ICorProfilerInfo14 * This, + /* [in] */ EVENTPIPE_EVENT event, + /* [in] */ UINT32 cData, + /* [size_is][in] */ COR_PRF_EVENT_DATA data[ ], + /* [in] */ LPCGUID pActivityId, + /* [in] */ LPCGUID pRelatedActivityId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo13, CreateHandle) + HRESULT ( STDMETHODCALLTYPE *CreateHandle )( + ICorProfilerInfo14 * This, + /* [in] */ ObjectID object, + /* [in] */ COR_PRF_HANDLE_TYPE type, + /* [out] */ ObjectHandleID *pHandle); + + DECLSPEC_XFGVIRT(ICorProfilerInfo13, DestroyHandle) + HRESULT ( STDMETHODCALLTYPE *DestroyHandle )( + ICorProfilerInfo14 * This, + /* [in] */ ObjectHandleID handle); + + DECLSPEC_XFGVIRT(ICorProfilerInfo13, GetObjectIDFromHandle) + HRESULT ( STDMETHODCALLTYPE *GetObjectIDFromHandle )( + ICorProfilerInfo14 * This, + /* [in] */ ObjectHandleID handle, + /* [out] */ ObjectID *pObject); + + DECLSPEC_XFGVIRT(ICorProfilerInfo14, EnumerateNonGCObjects) + HRESULT ( STDMETHODCALLTYPE *EnumerateNonGCObjects )( + ICorProfilerInfo14 * This, + /* [out] */ ICorProfilerObjectEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo14, GetNonGCHeapBounds) + HRESULT ( STDMETHODCALLTYPE *GetNonGCHeapBounds )( + ICorProfilerInfo14 * This, + /* [in] */ ULONG cObjectRanges, + /* [out] */ ULONG *pcObjectRanges, + /* [length_is][size_is][out] */ COR_PRF_NONGC_HEAP_RANGE ranges[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo14, EventPipeCreateProvider2) + HRESULT ( STDMETHODCALLTYPE *EventPipeCreateProvider2 )( + ICorProfilerInfo14 * This, + /* [string][in] */ const WCHAR *providerName, + /* [in] */ EventPipeProviderCallback *pCallback, + /* [out] */ EVENTPIPE_PROVIDER *pProvider); + + END_INTERFACE + } ICorProfilerInfo14Vtbl; + + interface ICorProfilerInfo14 + { + CONST_VTBL struct ICorProfilerInfo14Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorProfilerInfo14_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorProfilerInfo14_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorProfilerInfo14_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorProfilerInfo14_GetClassFromObject(This,objectId,pClassId) \ + ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) + +#define ICorProfilerInfo14_GetClassFromToken(This,moduleId,typeDef,pClassId) \ + ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) + +#define ICorProfilerInfo14_GetCodeInfo(This,functionId,pStart,pcSize) \ + ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) + +#define ICorProfilerInfo14_GetEventMask(This,pdwEvents) \ + ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) + +#define ICorProfilerInfo14_GetFunctionFromIP(This,ip,pFunctionId) \ + ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) + +#define ICorProfilerInfo14_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ + ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) + +#define ICorProfilerInfo14_GetHandleFromThread(This,threadId,phThread) \ + ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) + +#define ICorProfilerInfo14_GetObjectSize(This,objectId,pcSize) \ + ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) + +#define ICorProfilerInfo14_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ + ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) + +#define ICorProfilerInfo14_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ + ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) + +#define ICorProfilerInfo14_GetCurrentThreadID(This,pThreadId) \ + ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) + +#define ICorProfilerInfo14_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ + ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) + +#define ICorProfilerInfo14_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ + ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) + +#define ICorProfilerInfo14_SetEventMask(This,dwEvents) \ + ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) + +#define ICorProfilerInfo14_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) + +#define ICorProfilerInfo14_SetFunctionIDMapper(This,pFunc) \ + ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) + +#define ICorProfilerInfo14_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ + ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) + +#define ICorProfilerInfo14_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ + ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) + +#define ICorProfilerInfo14_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ + ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) + +#define ICorProfilerInfo14_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ + ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) + +#define ICorProfilerInfo14_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ + ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) + +#define ICorProfilerInfo14_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ + ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) + +#define ICorProfilerInfo14_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ + ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) + +#define ICorProfilerInfo14_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ + ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) + +#define ICorProfilerInfo14_SetFunctionReJIT(This,functionId) \ + ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) + +#define ICorProfilerInfo14_ForceGC(This) \ + ( (This)->lpVtbl -> ForceGC(This) ) + +#define ICorProfilerInfo14_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ + ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) + +#define ICorProfilerInfo14_GetInprocInspectionInterface(This,ppicd) \ + ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) + +#define ICorProfilerInfo14_GetInprocInspectionIThisThread(This,ppicd) \ + ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) + +#define ICorProfilerInfo14_GetThreadContext(This,threadId,pContextId) \ + ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) + +#define ICorProfilerInfo14_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ + ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) + +#define ICorProfilerInfo14_EndInprocDebugging(This,dwProfilerContext) \ + ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) + +#define ICorProfilerInfo14_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) + + +#define ICorProfilerInfo14_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ + ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) + +#define ICorProfilerInfo14_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) + +#define ICorProfilerInfo14_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ + ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) + +#define ICorProfilerInfo14_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ + ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) + +#define ICorProfilerInfo14_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ + ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) + +#define ICorProfilerInfo14_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ + ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) + +#define ICorProfilerInfo14_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) + +#define ICorProfilerInfo14_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ + ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) + +#define ICorProfilerInfo14_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ + ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) + +#define ICorProfilerInfo14_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ + ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) + +#define ICorProfilerInfo14_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ + ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) + +#define ICorProfilerInfo14_GetBoxClassLayout(This,classId,pBufferOffset) \ + ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) + +#define ICorProfilerInfo14_GetThreadAppDomain(This,threadId,pAppDomainId) \ + ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) + +#define ICorProfilerInfo14_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ + ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) + +#define ICorProfilerInfo14_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ + ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) + +#define ICorProfilerInfo14_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ + ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) + +#define ICorProfilerInfo14_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ + ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) + +#define ICorProfilerInfo14_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ + ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) + +#define ICorProfilerInfo14_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ + ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) + +#define ICorProfilerInfo14_GetObjectGeneration(This,objectId,range) \ + ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) + +#define ICorProfilerInfo14_GetNotifiedExceptionClauseInfo(This,pinfo) \ + ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) + + +#define ICorProfilerInfo14_EnumJITedFunctions(This,ppEnum) \ + ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) + +#define ICorProfilerInfo14_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ + ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) + +#define ICorProfilerInfo14_SetFunctionIDMapper2(This,pFunc,clientData) \ + ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) + +#define ICorProfilerInfo14_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ + ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) + +#define ICorProfilerInfo14_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) + +#define ICorProfilerInfo14_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) + +#define ICorProfilerInfo14_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ + ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) + +#define ICorProfilerInfo14_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ + ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) + +#define ICorProfilerInfo14_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ + ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) + +#define ICorProfilerInfo14_EnumModules(This,ppEnum) \ + ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) + +#define ICorProfilerInfo14_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ + ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) + +#define ICorProfilerInfo14_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ + ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) + +#define ICorProfilerInfo14_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ + ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) + +#define ICorProfilerInfo14_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ + ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) + + +#define ICorProfilerInfo14_EnumThreads(This,ppEnum) \ + ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) + +#define ICorProfilerInfo14_InitializeCurrentThread(This) \ + ( (This)->lpVtbl -> InitializeCurrentThread(This) ) + +#define ICorProfilerInfo14_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ + ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) + +#define ICorProfilerInfo14_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ + ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) + +#define ICorProfilerInfo14_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) + +#define ICorProfilerInfo14_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ + ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) + +#define ICorProfilerInfo14_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ + ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) + +#define ICorProfilerInfo14_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) + +#define ICorProfilerInfo14_EnumJITedFunctions2(This,ppEnum) \ + ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) + +#define ICorProfilerInfo14_GetObjectSize2(This,objectId,pcSize) \ + ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) + + +#define ICorProfilerInfo14_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ + ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) + +#define ICorProfilerInfo14_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ + ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) + + +#define ICorProfilerInfo14_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ + ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) + + +#define ICorProfilerInfo14_ApplyMetaData(This,moduleId) \ + ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) + +#define ICorProfilerInfo14_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ + ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) + +#define ICorProfilerInfo14_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ + ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) + + +#define ICorProfilerInfo14_IsFunctionDynamic(This,functionId,isDynamic) \ + ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) ) + +#define ICorProfilerInfo14_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ + ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) ) + +#define ICorProfilerInfo14_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ + ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) ) + + +#define ICorProfilerInfo14_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ + ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) ) + +#define ICorProfilerInfo14_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) ) + +#define ICorProfilerInfo14_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) ) + + +#define ICorProfilerInfo14_EnumerateObjectReferences(This,objectId,callback,clientData) \ + ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) ) + +#define ICorProfilerInfo14_IsFrozenObject(This,objectId,pbFrozen) \ + ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) ) + +#define ICorProfilerInfo14_GetLOHObjectSizeThreshold(This,pThreshold) \ + ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) ) + +#define ICorProfilerInfo14_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) \ + ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) ) + +#define ICorProfilerInfo14_SuspendRuntime(This) \ + ( (This)->lpVtbl -> SuspendRuntime(This) ) + +#define ICorProfilerInfo14_ResumeRuntime(This) \ + ( (This)->lpVtbl -> ResumeRuntime(This) ) + + +#define ICorProfilerInfo14_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) \ + ( (This)->lpVtbl -> GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) ) + +#define ICorProfilerInfo14_SetEnvironmentVariable(This,szName,szValue) \ + ( (This)->lpVtbl -> SetEnvironmentVariable(This,szName,szValue) ) + + +#define ICorProfilerInfo14_EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) \ + ( (This)->lpVtbl -> EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) ) + +#define ICorProfilerInfo14_EventPipeAddProviderToSession(This,session,providerConfig) \ + ( (This)->lpVtbl -> EventPipeAddProviderToSession(This,session,providerConfig) ) + +#define ICorProfilerInfo14_EventPipeStopSession(This,session) \ + ( (This)->lpVtbl -> EventPipeStopSession(This,session) ) + +#define ICorProfilerInfo14_EventPipeCreateProvider(This,providerName,pProvider) \ + ( (This)->lpVtbl -> EventPipeCreateProvider(This,providerName,pProvider) ) + +#define ICorProfilerInfo14_EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) \ + ( (This)->lpVtbl -> EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) ) + +#define ICorProfilerInfo14_EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) \ + ( (This)->lpVtbl -> EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) ) + +#define ICorProfilerInfo14_EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) \ + ( (This)->lpVtbl -> EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) ) + + +#define ICorProfilerInfo14_CreateHandle(This,object,type,pHandle) \ + ( (This)->lpVtbl -> CreateHandle(This,object,type,pHandle) ) + +#define ICorProfilerInfo14_DestroyHandle(This,handle) \ + ( (This)->lpVtbl -> DestroyHandle(This,handle) ) + +#define ICorProfilerInfo14_GetObjectIDFromHandle(This,handle,pObject) \ + ( (This)->lpVtbl -> GetObjectIDFromHandle(This,handle,pObject) ) + + +#define ICorProfilerInfo14_EnumerateNonGCObjects(This,ppEnum) \ + ( (This)->lpVtbl -> EnumerateNonGCObjects(This,ppEnum) ) + +#define ICorProfilerInfo14_GetNonGCHeapBounds(This,cObjectRanges,pcObjectRanges,ranges) \ + ( (This)->lpVtbl -> GetNonGCHeapBounds(This,cObjectRanges,pcObjectRanges,ranges) ) + +#define ICorProfilerInfo14_EventPipeCreateProvider2(This,providerName,pCallback,pProvider) \ + ( (This)->lpVtbl -> EventPipeCreateProvider2(This,providerName,pCallback,pProvider) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ICorProfilerInfo14_INTERFACE_DEFINED__ */ + + +#ifndef __ICorProfilerInfo15_INTERFACE_DEFINED__ +#define __ICorProfilerInfo15_INTERFACE_DEFINED__ + +/* interface ICorProfilerInfo15 */ +/* [local][unique][uuid][object] */ + + +EXTERN_C const IID IID_ICorProfilerInfo15; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B446462D-BD22-41DD-872D-DC714C49EB56") + ICorProfilerInfo15 : public ICorProfilerInfo14 + { + public: + virtual HRESULT STDMETHODCALLTYPE EnumerateGCHeapObjects( + /* [in] */ ObjectCallback callback, + /* [in] */ void *callbackState) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ICorProfilerInfo15Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ICorProfilerInfo15 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ICorProfilerInfo15 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ICorProfilerInfo15 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromObject) + HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )( + ICorProfilerInfo15 * This, + /* [in] */ ObjectID objectId, + /* [out] */ ClassID *pClassId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassFromToken) + HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdTypeDef typeDef, + /* [out] */ ClassID *pClassId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCodeInfo) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [out] */ LPCBYTE *pStart, + /* [out] */ ULONG *pcSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetEventMask) + HRESULT ( STDMETHODCALLTYPE *GetEventMask )( + ICorProfilerInfo15 * This, + /* [out] */ DWORD *pdwEvents); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromIP) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )( + ICorProfilerInfo15 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *pFunctionId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionFromToken) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdToken token, + /* [out] */ FunctionID *pFunctionId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetHandleFromThread) + HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )( + ICorProfilerInfo15 * This, + /* [in] */ ThreadID threadId, + /* [out] */ HANDLE *phThread); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetObjectSize) + HRESULT ( STDMETHODCALLTYPE *GetObjectSize )( + ICorProfilerInfo15 * This, + /* [in] */ ObjectID objectId, + /* [out] */ ULONG *pcSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, IsArrayClass) + HRESULT ( STDMETHODCALLTYPE *IsArrayClass )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [out] */ CorElementType *pBaseElemType, + /* [out] */ ClassID *pBaseClassId, + /* [out] */ ULONG *pcRank); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadInfo) + HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )( + ICorProfilerInfo15 * This, + /* [in] */ ThreadID threadId, + /* [out] */ DWORD *pdwWin32ThreadId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetCurrentThreadID) + HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( + ICorProfilerInfo15 * This, + /* [out] */ ThreadID *pThreadId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetClassIDInfo) + HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdTypeDef *pTypeDefToken); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetFunctionInfo) + HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [out] */ ClassID *pClassId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdToken *pToken); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEventMask) + HRESULT ( STDMETHODCALLTYPE *SetEventMask )( + ICorProfilerInfo15 * This, + /* [in] */ DWORD dwEvents); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetEnterLeaveFunctionHooks) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionEnter *pFuncEnter, + /* [in] */ FunctionLeave *pFuncLeave, + /* [in] */ FunctionTailcall *pFuncTailcall); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionIDMapper) + HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionIDMapper *pFunc); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetTokenAndMetaDataFromFunction) + HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [in] */ REFIID riid, + /* [out] */ IUnknown **ppImport, + /* [out] */ mdToken *pToken); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleInfo) + HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ LPCBYTE *ppBaseLoadAddress, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AssemblyID *pAssemblyId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetModuleMetaData) + HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ DWORD dwOpenFlags, + /* [in] */ REFIID riid, + /* [out] */ IUnknown **ppOut); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBody) + HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdMethodDef methodId, + /* [out] */ LPCBYTE *ppMethodHeader, + /* [out] */ ULONG *pcbMethodSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILFunctionBodyAllocator) + HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ IMethodMalloc **ppMalloc); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILFunctionBody) + HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ mdMethodDef methodid, + /* [in] */ LPCBYTE pbNewILMethodHeader); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAppDomainInfo) + HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )( + ICorProfilerInfo15 * This, + /* [in] */ AppDomainID appDomainId, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ ProcessID *pProcessId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetAssemblyInfo) + HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )( + ICorProfilerInfo15 * This, + /* [in] */ AssemblyID assemblyId, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AppDomainID *pAppDomainId, + /* [out] */ ModuleID *pModuleId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetFunctionReJIT) + HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, ForceGC) + HRESULT ( STDMETHODCALLTYPE *ForceGC )( + ICorProfilerInfo15 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, SetILInstrumentedCodeMap) + HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [in] */ BOOL fStartJit, + /* [in] */ ULONG cILMapEntries, + /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionInterface) + HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )( + ICorProfilerInfo15 * This, + /* [out] */ IUnknown **ppicd); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetInprocInspectionIThisThread) + HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )( + ICorProfilerInfo15 * This, + /* [out] */ IUnknown **ppicd); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetThreadContext) + HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( + ICorProfilerInfo15 * This, + /* [in] */ ThreadID threadId, + /* [out] */ ContextID *pContextId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, BeginInprocDebugging) + HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )( + ICorProfilerInfo15 * This, + /* [in] */ BOOL fThisThreadOnly, + /* [out] */ DWORD *pdwProfilerContext); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, EndInprocDebugging) + HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )( + ICorProfilerInfo15 * This, + /* [in] */ DWORD dwProfilerContext); + + DECLSPEC_XFGVIRT(ICorProfilerInfo, GetILToNativeMapping) + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ULONG32 cMap, + /* [out] */ ULONG32 *pcMap, + /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, DoStackSnapshot) + HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )( + ICorProfilerInfo15 * This, + /* [in] */ ThreadID thread, + /* [in] */ StackSnapshotCallback *callback, + /* [in] */ ULONG32 infoFlags, + /* [in] */ void *clientData, + /* [size_is][in] */ BYTE context[ ], + /* [in] */ ULONG32 contextSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, SetEnterLeaveFunctionHooks2) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionEnter2 *pFuncEnter, + /* [in] */ FunctionLeave2 *pFuncLeave, + /* [in] */ FunctionTailcall2 *pFuncTailcall); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionInfo2) + HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID funcId, + /* [in] */ COR_PRF_FRAME_INFO frameInfo, + /* [out] */ ClassID *pClassId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdToken *pToken, + /* [in] */ ULONG32 cTypeArgs, + /* [out] */ ULONG32 *pcTypeArgs, + /* [out] */ ClassID typeArgs[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStringLayout) + HRESULT ( STDMETHODCALLTYPE *GetStringLayout )( + ICorProfilerInfo15 * This, + /* [out] */ ULONG *pBufferLengthOffset, + /* [out] */ ULONG *pStringLengthOffset, + /* [out] */ ULONG *pBufferOffset); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassLayout) + HRESULT ( STDMETHODCALLTYPE *GetClassLayout )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classID, + /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[ ], + /* [in] */ ULONG cFieldOffset, + /* [out] */ ULONG *pcFieldOffset, + /* [out] */ ULONG *pulClassSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassIDInfo2) + HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [out] */ ModuleID *pModuleId, + /* [out] */ mdTypeDef *pTypeDefToken, + /* [out] */ ClassID *pParentClassId, + /* [in] */ ULONG32 cNumTypeArgs, + /* [out] */ ULONG32 *pcNumTypeArgs, + /* [out] */ ClassID typeArgs[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetCodeInfo2) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionID, + /* [in] */ ULONG32 cCodeInfos, + /* [out] */ ULONG32 *pcCodeInfos, + /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetClassFromTokenAndTypeArgs) + HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleID, + /* [in] */ mdTypeDef typeDef, + /* [in] */ ULONG32 cTypeArgs, + /* [size_is][in] */ ClassID typeArgs[ ], + /* [out] */ ClassID *pClassID); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetFunctionFromTokenAndTypeArgs) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleID, + /* [in] */ mdMethodDef funcDef, + /* [in] */ ClassID classId, + /* [in] */ ULONG32 cTypeArgs, + /* [size_is][in] */ ClassID typeArgs[ ], + /* [out] */ FunctionID *pFunctionID); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, EnumModuleFrozenObjects) + HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleID, + /* [out] */ ICorProfilerObjectEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetArrayObjectInfo) + HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )( + ICorProfilerInfo15 * This, + /* [in] */ ObjectID objectId, + /* [in] */ ULONG32 cDimensions, + /* [size_is][out] */ ULONG32 pDimensionSizes[ ], + /* [size_is][out] */ int pDimensionLowerBounds[ ], + /* [out] */ BYTE **ppData); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetBoxClassLayout) + HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [out] */ ULONG32 *pBufferOffset); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadAppDomain) + HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )( + ICorProfilerInfo15 * This, + /* [in] */ ThreadID threadId, + /* [out] */ AppDomainID *pAppDomainId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetRVAStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetAppDomainStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ AppDomainID appDomainId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetThreadStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ ThreadID threadId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetContextStaticAddress) + HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ ContextID contextId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetStaticFieldInfo) + HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetGenerationBounds) + HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )( + ICorProfilerInfo15 * This, + /* [in] */ ULONG cObjectRanges, + /* [out] */ ULONG *pcObjectRanges, + /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetObjectGeneration) + HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )( + ICorProfilerInfo15 * This, + /* [in] */ ObjectID objectId, + /* [out] */ COR_PRF_GC_GENERATION_RANGE *range); + + DECLSPEC_XFGVIRT(ICorProfilerInfo2, GetNotifiedExceptionClauseInfo) + HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )( + ICorProfilerInfo15 * This, + /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumJITedFunctions) + HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )( + ICorProfilerInfo15 * This, + /* [out] */ ICorProfilerFunctionEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, RequestProfilerDetach) + HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )( + ICorProfilerInfo15 * This, + /* [in] */ DWORD dwExpectedCompletionMilliseconds); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetFunctionIDMapper2) + HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionIDMapper2 *pFunc, + /* [in] */ void *clientData); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetStringLayout2) + HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )( + ICorProfilerInfo15 * This, + /* [out] */ ULONG *pStringLengthOffset, + /* [out] */ ULONG *pBufferOffset); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionEnter3 *pFuncEnter3, + /* [in] */ FunctionLeave3 *pFuncLeave3, + /* [in] */ FunctionTailcall3 *pFuncTailcall3); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, SetEnterLeaveFunctionHooks3WithInfo) + HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo, + /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo, + /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionEnter3Info) + HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, + /* [out][in] */ ULONG *pcbArgumentInfo, + /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionLeave3Info) + HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo, + /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetFunctionTailcall3Info) + HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [in] */ COR_PRF_ELT_INFO eltInfo, + /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, EnumModules) + HRESULT ( STDMETHODCALLTYPE *EnumModules )( + ICorProfilerInfo15 * This, + /* [out] */ ICorProfilerModuleEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetRuntimeInformation) + HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )( + ICorProfilerInfo15 * This, + /* [out] */ USHORT *pClrInstanceId, + /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType, + /* [out] */ USHORT *pMajorVersion, + /* [out] */ USHORT *pMinorVersion, + /* [out] */ USHORT *pBuildNumber, + /* [out] */ USHORT *pQFEVersion, + /* [in] */ ULONG cchVersionString, + /* [out] */ ULONG *pcchVersionString, + /* [annotation][out] */ + _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetThreadStaticAddress2) + HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )( + ICorProfilerInfo15 * This, + /* [in] */ ClassID classId, + /* [in] */ mdFieldDef fieldToken, + /* [in] */ AppDomainID appDomainId, + /* [in] */ ThreadID threadId, + /* [out] */ void **ppAddress); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetAppDomainsContainingModule) + HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ ULONG32 cAppDomainIds, + /* [out] */ ULONG32 *pcAppDomainIds, + /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo3, GetModuleInfo2) + HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ LPCBYTE *ppBaseLoadAddress, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ], + /* [out] */ AssemblyID *pAssemblyId, + /* [out] */ DWORD *pdwModuleFlags); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumThreads) + HRESULT ( STDMETHODCALLTYPE *EnumThreads )( + ICorProfilerInfo15 * This, + /* [out] */ ICorProfilerThreadEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, InitializeCurrentThread) + HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )( + ICorProfilerInfo15 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestReJIT) + HRESULT ( STDMETHODCALLTYPE *RequestReJIT )( + ICorProfilerInfo15 * This, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, RequestRevert) + HRESULT ( STDMETHODCALLTYPE *RequestRevert )( + ICorProfilerInfo15 * This, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ], + /* [size_is][out] */ HRESULT status[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetCodeInfo3) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionID, + /* [in] */ ReJITID reJitId, + /* [in] */ ULONG32 cCodeInfos, + /* [out] */ ULONG32 *pcCodeInfos, + /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetFunctionFromIP2) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )( + ICorProfilerInfo15 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *pFunctionId, + /* [out] */ ReJITID *pReJitId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetReJITIDs) + HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ULONG cReJitIds, + /* [out] */ ULONG *pcReJitIds, + /* [length_is][size_is][out] */ ReJITID reJitIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetILToNativeMapping2) + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [in] */ ReJITID reJitId, + /* [in] */ ULONG32 cMap, + /* [out] */ ULONG32 *pcMap, + /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, EnumJITedFunctions2) + HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )( + ICorProfilerInfo15 * This, + /* [out] */ ICorProfilerFunctionEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo4, GetObjectSize2) + HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )( + ICorProfilerInfo15 * This, + /* [in] */ ObjectID objectId, + /* [out] */ SIZE_T *pcSize); + + DECLSPEC_XFGVIRT(ICorProfilerInfo5, GetEventMask2) + HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )( + ICorProfilerInfo15 * This, + /* [out] */ DWORD *pdwEventsLow, + /* [out] */ DWORD *pdwEventsHigh); + + DECLSPEC_XFGVIRT(ICorProfilerInfo5, SetEventMask2) + HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )( + ICorProfilerInfo15 * This, + /* [in] */ DWORD dwEventsLow, + /* [in] */ DWORD dwEventsHigh); + + DECLSPEC_XFGVIRT(ICorProfilerInfo6, EnumNgenModuleMethodsInliningThisMethod) + HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID inlinersModuleId, + /* [in] */ ModuleID inlineeModuleId, + /* [in] */ mdMethodDef inlineeMethodId, + /* [out] */ BOOL *incompleteData, + /* [out] */ ICorProfilerMethodEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ApplyMetaData) + HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo7, GetInMemorySymbolsLength) + HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [out] */ DWORD *pCountSymbolBytes); + + DECLSPEC_XFGVIRT(ICorProfilerInfo7, ReadInMemorySymbols) + HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )( + ICorProfilerInfo15 * This, + /* [in] */ ModuleID moduleId, + /* [in] */ DWORD symbolsReadOffset, + /* [out] */ BYTE *pSymbolBytes, + /* [in] */ DWORD countSymbolBytes, + /* [out] */ DWORD *pCountSymbolBytesRead); + + DECLSPEC_XFGVIRT(ICorProfilerInfo8, IsFunctionDynamic) + HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [out] */ BOOL *isDynamic); + + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetFunctionFromIP3) + HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )( + ICorProfilerInfo15 * This, + /* [in] */ LPCBYTE ip, + /* [out] */ FunctionID *functionId, + /* [out] */ ReJITID *pReJitId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo8, GetDynamicFunctionInfo) + HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )( + ICorProfilerInfo15 * This, + /* [in] */ FunctionID functionId, + /* [out] */ ModuleID *moduleId, + /* [out] */ PCCOR_SIGNATURE *ppvSig, + /* [out] */ ULONG *pbSig, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [out] */ WCHAR wszName[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetNativeCodeStartAddresses) + HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )( + ICorProfilerInfo15 * This, + FunctionID functionID, + ReJITID reJitId, + ULONG32 cCodeStartAddresses, + ULONG32 *pcCodeStartAddresses, + UINT_PTR codeStartAddresses[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetILToNativeMapping3) + HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )( + ICorProfilerInfo15 * This, + UINT_PTR pNativeCodeStartAddress, + ULONG32 cMap, + ULONG32 *pcMap, + COR_DEBUG_IL_TO_NATIVE_MAP map[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo9, GetCodeInfo4) + HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )( + ICorProfilerInfo15 * This, + UINT_PTR pNativeCodeStartAddress, + ULONG32 cCodeInfos, + ULONG32 *pcCodeInfos, + COR_PRF_CODE_INFO codeInfos[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, EnumerateObjectReferences) + HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )( + ICorProfilerInfo15 * This, + ObjectID objectId, + ObjectReferenceCallback callback, + void *clientData); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, IsFrozenObject) + HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )( + ICorProfilerInfo15 * This, + ObjectID objectId, + BOOL *pbFrozen); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, GetLOHObjectSizeThreshold) + HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )( + ICorProfilerInfo15 * This, + DWORD *pThreshold); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, RequestReJITWithInliners) + HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )( + ICorProfilerInfo15 * This, + /* [in] */ DWORD dwRejitFlags, + /* [in] */ ULONG cFunctions, + /* [size_is][in] */ ModuleID moduleIds[ ], + /* [size_is][in] */ mdMethodDef methodIds[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, SuspendRuntime) + HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )( + ICorProfilerInfo15 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo10, ResumeRuntime) + HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )( + ICorProfilerInfo15 * This); + + DECLSPEC_XFGVIRT(ICorProfilerInfo11, GetEnvironmentVariable) + HRESULT ( STDMETHODCALLTYPE *GetEnvironmentVariable )( + ICorProfilerInfo15 * This, + /* [string][in] */ const WCHAR *szName, + /* [in] */ ULONG cchValue, + /* [out] */ ULONG *pcchValue, + /* [annotation][out] */ + _Out_writes_to_(cchValue, *pcchValue) WCHAR szValue[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo11, SetEnvironmentVariable) + HRESULT ( STDMETHODCALLTYPE *SetEnvironmentVariable )( + ICorProfilerInfo15 * This, + /* [string][in] */ const WCHAR *szName, + /* [string][in] */ const WCHAR *szValue); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeStartSession) + HRESULT ( STDMETHODCALLTYPE *EventPipeStartSession )( + ICorProfilerInfo15 * This, + /* [in] */ UINT32 cProviderConfigs, + /* [size_is][in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG pProviderConfigs[ ], + /* [in] */ BOOL requestRundown, + /* [out] */ EVENTPIPE_SESSION *pSession); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeAddProviderToSession) + HRESULT ( STDMETHODCALLTYPE *EventPipeAddProviderToSession )( + ICorProfilerInfo15 * This, + /* [in] */ EVENTPIPE_SESSION session, + /* [in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG providerConfig); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeStopSession) + HRESULT ( STDMETHODCALLTYPE *EventPipeStopSession )( + ICorProfilerInfo15 * This, + /* [in] */ EVENTPIPE_SESSION session); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeCreateProvider) + HRESULT ( STDMETHODCALLTYPE *EventPipeCreateProvider )( + ICorProfilerInfo15 * This, + /* [string][in] */ const WCHAR *providerName, + /* [out] */ EVENTPIPE_PROVIDER *pProvider); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeGetProviderInfo) + HRESULT ( STDMETHODCALLTYPE *EventPipeGetProviderInfo )( + ICorProfilerInfo15 * This, + /* [in] */ EVENTPIPE_PROVIDER provider, + /* [in] */ ULONG cchName, + /* [out] */ ULONG *pcchName, + /* [annotation][out] */ + _Out_writes_to_(cchName, *pcchName) WCHAR providerName[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeDefineEvent) + HRESULT ( STDMETHODCALLTYPE *EventPipeDefineEvent )( + ICorProfilerInfo15 * This, + /* [in] */ EVENTPIPE_PROVIDER provider, + /* [string][in] */ const WCHAR *eventName, + /* [in] */ UINT32 eventID, + /* [in] */ UINT64 keywords, + /* [in] */ UINT32 eventVersion, + /* [in] */ UINT32 level, + /* [in] */ UINT8 opcode, + /* [in] */ BOOL needStack, + /* [in] */ UINT32 cParamDescs, + /* [size_is][in] */ COR_PRF_EVENTPIPE_PARAM_DESC pParamDescs[ ], + /* [out] */ EVENTPIPE_EVENT *pEvent); + + DECLSPEC_XFGVIRT(ICorProfilerInfo12, EventPipeWriteEvent) + HRESULT ( STDMETHODCALLTYPE *EventPipeWriteEvent )( + ICorProfilerInfo15 * This, + /* [in] */ EVENTPIPE_EVENT event, + /* [in] */ UINT32 cData, + /* [size_is][in] */ COR_PRF_EVENT_DATA data[ ], + /* [in] */ LPCGUID pActivityId, + /* [in] */ LPCGUID pRelatedActivityId); + + DECLSPEC_XFGVIRT(ICorProfilerInfo13, CreateHandle) + HRESULT ( STDMETHODCALLTYPE *CreateHandle )( + ICorProfilerInfo15 * This, + /* [in] */ ObjectID object, + /* [in] */ COR_PRF_HANDLE_TYPE type, + /* [out] */ ObjectHandleID *pHandle); + + DECLSPEC_XFGVIRT(ICorProfilerInfo13, DestroyHandle) + HRESULT ( STDMETHODCALLTYPE *DestroyHandle )( + ICorProfilerInfo15 * This, + /* [in] */ ObjectHandleID handle); + + DECLSPEC_XFGVIRT(ICorProfilerInfo13, GetObjectIDFromHandle) + HRESULT ( STDMETHODCALLTYPE *GetObjectIDFromHandle )( + ICorProfilerInfo15 * This, + /* [in] */ ObjectHandleID handle, + /* [out] */ ObjectID *pObject); + + DECLSPEC_XFGVIRT(ICorProfilerInfo14, EnumerateNonGCObjects) + HRESULT ( STDMETHODCALLTYPE *EnumerateNonGCObjects )( + ICorProfilerInfo15 * This, + /* [out] */ ICorProfilerObjectEnum **ppEnum); + + DECLSPEC_XFGVIRT(ICorProfilerInfo14, GetNonGCHeapBounds) + HRESULT ( STDMETHODCALLTYPE *GetNonGCHeapBounds )( + ICorProfilerInfo15 * This, + /* [in] */ ULONG cObjectRanges, + /* [out] */ ULONG *pcObjectRanges, + /* [length_is][size_is][out] */ COR_PRF_NONGC_HEAP_RANGE ranges[ ]); + + DECLSPEC_XFGVIRT(ICorProfilerInfo14, EventPipeCreateProvider2) + HRESULT ( STDMETHODCALLTYPE *EventPipeCreateProvider2 )( + ICorProfilerInfo15 * This, + /* [string][in] */ const WCHAR *providerName, + /* [in] */ EventPipeProviderCallback *pCallback, + /* [out] */ EVENTPIPE_PROVIDER *pProvider); + + DECLSPEC_XFGVIRT(ICorProfilerInfo15, EnumerateGCHeapObjects) + HRESULT ( STDMETHODCALLTYPE *EnumerateGCHeapObjects )( + ICorProfilerInfo15 * This, + /* [in] */ ObjectCallback callback, + /* [in] */ void *callbackState); + + END_INTERFACE + } ICorProfilerInfo15Vtbl; + + interface ICorProfilerInfo15 + { + CONST_VTBL struct ICorProfilerInfo15Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ICorProfilerInfo15_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ICorProfilerInfo15_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ICorProfilerInfo15_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ICorProfilerInfo15_GetClassFromObject(This,objectId,pClassId) \ + ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) ) + +#define ICorProfilerInfo15_GetClassFromToken(This,moduleId,typeDef,pClassId) \ + ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) ) + +#define ICorProfilerInfo15_GetCodeInfo(This,functionId,pStart,pcSize) \ + ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) ) + +#define ICorProfilerInfo15_GetEventMask(This,pdwEvents) \ + ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) ) + +#define ICorProfilerInfo15_GetFunctionFromIP(This,ip,pFunctionId) \ + ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) ) + +#define ICorProfilerInfo15_GetFunctionFromToken(This,moduleId,token,pFunctionId) \ + ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) ) + +#define ICorProfilerInfo15_GetHandleFromThread(This,threadId,phThread) \ + ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) ) + +#define ICorProfilerInfo15_GetObjectSize(This,objectId,pcSize) \ + ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) ) + +#define ICorProfilerInfo15_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \ + ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) ) + +#define ICorProfilerInfo15_GetThreadInfo(This,threadId,pdwWin32ThreadId) \ + ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) ) + +#define ICorProfilerInfo15_GetCurrentThreadID(This,pThreadId) \ + ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) ) + +#define ICorProfilerInfo15_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \ + ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) ) + +#define ICorProfilerInfo15_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \ + ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) ) + +#define ICorProfilerInfo15_SetEventMask(This,dwEvents) \ + ( (This)->lpVtbl -> SetEventMask(This,dwEvents) ) + +#define ICorProfilerInfo15_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) + +#define ICorProfilerInfo15_SetFunctionIDMapper(This,pFunc) \ + ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) ) + +#define ICorProfilerInfo15_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \ + ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) ) + +#define ICorProfilerInfo15_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \ + ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) ) + +#define ICorProfilerInfo15_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \ + ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) ) + +#define ICorProfilerInfo15_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \ + ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) ) + +#define ICorProfilerInfo15_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \ + ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) ) + +#define ICorProfilerInfo15_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \ + ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) ) + +#define ICorProfilerInfo15_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \ + ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) ) + +#define ICorProfilerInfo15_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \ + ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) ) + +#define ICorProfilerInfo15_SetFunctionReJIT(This,functionId) \ + ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) ) + +#define ICorProfilerInfo15_ForceGC(This) \ + ( (This)->lpVtbl -> ForceGC(This) ) + +#define ICorProfilerInfo15_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \ + ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) ) + +#define ICorProfilerInfo15_GetInprocInspectionInterface(This,ppicd) \ + ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) ) + +#define ICorProfilerInfo15_GetInprocInspectionIThisThread(This,ppicd) \ + ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) ) + +#define ICorProfilerInfo15_GetThreadContext(This,threadId,pContextId) \ + ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) ) + +#define ICorProfilerInfo15_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \ + ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) ) + +#define ICorProfilerInfo15_EndInprocDebugging(This,dwProfilerContext) \ + ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) ) + +#define ICorProfilerInfo15_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) ) + + +#define ICorProfilerInfo15_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \ + ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) ) + +#define ICorProfilerInfo15_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) ) + +#define ICorProfilerInfo15_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \ + ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) ) + +#define ICorProfilerInfo15_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \ + ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) ) + +#define ICorProfilerInfo15_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \ + ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) ) + +#define ICorProfilerInfo15_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \ + ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) ) + +#define ICorProfilerInfo15_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) ) + +#define ICorProfilerInfo15_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \ + ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) ) + +#define ICorProfilerInfo15_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \ + ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) ) + +#define ICorProfilerInfo15_EnumModuleFrozenObjects(This,moduleID,ppEnum) \ + ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) ) + +#define ICorProfilerInfo15_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \ + ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) ) + +#define ICorProfilerInfo15_GetBoxClassLayout(This,classId,pBufferOffset) \ + ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) ) + +#define ICorProfilerInfo15_GetThreadAppDomain(This,threadId,pAppDomainId) \ + ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) ) + +#define ICorProfilerInfo15_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \ + ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) ) + +#define ICorProfilerInfo15_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \ + ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) ) + +#define ICorProfilerInfo15_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \ + ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) ) + +#define ICorProfilerInfo15_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \ + ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) ) + +#define ICorProfilerInfo15_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \ + ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) ) + +#define ICorProfilerInfo15_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \ + ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) ) + +#define ICorProfilerInfo15_GetObjectGeneration(This,objectId,range) \ + ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) ) + +#define ICorProfilerInfo15_GetNotifiedExceptionClauseInfo(This,pinfo) \ + ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) ) + + +#define ICorProfilerInfo15_EnumJITedFunctions(This,ppEnum) \ + ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) ) + +#define ICorProfilerInfo15_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \ + ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) ) + +#define ICorProfilerInfo15_SetFunctionIDMapper2(This,pFunc,clientData) \ + ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) ) + +#define ICorProfilerInfo15_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \ + ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) ) + +#define ICorProfilerInfo15_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) ) + +#define ICorProfilerInfo15_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \ + ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) ) + +#define ICorProfilerInfo15_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \ + ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) ) + +#define ICorProfilerInfo15_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \ + ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) ) + +#define ICorProfilerInfo15_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \ + ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) ) + +#define ICorProfilerInfo15_EnumModules(This,ppEnum) \ + ( (This)->lpVtbl -> EnumModules(This,ppEnum) ) + +#define ICorProfilerInfo15_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \ + ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) ) + +#define ICorProfilerInfo15_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \ + ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) ) + +#define ICorProfilerInfo15_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \ + ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) ) + +#define ICorProfilerInfo15_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \ + ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) ) + + +#define ICorProfilerInfo15_EnumThreads(This,ppEnum) \ + ( (This)->lpVtbl -> EnumThreads(This,ppEnum) ) + +#define ICorProfilerInfo15_InitializeCurrentThread(This) \ + ( (This)->lpVtbl -> InitializeCurrentThread(This) ) + +#define ICorProfilerInfo15_RequestReJIT(This,cFunctions,moduleIds,methodIds) \ + ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) ) + +#define ICorProfilerInfo15_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \ + ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) ) + +#define ICorProfilerInfo15_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) ) + +#define ICorProfilerInfo15_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \ + ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) ) + +#define ICorProfilerInfo15_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \ + ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) ) + +#define ICorProfilerInfo15_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) ) + +#define ICorProfilerInfo15_EnumJITedFunctions2(This,ppEnum) \ + ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) ) + +#define ICorProfilerInfo15_GetObjectSize2(This,objectId,pcSize) \ + ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) ) + + +#define ICorProfilerInfo15_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \ + ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) ) + +#define ICorProfilerInfo15_SetEventMask2(This,dwEventsLow,dwEventsHigh) \ + ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) ) + + +#define ICorProfilerInfo15_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \ + ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) ) + + +#define ICorProfilerInfo15_ApplyMetaData(This,moduleId) \ + ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) ) + +#define ICorProfilerInfo15_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \ + ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) ) + +#define ICorProfilerInfo15_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \ + ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) ) + + +#define ICorProfilerInfo15_IsFunctionDynamic(This,functionId,isDynamic) \ + ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) ) + +#define ICorProfilerInfo15_GetFunctionFromIP3(This,ip,functionId,pReJitId) \ + ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) ) + +#define ICorProfilerInfo15_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \ + ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) ) + + +#define ICorProfilerInfo15_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \ + ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) ) + +#define ICorProfilerInfo15_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) \ + ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) ) + +#define ICorProfilerInfo15_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) \ + ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) ) + + +#define ICorProfilerInfo15_EnumerateObjectReferences(This,objectId,callback,clientData) \ + ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) ) + +#define ICorProfilerInfo15_IsFrozenObject(This,objectId,pbFrozen) \ + ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) ) + +#define ICorProfilerInfo15_GetLOHObjectSizeThreshold(This,pThreshold) \ + ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) ) + +#define ICorProfilerInfo15_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) \ + ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) ) + +#define ICorProfilerInfo15_SuspendRuntime(This) \ + ( (This)->lpVtbl -> SuspendRuntime(This) ) + +#define ICorProfilerInfo15_ResumeRuntime(This) \ + ( (This)->lpVtbl -> ResumeRuntime(This) ) + + +#define ICorProfilerInfo15_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) \ + ( (This)->lpVtbl -> GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) ) + +#define ICorProfilerInfo15_SetEnvironmentVariable(This,szName,szValue) \ + ( (This)->lpVtbl -> SetEnvironmentVariable(This,szName,szValue) ) + + +#define ICorProfilerInfo15_EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) \ + ( (This)->lpVtbl -> EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) ) + +#define ICorProfilerInfo15_EventPipeAddProviderToSession(This,session,providerConfig) \ + ( (This)->lpVtbl -> EventPipeAddProviderToSession(This,session,providerConfig) ) + +#define ICorProfilerInfo15_EventPipeStopSession(This,session) \ + ( (This)->lpVtbl -> EventPipeStopSession(This,session) ) + +#define ICorProfilerInfo15_EventPipeCreateProvider(This,providerName,pProvider) \ + ( (This)->lpVtbl -> EventPipeCreateProvider(This,providerName,pProvider) ) + +#define ICorProfilerInfo15_EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) \ + ( (This)->lpVtbl -> EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) ) + +#define ICorProfilerInfo15_EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) \ + ( (This)->lpVtbl -> EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) ) + +#define ICorProfilerInfo15_EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) \ + ( (This)->lpVtbl -> EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) ) + + +#define ICorProfilerInfo15_CreateHandle(This,object,type,pHandle) \ + ( (This)->lpVtbl -> CreateHandle(This,object,type,pHandle) ) + +#define ICorProfilerInfo15_DestroyHandle(This,handle) \ + ( (This)->lpVtbl -> DestroyHandle(This,handle) ) + +#define ICorProfilerInfo15_GetObjectIDFromHandle(This,handle,pObject) \ + ( (This)->lpVtbl -> GetObjectIDFromHandle(This,handle,pObject) ) + + +#define ICorProfilerInfo15_EnumerateNonGCObjects(This,ppEnum) \ + ( (This)->lpVtbl -> EnumerateNonGCObjects(This,ppEnum) ) + +#define ICorProfilerInfo15_GetNonGCHeapBounds(This,cObjectRanges,pcObjectRanges,ranges) \ + ( (This)->lpVtbl -> GetNonGCHeapBounds(This,cObjectRanges,pcObjectRanges,ranges) ) + +#define ICorProfilerInfo15_EventPipeCreateProvider2(This,providerName,pCallback,pProvider) \ + ( (This)->lpVtbl -> EventPipeCreateProvider2(This,providerName,pCallback,pProvider) ) + + +#define ICorProfilerInfo15_EnumerateGCHeapObjects(This,callback,callbackState) \ + ( (This)->lpVtbl -> EnumerateGCHeapObjects(This,callback,callbackState) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ -#endif /* __ICorProfilerInfo12_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerInfo15_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerMethodEnum_INTERFACE_DEFINED__ @@ -20012,39 +25743,47 @@ EXTERN_C const IID IID_ICorProfilerMethodEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerMethodEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerMethodEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerMethodEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerMethodEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerMethodEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorProfilerMethodEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorProfilerMethodEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorProfilerMethodEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerMethodEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorProfilerMethodEnum * This, /* [out] */ ICorProfilerMethodEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerMethodEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorProfilerMethodEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorProfilerMethodEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorProfilerMethodEnum * This, /* [in] */ ULONG celt, @@ -20064,40 +25803,40 @@ EXTERN_C const IID IID_ICorProfilerMethodEnum; #ifdef COBJMACROS -#define ICorProfilerMethodEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerMethodEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerMethodEnum_AddRef(This) \ +#define ICorProfilerMethodEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerMethodEnum_Release(This) \ +#define ICorProfilerMethodEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerMethodEnum_Skip(This,celt) \ +#define ICorProfilerMethodEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorProfilerMethodEnum_Reset(This) \ +#define ICorProfilerMethodEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorProfilerMethodEnum_Clone(This,ppEnum) \ +#define ICorProfilerMethodEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorProfilerMethodEnum_GetCount(This,pcelt) \ +#define ICorProfilerMethodEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorProfilerMethodEnum_Next(This,celt,elements,pceltFetched) \ +#define ICorProfilerMethodEnum_Next(This,celt,elements,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,elements,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerMethodEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerMethodEnum_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerThreadEnum_INTERFACE_DEFINED__ @@ -20134,39 +25873,47 @@ EXTERN_C const IID IID_ICorProfilerThreadEnum; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerThreadEnumVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerThreadEnum * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerThreadEnum * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerThreadEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerThreadEnum, Skip) HRESULT ( STDMETHODCALLTYPE *Skip )( ICorProfilerThreadEnum * This, /* [in] */ ULONG celt); + DECLSPEC_XFGVIRT(ICorProfilerThreadEnum, Reset) HRESULT ( STDMETHODCALLTYPE *Reset )( ICorProfilerThreadEnum * This); + DECLSPEC_XFGVIRT(ICorProfilerThreadEnum, Clone) HRESULT ( STDMETHODCALLTYPE *Clone )( ICorProfilerThreadEnum * This, /* [out] */ ICorProfilerThreadEnum **ppEnum); + DECLSPEC_XFGVIRT(ICorProfilerThreadEnum, GetCount) HRESULT ( STDMETHODCALLTYPE *GetCount )( ICorProfilerThreadEnum * This, /* [out] */ ULONG *pcelt); + DECLSPEC_XFGVIRT(ICorProfilerThreadEnum, Next) HRESULT ( STDMETHODCALLTYPE *Next )( ICorProfilerThreadEnum * This, /* [in] */ ULONG celt, @@ -20186,40 +25933,40 @@ EXTERN_C const IID IID_ICorProfilerThreadEnum; #ifdef COBJMACROS -#define ICorProfilerThreadEnum_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerThreadEnum_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerThreadEnum_AddRef(This) \ +#define ICorProfilerThreadEnum_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerThreadEnum_Release(This) \ +#define ICorProfilerThreadEnum_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerThreadEnum_Skip(This,celt) \ +#define ICorProfilerThreadEnum_Skip(This,celt) \ ( (This)->lpVtbl -> Skip(This,celt) ) -#define ICorProfilerThreadEnum_Reset(This) \ +#define ICorProfilerThreadEnum_Reset(This) \ ( (This)->lpVtbl -> Reset(This) ) -#define ICorProfilerThreadEnum_Clone(This,ppEnum) \ +#define ICorProfilerThreadEnum_Clone(This,ppEnum) \ ( (This)->lpVtbl -> Clone(This,ppEnum) ) -#define ICorProfilerThreadEnum_GetCount(This,pcelt) \ +#define ICorProfilerThreadEnum_GetCount(This,pcelt) \ ( (This)->lpVtbl -> GetCount(This,pcelt) ) -#define ICorProfilerThreadEnum_Next(This,celt,ids,pceltFetched) \ +#define ICorProfilerThreadEnum_Next(This,celt,ids,pceltFetched) \ ( (This)->lpVtbl -> Next(This,celt,ids,pceltFetched) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerThreadEnum_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerThreadEnum_INTERFACE_DEFINED__ */ #ifndef __ICorProfilerAssemblyReferenceProvider_INTERFACE_DEFINED__ @@ -20243,24 +25990,28 @@ EXTERN_C const IID IID_ICorProfilerAssemblyReferenceProvider; }; -#else /* C style interface */ +#else /* C style interface */ typedef struct ICorProfilerAssemblyReferenceProviderVtbl { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICorProfilerAssemblyReferenceProvider * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICorProfilerAssemblyReferenceProvider * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICorProfilerAssemblyReferenceProvider * This); + DECLSPEC_XFGVIRT(ICorProfilerAssemblyReferenceProvider, AddAssemblyReference) HRESULT ( STDMETHODCALLTYPE *AddAssemblyReference )( ICorProfilerAssemblyReferenceProvider * This, const COR_PRF_ASSEMBLY_REFERENCE_INFO *pAssemblyRefInfo); @@ -20278,28 +26029,28 @@ EXTERN_C const IID IID_ICorProfilerAssemblyReferenceProvider; #ifdef COBJMACROS -#define ICorProfilerAssemblyReferenceProvider_QueryInterface(This,riid,ppvObject) \ +#define ICorProfilerAssemblyReferenceProvider_QueryInterface(This,riid,ppvObject) \ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) -#define ICorProfilerAssemblyReferenceProvider_AddRef(This) \ +#define ICorProfilerAssemblyReferenceProvider_AddRef(This) \ ( (This)->lpVtbl -> AddRef(This) ) -#define ICorProfilerAssemblyReferenceProvider_Release(This) \ +#define ICorProfilerAssemblyReferenceProvider_Release(This) \ ( (This)->lpVtbl -> Release(This) ) -#define ICorProfilerAssemblyReferenceProvider_AddAssemblyReference(This,pAssemblyRefInfo) \ +#define ICorProfilerAssemblyReferenceProvider_AddAssemblyReference(This,pAssemblyRefInfo) \ ( (This)->lpVtbl -> AddAssemblyReference(This,pAssemblyRefInfo) ) #endif /* COBJMACROS */ -#endif /* C style interface */ +#endif /* C style interface */ -#endif /* __ICorProfilerAssemblyReferenceProvider_INTERFACE_DEFINED__ */ +#endif /* __ICorProfilerAssemblyReferenceProvider_INTERFACE_DEFINED__ */ /* Additional Prototypes for ALL interfaces */ diff --git a/src/shared/pal/prebuilt/inc/fxver.h b/src/shared/pal/prebuilt/inc/fxver.h index e85563a038..b88f7e9c95 100644 --- a/src/shared/pal/prebuilt/inc/fxver.h +++ b/src/shared/pal/prebuilt/inc/fxver.h @@ -1,202 +1,32 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -// -// Insert just the #defines in winver.h, so that the -// C# compiler can include this file after macro preprocessing. -// - -#ifdef __cplusplus -#ifndef FXVER_H_ -#define FXVER_H_ -#define INCLUDE_FXVER_H -#endif -#else -#define RC_INVOKED 1 -#define INCLUDE_FXVER_H -#endif - -#ifdef INCLUDE_FXVER_H -#undef INCLUDE_FXVER_H - -#ifndef RC_INVOKED -#define FXVER_H_RC_INVOKED_ENABLED -#define RC_INVOKED 1 -#endif - +// Our custom .rc parser on Unix follows the #ifdef and #include rules +// Use #ifndef here to avoid dummy verrsrc.h +#ifndef HOST_UNIX #include - -#ifdef FXVER_H_RC_INVOKED_ENABLED -#undef RC_INVOKED -#undef FXVER_H_RC_INVOKED_ENABLED #endif -// -// Include the definitions for rmj, rmm, rup, rpt -// - -#include - -/* - * Product version, name and copyright - */ - -#include "fxverstrings.h" +#define QUOTE_MACRO_HELPER(x) #x +#define QUOTE_MACRO(x) QUOTE_MACRO_HELPER(x) -/* - * File version, names, description. - */ +#define VER_PRODUCTNAME_STR L"Microsoft\256 .NET" -// FX_VER_INTERNALNAME_STR is passed in by the build environment. -#ifndef FX_VER_INTERNALNAME_STR -#define FX_VER_INTERNALNAME_STR UNKNOWN_FILE -#endif #define VER_INTERNALNAME_STR QUOTE_MACRO(FX_VER_INTERNALNAME_STR) #define VER_ORIGINALFILENAME_STR QUOTE_MACRO(FX_VER_INTERNALNAME_STR) -// FX_VER_FILEDESCRIPTION_STR is defined in RC files that include fxver.h - -#ifndef FX_VER_FILEDESCRIPTION_STR -#define FX_VER_FILEDESCRIPTION_STR QUOTE_MACRO(FX_VER_INTERNALNAME_STR) -#endif - #define VER_FILEDESCRIPTION_STR FX_VER_FILEDESCRIPTION_STR -#ifndef FX_VER_FILEVERSION_STR -#define FX_VER_FILEVERSION_STR FX_FILEVERSION_STR -#endif - -#define VER_FILEVERSION_STR FX_VER_FILEVERSION_STR -#define VER_FILEVERSION_STR_L VER_PRODUCTVERSION_STR_L - -#ifndef FX_VER_FILEVERSION -#define FX_VER_FILEVERSION VER_DOTFILEVERSION -#endif - -#define VER_FILEVERSION FX_VER_FILEVERSION - -//URT_VFT passed in by the build environment. -#ifndef FX_VFT -#define FX_VFT VFT_UNKNOWN -#endif - -#define VER_FILETYPE FX_VFT -#define VER_FILESUBTYPE VFT2_UNKNOWN - -/* default is nodebug */ -#if _DEBUG -#define VER_DEBUG VS_FF_DEBUG -#else -#define VER_DEBUG 0 -#endif - -#define VER_PRERELEASE 0 - -#define EXPORT_TAG - -#if OFFICIAL_BUILD -#define VER_PRIVATE 0 -#else -#define VER_PRIVATE VS_FF_PRIVATEBUILD -#endif - -#define VER_SPECIALBUILD 0 +#define VER_COMMENTS_STR "Flavor=" QUOTE_MACRO(URTBLDENV_FRIENDLY) #define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#define VER_FILEFLAGS (VER_PRERELEASE|VER_DEBUG|VER_PRIVATE|VER_SPECIALBUILD) +#define VER_FILEFLAGS VER_DEBUG #define VER_FILEOS VOS__WINDOWS32 -#define VER_COMPANYNAME_STR "Microsoft Corporation" +#define VER_FILETYPE VFT_UNKNOWN +#define VER_FILESUBTYPE VFT2_UNKNOWN -#ifdef VER_LANGNEUTRAL -#define VER_VERSION_UNICODE_LANG "000004B0" /* LANG_NEUTRAL/SUBLANG_NEUTRAL, Unicode CP */ -#define VER_VERSION_ANSI_LANG "000004E4" /* LANG_NEUTRAL/SUBLANG_NEUTRAL, Ansi CP */ -#define VER_VERSION_TRANSLATION 0x0000, 0x04B0 -#else #define VER_VERSION_UNICODE_LANG "040904B0" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */ #define VER_VERSION_ANSI_LANG "040904E4" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Ansi CP */ #define VER_VERSION_TRANSLATION 0x0409, 0x04B0 -#endif - -#if defined(CSC_INVOKED) -#define VER_COMMENTS_STR "Flavor=" + QUOTE_MACRO(URTBLDENV_FRIENDLY) -#else -#define VER_COMMENTS_STR "Flavor=" QUOTE_MACRO(URTBLDENV_FRIENDLY) -#endif - -#define VER_PRIVATEBUILD_STR QUOTE_MACRO(FX_VER_PRIVATEBUILD_STR) - -#if defined(__BUILDMACHINE__) -#if defined(__BUILDDATE__) -#define B2(x,y) " (" #x "." #y ")" -#define B1(x,y) B2(x, y) -#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__, __BUILDDATE__) -#else -#define B2(x) " built by: " #x -#define B1(x) B2(x) -#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__) -#endif -#if defined(__BUILDMACHINE_LEN__) -#if __BUILDMACHINE_LEN__ >= 25 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG -#elif __BUILDMACHINE_LEN__ == 24 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 23 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 22 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 21 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 20 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 19 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 18 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 17 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 16 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 15 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 14 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 13 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 12 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 11 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 10 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 9 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 8 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 7 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 6 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 5 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 4 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 3 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 2 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 1 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#else -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG -#endif -#else -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG -#endif -#else -#define BUILD_MACHINE_TAG -#define BUILD_MACHINE_TAG_PADDED -#endif - -#endif diff --git a/src/shared/pal/prebuilt/inc/fxver.rc b/src/shared/pal/prebuilt/inc/fxver.rc index 69164f8336..ce3aa4e98e 100644 --- a/src/shared/pal/prebuilt/inc/fxver.rc +++ b/src/shared/pal/prebuilt/inc/fxver.rc @@ -1,35 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -/*---------------------------------------------------------------*/ -/* */ -/* The following section actually creates the version structure. */ -/* They are ignored if we are not being invoked by RC. */ -/* */ -/* ntverp.H must be included before including this file */ -/* */ -/* If VER_LEGALCOPYRIGHT_STR is not defined, it will be */ -/* constructed using VER_LEGALCOPYRIGHT_YEARS, so at least one */ -/* these macros must be defined before including this file. */ -/* */ -/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR, and */ -/* VER_INTERNALNAME_STR must be defined before including this */ -/* file. */ -/* */ -/* If VER_FILEVERSION is not defined, VER_PRODUCTVERSION will be */ -/* used instead. If VER_FILEVERSION_STR is not defined, */ -/* VER_PRODUCTVERSION_STR will be used instead. */ -/* */ -/* If VER_ORIGINALFILENAME_STR is not defined, it is set to */ -/* the value in VER_INTERNALNAME_STR. */ -/* */ -/* If INTL is defined, then this is assumed to be an */ -/* an international build; two string blocks will be created, */ -/* (since all version resources must have English), and the */ -/* second one can be localized */ -/* */ -/*---------------------------------------------------------------*/ - #ifdef _WIN32 #include <_version.h> #endif //_WIN32 @@ -50,50 +21,15 @@ BEGIN BLOCK VER_VERSION_UNICODE_LANG BEGIN VALUE "CompanyName", VER_COMPANYNAME_STR - VALUE "FileDescription", VER_FILEDESCRIPTION_STR EXPORT_TAG - VALUE "FileVersion", VER_FILEVERSION_STR BUILD_MACHINE_TAG_PADDED - VALUE "InternalName", VER_INTERNALNAME_STR - VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR - VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR - VALUE "ProductName", VER_PRODUCTNAME_STR - VALUE "ProductVersion", VER_PRODUCTVERSION_STR -#ifdef VER_OLESELFREGISTER - VALUE "OleSelfRegister", "\0" -#endif - VALUE "Comments", VER_COMMENTS_STR -#if VER_PRIVATE - VALUE "PrivateBuild", VER_PRIVATEBUILD_STR -#endif -#ifdef VER_EXTRA_VALUES - VER_EXTRA_VALUES -#endif - - END - - -#ifdef VER_ANSICP /* Some apps are hard coded to look for ANSI CP. */ - BLOCK VER_VERSION_ANSI_LANG - BEGIN - VALUE "CompanyName", VER_COMPANYNAME_STR - VALUE "FileDescription", VER_FILEDESCRIPTION_STR EXPORT_TAG + VALUE "FileDescription", VER_FILEDESCRIPTION_STR VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", VER_INTERNALNAME_STR VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR VALUE "ProductName", VER_PRODUCTNAME_STR - VALUE "ProductVersion", VER_PRODUCTVERSION_STR -#ifdef VER_OLESELFREGISTER - VALUE "OleSelfRegister", "\0" -#endif + VALUE "ProductVersion", VER_FILEVERSION_STR VALUE "Comments", VER_COMMENTS_STR -#if VER_PRIVATE - VALUE "PrivateBuild", VER_PRIVATEBUILD_STR -#endif -#ifdef VER_EXTRA_VALUES - VER_EXTRA_VALUES -#endif END -#endif END BLOCK "VarFileInfo" diff --git a/src/shared/pal/prebuilt/inc/fxverstrings.h b/src/shared/pal/prebuilt/inc/fxverstrings.h deleted file mode 100644 index 68b59f2592..0000000000 --- a/src/shared/pal/prebuilt/inc/fxverstrings.h +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#ifndef VER_PRODUCTNAME_STR - #define VER_PRODUCTNAME_STR L"Microsoft\256 .NET Core" -#endif - -#ifndef VER_LEGALCOPYRIGHT_STR - #define VER_LEGALCOPYRIGHT_STR "\251 Microsoft Corporation. All rights reserved." - #define VER_LEGALCOPYRIGHT_STR_L L"\251 Microsoft Corporation. All rights reserved." -#endif - -#ifndef VER_LEGALCOPYRIGHT_LOGO_STR - #define VER_LEGALCOPYRIGHT_LOGO_STR "Copyright (c) Microsoft Corporation. All rights reserved." - #define VER_LEGALCOPYRIGHT_LOGO_STR_L L"Copyright (c) Microsoft Corporation. All rights reserved." -#endif diff --git a/src/shared/pal/prebuilt/inc/metahost.h b/src/shared/pal/prebuilt/inc/metahost.h index 069d71da52..825974b921 100644 --- a/src/shared/pal/prebuilt/inc/metahost.h +++ b/src/shared/pal/prebuilt/inc/metahost.h @@ -3,9 +3,9 @@ /* this ALWAYS GENERATED file contains the definitions for the interfaces */ - /* File created by MIDL compiler version 8.01.0622 */ + /* File created by MIDL compiler version 8.01.0628 */ /* Compiler settings for metahost.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628 protocol : dce , ms_ext, c_ext, robust error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: @@ -41,6 +41,14 @@ #pragma once #endif +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + /* Forward Declarations */ #ifndef __ICLRMetaHost_FWD_DEFINED__ @@ -122,7 +130,7 @@ typedef void ( __stdcall *RuntimeLoadedCallbackFnPtr )( typedef /* [public][public][public] */ enum __MIDL___MIDL_itf_metahost_0000_0000_0001 { - Unknown = 0, + UnknownIndex = 0, Identity = 1, Runtime = 2 } LIBRARY_PROVIDER_INDEX_TYPE; @@ -184,24 +192,29 @@ EXTERN_C const IID IID_ICLRMetaHost; { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICLRMetaHost * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICLRMetaHost * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICLRMetaHost * This); + DECLSPEC_XFGVIRT(ICLRMetaHost, GetRuntime) HRESULT ( STDMETHODCALLTYPE *GetRuntime )( ICLRMetaHost * This, /* [in] */ LPCWSTR pwzVersion, /* [in] */ REFIID riid, /* [retval][iid_is][out] */ LPVOID *ppRuntime); + DECLSPEC_XFGVIRT(ICLRMetaHost, GetVersionFromFile) HRESULT ( STDMETHODCALLTYPE *GetVersionFromFile )( ICLRMetaHost * This, /* [in] */ LPCWSTR pwzFilePath, @@ -209,24 +222,29 @@ EXTERN_C const IID IID_ICLRMetaHost; _Out_writes_all_(*pcchBuffer) LPWSTR pwzBuffer, /* [out][in] */ DWORD *pcchBuffer); + DECLSPEC_XFGVIRT(ICLRMetaHost, EnumerateInstalledRuntimes) HRESULT ( STDMETHODCALLTYPE *EnumerateInstalledRuntimes )( ICLRMetaHost * This, /* [retval][out] */ IEnumUnknown **ppEnumerator); + DECLSPEC_XFGVIRT(ICLRMetaHost, EnumerateLoadedRuntimes) HRESULT ( STDMETHODCALLTYPE *EnumerateLoadedRuntimes )( ICLRMetaHost * This, /* [in] */ HANDLE hndProcess, /* [retval][out] */ IEnumUnknown **ppEnumerator); + DECLSPEC_XFGVIRT(ICLRMetaHost, RequestRuntimeLoadedNotification) HRESULT ( STDMETHODCALLTYPE *RequestRuntimeLoadedNotification )( ICLRMetaHost * This, /* [in] */ RuntimeLoadedCallbackFnPtr pCallbackFunction); + DECLSPEC_XFGVIRT(ICLRMetaHost, QueryLegacyV2RuntimeBinding) HRESULT ( STDMETHODCALLTYPE *QueryLegacyV2RuntimeBinding )( ICLRMetaHost * This, /* [in] */ REFIID riid, /* [retval][iid_is][out] */ LPVOID *ppUnk); + DECLSPEC_XFGVIRT(ICLRMetaHost, ExitProcess) HRESULT ( STDMETHODCALLTYPE *ExitProcess )( ICLRMetaHost * This, /* [in] */ INT32 iExitCode); @@ -340,18 +358,22 @@ EXTERN_C const IID IID_ICLRDebuggingLibraryProvider; { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICLRDebuggingLibraryProvider * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICLRDebuggingLibraryProvider * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICLRDebuggingLibraryProvider * This); + DECLSPEC_XFGVIRT(ICLRDebuggingLibraryProvider, ProvideLibrary) HRESULT ( STDMETHODCALLTYPE *ProvideLibrary )( ICLRDebuggingLibraryProvider * This, /* [in] */ const WCHAR *pwszFileName, @@ -426,18 +448,22 @@ EXTERN_C const IID IID_ICLRDebuggingLibraryProvider2; { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICLRDebuggingLibraryProvider2 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICLRDebuggingLibraryProvider2 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICLRDebuggingLibraryProvider2 * This); + DECLSPEC_XFGVIRT(ICLRDebuggingLibraryProvider2, ProvideLibrary2) HRESULT ( STDMETHODCALLTYPE *ProvideLibrary2 )( ICLRDebuggingLibraryProvider2 * This, /* [in] */ const WCHAR *pwszFileName, @@ -522,18 +548,22 @@ EXTERN_C const IID IID_ICLRDebuggingLibraryProvider3; { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICLRDebuggingLibraryProvider3 * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICLRDebuggingLibraryProvider3 * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICLRDebuggingLibraryProvider3 * This); + DECLSPEC_XFGVIRT(ICLRDebuggingLibraryProvider3, ProvideWindowsLibrary) HRESULT ( STDMETHODCALLTYPE *ProvideWindowsLibrary )( ICLRDebuggingLibraryProvider3 * This, /* [in] */ const WCHAR *pwszFileName, @@ -543,6 +573,7 @@ EXTERN_C const IID IID_ICLRDebuggingLibraryProvider3; /* [in] */ DWORD dwSizeOfImage, /* [out] */ LPWSTR *ppResolvedModulePath); + DECLSPEC_XFGVIRT(ICLRDebuggingLibraryProvider3, ProvideUnixLibrary) HRESULT ( STDMETHODCALLTYPE *ProvideUnixLibrary )( ICLRDebuggingLibraryProvider3 * This, /* [in] */ const WCHAR *pwszFileName, @@ -629,18 +660,22 @@ EXTERN_C const IID IID_ICLRDebugging; { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICLRDebugging * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICLRDebugging * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICLRDebugging * This); + DECLSPEC_XFGVIRT(ICLRDebugging, OpenVirtualProcess) HRESULT ( STDMETHODCALLTYPE *OpenVirtualProcess )( ICLRDebugging * This, /* [in] */ ULONG64 moduleBaseAddress, @@ -652,6 +687,7 @@ EXTERN_C const IID IID_ICLRDebugging; /* [out][in] */ CLR_DEBUGGING_VERSION *pVersion, /* [out] */ CLR_DEBUGGING_PROCESS_FLAGS *pdwFlags); + DECLSPEC_XFGVIRT(ICLRDebugging, CanUnloadNow) HRESULT ( STDMETHODCALLTYPE *CanUnloadNow )( ICLRDebugging * This, HMODULE hModule); @@ -773,35 +809,42 @@ EXTERN_C const IID IID_ICLRRuntimeInfo; { BEGIN_INTERFACE + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) HRESULT ( STDMETHODCALLTYPE *QueryInterface )( ICLRRuntimeInfo * This, /* [in] */ REFIID riid, /* [annotation][iid_is][out] */ _COM_Outptr_ void **ppvObject); + DECLSPEC_XFGVIRT(IUnknown, AddRef) ULONG ( STDMETHODCALLTYPE *AddRef )( ICLRRuntimeInfo * This); + DECLSPEC_XFGVIRT(IUnknown, Release) ULONG ( STDMETHODCALLTYPE *Release )( ICLRRuntimeInfo * This); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, GetVersionString) HRESULT ( STDMETHODCALLTYPE *GetVersionString )( ICLRRuntimeInfo * This, /* [annotation][size_is][out] */ _Out_writes_all_opt_(*pcchBuffer) LPWSTR pwzBuffer, /* [out][in] */ DWORD *pcchBuffer); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, GetRuntimeDirectory) HRESULT ( STDMETHODCALLTYPE *GetRuntimeDirectory )( ICLRRuntimeInfo * This, /* [annotation][size_is][out] */ _Out_writes_all_(*pcchBuffer) LPWSTR pwzBuffer, /* [out][in] */ DWORD *pcchBuffer); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, IsLoaded) HRESULT ( STDMETHODCALLTYPE *IsLoaded )( ICLRRuntimeInfo * This, /* [in] */ HANDLE hndProcess, /* [retval][out] */ BOOL *pbLoaded); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, LoadErrorString) HRESULT ( STDMETHODCALLTYPE *LoadErrorString )( ICLRRuntimeInfo * This, /* [in] */ UINT iResourceID, @@ -810,31 +853,37 @@ EXTERN_C const IID IID_ICLRRuntimeInfo; /* [out][in] */ DWORD *pcchBuffer, /* [lcid][in] */ LONG iLocaleID); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, LoadLibrary) HRESULT ( STDMETHODCALLTYPE *LoadLibrary )( ICLRRuntimeInfo * This, /* [in] */ LPCWSTR pwzDllName, /* [retval][out] */ HMODULE *phndModule); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, GetProcAddress) HRESULT ( STDMETHODCALLTYPE *GetProcAddress )( ICLRRuntimeInfo * This, /* [in] */ LPCSTR pszProcName, /* [retval][out] */ LPVOID *ppProc); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, GetInterface) HRESULT ( STDMETHODCALLTYPE *GetInterface )( ICLRRuntimeInfo * This, /* [in] */ REFCLSID rclsid, /* [in] */ REFIID riid, /* [retval][iid_is][out] */ LPVOID *ppUnk); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, IsLoadable) HRESULT ( STDMETHODCALLTYPE *IsLoadable )( ICLRRuntimeInfo * This, /* [retval][out] */ BOOL *pbLoadable); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, SetDefaultStartupFlags) HRESULT ( STDMETHODCALLTYPE *SetDefaultStartupFlags )( ICLRRuntimeInfo * This, /* [in] */ DWORD dwStartupFlags, /* [in] */ LPCWSTR pwzHostConfigFile); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, GetDefaultStartupFlags) HRESULT ( STDMETHODCALLTYPE *GetDefaultStartupFlags )( ICLRRuntimeInfo * This, /* [out] */ DWORD *pdwStartupFlags, @@ -842,9 +891,11 @@ EXTERN_C const IID IID_ICLRRuntimeInfo; _Out_writes_all_opt_(*pcchHostConfigFile) LPWSTR pwzHostConfigFile, /* [out][in] */ DWORD *pcchHostConfigFile); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, BindAsLegacyV2Runtime) HRESULT ( STDMETHODCALLTYPE *BindAsLegacyV2Runtime )( ICLRRuntimeInfo * This); + DECLSPEC_XFGVIRT(ICLRRuntimeInfo, IsStarted) HRESULT ( STDMETHODCALLTYPE *IsStarted )( ICLRRuntimeInfo * This, /* [out] */ BOOL *pbStarted, diff --git a/src/shared/pal/prebuilt/inc/product_version.h b/src/shared/pal/prebuilt/inc/product_version.h deleted file mode 100644 index 374cbab24e..0000000000 --- a/src/shared/pal/prebuilt/inc/product_version.h +++ /dev/null @@ -1,106 +0,0 @@ - -#if 0 - Version strings for product keys... no comments can be allowed in this - file due to some usage of this in the build process. - // Licensed to the .NET Foundation under one or more agreements. - // The .NET Foundation licenses this file to you under the MIT license. - // See the LICENSE file in the project root for more information. -#endif - -#ifdef CLR_MAJOR_VERSION -#undef CLR_MAJOR_VERSION -#endif - -#ifdef CLR_MINOR_VERSION -#undef CLR_MINOR_VERSION -#endif - -#ifdef CLR_BUILD_VERSION -#undef CLR_BUILD_VERSION -#endif - -#ifdef CLR_BUILD_VERSION_QFE -#undef CLR_BUILD_VERSION_QFE -#endif - -#ifdef VER_FILEVERSIONMINOR -#undef VER_FILEVERSIONMINOR -#endif - -#ifdef VER_FILEVERSIONBUILD -#undef VER_FILEVERSIONBUILD -#endif - -#ifdef VER_FILEVERSIONREVISION -#undef VER_FILEVERSIONREVISION -#endif - -#define CLR_MAJOR_VERSION rmj -#define CLR_MINOR_VERSION rmm -#define CLR_BUILD_VERSION rup -#define CLR_BUILD_VERSION_QFE rpt - -#define VER_FILEVERSIONMINOR fvn -#define VER_FILEVERSIONBUILD fvb -#define VER_FILEVERSIONREVISION fvr - -#define VER_ASSEMBLYMAJORVERSION asm_rmj -#define VER_ASSEMBLYMINORVERSION asm_rmm -#define VER_ASSEMBLYBUILD asm_rup -#define VER_ASSEMBLYBUILD_QFE asm_rpt - -#define QUOTE_MACRO_HELPER(x) #x -#define QUOTE_MACRO(x) QUOTE_MACRO_HELPER(x) - -#ifndef QUOTE_MACRO_L -#define QUOTE_MACRO_L_HELPER(x) L###x -#define QUOTE_MACRO_L(x) QUOTE_MACRO_L_HELPER(x) -#endif - -#define CONCAT_MACRO_HELPER(x, y) x ## y -#define CONCAT_MACRO(x, y) CONCAT_MACRO_HELPER(x, y) - -#define VER_PRODUCTVERSION CLR_MAJOR_VERSION,CLR_MINOR_VERSION,CLR_BUILD_VERSION,CLR_BUILD_VERSION_QFE -#define VER_DOTFILEVERSION CLR_MAJOR_VERSION,VER_FILEVERSIONMINOR,VER_FILEVERSIONBUILD,VER_FILEVERSIONREVISION -#define VER_MANAGED_DOTFILEVERSION CLR_MAJOR_VERSION.VER_FILEVERSIONMINOR.VER_FILEVERSIONBUILD.VER_FILEVERSIONREVISION - -#define VER_DOTPRODUCTVERSION CLR_MAJOR_VERSION.CLR_MINOR_VERSION.CLR_BUILD_VERSION.CLR_BUILD_VERSION_QFE -#define VER_DOTPRODUCTMAJORMINOR CLR_MAJOR_VERSION.CLR_MINOR_VERSION -#define VER_DOTPRODUCTVERSIONNOQFE CLR_MAJOR_VERSION.CLR_MINOR_VERSION.CLR_BUILD_VERSION -#define VER_DOTPRODUCTVERSIONZEROQFE CLR_MAJOR_VERSION.CLR_MINOR_VERSION.CLR_BUILD_VERSION.0 -#define VER_DOTASSEMBLYVERSION VER_ASSEMBLYMAJORVERSION.VER_ASSEMBLYMINORVERSION.VER_ASSEMBLYBUILD.VER_ASSEMBLYBUILD_QFE -#define VER_DOTASSEMBLYVERSION3PART VER_ASSEMBLYMAJORVERSION.VER_ASSEMBLYMINORVERSION.VER_ASSEMBLYBUILD - -#define VER_UNDERSCORE_PRODUCTVERSION_STR3 CONCAT_MACRO(_, CLR_BUILD_VERSION) -#define VER_UNDERSCORE_PRODUCTVERSION_STR2 CONCAT_MACRO(CLR_MINOR_VERSION, VER_UNDERSCORE_PRODUCTVERSION_STR3) -#define VER_UNDERSCORE_PRODUCTVERSION_STR1 CONCAT_MACRO(_, VER_UNDERSCORE_PRODUCTVERSION_STR2) -#define VER_UNDERSCORE_PRODUCTVERSION CONCAT_MACRO(CLR_MAJOR_VERSION, VER_UNDERSCORE_PRODUCTVERSION_STR1) - -#define VER_UNDERSCORE_PRODUCTVERSION_STR QUOTE_MACRO(VER_UNDERSCORE_PRODUCTVERSION) -#define VER_UNDERSCORE_PRODUCTVERSION_STR_L QUOTE_MACRO_L(VER_UNDERSCORE_PRODUCTVERSION) - -#define FX_FILEVERSION_STR QUOTE_MACRO(VER_MANAGED_DOTFILEVERSION) -#define VER_PRODUCTVERSION_STR QUOTE_MACRO(VER_DOTPRODUCTVERSION) -#define VER_PRODUCTVERSION_STR_L QUOTE_MACRO_L(VER_DOTPRODUCTVERSION) - -#define VER_PRODUCTMAJORMINOR_STR QUOTE_MACRO(VER_DOTPRODUCTMAJORMINOR) -#define VER_PRODUCTMAJORMINOR_STR_L QUOTE_MACRO_L(VER_DOTPRODUCTMAJORMINOR) - -#define VER_PRODUCTVERSION_NO_QFE_STR QUOTE_MACRO(VER_DOTPRODUCTVERSIONNOQFE) -#define VER_PRODUCTVERSION_NO_QFE_STR_L QUOTE_MACRO_L(VER_DOTPRODUCTVERSIONNOQFE) - -#define VER_PRODUCTVERSION_ZERO_QFE_STR QUOTE_MACRO(VER_DOTPRODUCTVERSIONZEROQFE) -#define VER_PRODUCTVERSION_ZERO_QFE_STR_L QUOTE_MACRO_L(VER_DOTPRODUCTVERSIONZEROQFE) - -#define VER_PRODUCTVERSION_NO_QFE_STR QUOTE_MACRO(VER_DOTPRODUCTVERSIONNOQFE) -#define VER_PRODUCTVERSION_NO_QFE_STR_L QUOTE_MACRO_L(VER_DOTPRODUCTVERSIONNOQFE) - -#define VER_ASSEMBLYVERSION_STR QUOTE_MACRO(VER_DOTASSEMBLYVERSION) -#define VER_ASSEMBLYVERSION_STR_L QUOTE_MACRO_L(VER_DOTASSEMBLYVERSION) - -#define VER_ASSEMBLYVERSION3PART_STR QUOTE_MACRO(VER_DOTASSEMBLYVERSION3PART) -#define VER_ASSEMBLYVERSION3PART_STR_L QUOTE_MACRO_L(VER_DOTASSEMBLYVERSION3PART) - -#define VER_ECMA_PUBLICKEY b77a5c561934e089 -#define ECMA_PUBLICKEY_STR QUOTE_MACRO(VER_ECMA_PUBLICKEY) -#define ECMA_PUBLICKEY_STR_L QUOTE_MACRO_L(VER_ECMA_PUBLICKEY) diff --git a/src/shared/pal/prebuilt/inc/sospriv.h b/src/shared/pal/prebuilt/inc/sospriv.h index 64db79c792..a3d741f740 100644 --- a/src/shared/pal/prebuilt/inc/sospriv.h +++ b/src/shared/pal/prebuilt/inc/sospriv.h @@ -3333,6 +3333,27 @@ EXTERN_C const IID IID_ISOSDacInterface13; #define ISOSDacInterface13_TraverseLoaderHeap(This,loaderHeapAddr,kind,pCallback) \ ( (This)->lpVtbl -> TraverseLoaderHeap(This,loaderHeapAddr,kind,pCallback) ) +#define ISOSDacInterface13_GetDomainLoaderAllocator(This,domainAddress,pLoaderAllocator) \ + ( (This)->lpVtbl -> GetDomainLoaderAllocator(This,domainAddress,pLoaderAllocator) ) + +#define ISOSDacInterface13_GetLoaderAllocatorHeapNames(This,count,ppNames,pNeeded) \ + ( (This)->lpVtbl -> GetLoaderAllocatorHeapNames(This,count,ppNames,pNeeded) ) + +#define ISOSDacInterface13_GetLoaderAllocatorHeaps(This,loaderAllocator,count,pLoaderHeaps,pKinds,pNeeded) \ + ( (This)->lpVtbl -> GetLoaderAllocatorHeaps(This,loaderAllocator,count,pLoaderHeaps,pKinds,pNeeded) ) + +#define ISOSDacInterface13_GetHandleTableMemoryRegions(This,ppEnum) \ + ( (This)->lpVtbl -> GetHandleTableMemoryRegions(This,ppEnum) ) + +#define ISOSDacInterface13_GetGCBookkeepingMemoryRegions(This,ppEnum) \ + ( (This)->lpVtbl -> GetGCBookkeepingMemoryRegions(This,ppEnum) ) + +#define ISOSDacInterface13_GetGCFreeRegions(This,ppEnum) \ + ( (This)->lpVtbl -> GetGCFreeRegions(This,ppEnum) ) + +#define ISOSDacInterface13_LockedFlush(This) \ + ( (This)->lpVtbl -> LockedFlush(This) ) + #endif /* COBJMACROS */ @@ -3456,6 +3477,214 @@ EXTERN_C const IID IID_ISOSDacInterface14; #endif /* __ISOSDacInterface14_INTERFACE_DEFINED__ */ +/* interface __MIDL_itf_sospriv_0000_0019 */ +/* [local] */ + +#ifndef _SOS_MethodData +#define _SOS_MethodData +typedef struct _SOSMethodData + { + CLRDATA_ADDRESS MethodDesc; + CLRDATA_ADDRESS Entrypoint; + CLRDATA_ADDRESS DefininingMethodTable; + CLRDATA_ADDRESS DefiningModule; + unsigned int Token; + unsigned int Slot; + } SOSMethodData; + +#endif //_SOS_MethodData + + +extern RPC_IF_HANDLE __MIDL_itf_sospriv_0000_0019_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_sospriv_0000_0019_v0_0_s_ifspec; + +#ifndef __ISOSMethodEnum_INTERFACE_DEFINED__ +#define __ISOSMethodEnum_INTERFACE_DEFINED__ + +/* interface ISOSMethodEnum */ +/* [uuid][local][object] */ + + +EXTERN_C const IID IID_ISOSMethodEnum; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3c0fe725-c324-4a4f-8100-d399588a662e") + ISOSMethodEnum : public ISOSEnum + { + public: + virtual HRESULT STDMETHODCALLTYPE Next( + /* [in] */ unsigned int count, + /* [length_is][size_is][out] */ SOSMethodData handles[ ], + /* [out] */ unsigned int *pNeeded) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISOSMethodEnumVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISOSMethodEnum * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISOSMethodEnum * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISOSMethodEnum * This); + + HRESULT ( STDMETHODCALLTYPE *Skip )( + ISOSMethodEnum * This, + /* [in] */ unsigned int count); + + HRESULT ( STDMETHODCALLTYPE *Reset )( + ISOSMethodEnum * This); + + HRESULT ( STDMETHODCALLTYPE *GetCount )( + ISOSMethodEnum * This, + /* [out] */ unsigned int *pCount); + + HRESULT ( STDMETHODCALLTYPE *Next )( + ISOSMethodEnum * This, + /* [in] */ unsigned int count, + /* [length_is][size_is][out] */ SOSMethodData handles[ ], + /* [out] */ unsigned int *pNeeded); + + END_INTERFACE + } ISOSMethodEnumVtbl; + + interface ISOSMethodEnum + { + CONST_VTBL struct ISOSMethodEnumVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISOSMethodEnum_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISOSMethodEnum_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISOSMethodEnum_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISOSMethodEnum_Skip(This,count) \ + ( (This)->lpVtbl -> Skip(This,count) ) + +#define ISOSMethodEnum_Reset(This) \ + ( (This)->lpVtbl -> Reset(This) ) + +#define ISOSMethodEnum_GetCount(This,pCount) \ + ( (This)->lpVtbl -> GetCount(This,pCount) ) + + +#define ISOSMethodEnum_Next(This,count,handles,pNeeded) \ + ( (This)->lpVtbl -> Next(This,count,handles,pNeeded) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISOSMethodEnum_INTERFACE_DEFINED__ */ + + +#ifndef __ISOSDacInterface15_INTERFACE_DEFINED__ +#define __ISOSDacInterface15_INTERFACE_DEFINED__ + +/* interface ISOSDacInterface15 */ +/* [uuid][local][object] */ + + +EXTERN_C const IID IID_ISOSDacInterface15; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7ed81261-52a9-4a23-a358-c3313dea30a8") + ISOSDacInterface15 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetMethodTableSlotEnumerator( + CLRDATA_ADDRESS mt, + ISOSMethodEnum **enumerator) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ISOSDacInterface15Vtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISOSDacInterface15 * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISOSDacInterface15 * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISOSDacInterface15 * This); + + HRESULT ( STDMETHODCALLTYPE *GetMethodTableSlotEnumerator )( + ISOSDacInterface15 * This, + CLRDATA_ADDRESS mt, + ISOSMethodEnum **enumerator); + + END_INTERFACE + } ISOSDacInterface15Vtbl; + + interface ISOSDacInterface15 + { + CONST_VTBL struct ISOSDacInterface15Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISOSDacInterface15_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ISOSDacInterface15_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ISOSDacInterface15_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ISOSDacInterface15_GetMethodTableSlotEnumerator(This,mt,enumerator) \ + ( (This)->lpVtbl -> GetMethodTableSlotEnumerator(This,mt,enumerator) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ISOSDacInterface15_INTERFACE_DEFINED__ */ + + /* Additional Prototypes for ALL interfaces */ /* end of Additional Prototypes */ diff --git a/src/shared/pal/src/CMakeLists.txt b/src/shared/pal/src/CMakeLists.txt index 7ae9cb393d..a1bfdd66ff 100644 --- a/src/shared/pal/src/CMakeLists.txt +++ b/src/shared/pal/src/CMakeLists.txt @@ -1,7 +1,8 @@ -if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_FREEBSD) +if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_HAIKU) # On OSX and *BSD, we use the libunwind that's part of the OS + # On Haiku, we used a special port of libunwind set(CLR_CMAKE_USE_SYSTEM_LIBUNWIND 1) -endif(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_FREEBSD) +endif(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_FREEBSD OR CLR_CMAKE_TARGET_HAIKU) if(NOT DEFINED ENV{ROOTFS_DIR}) include_directories(SYSTEM /usr/local/include) @@ -38,17 +39,21 @@ elseif(CLR_CMAKE_HOST_ARCH_ARMV6) add_definitions(-D__armv6__) elseif(CLR_CMAKE_HOST_ARCH_ARM64) set(PAL_ARCH_SOURCES_DIR arm64) +elseif(CLR_CMAKE_HOST_ARCH_LOONGARCH64) + set(PAL_ARCH_SOURCES_DIR loongarch64) +elseif(CLR_CMAKE_HOST_ARCH_RISCV64) + set(PAL_ARCH_SOURCES_DIR riscv64) elseif(CLR_CMAKE_HOST_ARCH_I386) set(PAL_ARCH_SOURCES_DIR i386) elseif(CLR_CMAKE_HOST_ARCH_S390X) set(PAL_ARCH_SOURCES_DIR s390x) -elseif(CLR_CMAKE_HOST_ARCH_RISCV64) - set(PAL_ARCH_SOURCES_DIR riscv64) +elseif(CLR_CMAKE_HOST_ARCH_POWERPC64) + set(PAL_ARCH_SOURCES_DIR ppc64le) endif() if(CLR_CMAKE_TARGET_OSX) add_definitions(-DTARGET_OSX) - if(CLR_CMAKE_TARGET_ARCH_AMD64) + if(CLR_CMAKE_HOST_ARCH_AMD64) add_definitions(-DXSTATE_SUPPORTED) endif() set(PLATFORM_SOURCES @@ -63,25 +68,33 @@ add_definitions(-DLP64COMPATIBLE) add_definitions(-DCORECLR) add_definitions(-DPIC) -if(CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_HOST_LINUX_MUSL) - # Currently the _xstate is not available on linux-musl +if(CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_TARGET_LINUX_MUSL) + # Currently the _xstate is not available on Alpine Linux + add_definitions(-DXSTATE_SUPPORTED) +endif(CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_TARGET_LINUX_MUSL) + +if(CLR_CMAKE_HOST_ARCH_ARM64 AND CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_TARGET_LINUX_MUSL) + # Currently the _xstate is not available on Alpine Linux add_definitions(-DXSTATE_SUPPORTED) -endif(CLR_CMAKE_HOST_ARCH_AMD64 AND CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_HOST_LINUX_MUSL) +endif(CLR_CMAKE_HOST_ARCH_ARM64 AND CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_TARGET_LINUX_MUSL) -if(CLR_CMAKE_HOST_LINUX_MUSL) - # Setting RLIMIT_NOFILE breaks debugging of coreclr on linux-musl for some reason +if(CLR_CMAKE_TARGET_LINUX_MUSL) + # Setting RLIMIT_NOFILE breaks debugging of coreclr on Alpine Linux for some reason add_definitions(-DDONT_SET_RLIMIT_NOFILE) - # On linux-musl, we need to ensure that the reported stack range for the primary thread is + # On Alpine Linux, we need to ensure that the reported stack range for the primary thread is # larger than the initial committed stack size. add_definitions(-DENSURE_PRIMARY_STACK_SIZE) -endif(CLR_CMAKE_HOST_LINUX_MUSL) +endif(CLR_CMAKE_TARGET_LINUX_MUSL) + +if(CLR_CMAKE_TARGET_HAIKU) + add_definitions(-D_GNU_SOURCE) +endif(CLR_CMAKE_TARGET_HAIKU) # turn off capability to remove unused functions (which was enabled in debug build with sanitizers) set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--no-gc-sections") set(ARCH_SOURCES arch/${PAL_ARCH_SOURCES_DIR}/debugbreak.S - arch/${PAL_ARCH_SOURCES_DIR}/processor.cpp ) if(CLR_CMAKE_HOST_ARCH_ARM) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -94,16 +107,6 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND (CLR_CMAKE_HOST_ARCH_AMD64 OR CLR_CM endif() set(SOURCES - cruntime/file.cpp - cruntime/filecrt.cpp - cruntime/malloc.cpp - cruntime/math.cpp - cruntime/misc.cpp - cruntime/printf.cpp - cruntime/printfcpp.cpp - cruntime/silent_printf.cpp - cruntime/string.cpp - cruntime/stringtls.cpp cruntime/wchar.cpp debug/debug.cpp file/directory.cpp @@ -117,8 +120,8 @@ set(SOURCES init/sxs.cpp loader/module.cpp locale/unicode.cpp - locale/unicodedata.cpp - locale/utf8.cpp + ${CLR_SRC_NATIVE_DIR}/minipal/utf8.c + ${CLR_SRC_NATIVE_DIR}/minipal/unicodedata.c map/common.cpp map/map.cpp map/virtual.cpp @@ -149,10 +152,8 @@ set(SOURCES safecrt/sscanf_s.cpp safecrt/strcat_s.cpp safecrt/strcpy_s.cpp - safecrt/strlen_s.cpp safecrt/strncat_s.cpp safecrt/strncpy_s.cpp - safecrt/strtok_s.cpp safecrt/swprintf.cpp safecrt/vsprintf.cpp safecrt/vswprint.cpp @@ -161,9 +162,7 @@ set(SOURCES safecrt/wcslen_s.cpp safecrt/wcsncat_s.cpp safecrt/wcsncpy_s.cpp - safecrt/wcstok_s.cpp safecrt/wmakepath_s.cpp - safecrt/wsplitpath_s.cpp safecrt/xtoa_s.cpp safecrt/xtow_s.cpp shmemory/shmemory.cpp @@ -190,6 +189,7 @@ if(CLR_CMAKE_TARGET_OSX) find_library(SECURITY Security) find_library(SYSTEM System) target_link_libraries(coreclrpal + PUBLIC ${COREFOUNDATION} ${CORESERVICES} ${SECURITY} @@ -199,26 +199,37 @@ endif(CLR_CMAKE_TARGET_OSX) if(CLR_CMAKE_TARGET_FREEBSD) target_link_libraries(coreclrpal + PUBLIC pthread rt ) endif(CLR_CMAKE_TARGET_FREEBSD) +if(CLR_CMAKE_TARGET_HAIKU) + target_link_libraries(coreclrpal + PUBLIC + bsd + ) +endif(CLR_CMAKE_TARGET_HAIKU) + if(CLR_CMAKE_TARGET_LINUX) # On Android, we don't need to link with gcc_s, pthread and rt if(NOT CLR_CMAKE_TARGET_ANDROID) target_link_libraries(coreclrpal + PUBLIC gcc_s pthread rt ) else(NOT CLR_CMAKE_TARGET_ANDROID) target_link_libraries(coreclrpal + PUBLIC ${ANDROID_GLOB} ${LZMA}) endif(NOT CLR_CMAKE_TARGET_ANDROID) target_link_libraries(coreclrpal + PUBLIC dl ) @@ -227,6 +238,7 @@ if(CLR_CMAKE_TARGET_NETBSD) add_definitions(-D_KMEMUSER) find_library(KVM kvm) target_link_libraries(coreclrpal + PUBLIC pthread rt ${KVM} @@ -234,6 +246,7 @@ if(CLR_CMAKE_TARGET_NETBSD) endif(CLR_CMAKE_TARGET_NETBSD) if(CLR_CMAKE_TARGET_SUNOS) target_link_libraries(coreclrpal + PUBLIC pthread rt ) diff --git a/src/shared/pal/src/arch/amd64/asmconstants.h b/src/shared/pal/src/arch/amd64/asmconstants.h index c23fb7043c..d5a72cf6ed 100644 --- a/src/shared/pal/src/arch/amd64/asmconstants.h +++ b/src/shared/pal/src/arch/amd64/asmconstants.h @@ -3,6 +3,18 @@ #ifdef HOST_64BIT +#define XSTATE_GSSE (2) +#define XSTATE_AVX (XSTATE_GSSE) +#define XSTATE_AVX512_KMASK (5) +#define XSTATE_AVX512_ZMM_H (6) +#define XSTATE_AVX512_ZMM (7) + +#define XSTATE_MASK_GSSE (1 << (XSTATE_GSSE)) +#define XSTATE_MASK_AVX (XSTATE_MASK_GSSE) +#define XSTATE_MASK_AVX512 ((1 << (XSTATE_AVX512_KMASK)) | \ + (1 << (XSTATE_AVX512_ZMM_H)) | \ + (1 << (XSTATE_AVX512_ZMM))) + // The arch bit is normally set in the flag constants below. Since this is already arch-specific code and the arch bit is not // relevant, the arch bit is excluded from the flag constants below for simpler tests. #define CONTEXT_AMD64 0x100000 @@ -17,7 +29,7 @@ #define CONTEXT_XSTATE 64 -#define CONTEXT_ContextFlags 6*8 +#define CONTEXT_ContextFlags (6*8) #define CONTEXT_SegCs CONTEXT_ContextFlags+8 #define CONTEXT_SegDs CONTEXT_SegCs+2 #define CONTEXT_SegEs CONTEXT_SegDs+2 @@ -49,8 +61,8 @@ #define CONTEXT_R15 CONTEXT_R14+8 #define CONTEXT_Rip CONTEXT_R15+8 #define CONTEXT_FltSave CONTEXT_Rip+8 -#define FLOATING_SAVE_AREA_SIZE 4*8+24*16+96 -#define CONTEXT_Xmm0 CONTEXT_FltSave+10*16 +#define FLOATING_SAVE_AREA_SIZE (4*8)+(24*16)+96 +#define CONTEXT_Xmm0 CONTEXT_FltSave+(10*16) #define CONTEXT_Xmm1 CONTEXT_Xmm0+16 #define CONTEXT_Xmm2 CONTEXT_Xmm1+16 #define CONTEXT_Xmm3 CONTEXT_Xmm2+16 @@ -67,13 +79,19 @@ #define CONTEXT_Xmm14 CONTEXT_Xmm13+16 #define CONTEXT_Xmm15 CONTEXT_Xmm14+16 #define CONTEXT_VectorRegister CONTEXT_FltSave+FLOATING_SAVE_AREA_SIZE -#define CONTEXT_VectorControl CONTEXT_VectorRegister+16*26 +#define CONTEXT_VectorControl CONTEXT_VectorRegister+(16*26) #define CONTEXT_DebugControl CONTEXT_VectorControl+8 #define CONTEXT_LastBranchToRip CONTEXT_DebugControl+8 #define CONTEXT_LastBranchFromRip CONTEXT_LastBranchToRip+8 #define CONTEXT_LastExceptionToRip CONTEXT_LastBranchFromRip+8 #define CONTEXT_LastExceptionFromRip CONTEXT_LastExceptionToRip+8 -#define CONTEXT_Size CONTEXT_LastExceptionFromRip+8 +#define CONTEXT_XStateFeaturesMask CONTEXT_LastExceptionFromRip+8 +#define CONTEXT_XStateReserved0 CONTEXT_XStateFeaturesMask+8 +#define CONTEXT_Ymm0H CONTEXT_XStateReserved0+8 +#define CONTEXT_KMask0 CONTEXT_Ymm0H+(16*16) +#define CONTEXT_Zmm0H CONTEXT_KMask0+(8*8) +#define CONTEXT_Zmm16 CONTEXT_Zmm0H+(32*16) +#define CONTEXT_Size CONTEXT_Zmm16+(64*16) #else // HOST_64BIT diff --git a/src/shared/pal/src/arch/amd64/processor.cpp b/src/shared/pal/src/arch/amd64/processor.cpp deleted file mode 100644 index 1c9e026cfe..0000000000 --- a/src/shared/pal/src/arch/amd64/processor.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - processor.cpp - -Abstract: - - Implementation of processor related functions for the Intel x86/x64 - platforms. These functions are processor dependent. - - - ---*/ - -#include "pal/palinternal.h" - -/*++ -Function: -XmmYmmStateSupport - -Check if OS has enabled both XMM and YMM state support - -Return value: -1 if XMM and YMM are enabled, 0 otherwise ---*/ -extern "C" unsigned int XmmYmmStateSupport() -{ - unsigned int eax; - __asm(" mov $1, %%eax\n" \ - " cpuid\n" \ - " xor %%eax, %%eax\n" \ - " and $0x18000000, %%ecx\n" /* check for xsave feature set and that it is enabled by the OS */ \ - " cmp $0x18000000, %%ecx\n" \ - " jne end\n" \ - " xor %%ecx, %%ecx\n" \ - " xgetbv\n" \ - "end:\n" \ - : "=a"(eax) /* output in eax */ \ - : /* no inputs */ \ - : "ebx", "ecx", "edx" /* registers that are clobbered */ - ); - // Check OS has enabled both XMM and YMM state support - return ((eax & 0x06) == 0x06) ? 1 : 0; -} diff --git a/src/shared/pal/src/arch/arm/debugbreak.S b/src/shared/pal/src/arch/arm/debugbreak.S index dd8a934835..88301b9854 100644 --- a/src/shared/pal/src/arch/arm/debugbreak.S +++ b/src/shared/pal/src/arch/arm/debugbreak.S @@ -4,7 +4,9 @@ #include "unixasmmacros.inc" .syntax unified +#ifndef __armv6__ .thumb +#endif LEAF_ENTRY DBG_DebugBreak, _TEXT EMIT_BREAKPOINT diff --git a/src/shared/pal/src/arch/arm/processor.cpp b/src/shared/pal/src/arch/arm/processor.cpp deleted file mode 100644 index 7048a5b4b4..0000000000 --- a/src/shared/pal/src/arch/arm/processor.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - processor.cpp - -Abstract: - - Implementation of processor related functions for the ARM - platform. These functions are processor dependent. - - - ---*/ - -#include "pal/palinternal.h" diff --git a/src/shared/pal/src/arch/arm64/asmconstants.h b/src/shared/pal/src/arch/arm64/asmconstants.h index a657b8e5eb..c99cb4bed9 100644 --- a/src/shared/pal/src/arch/arm64/asmconstants.h +++ b/src/shared/pal/src/arch/arm64/asmconstants.h @@ -18,6 +18,14 @@ #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) +#define CONTEXT_ARM64_XSTATE_BIT (5) +#define CONTEXT_ARM64_XSTATE (1 << CONTEXT_XSTATE_BIT) + +#define CONTEXT_XSTATE_BIT CONTEXT_ARM64_XSTATE_BIT +#define CONTEXT_XSTATE CONTEXT_ARM64_XSTATE + +#define XSTATE_ARM64_SVE_BIT (2) +#define XSTATE_MASK_ARM64_SVE (UI64(1) << (XSTATE_ARM64_SVE_BIT)) #define CONTEXT_ContextFlags 0 #define CONTEXT_Cpsr CONTEXT_ContextFlags+4 @@ -54,6 +62,7 @@ #define CONTEXT_Lr CONTEXT_Fp+8 #define CONTEXT_Sp CONTEXT_Lr+8 #define CONTEXT_Pc CONTEXT_Sp+8 + #define CONTEXT_NEON_OFFSET CONTEXT_Pc+8 #define CONTEXT_V0 0 #define CONTEXT_V1 CONTEXT_V0+16 @@ -89,7 +98,42 @@ #define CONTEXT_V31 CONTEXT_V30+16 #define CONTEXT_FLOAT_CONTROL_OFFSET CONTEXT_V31+16 #define CONTEXT_Fpcr 0 -#define CONTEXT_Fpsr CONTEXT_Fpcr+8 -#define CONTEXT_Size ((CONTEXT_NEON_OFFSET + CONTEXT_Fpsr + 8 + 0xf) & ~0xf) +#define CONTEXT_Fpsr CONTEXT_Fpcr+4 +#define CONTEXT_NEON_SIZE CONTEXT_FLOAT_CONTROL_OFFSET+CONTEXT_Fpsr+4 + +#define CONTEXT_DEBUG_OFFSET CONTEXT_NEON_OFFSET+CONTEXT_NEON_SIZE +#define CONTEXT_DEBUG_SIZE 120 // (8*4)+(8*8)+(2*4)+(2*8) + +#define CONTEXT_XSTATEFEATURESMASK_OFFSET CONTEXT_DEBUG_OFFSET+CONTEXT_DEBUG_SIZE + +// TODO-SVE: Support Vector register sizes >128bit + +#define CONTEXT_SVE_OFFSET CONTEXT_XSTATEFEATURESMASK_OFFSET+8 +#define CONTEXT_VL_OFFSET 0 + +// SVE register offsets are multiples of the vector length +#define CONTEXT_SVE_REGS_OFFSET CONTEXT_VL_OFFSET+4 +#define CONTEXT_FFR_VL 0 +#define CONTEXT_P0_VL CONTEXT_FFR_VL+1 +#define CONTEXT_P1_VL CONTEXT_P0_VL+1 +#define CONTEXT_P2_VL CONTEXT_P1_VL+1 +#define CONTEXT_P3_VL CONTEXT_P2_VL+1 +#define CONTEXT_P4_VL CONTEXT_P3_VL+1 +#define CONTEXT_P5_VL CONTEXT_P4_VL+1 +#define CONTEXT_P6_VL CONTEXT_P5_VL+1 +#define CONTEXT_P7_VL CONTEXT_P6_VL+1 +#define CONTEXT_P8_VL CONTEXT_P7_VL+1 +#define CONTEXT_P9_VL CONTEXT_P8_VL+1 +#define CONTEXT_P10_VL CONTEXT_P9_VL+1 +#define CONTEXT_P11_VL CONTEXT_P10_VL+1 +#define CONTEXT_P12_VL CONTEXT_P11_VL+1 +#define CONTEXT_P13_VL CONTEXT_P12_VL+1 +#define CONTEXT_P14_VL CONTEXT_P13_VL+1 +#define CONTEXT_P15_VL CONTEXT_P14_VL+1 + +#define CONTEXT_SVE_REGS_SIZE ((CONTEXT_P15_VL+1) * 4) +#define CONTEXT_SVE_SIZE CONTEXT_SVE_REGS_SIZE + 8 + +#define CONTEXT_Size CONTEXT_SVE_OFFSET + CONTEXT_SVE_SIZE #endif diff --git a/src/shared/pal/src/arch/arm64/processor.cpp b/src/shared/pal/src/arch/arm64/processor.cpp deleted file mode 100644 index ab4b84febd..0000000000 --- a/src/shared/pal/src/arch/arm64/processor.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - processor.cpp - -Abstract: - - Implementation of processor related functions for the ARM64 - platform. These functions are processor dependent. - - - ---*/ - -#include "pal/palinternal.h" diff --git a/src/shared/pal/src/arch/i386/processor.cpp b/src/shared/pal/src/arch/i386/processor.cpp deleted file mode 100644 index 7f60b75cfe..0000000000 --- a/src/shared/pal/src/arch/i386/processor.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - processor.cpp - -Abstract: - - Implementation of processor related functions for the Intel x86/x64 - platforms. These functions are processor dependent. - - - ---*/ - -#include "pal/palinternal.h" diff --git a/src/shared/pal/src/arch/loongarch64/asmconstants.h b/src/shared/pal/src/arch/loongarch64/asmconstants.h new file mode 100644 index 0000000000..3676b16fcc --- /dev/null +++ b/src/shared/pal/src/arch/loongarch64/asmconstants.h @@ -0,0 +1,96 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef __PAL_LOONGARCH64_ASMCONSTANTS_H__ +#define __PAL_LOONGARCH64_ASMCONSTANTS_H__ + +// Please refer to src/coreclr/pal/inc/pal.h +#define CONTEXT_LOONGARCH64 0x00800000 + +#define CONTEXT_CONTROL_BIT (0) +#define CONTEXT_INTEGER_BIT (1) +#define CONTEXT_FLOATING_POINT_BIT (2) +#define CONTEXT_DEBUG_REGISTERS_BIT (3) + +#define CONTEXT_CONTROL (CONTEXT_LOONGARCH64 | (1 << CONTEXT_CONTROL_BIT)) +#define CONTEXT_INTEGER (CONTEXT_LOONGARCH64 | (1 << CONTEXT_INTEGER_BIT)) +#define CONTEXT_FLOATING_POINT (CONTEXT_LOONGARCH64 | (1 << CONTEXT_FLOATING_POINT_BIT)) +#define CONTEXT_DEBUG_REGISTERS (CONTEXT_LOONGARCH64 | (1 << CONTEXT_DEBUG_REGISTERS_BIT)) + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) + +#define SIZEOF_LOONGARCH_GPR 8 +#define SIZEOF_LOONGARCH_FPR 8 + +#define CONTEXT_ContextFlags 0 +// Note: Here CONTEXT_ContextFlags+8 for memory algin. +#define CONTEXT_R0 CONTEXT_ContextFlags+SIZEOF_LOONGARCH_GPR +#define CONTEXT_Ra CONTEXT_R0+SIZEOF_LOONGARCH_GPR +#define CONTEXT_Tp CONTEXT_Ra+SIZEOF_LOONGARCH_GPR +#define CONTEXT_Sp CONTEXT_Tp+SIZEOF_LOONGARCH_GPR +#define CONTEXT_A0 CONTEXT_Sp+SIZEOF_LOONGARCH_GPR +#define CONTEXT_A1 CONTEXT_A0+SIZEOF_LOONGARCH_GPR +#define CONTEXT_A2 CONTEXT_A1+SIZEOF_LOONGARCH_GPR +#define CONTEXT_A3 CONTEXT_A2+SIZEOF_LOONGARCH_GPR +#define CONTEXT_A4 CONTEXT_A3+SIZEOF_LOONGARCH_GPR +#define CONTEXT_A5 CONTEXT_A4+SIZEOF_LOONGARCH_GPR +#define CONTEXT_A6 CONTEXT_A5+SIZEOF_LOONGARCH_GPR +#define CONTEXT_A7 CONTEXT_A6+SIZEOF_LOONGARCH_GPR +#define CONTEXT_T0 CONTEXT_A7+SIZEOF_LOONGARCH_GPR +#define CONTEXT_T1 CONTEXT_T0+SIZEOF_LOONGARCH_GPR +#define CONTEXT_T2 CONTEXT_T1+SIZEOF_LOONGARCH_GPR +#define CONTEXT_T3 CONTEXT_T2+SIZEOF_LOONGARCH_GPR +#define CONTEXT_T4 CONTEXT_T3+SIZEOF_LOONGARCH_GPR +#define CONTEXT_T5 CONTEXT_T4+SIZEOF_LOONGARCH_GPR +#define CONTEXT_T6 CONTEXT_T5+SIZEOF_LOONGARCH_GPR +#define CONTEXT_T7 CONTEXT_T6+SIZEOF_LOONGARCH_GPR +#define CONTEXT_T8 CONTEXT_T7+SIZEOF_LOONGARCH_GPR +#define CONTEXT_R21 CONTEXT_T8+SIZEOF_LOONGARCH_GPR +#define CONTEXT_Fp CONTEXT_R21+SIZEOF_LOONGARCH_GPR +#define CONTEXT_S0 CONTEXT_Fp+SIZEOF_LOONGARCH_GPR +#define CONTEXT_S1 CONTEXT_S0+SIZEOF_LOONGARCH_GPR +#define CONTEXT_S2 CONTEXT_S1+SIZEOF_LOONGARCH_GPR +#define CONTEXT_S3 CONTEXT_S2+SIZEOF_LOONGARCH_GPR +#define CONTEXT_S4 CONTEXT_S3+SIZEOF_LOONGARCH_GPR +#define CONTEXT_S5 CONTEXT_S4+SIZEOF_LOONGARCH_GPR +#define CONTEXT_S6 CONTEXT_S5+SIZEOF_LOONGARCH_GPR +#define CONTEXT_S7 CONTEXT_S6+SIZEOF_LOONGARCH_GPR +#define CONTEXT_S8 CONTEXT_S7+SIZEOF_LOONGARCH_GPR +#define CONTEXT_Pc CONTEXT_S8+SIZEOF_LOONGARCH_GPR +#define CONTEXT_FPU_OFFSET CONTEXT_Pc+SIZEOF_LOONGARCH_GPR + +#define CONTEXT_F0 0 +#define CONTEXT_F1 CONTEXT_F0+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F2 CONTEXT_F1+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F3 CONTEXT_F2+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F4 CONTEXT_F3+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F5 CONTEXT_F4+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F6 CONTEXT_F5+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F7 CONTEXT_F6+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F8 CONTEXT_F7+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F9 CONTEXT_F8+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F10 CONTEXT_F9+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F11 CONTEXT_F10+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F12 CONTEXT_F11+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F13 CONTEXT_F12+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F14 CONTEXT_F13+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F15 CONTEXT_F14+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F16 CONTEXT_F15+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F17 CONTEXT_F16+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F18 CONTEXT_F17+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F19 CONTEXT_F18+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F20 CONTEXT_F19+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F21 CONTEXT_F20+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F22 CONTEXT_F21+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F23 CONTEXT_F22+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F24 CONTEXT_F23+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F25 CONTEXT_F24+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F26 CONTEXT_F25+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F27 CONTEXT_F26+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F28 CONTEXT_F27+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F29 CONTEXT_F28+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F30 CONTEXT_F29+SIZEOF_LOONGARCH_FPR +#define CONTEXT_F31 CONTEXT_F30+SIZEOF_LOONGARCH_FPR +#define CONTEXT_FLOAT_CONTROL_OFFSET (CONTEXT_FPU_OFFSET + 4*32*8) + +#endif diff --git a/src/shared/pal/src/arch/loongarch64/context2.S b/src/shared/pal/src/arch/loongarch64/context2.S new file mode 100644 index 0000000000..dda4f1922f --- /dev/null +++ b/src/shared/pal/src/arch/loongarch64/context2.S @@ -0,0 +1,282 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// +// Implementation of _CONTEXT_CaptureContext for the LOONGARCH platform. +// This function is processor dependent. It is used by exception handling, +// and is always apply to the current thread. +// + +#include "unixasmmacros.inc" +#include "asmconstants.h" + +// Incoming: +// a0: Context* +// a1: Exception* +// +LEAF_ENTRY RtlRestoreContext, _TEXT +#ifdef HAS_ADDRESS_SANITIZER + ld.w $r21, $a0, CONTEXT_ContextFlags + andi $r21, $r21, (1 << CONTEXT_CONTROL_BIT) + beq $r21, $r0, LOCAL_LABEL(Restore_CONTEXT_FLOATING_POINT) + + addi.d $sp, $sp, -16 + st.d a0, $sp, 0 + st.d a1, $sp, 8 + + bl __asan_handle_no_return + + ld.d $a0, $sp, 0 + ld.d $a1, $sp, 8 + addi.d $sp, $sp, 16 + +LOCAL_LABEL(Restore_CONTEXT_FLOATING_POINT): +#endif + + ori $t4, $a0, 0 + ld.w $r21, $a0, CONTEXT_ContextFlags + andi $t1, $r21, (1 << CONTEXT_FLOATING_POINT_BIT) + beqz $t1, LOCAL_LABEL(No_Restore_CONTEXT_FLOATING_POINT) + + // 256-bits SIMD:LASX. + xvld $xr0, $a0, CONTEXT_FPU_OFFSET + 0 + xvld $xr1, $a0, CONTEXT_FPU_OFFSET + 32*1 + xvld $xr2, $a0, CONTEXT_FPU_OFFSET + 32*2 + xvld $xr3, $a0, CONTEXT_FPU_OFFSET + 32*3 + xvld $xr4, $a0, CONTEXT_FPU_OFFSET + 32*4 + xvld $xr5, $a0, CONTEXT_FPU_OFFSET + 32*5 + xvld $xr6, $a0, CONTEXT_FPU_OFFSET + 32*6 + xvld $xr7, $a0, CONTEXT_FPU_OFFSET + 32*7 + xvld $xr8, $a0, CONTEXT_FPU_OFFSET + 32*8 + xvld $xr9, $a0, CONTEXT_FPU_OFFSET + 32*9 + xvld $xr10, $a0, CONTEXT_FPU_OFFSET + 32*10 + xvld $xr11, $a0, CONTEXT_FPU_OFFSET + 32*11 + xvld $xr12, $a0, CONTEXT_FPU_OFFSET + 32*12 + xvld $xr13, $a0, CONTEXT_FPU_OFFSET + 32*13 + xvld $xr14, $a0, CONTEXT_FPU_OFFSET + 32*14 + xvld $xr15, $a0, CONTEXT_FPU_OFFSET + 32*15 + xvld $xr16, $a0, CONTEXT_FPU_OFFSET + 32*16 + xvld $xr17, $a0, CONTEXT_FPU_OFFSET + 32*17 + xvld $xr18, $a0, CONTEXT_FPU_OFFSET + 32*18 + xvld $xr19, $a0, CONTEXT_FPU_OFFSET + 32*19 + xvld $xr20, $a0, CONTEXT_FPU_OFFSET + 32*20 + xvld $xr21, $a0, CONTEXT_FPU_OFFSET + 32*21 + xvld $xr22, $a0, CONTEXT_FPU_OFFSET + 32*22 + xvld $xr23, $a0, CONTEXT_FPU_OFFSET + 32*23 + xvld $xr24, $a0, CONTEXT_FPU_OFFSET + 32*24 + xvld $xr25, $a0, CONTEXT_FPU_OFFSET + 32*25 + xvld $xr26, $a0, CONTEXT_FPU_OFFSET + 32*26 + xvld $xr27, $a0, CONTEXT_FPU_OFFSET + 32*27 + xvld $xr28, $a0, CONTEXT_FPU_OFFSET + 32*28 + xvld $xr29, $a0, CONTEXT_FPU_OFFSET + 32*29 + xvld $xr30, $a0, CONTEXT_FPU_OFFSET + 32*30 + xvld $xr31, $a0, CONTEXT_FPU_OFFSET + 32*31 + + ld.d $t1, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + movgr2cf $fcc0, $t1 + srli.d $t1, $t1, 8 + movgr2cf $fcc1, $t1 + srli.d $t1, $t1, 8 + movgr2cf $fcc2, $t1 + srli.d $t1, $t1, 8 + movgr2cf $fcc3, $t1 + srli.d $t1, $t1, 8 + movgr2cf $fcc4, $t1 + srli.d $t1, $t1, 8 + movgr2cf $fcc5, $t1 + srli.d $t1, $t1, 8 + movgr2cf $fcc6, $t1 + srli.d $t1, $t1, 8 + movgr2cf $fcc7, $t1 + + ld.w $t1, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + 8 + movgr2fcsr $fcsr0, $t1 + +LOCAL_LABEL(No_Restore_CONTEXT_FLOATING_POINT): + + andi $t1, $r21, (1 << CONTEXT_INTEGER_BIT) + beqz $t1, LOCAL_LABEL(No_Restore_CONTEXT_INTEGER) + + ld.d $tp, $a0, CONTEXT_Tp + ld.d $a1, $a0, CONTEXT_A1 + ld.d $a2, $a0, CONTEXT_A2 + ld.d $a3, $a0, CONTEXT_A3 + ld.d $a4, $a0, CONTEXT_A4 + ld.d $a5, $a0, CONTEXT_A5 + ld.d $a6, $a0, CONTEXT_A6 + ld.d $a7, $a0, CONTEXT_A7 + ld.d $t0, $a0, CONTEXT_T0 + ld.d $t1, $a0, CONTEXT_T1 + ld.d $t2, $a0, CONTEXT_T2 + ld.d $t3, $a0, CONTEXT_T3 + ld.d $t5, $a0, CONTEXT_T5 + ld.d $t6, $a0, CONTEXT_T6 + ld.d $t7, $a0, CONTEXT_T7 + ld.d $t8, $a0, CONTEXT_T8 + + ld.d $s0, $a0, CONTEXT_S0 + ld.d $s1, $a0, CONTEXT_S1 + ld.d $s2, $a0, CONTEXT_S2 + ld.d $s3, $a0, CONTEXT_S3 + ld.d $s4, $a0, CONTEXT_S4 + ld.d $s5, $a0, CONTEXT_S5 + ld.d $s6, $a0, CONTEXT_S6 + ld.d $s7, $a0, CONTEXT_S7 + ld.d $s8, $a0, CONTEXT_S8 + + ld.d $a0, $a0, CONTEXT_A0 + +LOCAL_LABEL(No_Restore_CONTEXT_INTEGER): + + andi $r21, $r21, (1 << CONTEXT_CONTROL_BIT) + beq $r21, $r0, LOCAL_LABEL(No_Restore_CONTEXT_CONTROL) + + ld.d $ra, $t4, CONTEXT_Ra + ld.d $fp, $t4, CONTEXT_Fp + ld.d $r21, $t4, CONTEXT_Pc + ld.d $sp, $t4, CONTEXT_Sp + // NOTE: the r21 and t4 had been trashed. + jirl $r0, $r21, 0 + + +LOCAL_LABEL(No_Restore_CONTEXT_CONTROL): + ld.d $r21, $t4, CONTEXT_R21 + ld.d $t4, $t4, CONTEXT_T4 + jirl $r0, $ra, 0 +LEAF_END RtlRestoreContext, _TEXT + +// Incoming: +// a0: Context* + +LEAF_ENTRY RtlCaptureContext, _TEXT + PROLOG_STACK_ALLOC 16 + st.d $r21, $sp, 0 + li.w $r21, CONTEXT_FULL + st.w $r21, $a0, CONTEXT_ContextFlags + ld.d $r21, $sp, 0 + EPILOG_STACK_FREE 16 + b C_FUNC(CONTEXT_CaptureContext) +LEAF_END RtlCaptureContext, _TEXT + +// Incoming: +// a0: Context* +// +LEAF_ENTRY CONTEXT_CaptureContext, _TEXT + PROLOG_STACK_ALLOC 32 + st.d $t0, $sp, 0 + st.d $t1, $sp, 8 + st.d $t3, $sp, 16 + + ld.w $t1, $a0, CONTEXT_ContextFlags + andi $t3, $t1, (1 << CONTEXT_CONTROL_BIT) + beqz $t3, LOCAL_LABEL(Done_CONTEXT_CONTROL) + + addi.d $t0, $sp, 32 + st.d $fp, $a0, CONTEXT_Fp + st.d $t0, $a0, CONTEXT_Sp + st.d $ra, $a0, CONTEXT_Ra + st.d $ra, $a0, CONTEXT_Pc + +LOCAL_LABEL(Done_CONTEXT_CONTROL): + + andi $t3, $t1, (1 << CONTEXT_INTEGER_BIT) + beqz $t3, LOCAL_LABEL(Done_CONTEXT_INTEGER) + + ld.d $t0, $sp, 0 + ld.d $t1, $sp, 8 + ld.d $t3, $sp, 16 + + st.d $tp, $a0, CONTEXT_Tp + st.d $a0, $a0, CONTEXT_A0 + st.d $a1, $a0, CONTEXT_A1 + st.d $a2, $a0, CONTEXT_A2 + st.d $a3, $a0, CONTEXT_A3 + st.d $a4, $a0, CONTEXT_A4 + st.d $a5, $a0, CONTEXT_A5 + st.d $a6, $a0, CONTEXT_A6 + st.d $a7, $a0, CONTEXT_A7 + st.d $t0, $a0, CONTEXT_T0 + st.d $t1, $a0, CONTEXT_T1 + st.d $t2, $a0, CONTEXT_T2 + st.d $t3, $a0, CONTEXT_T3 + st.d $t4, $a0, CONTEXT_T4 + st.d $t5, $a0, CONTEXT_T5 + st.d $t6, $a0, CONTEXT_T6 + st.d $t7, $a0, CONTEXT_T7 + st.d $t8, $a0, CONTEXT_T8 + st.d $r21,$a0, CONTEXT_R21 + st.d $s0, $a0, CONTEXT_S0 + st.d $s1, $a0, CONTEXT_S1 + st.d $s2, $a0, CONTEXT_S2 + st.d $s3, $a0, CONTEXT_S3 + st.d $s4, $a0, CONTEXT_S4 + st.d $s5, $a0, CONTEXT_S5 + st.d $s6, $a0, CONTEXT_S6 + st.d $s7, $a0, CONTEXT_S7 + st.d $s8, $a0, CONTEXT_S8 + +LOCAL_LABEL(Done_CONTEXT_INTEGER): + ld.w $t1, $a0, CONTEXT_ContextFlags + + andi $t3, $t1, (1 << CONTEXT_FLOATING_POINT_BIT) + beqz $t3, LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT) + + // 256-bits SIMD:LASX. + xvst $xr0 , $a0, CONTEXT_FPU_OFFSET + 32*0 + xvst $xr1 , $a0, CONTEXT_FPU_OFFSET + 32*1 + xvst $xr2 , $a0, CONTEXT_FPU_OFFSET + 32*2 + xvst $xr3 , $a0, CONTEXT_FPU_OFFSET + 32*3 + xvst $xr4 , $a0, CONTEXT_FPU_OFFSET + 32*4 + xvst $xr5 , $a0, CONTEXT_FPU_OFFSET + 32*5 + xvst $xr6 , $a0, CONTEXT_FPU_OFFSET + 32*6 + xvst $xr7 , $a0, CONTEXT_FPU_OFFSET + 32*7 + xvst $xr8 , $a0, CONTEXT_FPU_OFFSET + 32*8 + xvst $xr9 , $a0, CONTEXT_FPU_OFFSET + 32*9 + xvst $xr10, $a0, CONTEXT_FPU_OFFSET + 32*10 + xvst $xr11, $a0, CONTEXT_FPU_OFFSET + 32*11 + xvst $xr12, $a0, CONTEXT_FPU_OFFSET + 32*12 + xvst $xr13, $a0, CONTEXT_FPU_OFFSET + 32*13 + xvst $xr14, $a0, CONTEXT_FPU_OFFSET + 32*14 + xvst $xr15, $a0, CONTEXT_FPU_OFFSET + 32*15 + xvst $xr16, $a0, CONTEXT_FPU_OFFSET + 32*16 + xvst $xr17, $a0, CONTEXT_FPU_OFFSET + 32*17 + xvst $xr18, $a0, CONTEXT_FPU_OFFSET + 32*18 + xvst $xr19, $a0, CONTEXT_FPU_OFFSET + 32*19 + xvst $xr20, $a0, CONTEXT_FPU_OFFSET + 32*20 + xvst $xr21, $a0, CONTEXT_FPU_OFFSET + 32*21 + xvst $xr22, $a0, CONTEXT_FPU_OFFSET + 32*22 + xvst $xr23, $a0, CONTEXT_FPU_OFFSET + 32*23 + xvst $xr24, $a0, CONTEXT_FPU_OFFSET + 32*24 + xvst $xr25, $a0, CONTEXT_FPU_OFFSET + 32*25 + xvst $xr26, $a0, CONTEXT_FPU_OFFSET + 32*26 + xvst $xr27, $a0, CONTEXT_FPU_OFFSET + 32*27 + xvst $xr28, $a0, CONTEXT_FPU_OFFSET + 32*28 + xvst $xr29, $a0, CONTEXT_FPU_OFFSET + 32*29 + xvst $xr30, $a0, CONTEXT_FPU_OFFSET + 32*30 + xvst $xr31, $a0, CONTEXT_FPU_OFFSET + 32*31 + + ori $t0, $r0, 0 + movcf2gr $t0, $fcc0 + st.b $t0, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + movcf2gr $t0, $fcc1 + st.b $t0, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + 1 + movcf2gr $t0, $fcc2 + st.b $t0, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + 2 + movcf2gr $t0, $fcc3 + st.b $t0, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + 3 + movcf2gr $t0, $fcc4 + st.b $t0, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + 4 + movcf2gr $t0, $fcc5 + st.b $t0, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + 5 + movcf2gr $t0, $fcc6 + st.b $t0, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + 6 + movcf2gr $t0, $fcc7 + st.b $t0, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + 7 + + movfcsr2gr $t0, $fcsr0 + st.w $t0, $a0, CONTEXT_FLOAT_CONTROL_OFFSET + 8 + +LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT): + + EPILOG_STACK_FREE 32 + jirl $r0, $ra, 0 +LEAF_END CONTEXT_CaptureContext, _TEXT diff --git a/src/shared/pal/src/arch/loongarch64/debugbreak.S b/src/shared/pal/src/arch/loongarch64/debugbreak.S new file mode 100644 index 0000000000..93fdfd8c4c --- /dev/null +++ b/src/shared/pal/src/arch/loongarch64/debugbreak.S @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "unixasmmacros.inc" +LEAF_ENTRY DBG_DebugBreak, _TEXT + EMIT_BREAKPOINT +LEAF_END_MARKED DBG_DebugBreak, _TEXT diff --git a/src/shared/pal/src/arch/ppc64le/asmconstants.h b/src/shared/pal/src/arch/ppc64le/asmconstants.h new file mode 100644 index 0000000000..15ee945daf --- /dev/null +++ b/src/shared/pal/src/arch/ppc64le/asmconstants.h @@ -0,0 +1,89 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#ifndef __PAL_POWERPC_ASMCONSTANTS_H__ +#define __PAL_POWERPC_ASMCONSTANTS_H__ + +#define CONTEXT_PPC64 0x100000 + +#define CONTEXT_CONTROL 1 +#define CONTEXT_INTEGER 2 +#define CONTEXT_FLOATING_POINT 4 + +#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) + +#define CONTEXT_ContextFlags 0 +#define CONTEXT_R0 CONTEXT_ContextFlags+8 +#define CONTEXT_R1 CONTEXT_R0+8 +#define CONTEXT_R2 CONTEXT_R1+8 +#define CONTEXT_R3 CONTEXT_R2+8 +#define CONTEXT_R4 CONTEXT_R3+8 +#define CONTEXT_R5 CONTEXT_R4+8 +#define CONTEXT_R6 CONTEXT_R5+8 +#define CONTEXT_R7 CONTEXT_R6+8 +#define CONTEXT_R8 CONTEXT_R7+8 +#define CONTEXT_R9 CONTEXT_R8+8 +#define CONTEXT_R10 CONTEXT_R9+8 +#define CONTEXT_R11 CONTEXT_R10+8 +#define CONTEXT_R12 CONTEXT_R11+8 +#define CONTEXT_R13 CONTEXT_R12+8 +#define CONTEXT_R14 CONTEXT_R13+8 +#define CONTEXT_R15 CONTEXT_R14+8 +#define CONTEXT_R16 CONTEXT_R15+8 +#define CONTEXT_R17 CONTEXT_R16+8 +#define CONTEXT_R18 CONTEXT_R17+8 +#define CONTEXT_R19 CONTEXT_R18+8 +#define CONTEXT_R20 CONTEXT_R19+8 +#define CONTEXT_R21 CONTEXT_R20+8 +#define CONTEXT_R22 CONTEXT_R21+8 +#define CONTEXT_R23 CONTEXT_R22+8 +#define CONTEXT_R24 CONTEXT_R23+8 +#define CONTEXT_R25 CONTEXT_R24+8 +#define CONTEXT_R26 CONTEXT_R25+8 +#define CONTEXT_R27 CONTEXT_R26+8 +#define CONTEXT_R28 CONTEXT_R27+8 +#define CONTEXT_R29 CONTEXT_R28+8 +#define CONTEXT_R30 CONTEXT_R29+8 +#define CONTEXT_R31 CONTEXT_R30+8 +#define CONTEXT_F0 CONTEXT_R31+8 +#define CONTEXT_F1 CONTEXT_F0+8 +#define CONTEXT_F2 CONTEXT_F1+8 +#define CONTEXT_F3 CONTEXT_F2+8 +#define CONTEXT_F4 CONTEXT_F3+8 +#define CONTEXT_F5 CONTEXT_F4+8 +#define CONTEXT_F6 CONTEXT_F5+8 +#define CONTEXT_F7 CONTEXT_F6+8 +#define CONTEXT_F8 CONTEXT_F7+8 +#define CONTEXT_F9 CONTEXT_F8+8 +#define CONTEXT_F10 CONTEXT_F9+8 +#define CONTEXT_F11 CONTEXT_F10+8 +#define CONTEXT_F12 CONTEXT_F11+8 +#define CONTEXT_F13 CONTEXT_F12+8 +#define CONTEXT_F14 CONTEXT_F13+8 +#define CONTEXT_F15 CONTEXT_F14+8 +#define CONTEXT_F16 CONTEXT_F15+8 +#define CONTEXT_F17 CONTEXT_F16+8 +#define CONTEXT_F18 CONTEXT_F17+8 +#define CONTEXT_F19 CONTEXT_F18+8 +#define CONTEXT_F20 CONTEXT_F19+8 +#define CONTEXT_F21 CONTEXT_F20+8 +#define CONTEXT_F22 CONTEXT_F21+8 +#define CONTEXT_F23 CONTEXT_F22+8 +#define CONTEXT_F24 CONTEXT_F23+8 +#define CONTEXT_F25 CONTEXT_F24+8 +#define CONTEXT_F26 CONTEXT_F25+8 +#define CONTEXT_F27 CONTEXT_F26+8 +#define CONTEXT_F28 CONTEXT_F27+8 +#define CONTEXT_F29 CONTEXT_F28+8 +#define CONTEXT_F30 CONTEXT_F29+8 +#define CONTEXT_F31 CONTEXT_F30+8 +#define CONTEXT_FPSCR CONTEXT_F31+8 +#define CONTEXT_NIP CONTEXT_FPSCR+8 +#define CONTEXT_MSR CONTEXT_NIP+8 +#define CONTEXT_CTR CONTEXT_MSR+8 +#define CONTEXT_LINK CONTEXT_CTR+8 +#define CONTEXT_XER CONTEXT_LINK+8 +#define CONTEXT_CCR CONTEXT_XER+8 +#define CONTEXT_Size CONTEXT_CCR+8 + +#endif diff --git a/src/shared/pal/src/arch/ppc64le/debugbreak.S b/src/shared/pal/src/arch/ppc64le/debugbreak.S new file mode 100644 index 0000000000..8ff9c9c40c --- /dev/null +++ b/src/shared/pal/src/arch/ppc64le/debugbreak.S @@ -0,0 +1,10 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#include "unixasmmacros.inc" + +LEAF_ENTRY DBG_DebugBreak, _TEXT + bl abort + nop +LEAF_END_MARKED DBG_DebugBreak, _TEXT + diff --git a/src/shared/pal/src/arch/riscv64/context2.S b/src/shared/pal/src/arch/riscv64/context2.S index 6bc3970cb7..725e4ec9f1 100644 --- a/src/shared/pal/src/arch/riscv64/context2.S +++ b/src/shared/pal/src/arch/riscv64/context2.S @@ -105,10 +105,15 @@ LOCAL_LABEL(No_Restore_CONTEXT_INTEGER): beqz t1, LOCAL_LABEL(No_Restore_CONTEXT_CONTROL) ld ra, (CONTEXT_Ra)(t4) + ld t1, (CONTEXT_T4)(t4) + ld fp, (CONTEXT_Sp)(t4) + sd t1, -8(fp) ld fp, (CONTEXT_Fp)(t4) - ld sp, (CONTEXT_Sp)(t4) ld t1, (CONTEXT_Pc)(t4) // Since we cannot control $pc directly, we're going to corrupt t1 - ld t4, (CONTEXT_T4)(t4) + ld t4, (CONTEXT_Sp)(t4) + addi sp, t4, -8 + ld t4, (sp) + addi sp, sp, 8 jr t1 LOCAL_LABEL(No_Restore_CONTEXT_CONTROL): @@ -160,6 +165,7 @@ LOCAL_LABEL(Done_CONTEXT_CONTROL): ld t1, 8(sp) ld t3, 16(sp) + sd x0, (CONTEXT_X0)(a0) sd tp, (CONTEXT_Tp)(a0) sd gp, (CONTEXT_Gp)(a0) sd a0, (CONTEXT_A0)(a0) diff --git a/src/shared/pal/src/arch/riscv64/debugbreak.S b/src/shared/pal/src/arch/riscv64/debugbreak.S index 69cb82b86c..93fdfd8c4c 100644 --- a/src/shared/pal/src/arch/riscv64/debugbreak.S +++ b/src/shared/pal/src/arch/riscv64/debugbreak.S @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. #include "unixasmmacros.inc" - LEAF_ENTRY DBG_DebugBreak, _TEXT EMIT_BREAKPOINT LEAF_END_MARKED DBG_DebugBreak, _TEXT diff --git a/src/shared/pal/src/arch/riscv64/processor.cpp b/src/shared/pal/src/arch/riscv64/processor.cpp deleted file mode 100644 index ab4b84febd..0000000000 --- a/src/shared/pal/src/arch/riscv64/processor.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - processor.cpp - -Abstract: - - Implementation of processor related functions for the ARM64 - platform. These functions are processor dependent. - - - ---*/ - -#include "pal/palinternal.h" diff --git a/src/shared/pal/src/arch/s390x/context2.S b/src/shared/pal/src/arch/s390x/context2.S deleted file mode 100644 index a44d81c19a..0000000000 --- a/src/shared/pal/src/arch/s390x/context2.S +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// -// Implementation of _CONTEXT_CaptureContext for the IBM s390x platform. -// This function is processor dependent. It is used by exception handling, -// and is always apply to the current thread. -// - -#include "unixasmmacros.inc" -#include "asmconstants.h" - -// Incoming: -// R2: Context* -// -LEAF_ENTRY CONTEXT_CaptureContext, _TEXT - - tm CONTEXT_ContextFlags+3(%r2), CONTEXT_INTEGER - je LOCAL_LABEL(Done_CONTEXT_INTEGER) - stmg %r0, %r14, CONTEXT_R0(%r2) -LOCAL_LABEL(Done_CONTEXT_INTEGER): - - tm CONTEXT_ContextFlags+3(%r2), CONTEXT_CONTROL - je LOCAL_LABEL(Done_CONTEXT_CONTROL) - // Set PSW address to return address from %r14 - stg %r14, CONTEXT_PSWAddr(%r2) - // Extract PSW mask (CC is already changed; we ignore this here) - epsw %r0, %r1 - stm %r0, %r1, CONTEXT_PSWMask(%r2) - // Stack pointer is still unchanged - stg %r15, CONTEXT_R15(%r2) -LOCAL_LABEL(Done_CONTEXT_CONTROL): - - tm CONTEXT_ContextFlags+3(%r2), CONTEXT_FLOATING_POINT - je LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT) - std %f0, CONTEXT_F0(%r2) - std %f1, CONTEXT_F1(%r2) - std %f2, CONTEXT_F2(%r2) - std %f3, CONTEXT_F3(%r2) - std %f4, CONTEXT_F4(%r2) - std %f5, CONTEXT_F5(%r2) - std %f6, CONTEXT_F6(%r2) - std %f7, CONTEXT_F7(%r2) - std %f8, CONTEXT_F8(%r2) - std %f9, CONTEXT_F9(%r2) - std %f10, CONTEXT_F10(%r2) - std %f11, CONTEXT_F11(%r2) - std %f12, CONTEXT_F12(%r2) - std %f13, CONTEXT_F13(%r2) - std %f14, CONTEXT_F14(%r2) - std %f15, CONTEXT_F15(%r2) -LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT): - - br %r14 -LEAF_END CONTEXT_CaptureContext, _TEXT - -LEAF_ENTRY RtlCaptureContext, _TEXT - mvhhi CONTEXT_ContextFlags+2(%r2), ((CONTEXT_S390X | CONTEXT_FULL) & 0xffff) - mvhhi CONTEXT_ContextFlags(%r2), ((CONTEXT_S390X | CONTEXT_FULL) >> 16) - jg C_FUNC(CONTEXT_CaptureContext) -LEAF_END RtlCaptureContext, _TEXT - -LEAF_ENTRY RtlRestoreContext, _TEXT - - lgr %r1, %r14 - - tm CONTEXT_ContextFlags+3(%r2), CONTEXT_FLOATING_POINT - je LOCAL_LABEL(Done_Restore_CONTEXT_FLOATING_POINT) - ld %f0, CONTEXT_F0(%r2) - ld %f1, CONTEXT_F1(%r2) - ld %f2, CONTEXT_F2(%r2) - ld %f3, CONTEXT_F3(%r2) - ld %f4, CONTEXT_F4(%r2) - ld %f5, CONTEXT_F5(%r2) - ld %f6, CONTEXT_F6(%r2) - ld %f7, CONTEXT_F7(%r2) - ld %f8, CONTEXT_F8(%r2) - ld %f9, CONTEXT_F9(%r2) - ld %f10, CONTEXT_F10(%r2) - ld %f11, CONTEXT_F11(%r2) - ld %f12, CONTEXT_F12(%r2) - ld %f13, CONTEXT_F13(%r2) - ld %f14, CONTEXT_F14(%r2) - ld %f15, CONTEXT_F15(%r2) -LOCAL_LABEL(Done_Restore_CONTEXT_FLOATING_POINT): - - tm CONTEXT_ContextFlags+3(%r2), CONTEXT_CONTROL - je LOCAL_LABEL(Done_Restore_CONTEXT_CONTROL) - // We do *not* attempt to restore the PSW mask here! - lg %r1, CONTEXT_PSWAddr(%r2) - lg %r15, CONTEXT_R15(%r2) -LOCAL_LABEL(Done_Restore_CONTEXT_CONTROL): - - tm CONTEXT_ContextFlags+3(%r2), CONTEXT_INTEGER - je LOCAL_LABEL(Done_Restore_CONTEXT_INTEGER) - // We do *not* restore %r0 and %r1 here! - lmg %r2, %r14, CONTEXT_R2(%r2) -LOCAL_LABEL(Done_Restore_CONTEXT_INTEGER): - - br %r1 -LEAF_END RtlRestoreContext, _TEXT - diff --git a/src/shared/pal/src/arch/s390x/processor.cpp b/src/shared/pal/src/arch/s390x/processor.cpp deleted file mode 100644 index d2d0fdd5e8..0000000000 --- a/src/shared/pal/src/arch/s390x/processor.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - processor.cpp - -Abstract: - - Implementation of processor related functions for the IBM s390x - platforms. These functions are processor dependent. - - - ---*/ - -#include "pal/palinternal.h" - diff --git a/src/shared/pal/src/config.h.in b/src/shared/pal/src/config.h.in index 2cace986ec..d6a2a93adc 100644 --- a/src/shared/pal/src/config.h.in +++ b/src/shared/pal/src/config.h.in @@ -3,7 +3,6 @@ #cmakedefine01 HAVE_VM_FLAGS_SUPERPAGE_SIZE_ANY #cmakedefine01 HAVE_MAP_HUGETLB -#cmakedefine01 HAVE_IEEEFP_H #cmakedefine01 HAVE_SYS_VMPARAM_H #cmakedefine01 HAVE_MACH_VM_TYPES_H #cmakedefine01 HAVE_MACH_VM_PARAM_H @@ -19,36 +18,24 @@ #cmakedefine01 HAVE_RUNETYPE_H #cmakedefine01 HAVE_GNU_LIBNAMES_H #cmakedefine01 HAVE_PRCTL_H -#cmakedefine01 HAVE_NUMA_H #cmakedefine01 HAVE_PTHREAD_NP_H #cmakedefine01 HAVE_AUXV_HWCAP_H #cmakedefine01 HAVE_SYS_PTRACE_H +#cmakedefine01 HAVE_UCONTEXT_H #cmakedefine01 HAVE_GETAUXVAL #cmakedefine01 HAVE_KQUEUE -#cmakedefine01 HAVE_PTHREAD_SUSPEND -#cmakedefine01 HAVE_PTHREAD_SUSPEND_NP -#cmakedefine01 HAVE_PTHREAD_CONTINUE -#cmakedefine01 HAVE_PTHREAD_RESUME_NP -#cmakedefine01 HAVE_PTHREAD_CONTINUE_NP #cmakedefine01 HAVE_PTHREAD_ATTR_GET_NP #cmakedefine01 HAVE_PTHREAD_GETATTR_NP #cmakedefine01 HAVE_PTHREAD_GETCPUCLOCKID -#cmakedefine01 HAVE_PTHREAD_SIGQUEUE #cmakedefine01 HAVE_PTHREAD_GETAFFINITY_NP #cmakedefine01 HAVE_CPUSET_T -#cmakedefine01 HAVE_SIGRETURN -#cmakedefine01 HAVE__THREAD_SYS_SIGRETURN -#cmakedefine01 HAVE_COPYSIGN #cmakedefine01 HAVE_FSYNC #cmakedefine01 HAVE_FUTIMES -#cmakedefine01 HAVE_UTIMES #cmakedefine01 HAVE_SYSCTL #cmakedefine01 HAVE_SYSCTLBYNAME #cmakedefine01 HAVE_SYSCONF -#cmakedefine01 HAVE_SYSINFO #cmakedefine01 HAVE_GMTIME_R -#cmakedefine01 HAVE_TIMEGM #cmakedefine01 HAVE_POLL #cmakedefine01 HAVE_STATVFS #cmakedefine01 HAVE_NON_LEGACY_STATFS @@ -62,23 +49,20 @@ #cmakedefine01 HAVE_SEMAPHORE_H #cmakedefine01 HAS_SYSV_SEMAPHORES #cmakedefine01 HAS_PTHREAD_MUTEXES -#cmakedefine01 HAVE_TTRACE +#cmakedefine HAVE_TTRACE #cmakedefine01 HAVE_PIPE2 #cmakedefine01 HAVE_SCHED_GETAFFINITY #cmakedefine01 HAVE_SCHED_SETAFFINITY #cmakedefine HAVE_UNW_GET_SAVE_LOC #cmakedefine HAVE_UNW_GET_ACCESSORS -#cmakedefine01 HAVE_XSWDEV -#cmakedefine01 HAVE_XSW_USAGE +#cmakedefine HAVE_UNW_AARCH64_X19 #cmakedefine01 HAVE_PUBLIC_XSTATE_STRUCT #cmakedefine01 HAVE__FPX_SW_BYTES_WITH_XSTATE_BV #cmakedefine01 HAVE_PR_SET_PTRACER -#cmakedefine01 HAVE_SWAPCTL #cmakedefine01 HAVE_STAT_TIMESPEC #cmakedefine01 HAVE_STAT_TIM #cmakedefine01 HAVE_STAT_NSEC -#cmakedefine01 HAVE_TM_GMTOFF #cmakedefine01 HAVE_BSD_REGS_T #cmakedefine01 HAVE_PT_REGS @@ -86,58 +70,34 @@ #cmakedefine01 HAVE___GREGSET_T #cmakedefine01 HAVE_FPSTATE_GLIBC_RESERVED1 #cmakedefine01 HAVE_UCONTEXT_T -#cmakedefine01 HAVE_PTHREAD_RWLOCK_T -#cmakedefine01 HAVE_PRWATCH_T #cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@ -#cmakedefine01 HAVE_DIRENT_D_TYPE #cmakedefine01 HAVE_FPREGS_WITH_CW #cmakedefine01 HAVE_YIELD_SYSCALL #cmakedefine01 HAVE_INFTIM -#cmakedefine01 HAVE_CHAR_BIT #cmakedefine01 USER_H_DEFINES_DEBUG #cmakedefine01 HAVE__SC_PHYS_PAGES #cmakedefine01 HAVE__SC_AVPHYS_PAGES #cmakedefine01 REALPATH_SUPPORTS_NONEXISTENT_FILES -#cmakedefine01 SSCANF_CANNOT_HANDLE_MISSING_EXPONENT -#cmakedefine01 SSCANF_SUPPORT_ll -#cmakedefine01 HAVE_LARGE_SNPRINTF_SUPPORT #cmakedefine01 HAVE_BROKEN_FIFO_SELECT #cmakedefine01 HAVE_BROKEN_FIFO_KEVENT -#cmakedefine01 HAS_FTRUNCATE_LENGTH_ISSUE #cmakedefine01 UNWIND_CONTEXT_IS_UCONTEXT_T #cmakedefine01 HAVE_SCHED_GET_PRIORITY -#cmakedefine01 HAVE_SCHED_GETCPU #cmakedefine01 HAVE_WORKING_GETTIMEOFDAY #cmakedefine01 HAVE_WORKING_CLOCK_GETTIME #cmakedefine01 HAVE_CLOCK_MONOTONIC #cmakedefine01 HAVE_CLOCK_MONOTONIC_COARSE #cmakedefine01 HAVE_CLOCK_GETTIME_NSEC_NP -#cmakedefine01 HAVE_CLOCK_THREAD_CPUTIME #cmakedefine01 HAVE_PTHREAD_CONDATTR_SETCLOCK #cmakedefine01 MMAP_ANON_IGNORES_PROTECTION #cmakedefine01 ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS #cmakedefine01 PTHREAD_CREATE_MODIFIES_ERRNO #cmakedefine01 SEM_INIT_MODIFIES_ERRNO #cmakedefine01 HAVE_PROCFS_CTL -#cmakedefine01 HAVE_PROCFS_MAPS #cmakedefine01 HAVE_PROCFS_STAT -#cmakedefine01 HAVE_PROCFS_STATUS -#cmakedefine01 HAVE_COMPATIBLE_ACOS -#cmakedefine01 HAVE_COMPATIBLE_ASIN -#cmakedefine01 HAVE_COMPATIBLE_POW -#cmakedefine01 HAVE_VALID_NEGATIVE_INF_POW -#cmakedefine01 HAVE_VALID_POSITIVE_INF_POW -#cmakedefine01 HAVE_COMPATIBLE_ATAN2 -#cmakedefine01 HAVE_COMPATIBLE_EXP -#cmakedefine01 HAVE_COMPATIBLE_ILOGB0 -#cmakedefine01 HAVE_COMPATIBLE_ILOGBNAN -#cmakedefine01 HAVE_COMPATIBLE_LOG -#cmakedefine01 HAVE_COMPATIBLE_LOG10 -#cmakedefine01 UNGETC_NOT_RETURN_EOF +#cmakedefine01 HAVE_PROCFS_MAPS #cmakedefine01 HAS_POSIX_SEMAPHORES -#cmakedefine01 FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL #define PAL_THREAD_PRIORITY_MIN 0 #define PAL_THREAD_PRIORITY_MAX 0 @@ -145,17 +105,13 @@ #cmakedefine01 HAVE__NSGETENVIRON #cmakedefine01 DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX #cmakedefine PAL_PTRACE(cmd, pid, addr, data) @PAL_PTRACE@ -#cmakedefine PAL_PT_ATTACH @PAL_PT_ATTACH@ -#cmakedefine PAL_PT_DETACH @PAL_PT_DETACH@ -#cmakedefine PAL_PT_READ_D @PAL_PT_READ_D@ -#cmakedefine PAL_PT_WRITE_D @PAL_PT_WRITE_D@ #cmakedefine01 SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING #cmakedefine01 ERROR_FUNC_FOR_GLOB_HAS_FIXED_PARAMS -#cmakedefine01 HAS_FTRUNCATE_LENGTH_ISSUE #cmakedefine01 HAVE_FULLY_FEATURED_PTHREAD_MUTEXES #cmakedefine01 HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES #cmakedefine BSD_REGS_STYLE(reg, RR, rr) @BSD_REGS_STYLE@ #cmakedefine01 HAVE_SCHED_OTHER_ASSIGNABLE +#cmakedefine01 SET_SCHEDPARAM_NEEDS_PRIVS #define CHECK_TRACE_SPECIFIERS 0 #define HAVE_GETHRTIME 0 @@ -163,7 +119,6 @@ #define OPEN64_IS_USED_INSTEAD_OF_OPEN 0 #define PAL_IGNORE_NORMAL_THREAD_PRIORITY 0 #define SELF_SUSPEND_FAILS_WITH_NATIVE_SUSPENSION 0 -#define SET_SCHEDPARAM_NEEDS_PRIVS 0 #define SIGWAIT_FAILS_WHEN_PASSED_FULL_SIGSET 0 #define WRITE_0_BYTES_HANGS_TTY 0 #define HAVE_FTRUNCATE_LARGE_LENGTH_SUPPORT 1 diff --git a/src/shared/pal/src/configure.cmake b/src/shared/pal/src/configure.cmake index 62ae793797..dd0e26e8e2 100644 --- a/src/shared/pal/src/configure.cmake +++ b/src/shared/pal/src/configure.cmake @@ -30,7 +30,6 @@ endif() list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_FILE_OFFSET_BITS=64) -check_include_files(ieeefp.h HAVE_IEEEFP_H) check_include_files(sys/vmparam.h HAVE_SYS_VMPARAM_H) check_include_files(mach/vm_types.h HAVE_MACH_VM_TYPES_H) check_include_files(mach/vm_param.h HAVE_MACH_VM_PARAM_H) @@ -46,9 +45,9 @@ check_include_files(lwp.h HAVE_LWP_H) check_include_files(runetype.h HAVE_RUNETYPE_H) check_include_files(semaphore.h HAVE_SEMAPHORE_H) check_include_files(sys/prctl.h HAVE_PRCTL_H) -check_include_files(numa.h HAVE_NUMA_H) check_include_files("sys/auxv.h;asm/hwcap.h" HAVE_AUXV_HWCAP_H) check_include_files("sys/ptrace.h" HAVE_SYS_PTRACE_H) +check_include_files(ucontext.h HAVE_UCONTEXT_H) check_symbol_exists(getauxval sys/auxv.h HAVE_GETAUXVAL) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) @@ -80,7 +79,12 @@ set(CMAKE_REQUIRED_LIBRARIES) check_function_exists(sysctlbyname HAVE_SYSCTLBYNAME) check_include_files(gnu/lib-names.h HAVE_GNU_LIBNAMES_H) -check_function_exists(kqueue HAVE_KQUEUE) +if(CLR_CMAKE_TARGET_HAIKU) + # kqueue is broken on Haiku and does not provide the required information in the data field. + set(HAVE_KQUEUE 0) +else() + check_function_exists(kqueue HAVE_KQUEUE) +endif() check_library_exists(c sched_getaffinity "" HAVE_SCHED_GETAFFINITY) check_library_exists(c sched_setaffinity "" HAVE_SCHED_SETAFFINITY) @@ -93,35 +97,21 @@ elseif (HAVE_PTHREAD_IN_LIBC) set(PTHREAD_LIBRARY c) endif() -check_library_exists(${PTHREAD_LIBRARY} pthread_suspend "" HAVE_PTHREAD_SUSPEND) -check_library_exists(${PTHREAD_LIBRARY} pthread_suspend_np "" HAVE_PTHREAD_SUSPEND_NP) -check_library_exists(${PTHREAD_LIBRARY} pthread_continue "" HAVE_PTHREAD_CONTINUE) -check_library_exists(${PTHREAD_LIBRARY} pthread_continue_np "" HAVE_PTHREAD_CONTINUE_NP) -check_library_exists(${PTHREAD_LIBRARY} pthread_resume_np "" HAVE_PTHREAD_RESUME_NP) check_library_exists(${PTHREAD_LIBRARY} pthread_attr_get_np "" HAVE_PTHREAD_ATTR_GET_NP) check_library_exists(${PTHREAD_LIBRARY} pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP) check_library_exists(${PTHREAD_LIBRARY} pthread_getcpuclockid "" HAVE_PTHREAD_GETCPUCLOCKID) -check_library_exists(${PTHREAD_LIBRARY} pthread_sigqueue "" HAVE_PTHREAD_SIGQUEUE) check_library_exists(${PTHREAD_LIBRARY} pthread_getaffinity_np "" HAVE_PTHREAD_GETAFFINITY_NP) -check_function_exists(sigreturn HAVE_SIGRETURN) -check_function_exists(_thread_sys_sigreturn HAVE__THREAD_SYS_SIGRETURN) -set(CMAKE_REQUIRED_LIBRARIES m) -check_function_exists(copysign HAVE_COPYSIGN) -set(CMAKE_REQUIRED_LIBRARIES) check_function_exists(fsync HAVE_FSYNC) check_function_exists(futimes HAVE_FUTIMES) -check_function_exists(utimes HAVE_UTIMES) if(CLR_CMAKE_TARGET_LINUX) # sysctl is deprecated on Linux set(HAVE_SYSCTL 0) else() check_function_exists(sysctl HAVE_SYSCTL) endif() -check_function_exists(sysinfo HAVE_SYSINFO) check_function_exists(sysconf HAVE_SYSCONF) check_function_exists(gmtime_r HAVE_GMTIME_R) -check_function_exists(timegm HAVE_TIMEGM) check_function_exists(poll HAVE_POLL) check_function_exists(statvfs HAVE_STATVFS) check_function_exists(thread_self HAVE_THREAD_SELF) @@ -135,6 +125,7 @@ check_function_exists(semget HAS_SYSV_SEMAPHORES) check_function_exists(pthread_mutex_init HAS_PTHREAD_MUTEXES) check_function_exists(ttrace HAVE_TTRACE) check_function_exists(pipe2 HAVE_PIPE2) +check_function_exists(strerrorname_np HAVE_STRERRORNAME_NP) check_cxx_source_compiles(" #include @@ -147,12 +138,9 @@ int main(int argc, char **argv) { check_struct_has_member ("struct stat" st_atimespec "sys/types.h;sys/stat.h" HAVE_STAT_TIMESPEC) check_struct_has_member ("struct stat" st_atim "sys/types.h;sys/stat.h" HAVE_STAT_TIM) check_struct_has_member ("struct stat" st_atimensec "sys/types.h;sys/stat.h" HAVE_STAT_NSEC) -check_struct_has_member ("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF) check_struct_has_member ("ucontext_t" uc_mcontext.gregs[0] ucontext.h HAVE_GREGSET_T) check_struct_has_member ("ucontext_t" uc_mcontext.__gregs[0] ucontext.h HAVE___GREGSET_T) check_struct_has_member ("ucontext_t" uc_mcontext.fpregs->__glibc_reserved1[0] ucontext.h HAVE_FPSTATE_GLIBC_RESERVED1) -check_struct_has_member ("struct sysinfo" mem_unit "sys/sysinfo.h" HAVE_SYSINFO_WITH_MEM_UNIT) -check_struct_has_member ("struct dirent" d_type dirent.h HAVE_DIRENT_D_TYPE) check_struct_has_member ("struct _fpchip_state" cw sys/ucontext.h HAVE_FPREGS_WITH_CW) set(CMAKE_EXTRA_INCLUDE_FILES machine/reg.h) @@ -161,9 +149,11 @@ set(CMAKE_EXTRA_INCLUDE_FILES) set(CMAKE_EXTRA_INCLUDE_FILES asm/ptrace.h) check_type_size("struct pt_regs" PT_REGS) set(CMAKE_EXTRA_INCLUDE_FILES) -set(CMAKE_EXTRA_INCLUDE_FILES signal.h) -set(CMAKE_EXTRA_INCLUDE_FILES) -set(CMAKE_EXTRA_INCLUDE_FILES ucontext.h) +if(HAVE_UCONTEXT_H) + set(CMAKE_EXTRA_INCLUDE_FILES ucontext.h) +else() + set(CMAKE_EXTRA_INCLUDE_FILES signal.h) +endif() check_type_size(ucontext_t UCONTEXT_T) set(CMAKE_EXTRA_INCLUDE_FILES) set(CMAKE_EXTRA_INCLUDE_FILES pthread.h) @@ -176,11 +166,9 @@ check_type_size(off_t SIZEOF_OFF_T) check_cxx_symbol_exists(SYS_yield sys/syscall.h HAVE_YIELD_SYSCALL) check_cxx_symbol_exists(INFTIM poll.h HAVE_INFTIM) -check_cxx_symbol_exists(CHAR_BIT limits.h HAVE_CHAR_BIT) check_cxx_symbol_exists(_DEBUG sys/user.h USER_H_DEFINES_DEBUG) check_cxx_symbol_exists(_SC_PHYS_PAGES unistd.h HAVE__SC_PHYS_PAGES) check_cxx_symbol_exists(_SC_AVPHYS_PAGES unistd.h HAVE__SC_AVPHYS_PAGES) -check_cxx_symbol_exists(swapctl sys/swap.h HAVE_SWAPCTL) check_cxx_source_runs(" #include @@ -204,42 +192,6 @@ int main(void) { check_cxx_source_runs(" #include #include -int main(void) -{ - long long n = 0; - sscanf(\"5000000000\", \"%qu\", &n); - exit (n != 5000000000); - }" SSCANF_SUPPORT_ll) -check_cxx_source_runs(" -#include -#include - -int main() -{ - int ret; - float f = 0; - char * strin = \"12.34e\"; - - ret = sscanf (strin, \"%e\", &f); - if (ret <= 0) - exit (0); - exit(1); -}" SSCANF_CANNOT_HANDLE_MISSING_EXPONENT) -check_cxx_source_runs(" -#include -#include - -int main(void) { - char buf[256] = { 0 }; - snprintf(buf, 0x7fffffff, \"%#x\", 0x12345678); - if (buf[0] == 0x0) { - exit(1); - } - exit(0); -}" HAVE_LARGE_SNPRINTF_SUPPORT) -check_cxx_source_runs(" -#include -#include #include #include #include @@ -372,20 +324,6 @@ int main(void) exit(-1 == max_priority || -1 == min_priority); }" HAVE_SCHED_GET_PRIORITY) -set(CMAKE_REQUIRED_LIBRARIES pthread) -check_cxx_source_runs(" -#include -#include - -int main(void) -{ - if (sched_getcpu() >= 0) - { - exit(0); - } - exit(1); -}" HAVE_SCHED_GETCPU) -set(CMAKE_REQUIRED_LIBRARIES) check_cxx_source_runs(" #include #include @@ -461,22 +399,6 @@ int main() exit((ret == 0) ? 1 : 0); }" HAVE_CLOCK_GETTIME_NSEC_NP) -set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_RT_LIBS}) -check_cxx_source_runs(" -#include -#include -#include - -int main() -{ - int ret; - struct timespec ts; - ret = clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); - - exit(ret); -}" HAVE_CLOCK_THREAD_CPUTIME) -set(CMAKE_REQUIRED_LIBRARIES) - check_cxx_source_runs(" #include #include @@ -690,263 +612,6 @@ int main(void) { exit(0); }" HAVE_PROCFS_STAT) set(CMAKE_REQUIRED_LIBRARIES) -check_cxx_source_runs(" -#include -#include -#include -#include - -int main(void) { - int fd; -#ifdef PATH_MAX - char path[PATH_MAX]; -#elif defined(MAXPATHLEN) - char path[MAXPATHLEN]; -#else - char path[1024]; -#endif - - sprintf(path, \"/proc/%u/status\", getpid()); - fd = open(path, O_RDONLY); - if (fd == -1) { - exit(1); - } - exit(0); -}" HAVE_PROCFS_STATUS) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(void) { - volatile double x = 10; - if (!isnan(acos(x))) { - exit(1); - } - exit(0); -}" HAVE_COMPATIBLE_ACOS) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(void) { - volatile double arg = 10; - if (!isnan(asin(arg))) { - exit(1); - } - exit(0); -}" HAVE_COMPATIBLE_ASIN) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(void) { - volatile double base = 1.0; - volatile double infinity = 1.0 / 0.0; - if (pow(base, infinity) != 1.0 || pow(base, -infinity) != 1.0) { - exit(1); - } - if (pow(-base, infinity) != 1.0 || pow(-base, -infinity) != 1.0) { - exit(1); - } - - base = 0.0; - if (pow(base, infinity) != 0.0) { - exit(1); - } - if (pow(base, -infinity) != infinity) { - exit(1); - } - - base = 1.1; - if (pow(-base, infinity) != infinity || pow(base, infinity) != infinity) { - exit(1); - } - if (pow(-base, -infinity) != 0.0 || pow(base, -infinity) != 0.0) { - exit(1); - } - - base = 0.0; - volatile int iexp = 1; - if (pow(-base, -iexp) != -infinity) { - exit(1); - } - if (pow(base, -iexp) != infinity) { - exit(1); - } - exit(0); -}" HAVE_COMPATIBLE_POW) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(int argc, char **argv) { - double result; - volatile double base = 3.2e-10; - volatile double exp = 1 - 5e14; - - result = pow(-base, exp); - if (result != -1.0 / 0.0) { - exit(1); - } - exit(0); -}" HAVE_VALID_NEGATIVE_INF_POW) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(int argc, char **argv) { - double result; - volatile double base = 3.5; - volatile double exp = 3e100; - - result = pow(-base, exp); - if (result != 1.0 / 0.0) { - exit(1); - } - exit(0); -}" HAVE_VALID_POSITIVE_INF_POW) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(void) { - double pi = 3.14159265358979323846; - double result; - volatile double y = 0.0; - volatile double x = 0.0; - - result = atan2(y, -x); - if (fabs(pi - result) > 0.0000001) { - exit(1); - } - - result = atan2(-y, -x); - if (fabs(-pi - result) > 0.0000001) { - exit(1); - } - - result = atan2 (-y, x); - if (result != 0.0 || copysign (1.0, result) > 0) { - exit(1); - } - - result = atan2 (y, x); - if (result != 0.0 || copysign (1.0, result) < 0) { - exit(1); - } - - exit (0); -}" HAVE_COMPATIBLE_ATAN2) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(void) { - double d = exp(1.0), e = M_E; - - /* Used memcmp rather than == to test that the doubles are equal to - prevent gcc's optimizer from using its 80 bit internal long - doubles. If you use ==, then on BSD you get a false negative since - exp(1.0) == M_E to 64 bits, but not 80. - */ - - if (memcmp (&d, &e, sizeof (double)) == 0) { - exit(0); - } - exit(1); -}" HAVE_COMPATIBLE_EXP) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(void) { - if (FP_ILOGB0 != -2147483648) { - exit(1); - } - - exit(0); -}" HAVE_COMPATIBLE_ILOGB0) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(void) { - if (FP_ILOGBNAN != 2147483647) { - exit(1); - } - - exit(0); -}" HAVE_COMPATIBLE_ILOGBNAN) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(void) { - volatile int arg = 10000; - if (!isnan(log(-arg))) { - exit(1); - } - exit(0); -}" HAVE_COMPATIBLE_LOG) -set(CMAKE_REQUIRED_LIBRARIES) -set(CMAKE_REQUIRED_LIBRARIES m) -check_cxx_source_runs(" -#include -#include - -int main(void) { - volatile int arg = 10000; - if (!isnan(log10(-arg))) { - exit(1); - } - exit(0); -}" HAVE_COMPATIBLE_LOG10) -set(CMAKE_REQUIRED_LIBRARIES) -check_cxx_source_runs(" -#include -#include -#include - -int main(void) -{ - char* szFileName; - FILE* pFile = NULL; - int ret = 1; - - szFileName = tempnam(\".\", \"tmp\"); - - /* open the file write-only */ - pFile = fopen(szFileName, \"a\"); - if (pFile == NULL) - { - exit(0); - } - if (ungetc('A', pFile) != EOF) - { - ret = 0; - } - unlink(szFileName); - exit(ret); -}" UNGETC_NOT_RETURN_EOF) set(CMAKE_REQUIRED_LIBRARIES ${PTHREAD_LIBRARY}) check_cxx_source_runs(" @@ -963,47 +628,11 @@ int main() { }" HAS_POSIX_SEMAPHORES) set(CMAKE_REQUIRED_LIBRARIES) -check_cxx_source_runs(" -#include -#include - -int main() -{ - FILE *fp = NULL; - char *fileName = \"/dev/zero\"; - char buf[10]; - - /* - * Open the file in append mode and try to read some text. - * And, make sure ferror() is set. - */ - fp = fopen (fileName, \"a\"); - if ( (NULL == fp) || - (fread (buf, sizeof(buf), 1, fp) > 0) || - (!ferror(fp)) - ) - { - return 0; - } - - /* - * Now that ferror() is set, try to close the file. - * If we get an error, we can conclude that this - * fgets() depended on the previous ferror(). - */ - if ( fclose(fp) != 0 ) - { - return 0; - } - - return 1; -}" FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL) - set(SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING 1) set(ERROR_FUNC_FOR_GLOB_HAS_FIXED_PARAMS 1) if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) - list(INSERT CMAKE_REQUIRED_INCLUDES 0 ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include) + list(INSERT CMAKE_REQUIRED_INCLUDES 0 ${CLR_SRC_NATIVE_DIR}/external/libunwind/include ${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind/include) endif() check_c_source_compiles(" @@ -1020,32 +649,18 @@ int main(int argc, char **argv) check_symbol_exists(unw_get_save_loc libunwind.h HAVE_UNW_GET_SAVE_LOC) check_symbol_exists(unw_get_accessors libunwind.h HAVE_UNW_GET_ACCESSORS) -if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) - list(REMOVE_AT CMAKE_REQUIRED_INCLUDES 0 1) -endif() - check_cxx_source_compiles(" -#include -#include -#include +#include int main(int argc, char **argv) { - struct xswdev xsw; - + int flag = (int)UNW_AARCH64_X19; return 0; -}" HAVE_XSWDEV) - -check_cxx_source_compiles(" -#include -#include - -int main(int argc, char **argv) -{ - struct xsw_usage xsu; +}" HAVE_UNW_AARCH64_X19) - return 0; -}" HAVE_XSW_USAGE) +if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND) + list(REMOVE_AT CMAKE_REQUIRED_INCLUDES 0 1) +endif() check_cxx_source_compiles(" #include @@ -1298,42 +913,33 @@ if(CLR_CMAKE_TARGET_OSX) set(HAVE__NSGETENVIRON 1) set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 1) set(PAL_PTRACE "ptrace((cmd), (pid), (caddr_t)(addr), (data))") - set(PAL_PT_ATTACH PT_ATTACH) - set(PAL_PT_DETACH PT_DETACH) - set(PAL_PT_READ_D PT_READ_D) - set(PAL_PT_WRITE_D PT_WRITE_D) - set(HAS_FTRUNCATE_LENGTH_ISSUE 1) set(HAVE_SCHED_OTHER_ASSIGNABLE 1) elseif(CLR_CMAKE_TARGET_FREEBSD) set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 0) set(PAL_PTRACE "ptrace((cmd), (pid), (caddr_t)(addr), (data))") - set(PAL_PT_ATTACH PT_ATTACH) - set(PAL_PT_DETACH PT_DETACH) - set(PAL_PT_READ_D PT_READ_D) - set(PAL_PT_WRITE_D PT_WRITE_D) - set(HAS_FTRUNCATE_LENGTH_ISSUE 0) - set(BSD_REGS_STYLE "((reg).r_##rr)") + if (CLR_CMAKE_HOST_ARCH_AMD64) + set(BSD_REGS_STYLE "((reg).r_##rr)") + elseif(CLR_CMAKE_HOST_ARCH_ARM64) + set(BSD_REGS_STYLE "((reg).rr)") + else() + message(FATAL_ERROR "Unknown FreeBSD architecture") + endif() set(HAVE_SCHED_OTHER_ASSIGNABLE 1) elseif(CLR_CMAKE_TARGET_NETBSD) set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 0) set(PAL_PTRACE "ptrace((cmd), (pid), (void*)(addr), (data))") - set(PAL_PT_ATTACH PT_ATTACH) - set(PAL_PT_DETACH PT_DETACH) - set(PAL_PT_READ_D PT_READ_D) - set(PAL_PT_WRITE_D PT_WRITE_D) - set(HAS_FTRUNCATE_LENGTH_ISSUE 0) set(BSD_REGS_STYLE "((reg).regs[_REG_##RR])") set(HAVE_SCHED_OTHER_ASSIGNABLE 0) elseif(CLR_CMAKE_TARGET_SUNOS) set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 0) set(PAL_PTRACE "ptrace((cmd), (pid), (caddr_t)(addr), (data))") - set(PAL_PT_ATTACH PT_ATTACH) - set(PAL_PT_DETACH PT_DETACH) - set(PAL_PT_READ_D PT_READ_D) - set(PAL_PT_WRITE_D PT_WRITE_D) - set(HAS_FTRUNCATE_LENGTH_ISSUE 0) + set(SET_SCHEDPARAM_NEEDS_PRIVS 1) +elseif(CLR_CMAKE_TARGET_HAIKU) + # Haiku does not have ptrace. + set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 0) + set(HAVE_SCHED_OTHER_ASSIGNABLE 1) else() # Anything else is Linux if(NOT HAVE_LTTNG_TRACEPOINT_H AND FEATURE_EVENT_TRACE) unset(HAVE_LTTNG_TRACEPOINT_H CACHE) @@ -1341,11 +947,6 @@ else() # Anything else is Linux endif() set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 0) set(PAL_PTRACE "ptrace((cmd), (pid), (void*)(addr), (data))") - set(PAL_PT_ATTACH PTRACE_ATTACH) - set(PAL_PT_DETACH PTRACE_DETACH) - set(PAL_PT_READ_D PTRACE_PEEKDATA) - set(PAL_PT_WRITE_D PTRACE_POKEDATA) - set(HAS_FTRUNCATE_LENGTH_ISSUE 0) set(HAVE_SCHED_OTHER_ASSIGNABLE 1) endif(CLR_CMAKE_TARGET_OSX) diff --git a/src/shared/pal/src/cruntime/file.cpp b/src/shared/pal/src/cruntime/file.cpp deleted file mode 100644 index eb2512c68e..0000000000 --- a/src/shared/pal/src/cruntime/file.cpp +++ /dev/null @@ -1,724 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - file.c - -Abstract: - - Implementation of the file functions in the C runtime library that - are Windows specific. - - - ---*/ - -#include "pal/palinternal.h" -#include "pal/dbgmsg.h" -#include "pal/file.h" -#include "pal/cruntime.h" - -#include "pal/thread.hpp" -#include "pal/threadsusp.hpp" - -#include -#include -#include -#include - -#if FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL - #define CLEARERR(f) clearerr((f)->bsdFilePtr) -#else - #define CLEARERR(f) -#endif - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - -/* Global variables storing the std streams.*/ -PAL_FILE PAL_Stdout; -PAL_FILE PAL_Stdin; -PAL_FILE PAL_Stderr; - -/*++ - -Function: - - CRTInitStdStreams. - - Initilizes the standard streams. - Returns TRUE on success, FALSE otherwise. ---*/ -BOOL CRTInitStdStreams() -{ - /* stdout */ - PAL_Stdout.bsdFilePtr = stdout; - PAL_Stdout.PALferrorCode = PAL_FILE_NOERROR; - PAL_Stdout.bTextMode = TRUE; - - /* stdin */ - PAL_Stdin.bsdFilePtr = stdin; - PAL_Stdin.PALferrorCode = PAL_FILE_NOERROR; - PAL_Stdin.bTextMode = TRUE; - - /* stderr */ - PAL_Stderr.bsdFilePtr = stderr; - PAL_Stderr.PALferrorCode = PAL_FILE_NOERROR; - PAL_Stderr.bTextMode = TRUE; - return TRUE; -} - -/*++ -Function : - - MapFileOpenModes - - Maps Windows file open modes to Unix fopen modes and validates. - ---*/ -static LPSTR MapFileOpenModes(LPSTR str , BOOL * bTextMode) -{ - LPSTR retval = NULL; - LPSTR temp = NULL; - - if (NULL == bTextMode) - { - ASSERT("MapFileOpenModes called with a NULL parameter for bTextMode.\n"); - return NULL; - } - - *bTextMode = TRUE; - - if (NULL == str) - { - ASSERT("MapFileOpenModes called with a NULL parameter for str.\n"); - return NULL; - } - - /* The PAL behaves differently for some Windows file open modes: - - c, n, S, R, and T: these are all hints to the system that aren't supported - by the PAL. Since the user cannot depend on this behavior, it's safe to - simply ignore these modes. - - D: specifies a file as temporary. This file is expected to be deleted when - the last file descriptor is closed. The PAL does not support this behavior - and asserts when this mode is used. - - t: represents opening in text mode. Calls to fdopen on Unix don't accept - 't' so it is silently stripped out. However, the PAL supports the mode by - having the PAL wrappers do the translation of CR-LF to LF and vice versa. - - t vs. b: To get binary mode, you must explicitly use 'b'. If neither mode - is specified on Windows, the default mode is defined by the global - variable _fmode. The PAL simply defaults to text mode. After examining - CLR usage patterns, the PAL behavior seems acceptable. */ - - /* Check if the mode specifies deleting the temporary file - automatically when the last file descriptor is closed. - The PAL does not support this behavior. */ - if (NULL != strchr(str,'D')) - { - ASSERT("The PAL doesn't support the 'D' flag for _fdopen and fopen.\n"); - return NULL; - } - - /* Check if the mode specifies opening in binary. - If so, set the bTextMode to false. */ - if(NULL != strchr(str,'b')) - { - *bTextMode = FALSE; - } - - retval = (LPSTR)PAL_malloc( ( strlen( str ) + 1 ) * sizeof( CHAR ) ); - if (NULL == retval) - { - ERROR("Unable to allocate memory.\n"); - return NULL; - } - - temp = retval; - while ( *str ) - { - if ( *str == 'r' || *str == 'w' || *str == 'a' ) - { - *temp = *str; - temp++; - if ( ( ++str != NULL ) && *str == '+' ) - { - *temp = *str; - temp++; - str++; - } - } - else - { - str++; - } - } - *temp = '\0'; - return retval; -} - -#if UNGETC_NOT_RETURN_EOF -/*++ -Function : - - WriteOnlyMode - - Returns TRUE to if a file is opened in write-only mode, - Otherwise FALSE. - ---*/ -static BOOL WriteOnlyMode(FILE* pFile) -{ - INT fd, flags; - - if (pFile != NULL) - { - fd = fileno(pFile); - if ((flags = fcntl(fd, F_GETFL)) >= 0) - { - if ((flags & O_ACCMODE) == O_WRONLY) - { - return TRUE; - } - } - } - return FALSE; -} -#endif //UNGETC_NOT_RETURN_EOF - -/*++ -Function: - _fdopen - -see MSDN - ---*/ -PAL_FILE * -__cdecl -_fdopen( - int handle, - const char *mode) -{ - PAL_FILE *f = NULL; - LPSTR supported = NULL; - BOOL bTextMode = TRUE; - - PERF_ENTRY(_fdopen); - ENTRY("_fdopen (handle=%d mode=%p (%s))\n", handle, mode, mode); - - _ASSERTE(mode != NULL); - - f = (PAL_FILE*)PAL_malloc( sizeof( PAL_FILE ) ); - if ( f ) - { - supported = MapFileOpenModes( (char*)mode , &bTextMode); - if ( !supported ) - { - PAL_free(f); - f = NULL; - goto EXIT; - } - - f->bsdFilePtr = (FILE *)fdopen( handle, supported ); - f->PALferrorCode = PAL_FILE_NOERROR; - /* Make sure fdopen did not fail. */ - if ( !f->bsdFilePtr ) - { - PAL_free( f ); - f = NULL; - } - - PAL_free( supported ); - supported = NULL; - } - else - { - ERROR( "Unable to allocate memory for the PAL_FILE wrapper!\n" ); - } - -EXIT: - LOGEXIT( "_fdopen returns FILE* %p\n", f ); - PERF_EXIT(_fdopen); - return f; -} - - -/*++ - -Function : - fopen - -see MSDN doc. - ---*/ -PAL_FILE * -__cdecl -PAL_fopen(const char * fileName, const char * mode) -{ - PAL_FILE *f = NULL; - LPSTR supported = NULL; - LPSTR UnixFileName = NULL; - struct stat stat_data; - BOOL bTextMode = TRUE; - - PERF_ENTRY(fopen); - ENTRY("fopen ( fileName=%p (%s) mode=%p (%s))\n", fileName, fileName, mode , mode ); - - _ASSERTE(fileName != NULL); - _ASSERTE(mode != NULL); - - if ( *mode == 'r' || *mode == 'w' || *mode == 'a' ) - { - supported = MapFileOpenModes( (char*)mode,&bTextMode); - - if ( !supported ) - { - goto done; - } - - UnixFileName = PAL__strdup(fileName); - if (UnixFileName == NULL ) - { - ERROR("PAL__strdup() failed\n"); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto done; - } - - FILEDosToUnixPathA( UnixFileName ); - - /*I am not checking for the case where stat fails - *as fopen will handle the error more gracefully in case - *UnixFileName is invalid*/ - if ((stat(UnixFileName, &stat_data) == 0 ) && - ((stat_data.st_mode & S_IFMT) == S_IFDIR)) - { - goto done; - } - - f = (PAL_FILE*)PAL_malloc( sizeof( PAL_FILE ) ); - if ( f ) - { - f->bsdFilePtr = (FILE*)fopen( UnixFileName, supported ); - f->PALferrorCode = PAL_FILE_NOERROR; - f->bTextMode = bTextMode; - if ( !f->bsdFilePtr ) - { - /* Failed */ - PAL_free( f ); - f = NULL; - } -#if UNGETC_NOT_RETURN_EOF - else - { - f->bWriteOnlyMode = WriteOnlyMode(f->bsdFilePtr); - } -#endif //UNGETC_NOT_RETURN_EOF - } - else - { - ERROR( "Unable to allocate memory to the PAL_FILE wrapper\n" ); - } - } - else - { - ERROR( "The mode flags must start with either an a, w, or r.\n" ); - } - -done: - PAL_free( supported ); - supported = NULL; - PAL_free( UnixFileName ); - - LOGEXIT( "fopen returns FILE* %p\n", f ); - PERF_EXIT(fopen); - return f; -} - -/*++ -Function: - _wfopen - -see MSDN doc. - ---*/ -PAL_FILE * -__cdecl -_wfopen( - const wchar_16 *fileName, - const wchar_16 *mode) -{ - CHAR mbFileName[ _MAX_PATH ]; - CHAR mbMode[ 10 ]; - PAL_FILE * filePtr = NULL; - - PERF_ENTRY(_wfopen); - ENTRY("_wfopen(fileName:%p (%S), mode:%p (%S))\n", fileName, fileName, mode, mode); - - _ASSERTE(fileName != NULL); - _ASSERTE(mode != NULL); - - /* Convert the parameters to ASCII and defer to PAL_fopen */ - if ( WideCharToMultiByte( CP_ACP, 0, fileName, -1, mbFileName, - sizeof mbFileName, NULL, NULL ) != 0 ) - { - if ( WideCharToMultiByte( CP_ACP, 0, mode, -1, mbMode, - sizeof mbMode, NULL, NULL ) != 0 ) - { - filePtr = PAL_fopen(mbFileName, mbMode); - } - else - { - ERROR( "An error occurred while converting mode to ANSI.\n" ); - } - } - else - { - ERROR( "An error occurred while converting" - " fileName to ANSI string.\n" ); - } - LOGEXIT("_wfopen returning FILE* %p\n", filePtr); - PERF_EXIT(_wfopen); - return filePtr; -} - -/*++ -Function - PAL_get_stdout. - - Returns the stdout stream. ---*/ -PAL_FILE * __cdecl PAL_get_stdout(int caller) -{ - PERF_ENTRY(get_stdout); - ENTRY("PAL_get_stdout\n"); - LOGEXIT("PAL_get_stdout returns PAL_FILE * %p\n", &PAL_Stdout ); - PERF_EXIT(get_stdout); - return &PAL_Stdout; -} - -/*++ -Function - PAL_get_stdin. - - Returns the stdin stream. ---*/ -PAL_FILE * __cdecl PAL_get_stdin(int caller) -{ - PERF_ENTRY(get_stdin); - ENTRY("PAL_get_stdin\n"); - LOGEXIT("PAL_get_stdin returns PAL_FILE * %p\n", &PAL_Stdin ); - PERF_EXIT(get_stdin); - return &PAL_Stdin; -} - -/*++ -Function - PAL_get_stderr. - - Returns the stderr stream. ---*/ -PAL_FILE * __cdecl PAL_get_stderr(int caller) -{ - PERF_ENTRY(get_stderr); - ENTRY("PAL_get_stderr\n"); - LOGEXIT("PAL_get_stderr returns PAL_FILE * %p\n", &PAL_Stderr ); - PERF_EXIT(get_stderr); - return &PAL_Stderr; -} - -/*++ - -Function: - - PAL_pread - -See msdn for more details. ---*/ -size_t __cdecl PAL__pread(int fd, void *buf, size_t nbytes, ULONG64 offset) -{ - return pread(fd, buf, nbytes, offset); -} - -/*++ - -Function: - - _close - -See msdn for more details. ---*/ -int __cdecl PAL__close(int handle) -{ - INT nRetVal = 0; - - PERF_ENTRY(_close); - ENTRY( "_close( handle=%d )\n", handle ); - - nRetVal = close( handle ); - - LOGEXIT( "_close returning %d.\n", nRetVal ); - PERF_EXIT(_close); - return nRetVal; -} - -int __cdecl PAL__flushall() -{ - return fflush(NULL); -} - -int __cdecl PAL_getc(PAL_FILE *stream); - -/*++ -Function : - - fread - - See MSDN for more details. ---*/ - -size_t -__cdecl -PAL_fread(void * buffer, size_t size, size_t count, PAL_FILE * f) -{ - size_t nReadBytes = 0; - - PERF_ENTRY(fread); - ENTRY( "fread( buffer=%p, size=%d, count=%d, f=%p )\n", - buffer, size, count, f ); - - _ASSERTE(f != NULL); - - CLEARERR(f); - - if(f->bTextMode != TRUE) - { - nReadBytes = fread( buffer, size, count, f->bsdFilePtr ); - } - else - { - size_t i=0; - if(size > 0) - { - size_t j=0; - LPSTR temp = (LPSTR)buffer; - int nChar = 0; - int nCount =0; - - for(i=0; i< count; i++) - { - for(j=0; j< size; j++) - { - if((nChar = PAL_getc(f)) == EOF) - { - nReadBytes = i; - goto done; - } - else - { - temp[nCount++]=nChar; - } - } - } - } - nReadBytes = i; - } - -done: - LOGEXIT( "fread returning size_t %d\n", nReadBytes ); - PERF_EXIT(fread); - return nReadBytes; -} - - -/*++ -Function : - - ferror - - See MSDN for more details. ---*/ -int -_cdecl -PAL_ferror(PAL_FILE * f) -{ - INT nErrorCode = PAL_FILE_NOERROR; - - PERF_ENTRY(ferror); - ENTRY( "ferror( f=%p )\n", f ); - - _ASSERTE(f != NULL); - - nErrorCode = ferror( f->bsdFilePtr ); - if ( 0 == nErrorCode ) - { - /* See if the PAL file error code is set. */ - nErrorCode = f->PALferrorCode; - } - - LOGEXIT( "ferror returns %d\n", nErrorCode ); - PERF_EXIT(ferror); - return nErrorCode; -} - - -/*++ -Function : - - fclose - - See MSDN for more details. ---*/ -int -_cdecl -PAL_fclose(PAL_FILE * f) -{ - INT nRetVal = 0; - - PERF_ENTRY(fclose); - ENTRY( "fclose( f=%p )\n", f ); - - _ASSERTE(f != NULL); - - CLEARERR(f); - - nRetVal = fclose( f->bsdFilePtr ); - PAL_free( f ); - - LOGEXIT( "fclose returning %d\n", nRetVal ); - PERF_EXIT(fclose); - return nRetVal; -} - -/*++ -Function : - - fputs - - See MSDN for more details. ---*/ -int -_cdecl -PAL_fputs(const char * str, PAL_FILE * f) -{ - INT nRetVal = 0; - - PERF_ENTRY(fputs); - ENTRY( "fputs( %p (%s), %p )\n", str, str, f); - - _ASSERTE(str != NULL); - _ASSERTE(f != NULL); - - CLEARERR(f); - - nRetVal = fputs( str, f->bsdFilePtr ); - - LOGEXIT( "fputs returning %d\n", nRetVal ); - PERF_EXIT(fputs); - return nRetVal; -} - -/*++ -Function : - - ftell - - See MSDN for more details. ---*/ -LONG -_cdecl -PAL_ftell(PAL_FILE * f) -{ - long lRetVal = 0; - - PERF_ENTRY(ftell); - ENTRY( "ftell( %p )\n", f ); - - _ASSERTE(f != NULL); - lRetVal = ftell( f->bsdFilePtr ); - -#ifdef HOST_64BIT - /* Windows does not set an error if the file pointer's position - is greater than _I32_MAX. It just returns -1. */ - if (lRetVal > _I32_MAX) - { - lRetVal = -1; - } -#endif - - LOGEXIT( "ftell returning %ld\n", lRetVal ); - PERF_EXIT(ftell); - /* This explicit cast to LONG is used to silence any potential warnings - due to implicitly casting the native long lRetVal to LONG when returning. */ - return (LONG)lRetVal; -} - -/*++ -Function : - getc - - See MSDN for more details. ---*/ -int -_cdecl -PAL_getc(PAL_FILE * f) -{ - INT nRetVal = 0; - INT temp =0; - - PERF_ENTRY(getc); - ENTRY( "getc( %p )\n", f ); - - _ASSERTE(f != NULL); - - CLEARERR(f); - - nRetVal = getc( f->bsdFilePtr ); - - if ( (f->bTextMode) && (nRetVal == '\r') ) - { - if ((temp = getc( f->bsdFilePtr ))== '\n') - { - nRetVal ='\n'; - } - else if (EOF == ungetc( temp, f->bsdFilePtr )) - { - ERROR("ungetc operation failed\n"); - } - } - - LOGEXIT( "getc returning %d\n", nRetVal ); - PERF_EXIT(getc); - return nRetVal; -} - -/*++ -Function : - - setvbuf - - See MSDN for more details. ---*/ -int -_cdecl -PAL_setvbuf(PAL_FILE *f, char *buf, int type, size_t size) -{ - INT nRetVal = 0; - - PERF_ENTRY(setvbuf); - ENTRY( "setvbuf( %p, %p, %d, %ul )\n", f, buf, type, size); - - _ASSERTE(f != NULL); - - nRetVal = setvbuf(f->bsdFilePtr, buf, type, size); - - LOGEXIT( "setvbuf returning %d\n", nRetVal ); - PERF_EXIT(setvbuf); - return nRetVal; -} diff --git a/src/shared/pal/src/cruntime/filecrt.cpp b/src/shared/pal/src/cruntime/filecrt.cpp deleted file mode 100644 index 78aab0c4d1..0000000000 --- a/src/shared/pal/src/cruntime/filecrt.cpp +++ /dev/null @@ -1,479 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - filecrt.cpp - -Abstract: - - Implementation of the file functions in the C runtime library that - are Windows specific. - - - ---*/ - -#include "pal/thread.hpp" -#include "pal/file.hpp" - -#include "pal/palinternal.h" -#include "pal/dbgmsg.h" -#include "pal/file.h" -#include "pal/cruntime.h" - -#include -#include -#include - -#ifdef __APPLE__ -#include -#endif // __APPLE__ - -using namespace CorUnix; - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - -/*++ -Function: - _open_osfhandle - -See MSDN doc. ---*/ -int -__cdecl -_open_osfhandle( INT_PTR osfhandle, int flags ) -{ - PAL_ERROR palError = NO_ERROR; - CPalThread *pthrCurrent = NULL; - IPalObject *pobjFile = NULL; - CFileProcessLocalData *pLocalData = NULL; - IDataLock *pDataLock = NULL; - INT nRetVal = -1; - INT openFlags = 0; - - PERF_ENTRY(_open_osfhandle); - ENTRY( "_open_osfhandle (osfhandle=%#x, flags=%#x)\n", osfhandle, flags ); - - pthrCurrent = InternalGetCurrentThread(); - - if (flags != _O_RDONLY) - { - ASSERT("flag(%#x) not supported\n", flags); - goto EXIT; - } - - openFlags |= O_RDONLY; - - palError = g_pObjectManager->ReferenceObjectByHandle( - pthrCurrent, - reinterpret_cast(osfhandle), - &aotFile, - &pobjFile - ); - - if (NO_ERROR != palError) - { - ERROR("Error dereferencing file handle\n"); - goto EXIT; - } - - palError = pobjFile->GetProcessLocalData( - pthrCurrent, - ReadLock, - &pDataLock, - reinterpret_cast(&pLocalData) - ); - - if (NO_ERROR == palError) - { - if (NULL != pLocalData->unix_filename) - { - nRetVal = InternalOpen(pLocalData->unix_filename, openFlags); - } - else /* the only file object with no unix_filename is a pipe */ - { - /* check if the file pipe descrptor is for read or write */ - if (pLocalData->open_flags == O_WRONLY) - { - ERROR( "Couldn't open a write pipe on read mode\n"); - goto EXIT; - } - - nRetVal = pLocalData->unix_fd; - } - - if ( nRetVal == -1 ) - { - ERROR( "Error: %s.\n", strerror( errno ) ); - } - } - else - { - ASSERT("Unable to access file data"); - } - -EXIT: - - if (NULL != pDataLock) - { - pDataLock->ReleaseLock(pthrCurrent, FALSE); - } - - if (NULL != pobjFile) - { - pobjFile->ReleaseReference(pthrCurrent); - } - - LOGEXIT( "_open_osfhandle return nRetVal:%d\n", nRetVal); - PERF_EXIT(_open_osfhandle); - return nRetVal; -} - - -/*++ -Function: - PAL_fflush - -See MSDN for more details. ---*/ -int -_cdecl -PAL_fflush( PAL_FILE *stream ) -{ - int nRetVal = 0; - - PERF_ENTRY(fflush); - ENTRY( "fflush( %p )\n", stream ); - - nRetVal = fflush(stream ? stream->bsdFilePtr : NULL); - - LOGEXIT( "fflush returning %d\n", nRetVal ); - PERF_EXIT(fflush); - return nRetVal; -} - - -/*++ -PAL__open - -Wrapper function for InternalOpen. - -Input parameters: - -szPath = pointer to a pathname of a file to be opened -nFlags = arguments that control how the file should be accessed -mode = file permission settings that are used only when a file is created - -Return value: - File descriptor on success, -1 on failure ---*/ -int -__cdecl -PAL__open( - const char *szPath, - int nFlags, - ... - ) -{ - int nRet = -1; - int mode = 0; - va_list ap; - - // If nFlags does not contain O_CREAT, the mode parameter will be ignored. - if (nFlags & O_CREAT) - { - va_start(ap, nFlags); - mode = va_arg(ap, int); - va_end(ap); - } - - nRet = InternalOpen(szPath, nFlags, mode); - return nRet; -} - -/*++ -InternalOpen - -Wrapper for open. - -Input parameters: - -szPath = pointer to a pathname of a file to be opened -nFlags = arguments that control how the file should be accessed -mode = file permission settings that are used only when a file is created - -Return value: - File descriptor on success, -1 on failure ---*/ -int -CorUnix::InternalOpen( - const char *szPath, - int nFlags, - ... - ) -{ - int nRet = -1; - int mode = 0; - va_list ap; - - // If nFlags does not contain O_CREAT, the mode parameter will be ignored. - if (nFlags & O_CREAT) - { - va_start(ap, nFlags); - mode = va_arg(ap, int); - va_end(ap); - } - - do - { -#if OPEN64_IS_USED_INSTEAD_OF_OPEN - nRet = open64(szPath, nFlags, mode); -#else - nRet = open(szPath, nFlags, mode); -#endif - } - while ((nRet == -1) && (errno == EINTR)); - - return nRet; -} - - -/*++ -PAL_fgets - -Wrapper function for InternalFgets. - -Input parameters: - -sz = stores characters read from the given file stream -nSize = number of characters to be read -pf = stream to read characters from - -Return value: - Returns a pointer to the string storing the characters on success - and NULL on failure. ---*/ -char * -__cdecl -PAL_fgets( - char *sz, - int nSize, - PAL_FILE *pf - ) -{ - char * szBuf; - - PERF_ENTRY(fgets); - ENTRY( "fgets(sz=%p (%s) nSize=%d pf=%p)\n", sz, sz, nSize, pf); - - if (pf != NULL) - { - szBuf = InternalFgets(sz, nSize, pf->bsdFilePtr, pf->bTextMode); - } - else - { - szBuf = NULL; - } - - LOGEXIT("fgets() returns %p\n", szBuf); - PERF_EXIT(fgets); - - return szBuf; -} - -/*++ -InternalFgets - -Wrapper for fgets. - -Input parameters: - -sz = stores characters read from the given file stream -nSize = number of characters to be read -f = stream to read characters from -fTextMode = flag that indicates if file contents are text or binary - -Return value: - Returns a pointer to the string storing the characters on success - and NULL on failure. - -Notes: -In Unix systems, fgets() can return an error if it gets interrupted by a -signal before reading anything, and errno is set to EINTR. When this -happens, it is SOP to call fgets again. ---*/ -char * -CorUnix::InternalFgets( - char *sz, - int nSize, - FILE *f, - bool fTextMode - ) -{ - char *retval = NULL; - - _ASSERTE(sz != NULL); - _ASSERTE(f != NULL); - -#if FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL - clearerr(f); -#endif - - do - { - retval = fgets(sz, nSize, f); - if (NULL==retval) - { - if (feof(f)) - { - TRACE("Reached EOF\n"); - break; - } - /* The man page suggests using ferror and feof to distinguish - between error and EOF, but feof and errno is sufficient. - Not all cases that set errno also flag ferror, so just - checking errno is the best solution. */ - if (EINTR != errno) - { - WARN("got error; errno is %d (%s)\n",errno, strerror(errno)); - break; - } - /* we ignored a EINTR error, reset the stream's error state */ - clearerr(f); - TRACE("call got interrupted (EINTR), trying again\n"); - } - if (fTextMode) - { - int len = strlen(sz); - if ((len>=2) && (sz[len-1]=='\n') && (sz[len-2]=='\r')) - { - sz[len-2]='\n'; - sz[len-1]='\0'; - } - } - } while(NULL == retval); - - return retval; -} - -/*++ -PAL_fwrite - -Wrapper function for InternalFwrite. - -Input parameters: - -pvBuffer = array of objects to write to the given file stream -nSize = size of a object in bytes -nCount = number of objects to write -pf = stream to write characters to - -Return value: - Returns the number of objects written. ---*/ -size_t -__cdecl -PAL_fwrite( - const void *pvBuffer, - size_t nSize, - size_t nCount, - PAL_FILE *pf - ) -{ - size_t nWrittenBytes = 0; - - PERF_ENTRY(fwrite); - ENTRY( "fwrite( pvBuffer=%p, nSize=%d, nCount=%d, pf=%p )\n", - pvBuffer, nSize, nCount, pf); - _ASSERTE(pf != NULL); - - nWrittenBytes = InternalFwrite(pvBuffer, nSize, nCount, pf->bsdFilePtr, &pf->PALferrorCode); - - LOGEXIT( "fwrite returning size_t %d\n", nWrittenBytes ); - PERF_EXIT(fwrite); - return nWrittenBytes; -} - -/*++ -InternalFwrite - -Wrapper for fwrite. - -Input parameters: - -pvBuffer = array of objects to write to the given file stream -nSize = size of a object in bytes -nCount = number of objects to write -f = stream to write characters to -pnErrorCode = reference to a PAL_FILE's fwrite error code field - -Return value: - Returns the number of objects written. ---*/ -size_t -CorUnix::InternalFwrite( - const void *pvBuffer, - size_t nSize, - size_t nCount, - FILE *f, - INT *pnErrorCode - ) -{ - size_t nWrittenBytes = 0; - _ASSERTE(f != NULL); - -#if FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL - clearerr(f); -#endif - - nWrittenBytes = fwrite(pvBuffer, nSize, nCount, f); - - // Make sure no error ocurred. - if ( nWrittenBytes < nCount ) - { - // Set the FILE* error code - *pnErrorCode = PAL_FILE_ERROR; - } - - return nWrittenBytes; -} - - -/*++ -PAL_fseek - -Wrapper function for fseek. - -Input parameters: - -pf = a given file stream -lOffset = distance from position to set file-position indicator -nWhence = method used to determine the file_position indicator location relative to lOffset - -Return value: - 0 on success, -1 on failure. ---*/ -int -_cdecl -PAL_fseek( - PAL_FILE * pf, - LONG lOffset, - int nWhence - ) -{ - int nRet = 0; - - PERF_ENTRY(fseek); - ENTRY( "fseek( %p, %ld, %d )\n", pf, lOffset, nWhence ); - - nRet = fseek(pf ? pf->bsdFilePtr : NULL, lOffset, nWhence); - - LOGEXIT("fseek returning %d\n", nRet); - PERF_EXIT(fseek); - return nRet; -} diff --git a/src/shared/pal/src/cruntime/malloc.cpp b/src/shared/pal/src/cruntime/malloc.cpp deleted file mode 100644 index 4351c47e31..0000000000 --- a/src/shared/pal/src/cruntime/malloc.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - malloc.cpp - -Abstract: - - Implementation of suspension safe memory allocation functions. - -Revision History: - - - ---*/ - -#include "pal/corunix.hpp" -#include "pal/thread.hpp" -#include "pal/malloc.hpp" -#include "pal/dbgmsg.h" - -#include - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - -using namespace CorUnix; - -void * -__cdecl -PAL_realloc( - void* pvMemblock, - size_t szSize - ) -{ - return InternalRealloc(pvMemblock, szSize); -} - -void * -CorUnix::InternalRealloc( - void* pvMemblock, - size_t szSize - ) -{ - void *pvMem; - - PERF_ENTRY(InternalRealloc); - ENTRY("realloc (memblock:%p size=%d)\n", pvMemblock, szSize); - - if (szSize == 0) - { - // If pvMemblock is NULL, there's no reason to call free. - if (pvMemblock != NULL) - { - free(pvMemblock); - } - pvMem = NULL; - } - else - { - pvMem = realloc(pvMemblock, szSize); - } - - LOGEXIT("realloc returns void * %p\n", pvMem); - PERF_EXIT(InternalRealloc); - return pvMem; -} - -void -__cdecl -PAL_free( - void *pvMem - ) -{ - free(pvMem); -} - -void * -__cdecl -PAL_malloc( - size_t szSize - ) -{ - return InternalMalloc(szSize); -} - -void * -CorUnix::InternalMalloc( - size_t szSize - ) -{ - void *pvMem; - - if (szSize == 0) - { - // malloc may return null for a requested size of zero bytes. Force a nonzero size to get a valid pointer. - szSize = 1; - } - - pvMem = (void*)malloc(szSize); - return pvMem; -} - -char * -__cdecl -PAL__strdup( - const char *c_szStr - ) -{ - return strdup(c_szStr); -} diff --git a/src/shared/pal/src/cruntime/math.cpp b/src/shared/pal/src/cruntime/math.cpp deleted file mode 100644 index 14243f43a7..0000000000 --- a/src/shared/pal/src/cruntime/math.cpp +++ /dev/null @@ -1,859 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - math.cpp - -Abstract: - - Implementation of math family functions. - - - ---*/ - -#include "pal/palinternal.h" -#include "pal/dbgmsg.h" - -#include - -#if HAVE_IEEEFP_H -#include -#endif // HAVE_IEEEFP_H - -#include - -#define PAL_NAN_DBL sqrt(-1.0) -#define PAL_POSINF_DBL -log(0.0) -#define PAL_NEGINF_DBL log(0.0) - -#define IS_DBL_NEGZERO(x) (((*((INT64*)((void*)&x))) & I64(0xFFFFFFFFFFFFFFFF)) == I64(0x8000000000000000)) - -#define PAL_NAN_FLT sqrtf(-1.0f) -#define PAL_POSINF_FLT -logf(0.0f) -#define PAL_NEGINF_FLT logf(0.0f) - -#define IS_FLT_NEGZERO(x) (((*((INT32*)((void*)&x))) & 0xFFFFFFFF) == 0x80000000) - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - -/*++ -Function: - _finite - -Determines whether given double-precision floating point value is finite. - -Return Value - -_finite returns a nonzero value (TRUE) if its argument x is not -infinite, that is, if -INF < x < +INF. It returns 0 (FALSE) if the -argument is infinite or a NaN. - -Parameter - -x Double-precision floating-point value - ---*/ -int __cdecl _finite(double x) -{ - int ret; - PERF_ENTRY(_finite); - ENTRY("_finite (x=%f)\n", x); - - ret = isfinite(x); - - LOGEXIT("_finite returns int %d\n", ret); - PERF_EXIT(_finite); - return ret; -} - -/*++ -Function: - _isnan - -See MSDN doc ---*/ -int __cdecl _isnan(double x) -{ - int ret; - PERF_ENTRY(_isnan); - ENTRY("_isnan (x=%f)\n", x); - - ret = isnan(x); - - LOGEXIT("_isnan returns int %d\n", ret); - PERF_EXIT(_isnan); - return ret; -} - -/*++ -Function: - _copysign - -See MSDN doc ---*/ -double __cdecl _copysign(double x, double y) -{ - double ret; - PERF_ENTRY(_copysign); - ENTRY("_copysign (x=%f, y=%f)\n", x, y); - - ret = copysign(x, y); - - LOGEXIT("_copysign returns double %f\n", ret); - PERF_EXIT(_copysign); - return ret; -} - -/*++ -Function: - acos - -See MSDN. ---*/ -PALIMPORT double __cdecl PAL_acos(double x) -{ - double ret; - PERF_ENTRY(acos); - ENTRY("acos (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_ACOS - errno = 0; -#endif // HAVE_COMPATIBLE_ACOS - - ret = acos(x); - -#if !HAVE_COMPATIBLE_ACOS - if (errno == EDOM) - { - ret = PAL_NAN_DBL; // NaN - } -#endif // HAVE_COMPATIBLE_ACOS - - LOGEXIT("acos returns double %f\n", ret); - PERF_EXIT(acos); - return ret; -} - -/*++ -Function: - asin - -See MSDN. ---*/ -PALIMPORT double __cdecl PAL_asin(double x) -{ - double ret; - PERF_ENTRY(asin); - ENTRY("asin (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_ASIN - errno = 0; -#endif // HAVE_COMPATIBLE_ASIN - - ret = asin(x); - -#if !HAVE_COMPATIBLE_ASIN - if (errno == EDOM) - { - ret = PAL_NAN_DBL; // NaN - } -#endif // HAVE_COMPATIBLE_ASIN - - LOGEXIT("asin returns double %f\n", ret); - PERF_EXIT(asin); - return ret; -} - -/*++ -Function: - atan2 - -See MSDN. ---*/ -PALIMPORT double __cdecl PAL_atan2(double y, double x) -{ - double ret; - PERF_ENTRY(atan2); - ENTRY("atan2 (y=%f, x=%f)\n", y, x); - -#if !HAVE_COMPATIBLE_ATAN2 - errno = 0; -#endif // !HAVE_COMPATIBLE_ATAN2 - - ret = atan2(y, x); - -#if !HAVE_COMPATIBLE_ATAN2 - if ((errno == EDOM) && (x == 0.0) && (y == 0.0)) - { - const double sign_x = copysign(1.0, x); - const double sign_y = copysign(1.0, y); - - if (sign_x > 0) - { - ret = copysign(0.0, sign_y); - } - else - { - ret = copysign(atan2(0.0, -1.0), sign_y); - } - } -#endif // !HAVE_COMPATIBLE_ATAN2 - - LOGEXIT("atan2 returns double %f\n", ret); - PERF_EXIT(atan2); - return ret; -} - -/*++ -Function: - exp - -See MSDN. ---*/ -PALIMPORT double __cdecl PAL_exp(double x) -{ - double ret; - PERF_ENTRY(exp); - ENTRY("exp (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_EXP - if (x == 1.0) - { - ret = M_E; - } - else - { -#endif // HAVE_COMPATIBLE_EXP - - ret = exp(x); - -#if !HAVE_COMPATIBLE_EXP - } -#endif // HAVE_COMPATIBLE_EXP - - LOGEXIT("exp returns double %f\n", ret); - PERF_EXIT(exp); - return ret; -} - -/*++ -Function: - ilogb - -See MSDN. ---*/ -PALIMPORT int __cdecl PAL_ilogb(double x) -{ - int ret; - PERF_ENTRY(ilogb); - ENTRY("ilogb (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_ILOGB0 - if (x == 0.0) - { - ret = -2147483648; - } - else -#endif // !HAVE_COMPATIBLE_ILOGB0 - -#if !HAVE_COMPATIBLE_ILOGBNAN - if (isnan(x)) - { - ret = 2147483647; - } - else -#endif // !HAVE_COMPATIBLE_ILOGBNAN - - { - ret = ilogb(x); - } - - LOGEXIT("ilogb returns int %d\n", ret); - PERF_EXIT(ilogb); - return ret; -} - -/*++ -Function: - log - -See MSDN. ---*/ -PALIMPORT double __cdecl PAL_log(double x) -{ - double ret; - PERF_ENTRY(log); - ENTRY("log (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_LOG - errno = 0; -#endif // !HAVE_COMPATIBLE_LOG - - ret = log(x); - -#if !HAVE_COMPATIBLE_LOG - if ((errno == EDOM) && (x < 0)) - { - ret = PAL_NAN_DBL; // NaN - } -#endif // !HAVE_COMPATIBLE_LOG - - LOGEXIT("log returns double %f\n", ret); - PERF_EXIT(log); - return ret; -} - -/*++ -Function: - log10 - -See MSDN. ---*/ -PALIMPORT double __cdecl PAL_log10(double x) -{ - double ret; - PERF_ENTRY(log10); - ENTRY("log10 (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_LOG10 - errno = 0; -#endif // !HAVE_COMPATIBLE_LOG10 - - ret = log10(x); - -#if !HAVE_COMPATIBLE_LOG10 - if ((errno == EDOM) && (x < 0)) - { - ret = PAL_NAN_DBL; // NaN - } -#endif // !HAVE_COMPATIBLE_LOG10 - - LOGEXIT("log10 returns double %f\n", ret); - PERF_EXIT(log10); - return ret; -} - -/*++ -Function: - pow - -See MSDN. ---*/ -PALIMPORT double __cdecl PAL_pow(double x, double y) -{ - double ret; - PERF_ENTRY(pow); - ENTRY("pow (x=%f, y=%f)\n", x, y); - -#if !HAVE_COMPATIBLE_POW - if ((y == PAL_POSINF_DBL) && !isnan(x)) // +Inf - { - if (x == 1.0) - { - ret = x; - } - else if (x == -1.0) - { - ret = 1.0; - } - else if ((x > -1.0) && (x < 1.0)) - { - ret = 0.0; - } - else - { - ret = PAL_POSINF_DBL; // +Inf - } - } - else if ((y == PAL_NEGINF_DBL) && !isnan(x)) // -Inf - { - if (x == 1.0) - { - ret = x; - } - else if (x == -1.0) - { - ret = 1.0; - } - else if ((x > -1.0) && (x < 1.0)) - { - ret = PAL_POSINF_DBL; // +Inf - } - else - { - ret = 0.0; - } - } - else if (IS_DBL_NEGZERO(x) && (y == -1.0)) - { - ret = PAL_NEGINF_DBL; // -Inf - } - else if ((x == 0.0) && (y < 0.0)) - { - ret = PAL_POSINF_DBL; // +Inf - } - else -#endif // !HAVE_COMPATIBLE_POW - - ret = pow(x, y); - -#if !HAVE_VALID_NEGATIVE_INF_POW - if ((ret == PAL_POSINF_DBL) && (x < 0) && isfinite(x) && (ceil(y / 2) != floor(y / 2))) - { - ret = PAL_NEGINF_DBL; // -Inf - } -#endif // !HAVE_VALID_NEGATIVE_INF_POW - -#if !HAVE_VALID_POSITIVE_INF_POW - /* - * The even/odd test in the if (this one and the one above) used to be ((long long) y % 2 == 0) - * on SPARC (long long) y for large y (>2**63) is always 0x7fffffff7fffffff, which - * is an odd number, so the test ((long long) y % 2 == 0) will always fail for - * large y. Since large double numbers are always even (e.g., the representation of - * 1E20+1 is the same as that of 1E20, the last .+1. is too insignificant to be part - * of the representation), this test will always return the wrong result for large y. - * - * The (ceil(y/2) == floor(y/2)) test is slower, but more robust. - */ - if ((ret == PAL_NEGINF_DBL) && (x < 0) && isfinite(x) && (ceil(y / 2) == floor(y / 2))) - { - ret = PAL_POSINF_DBL; // +Inf - } -#endif // !HAVE_VALID_POSITIVE_INF_POW - - LOGEXIT("pow returns double %f\n", ret); - PERF_EXIT(pow); - return ret; -} - -/*++ -Function: - sincos - -See MSDN. ---*/ -PALIMPORT void __cdecl PAL_sincos(double x, double* sin, double* cos) -{ - PERF_ENTRY(sincos); - ENTRY("sincos (x=%f)\n", x); - -#if defined(__APPLE__) - __sincos(x, sin, cos); -#else - sincos(x, sin, cos); -#endif // !__APPLE__ - - LOGEXIT("sincos returns (double %f, double %f)\n", *sin, *cos); - PERF_EXIT(sincos); -} - -/*++ -Function: - _finitef - -Determines whether given single-precision floating point value is finite. - -Return Value - -_finitef returns a nonzero value (TRUE) if its argument x is not -infinite, that is, if -INF < x < +INF. It returns 0 (FALSE) if the -argument is infinite or a NaN. - -Parameter - -x Single-precision floating-point value - ---*/ -int __cdecl _finitef(float x) -{ - int ret; - PERF_ENTRY(_finitef); - ENTRY("_finitef (x=%f)\n", x); - - ret = isfinite(x); - - LOGEXIT("_finitef returns int %d\n", ret); - PERF_EXIT(_finitef); - return ret; -} - -/*++ -Function: - _isnanf - -See MSDN doc ---*/ -int __cdecl _isnanf(float x) -{ - int ret; - PERF_ENTRY(_isnanf); - ENTRY("_isnanf (x=%f)\n", x); - - ret = isnan(x); - - LOGEXIT("_isnanf returns int %d\n", ret); - PERF_EXIT(_isnanf); - return ret; -} - -/*++ -Function: - _copysignf - -See MSDN doc ---*/ -float __cdecl _copysignf(float x, float y) -{ - float ret; - PERF_ENTRY(_copysignf); - ENTRY("_copysignf (x=%f, y=%f)\n", x, y); - - ret = copysign(x, y); - - LOGEXIT("_copysignf returns float %f\n", ret); - PERF_EXIT(_copysignf); - return ret; -} - -/*++ -Function: - acosf - -See MSDN. ---*/ -PALIMPORT float __cdecl PAL_acosf(float x) -{ - float ret; - PERF_ENTRY(acosf); - ENTRY("acosf (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_ACOS - errno = 0; -#endif // HAVE_COMPATIBLE_ACOS - - ret = acosf(x); - -#if !HAVE_COMPATIBLE_ACOS - if (errno == EDOM) - { - ret = PAL_NAN_FLT; // NaN - } -#endif // HAVE_COMPATIBLE_ACOS - - LOGEXIT("acosf returns float %f\n", ret); - PERF_EXIT(acosf); - return ret; -} - -/*++ -Function: - asinf - -See MSDN. ---*/ -PALIMPORT float __cdecl PAL_asinf(float x) -{ - float ret; - PERF_ENTRY(asinf); - ENTRY("asinf (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_ASIN - errno = 0; -#endif // HAVE_COMPATIBLE_ASIN - - ret = asinf(x); - -#if !HAVE_COMPATIBLE_ASIN - if (errno == EDOM) - { - ret = PAL_NAN_FLT; // NaN - } -#endif // HAVE_COMPATIBLE_ASIN - - LOGEXIT("asinf returns float %f\n", ret); - PERF_EXIT(asinf); - return ret; -} - -/*++ -Function: - atan2f - -See MSDN. ---*/ -PALIMPORT float __cdecl PAL_atan2f(float y, float x) -{ - float ret; - PERF_ENTRY(atan2f); - ENTRY("atan2f (y=%f, x=%f)\n", y, x); - -#if !HAVE_COMPATIBLE_ATAN2 - errno = 0; -#endif // !HAVE_COMPATIBLE_ATAN2 - - ret = atan2f(y, x); - -#if !HAVE_COMPATIBLE_ATAN2 - if ((errno == EDOM) && (x == 0.0f) && (y == 0.0f)) - { - const float sign_x = copysign(1.0f, x); - const float sign_y = copysign(1.0f, y); - - if (sign_x > 0) - { - ret = copysign(0.0f, sign_y); - } - else - { - ret = copysign(atan2f(0.0f, -1.0f), sign_y); - } - } -#endif // !HAVE_COMPATIBLE_ATAN2 - - LOGEXIT("atan2f returns float %f\n", ret); - PERF_EXIT(atan2f); - return ret; -} - -/*++ -Function: - expf - -See MSDN. ---*/ -PALIMPORT float __cdecl PAL_expf(float x) -{ - float ret; - PERF_ENTRY(expf); - ENTRY("expf (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_EXP - if (x == 1.0f) - { - ret = M_E; - } - else - { -#endif // HAVE_COMPATIBLE_EXP - - ret = expf(x); - -#if !HAVE_COMPATIBLE_EXP - } -#endif // HAVE_COMPATIBLE_EXP - - LOGEXIT("expf returns float %f\n", ret); - PERF_EXIT(expf); - return ret; -} - -/*++ -Function: - ilogbf - -See MSDN. ---*/ -PALIMPORT int __cdecl PAL_ilogbf(float x) -{ - int ret; - PERF_ENTRY(ilogbf); - ENTRY("ilogbf (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_ILOGB0 - if (x == 0.0f) - { - ret = -2147483648; - } - else -#endif // !HAVE_COMPATIBLE_ILOGB0 - -#if !HAVE_COMPATIBLE_ILOGBNAN - if (isnan(x)) - { - ret = 2147483647; - } - else -#endif // !HAVE_COMPATIBLE_ILOGBNAN - - { - ret = ilogbf(x); - } - - LOGEXIT("ilogbf returns int %d\n", ret); - PERF_EXIT(ilogbf); - return ret; -} - -/*++ -Function: - logf - -See MSDN. ---*/ -PALIMPORT float __cdecl PAL_logf(float x) -{ - float ret; - PERF_ENTRY(logf); - ENTRY("logf (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_LOG - errno = 0; -#endif // !HAVE_COMPATIBLE_LOG - - ret = logf(x); - -#if !HAVE_COMPATIBLE_LOG - if ((errno == EDOM) && (x < 0)) - { - ret = PAL_NAN_FLT; // NaN - } -#endif // !HAVE_COMPATIBLE_LOG - - LOGEXIT("logf returns float %f\n", ret); - PERF_EXIT(logf); - return ret; -} - -/*++ -Function: - log10f - -See MSDN. ---*/ -PALIMPORT float __cdecl PAL_log10f(float x) -{ - float ret; - PERF_ENTRY(log10f); - ENTRY("log10f (x=%f)\n", x); - -#if !HAVE_COMPATIBLE_LOG10 - errno = 0; -#endif // !HAVE_COMPATIBLE_LOG10 - - ret = log10f(x); - -#if !HAVE_COMPATIBLE_LOG10 - if ((errno == EDOM) && (x < 0)) - { - ret = PAL_NAN_FLT; // NaN - } -#endif // !HAVE_COMPATIBLE_LOG10 - - LOGEXIT("log10f returns float %f\n", ret); - PERF_EXIT(log10f); - return ret; -} - -/*++ -Function: - powf - -See MSDN. ---*/ -PALIMPORT float __cdecl PAL_powf(float x, float y) -{ - float ret; - PERF_ENTRY(powf); - ENTRY("powf (x=%f, y=%f)\n", x, y); - -#if !HAVE_COMPATIBLE_POW - if ((y == PAL_POSINF_FLT) && !isnan(x)) // +Inf - { - if (x == 1.0f) - { - ret = x; - } - else if (x == -1.0f) - { - ret = 1.0f; - } - else if ((x > -1.0f) && (x < 1.0f)) - { - ret = 0.0f; - } - else - { - ret = PAL_POSINF_FLT; // +Inf - } - } - else if ((y == PAL_NEGINF_FLT) && !isnan(x)) // -Inf - { - if (x == 1.0f) - { - ret = x; - } - else if (x == -1.0f) - { - ret = 1.0f; - } - else if ((x > -1.0f) && (x < 1.0f)) - { - ret = PAL_POSINF_FLT; // +Inf - } - else - { - ret = 0.0f; - } - } - else if (IS_FLT_NEGZERO(x) && (y == -1.0f)) - { - ret = PAL_NEGINF_FLT; // -Inf - } - else if ((x == 0.0f) && (y < 0.0f)) - { - ret = PAL_POSINF_FLT; // +Inf - } - else -#endif // !HAVE_COMPATIBLE_POW - - ret = powf(x, y); - -#if !HAVE_VALID_NEGATIVE_INF_POW - if ((ret == PAL_POSINF_FLT) && (x < 0) && isfinite(x) && (ceilf(y / 2) != floorf(y / 2))) - { - ret = PAL_NEGINF_FLT; // -Inf - } -#endif // !HAVE_VALID_NEGATIVE_INF_POW - -#if !HAVE_VALID_POSITIVE_INF_POW - /* - * The (ceil(y/2) == floor(y/2)) test is slower, but more robust for platforms where large y - * will return the wrong result for ((long) y % 2 == 0). See PAL_pow(double) above for more details. - */ - if ((ret == PAL_NEGINF_FLT) && (x < 0) && isfinite(x) && (ceilf(y / 2) == floorf(y / 2))) - { - ret = PAL_POSINF_FLT; // +Inf - } -#endif // !HAVE_VALID_POSITIVE_INF_POW - - LOGEXIT("powf returns float %f\n", ret); - PERF_EXIT(powf); - return ret; -} - -/*++ -Function: - sincosf - -See MSDN. ---*/ -PALIMPORT void __cdecl PAL_sincosf(float x, float* sin, float* cos) -{ - PERF_ENTRY(sincosf); - ENTRY("sincosf (x=%f)\n", x); - -#if defined(__APPLE__) - __sincosf(x, sin, cos); -#else - sincosf(x, sin, cos); -#endif // !__APPLE__ - - LOGEXIT("sincosf returns (float %f, float %f)\n", *sin, *cos); - PERF_EXIT(sincosf); -} diff --git a/src/shared/pal/src/cruntime/misc.cpp b/src/shared/pal/src/cruntime/misc.cpp deleted file mode 100644 index 7a2690f132..0000000000 --- a/src/shared/pal/src/cruntime/misc.cpp +++ /dev/null @@ -1,282 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - cruntime/misc.cpp - -Abstract: - - Implementation of C runtime functions that don't fit anywhere else. - - - ---*/ - -#include "pal/thread.hpp" -#include "pal/threadsusp.hpp" -#include "pal/palinternal.h" -#include "pal/dbgmsg.h" -#include "pal/misc.h" - -#include -/* needs to be included after "palinternal.h" to avoid name - collision for va_start and va_end */ -#include -#include -#include - -#if defined(HOST_AMD64) || defined(_x86_) -#include -#endif // defined(HOST_AMD64) || defined(_x86_) -#if defined(_DEBUG) -#include -#endif //defined(_DEBUG) - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - -using namespace CorUnix; - -/*++ -Function: - _gcvt_s - -See MSDN doc. ---*/ -char * -__cdecl -_gcvt_s( char * buffer, int iSize, double value, int digits ) -{ - PERF_ENTRY(_gcvt); - ENTRY( "_gcvt( value:%f digits=%d, buffer=%p )\n", value, digits, buffer ); - - if ( !buffer ) - { - ERROR( "buffer was an invalid pointer.\n" ); - } - - switch ( digits ) - { - case 7 : - /* Fall through */ - case 8 : - /* Fall through */ - case 15 : - /* Fall through */ - case 17 : - - sprintf_s( buffer, iSize, "%.*g", digits, value ); - break; - - default : - ASSERT( "Only the digits 7, 8, 15, and 17 are valid.\n" ); - *buffer = '\0'; - } - - LOGEXIT( "_gcvt returns %p (%s)\n", buffer , buffer ); - PERF_EXIT(_gcvt); - return buffer; -} - - -/*++ -Function : - - __iscsym - -See MSDN for more details. ---*/ -int -__cdecl -__iscsym( int c ) -{ - PERF_ENTRY(__iscsym); - ENTRY( "__iscsym( c=%d )\n", c ); - - if ( isalnum( c ) || c == '_' ) - { - LOGEXIT( "__iscsym returning 1\n" ); - PERF_EXIT(__iscsym); - return 1; - } - - LOGEXIT( "__iscsym returning 0\n" ); - PERF_EXIT(__iscsym); - return 0; -} - - -/*++ - -Function : - - PAL_errno - - Returns the address of the errno. - ---*/ -int * __cdecl PAL_errno( int caller ) -{ - int *retval; - PERF_ENTRY(errno); - ENTRY( "PAL_errno( void )\n" ); - retval = (INT*)(&errno); - LOGEXIT("PAL_errno returns %p\n",retval); - PERF_EXIT(errno); - return retval; -} - - -/*++ -Function: - - rand - - The RAND_MAX value can vary by platform. - -See MSDN for more details. ---*/ -int -__cdecl -PAL_rand(void) -{ - int ret; - PERF_ENTRY(rand); - ENTRY("rand(void)\n"); - - ret = (rand() % (PAL_RAND_MAX + 1)); - - LOGEXIT("rand() returning %d\n", ret); - PERF_EXIT(rand); - return ret; -} - - -/*++ -Function: - - time - -See MSDN for more details. ---*/ -PAL_time_t -__cdecl -PAL_time(PAL_time_t *tloc) -{ - time_t result; - - PERF_ENTRY(time); - ENTRY( "time( tloc=%p )\n",tloc ); - - time_t t; - result = time(&t); - if (tloc != NULL) - { - *tloc = t; - } - - LOGEXIT( "time returning %#lx\n",result ); - PERF_EXIT(time); - return result; -} - -PALIMPORT -void __cdecl -PAL_qsort(void *base, size_t nmemb, size_t size, - int (__cdecl *compar )(const void *, const void *)) -{ - PERF_ENTRY(qsort); - ENTRY("qsort(base=%p, nmemb=%lu, size=%lu, compar=%p\n", - base,(unsigned long) nmemb,(unsigned long) size, compar); - -/* reset ENTRY nesting level back to zero, qsort will invoke app-defined - callbacks and we want their entry traces... */ -#if _ENABLE_DEBUG_MESSAGES_ -{ - int old_level; - old_level = DBG_change_entrylevel(0); -#endif /* _ENABLE_DEBUG_MESSAGES_ */ - - qsort(base,nmemb,size,compar); - -/* ...and set nesting level back to what it was */ -#if _ENABLE_DEBUG_MESSAGES_ - DBG_change_entrylevel(old_level); -} -#endif /* _ENABLE_DEBUG_MESSAGES_ */ - - LOGEXIT("qsort returns\n"); - PERF_EXIT(qsort); -} - -PALIMPORT -void * __cdecl -PAL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, - int (__cdecl *compar)(const void *, const void *)) -{ - void *retval; - - PERF_ENTRY(bsearch); - ENTRY("bsearch(key=%p, base=%p, nmemb=%lu, size=%lu, compar=%p\n", - key, base, (unsigned long) nmemb, (unsigned long) size, compar); - -/* reset ENTRY nesting level back to zero, bsearch will invoke app-defined - callbacks and we want their entry traces... */ -#if _ENABLE_DEBUG_MESSAGES_ -{ - int old_level; - old_level = DBG_change_entrylevel(0); -#endif /* _ENABLE_DEBUG_MESSAGES_ */ - - retval = bsearch(key,base,nmemb,size,compar); - -/* ...and set nesting level back to what it was */ -#if _ENABLE_DEBUG_MESSAGES_ - DBG_change_entrylevel(old_level); -} -#endif /* _ENABLE_DEBUG_MESSAGES_ */ - - LOGEXIT("bsearch returns %p\n",retval); - PERF_EXIT(bsearch); - return retval; -} - -#ifdef HOST_AMD64 - -PALIMPORT -unsigned int PAL__mm_getcsr(void) -{ - return _mm_getcsr(); -} - -PALIMPORT -void PAL__mm_setcsr(unsigned int i) -{ - _mm_setcsr(i); -} - -#endif // HOST_AMD64 - -/*++ -Function: -PAL_memcpy - -Overlapping buffer-safe version of memcpy. -See MSDN doc for memcpy ---*/ -EXTERN_C -PALIMPORT -void *PAL_memcpy (void *dest, const void *src, size_t count) -{ - UINT_PTR x = (UINT_PTR)dest, y = (UINT_PTR)src; - _ASSERTE((x + count <= y) || (y + count <= x)); - - void *ret; - #undef memcpy - ret = memcpy(dest, src, count); - return ret; -} diff --git a/src/shared/pal/src/cruntime/printf.cpp b/src/shared/pal/src/cruntime/printf.cpp deleted file mode 100644 index f08f6475da..0000000000 --- a/src/shared/pal/src/cruntime/printf.cpp +++ /dev/null @@ -1,892 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - printf.c - -Abstract: - - Implementation of the printf family functions. - -Revision History: - - - ---*/ - -#include "pal/palinternal.h" -#include "pal/dbgmsg.h" -#include "pal/cruntime.h" -#include "pal/thread.hpp" -#include "pal/threadsusp.hpp" -#include "pal/printfcpp.hpp" - -/* needs to be included after "palinternal.h" to avoid name - collision for va_start and va_end */ -#include -#include - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - -#if SSCANF_SUPPORT_ll -const static char *scanf_longlongfmt = "ll"; -#else -const static char *scanf_longlongfmt = "q"; -#endif - -#if SSCANF_CANNOT_HANDLE_MISSING_EXPONENT -static int SscanfFloatCheckExponent(LPCSTR buff, LPCSTR floatFmt, - void * voidPtr, int * pn); -#endif // SSCANF_CANNOT_HANDLE_MISSING_EXPONENT - -/******************************************************************************* -Function: - PAL_printf_arg_remover - -Parameters: - ap - - pointer to the va_list from which to remove arguments - Width - - the width of the current format operation - Precision - - the precision of the current format option - Type - - the type of the argument for the current format option - Prefix - - the prefix for the current format option -*******************************************************************************/ -void PAL_printf_arg_remover(va_list *ap, INT Width, INT Precision, INT Type, INT Prefix) -{ - /* remove arg and precision if needed */ - if (PRECISION_STAR == Precision || - PRECISION_INVALID == Precision) - { - (void)va_arg(*ap, int); - } - if (WIDTH_STAR == Width || - WIDTH_INVALID == Width) - { - (void)va_arg(*ap, int); - } - if (Type == PFF_TYPE_FLOAT) - { - (void)va_arg(*ap, double); - } - else if (Type == PFF_TYPE_INT && Prefix == PFF_PREFIX_LONGLONG) - { - (void)va_arg(*ap, INT64); - } - else if (Type == PFF_TYPE_INT || Type == PFF_TYPE_CHAR) - { - (void)va_arg(*ap, int); - } - else - { - (void)va_arg(*ap, void *); - } -} - -/*++ -Function: - PAL_printf - -See MSDN doc. ---*/ -int -__cdecl -PAL_printf( - const char *format, - ...) -{ - LONG Length; - va_list ap; - - PERF_ENTRY(printf); - ENTRY("PAL_printf (format=%p (%s))\n", format, format); - - va_start(ap, format); - Length = PAL_vprintf(format, ap); - va_end(ap); - - LOGEXIT("PAL_printf returns int %d\n", Length); - PERF_EXIT(printf); - return Length; -} - -/*++ -Function: - PAL_fprintf - -See MSDN doc. ---*/ -int -__cdecl -PAL_fprintf(PAL_FILE *stream,const char *format,...) -{ - LONG Length = 0; - va_list ap; - - PERF_ENTRY(fprintf); - ENTRY("PAL_fprintf(stream=%p,format=%p (%s))\n",stream, format, format); - - va_start(ap, format); - Length = PAL_vfprintf( stream, format, ap); - va_end(ap); - - LOGEXIT("PAL_fprintf returns int %d\n", Length); - PERF_EXIT(fprintf); - return Length; -} - -/*++ -Function: - PAL_wprintf - -See MSDN doc. ---*/ -int -__cdecl -PAL_wprintf( - const wchar_16 *format, - ...) -{ - LONG Length; - va_list ap; - - PERF_ENTRY(wprintf); - ENTRY("PAL_wprintf (format=%p (%S))\n", format, format); - - va_start(ap, format); - Length = PAL_vfwprintf( PAL_get_stdout(PAL_get_caller), format, ap); - va_end(ap); - - LOGEXIT("PAL_wprintf returns int %d\n", Length); - PERF_EXIT(wprintf); - return Length; -} - - - -/*++ -Function: - PAL_vprintf - -See MSDN doc. ---*/ -int -__cdecl -PAL_vprintf( - const char *format, - va_list ap) -{ - LONG Length; - - PERF_ENTRY(vprintf); - ENTRY("PAL_vprintf (format=%p (%s))\n", format, format); - - Length = PAL_vfprintf( PAL_get_stdout(PAL_get_caller), format, ap); - - LOGEXIT("PAL_vprintf returns int %d\n", Length); - PERF_EXIT(vprintf); - return Length; -} - - -/*++ -Function: - fwprintf - -See MSDN doc. ---*/ -int -__cdecl -PAL_fwprintf( - PAL_FILE *stream, - const wchar_16 *format, - ...) -{ - LONG Length; - va_list ap; - - PERF_ENTRY(fwprintf); - ENTRY("PAL_fwprintf (stream=%p, format=%p (%S))\n", stream, format, format); - - va_start(ap, format); - Length = PAL_vfwprintf( stream, format, ap); - va_end(ap); - - LOGEXIT("PAL_fwprintf returns int %d\n", Length); - PERF_EXIT(fwprintf); - return Length; -} - -/******************************************************************************* -Function: - Internal_ScanfExtractFormatW - -Paramaters: - Fmt - - format string to parse - - first character must be a '%' - - paramater gets updated to point to the character after - the % format string - Out - - buffer will contain the % format string - Store - - boolean value representing whether to store the type to be parsed - - '*' flag - Width - - will contain the width specified by the format string - - -1 if none given - Prefix - - an enumeration of the type prefix - Type - - an enumeration of the value type to be parsed - -Notes: - - I'm also handling the undocumented %ws, %wc, %w... -*******************************************************************************/ -static BOOL Internal_ScanfExtractFormatW(LPCWSTR *Fmt, LPSTR Out, int iOutSize, LPBOOL Store, - LPINT Width, LPINT Prefix, LPINT Type) -{ - BOOL Result = FALSE; - LPSTR TempStr; - LPSTR TempStrPtr; - - *Width = -1; - *Store = TRUE; - *Prefix = -1; - *Type = -1; - - if (*Fmt && **Fmt == '%') - { - *Out++ = *(*Fmt)++; - } - else - { - return Result; - } - - /* we'll never need a temp string longer than the original */ - TempStrPtr = TempStr = (LPSTR) PAL_malloc(PAL_wcslen(*Fmt)+1); - if (!TempStr) - { - ERROR("PAL_malloc failed\n"); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return Result; - } - - /* parse '*' flag which means don't store */ - if (**Fmt == '*') - { - *Store = FALSE; - *Out++ = *(*Fmt)++; - } - - /* grab width specifier */ - if (isdigit(**Fmt)) - { - TempStrPtr = TempStr; - while (isdigit(**Fmt)) - { - *TempStrPtr++ = **Fmt; - *Out++ = *(*Fmt)++; - } - *TempStrPtr = 0; /* end string */ - *Width = atoi(TempStr); - if (*Width < 0) - { - ERROR("atoi returned a negative value indicative of an overflow.\n"); - SetLastError(ERROR_INTERNAL_ERROR); - goto EXIT; - } - } - -#ifdef HOST_64BIT - if (**Fmt == 'p') - { - *Prefix = SCANF_PREFIX_LONGLONG; - } -#endif - /* grab prefix of 'I64' for __int64 */ - if ((*Fmt)[0] == 'I' && (*Fmt)[1] == '6' && (*Fmt)[2] == '4') - { - /* convert to 'q'/'ll' so that Unix sscanf can handle it */ - *Fmt += 3; - *Prefix = SCANF_PREFIX_LONGLONG; - } - /* grab a prefix of 'h' */ - else if (**Fmt == 'h') - { - *Prefix = SCANF_PREFIX_SHORT; - ++(*Fmt); - } - /* grab prefix of 'l' or the undocumented 'w' (at least in MSDN) */ - else if (**Fmt == 'l' || **Fmt == 'w') - { - ++(*Fmt); -#ifdef HOST_64BIT - // Only want to change the prefix on 64 bit when inputing characters. - if (**Fmt == 'C' || **Fmt == 'S') -#endif - { - *Prefix = SCANF_PREFIX_LONG; /* give it a wide prefix */ - } - if (**Fmt == 'l') - { - *Prefix = SCANF_PREFIX_LONGLONG; - ++(*Fmt); - } - } - else if (**Fmt == 'L') - { - /* a prefix of 'L' seems to be ignored */ - ++(*Fmt); - } - - /* grab type 'c' */ - if (**Fmt == 'c' || **Fmt == 'C') - { - *Type = SCANF_TYPE_CHAR; - if (*Prefix != SCANF_PREFIX_SHORT && **Fmt == 'c') - { - *Prefix = SCANF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == SCANF_PREFIX_LONG) - { - *Out++ = 'l'; - } - *Out++ = 'c'; - ++(*Fmt); - Result = TRUE; - } - /* grab type 's' */ - else if (**Fmt == 's' || **Fmt == 'S') - { - *Type = SCANF_TYPE_STRING; - if (*Prefix != SCANF_PREFIX_SHORT && **Fmt == 's') - { - *Prefix = SCANF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == SCANF_PREFIX_LONG) - { - *Out++ = 'l'; - } - *Out++ = 's'; - ++(*Fmt); - Result = TRUE; - } - /* grab int types */ - else if (**Fmt == 'd' || **Fmt == 'i' || **Fmt == 'o' || - **Fmt == 'u' || **Fmt == 'x' || **Fmt == 'X' || - **Fmt == 'p') - { - *Type = SCANF_TYPE_INT; - if (*Prefix == SCANF_PREFIX_SHORT) - { - *Out++ = 'h'; - } - else if (*Prefix == SCANF_PREFIX_LONG) - { - *Out++ = 'l'; - } - else if (*Prefix == SCANF_PREFIX_LONGLONG) - { - if (strcpy_s(Out, iOutSize, scanf_longlongfmt) != SAFECRT_SUCCESS) - { - ERROR("strcpy_s failed\n"); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - goto EXIT; - } - - Out += strlen(scanf_longlongfmt); - } - *Out++ = *(*Fmt)++; - Result = TRUE; - } - else if (**Fmt == 'e' || **Fmt == 'E' || **Fmt == 'f' || - **Fmt == 'g' || **Fmt == 'G') - { - /* we can safely ignore the prefixes and only add the type*/ - *Type = SCANF_TYPE_FLOAT; - /* this gets rid of %E/%G since they're they're the - same when scanning */ - *Out++ = tolower( *(*Fmt)++ ); - Result = TRUE; - } - else if (**Fmt == 'n') - { - if (*Prefix == SCANF_PREFIX_SHORT) - { - *Out++ = 'h'; - } - *Out++ = *(*Fmt)++; - *Type = SCANF_TYPE_N; - Result = TRUE; - } - else if (**Fmt == '[') - { - /* There is a small compatibility problem in the handling of the [] - option in FreeBSD vs. Windows. In Windows, you can have [z-a] - as well as [a-z]. In FreeBSD, [z-a] fails. So, we need to - reverse the instances of z-a to a-z (and [m-e] to [e-m], etc). */ - - /* step 1 : copy the leading [ */ - *Out++ = '['; - (*Fmt)++; - - /* step 2 : copy a leading ^, if present */ - if( '^' == **Fmt ) - { - *Out++ = '^'; - (*Fmt)++; - } - - /* step 3 : copy a leading ], if present; a ] immediately after the - leading [ (or [^) does *not* end the sequence, it is part of the - characters to match */ - if( ']' == **Fmt ) - { - *Out++ = ']'; - (*Fmt)++; - } - - /* step 4 : if the next character is already a '-', it's not part of an - interval specifier, so just copy it */ - if('-' == **Fmt ) - { - *Out++ = '-'; - (*Fmt)++; - } - - /* ok then, process the rest of it */ - while( '\0' != **Fmt ) - { - if(']' == **Fmt) - { - /* ']' marks end of the format specifier; we're done */ - *Out++ = ']'; - (*Fmt)++; - break; - } - if('-' == **Fmt) - { - if( ']' == (*Fmt)[1] ) - { - /* got a '-', next character is the terminating ']'; - copy '-' literally */ - *Out++ = '-'; - (*Fmt)++; - } - else - { - /* got a '-' indicating an interval specifier */ - unsigned char prev, next; - - /* get the interval boundaries */ - prev = (*Fmt)[-1]; - next = (*Fmt)[1]; - - /* if boundaries were inverted, replace the already-copied - low boundary by the 'real' low boundary */ - if( prev > next ) - { - Out[-1] = next; - - /* ...and save the 'real' upper boundary, which will be - copied to 'Out' below */ - next = prev; - } - - *Out++ = '-'; - *Out++ = next; - - /* skip over the '-' and the next character, which we - already copied */ - (*Fmt)+=2; - } - } - else - { - /* plain character; just copy it */ - *Out++ = **Fmt; - (*Fmt)++; - } - } - - *Type = SCANF_TYPE_BRACKETS; - Result = TRUE; - } - else if (**Fmt == ' ') - { - *Type = SCANF_TYPE_SPACE; - } - - /* add %n so we know how far to increment the pointer */ - *Out++ = '%'; - *Out++ = 'n'; - - *Out = 0; /* end the string */ - -EXIT: - PAL_free(TempStr); - return Result; -} - -/******************************************************************************* -Function: - PAL_wvsscanf - - Buffer - - buffer to parse values from - Format - - format string - ap - - stdarg parameter list -*******************************************************************************/ -int PAL_wvsscanf(LPCWSTR Buffer, LPCWSTR Format, va_list ap) -{ - INT Length = 0; - LPCWSTR Buff = Buffer; - LPCWSTR Fmt = Format; - CHAR TempBuff[1024]; /* used to hold a single % format string */ - BOOL Store; - INT Width; - INT Prefix; - INT Type = -1; - - while (*Fmt) - { - if (!*Buff && Length == 0) - { - Length = EOF; - break; - } - /* remove any number of blanks */ - else if (isspace(*Fmt)) - { - while (isspace(*Buff)) - { - ++Buff; - } - ++Fmt; - } - else if (*Fmt == '%' && - Internal_ScanfExtractFormatW(&Fmt, TempBuff, sizeof(TempBuff), &Store, - &Width, &Prefix, &Type)) - { - if (Prefix == SCANF_PREFIX_LONG && - (Type == SCANF_TYPE_STRING || Type == SCANF_TYPE_CHAR)) - { - int len = 0; - WCHAR *charPtr = 0; - - /* a single character */ - if (Type == SCANF_TYPE_CHAR && Width == -1) - { - len = Width = 1; - } - - /* calculate length of string to copy */ - while (Buff[len] && !isspace(Buff[len])) - { - if (Width != -1 && len >= Width) - { - break; - } - ++len; - } - - if (Store) - { - int i; - charPtr = va_arg(ap, WCHAR *); - - for (i = 0; i < len; i++) - { - charPtr[i] = Buff[i]; - } - if (Type == SCANF_TYPE_STRING) - { - /* end string */ - charPtr[len] = 0; - } - ++Length; - } - Buff += len; - } - /* this places the number of bytes stored into the next arg */ - else if (Type == SCANF_TYPE_N) - { - if (Prefix == SCANF_PREFIX_SHORT) - { - *(va_arg(ap, short *)) = Buff - Buffer; - } - else - { - *(va_arg(ap, LPLONG)) = Buff - Buffer; - } - } - /* types that sscanf can handle */ - else - { - int ret; - int n; - int size; - LPSTR newBuff = 0; - LPVOID voidPtr = NULL; - - size = WideCharToMultiByte(CP_ACP, 0, Buff, -1, 0, 0, 0, 0); - if (!size) - { - ASSERT("WideCharToMultiByte failed. Error is %d\n", - GetLastError()); - return -1; - } - newBuff = (LPSTR) PAL_malloc(size); - if (!newBuff) - { - ERROR("PAL_malloc failed\n"); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return -1; - } - size = WideCharToMultiByte(CP_ACP, 0, Buff, size, - newBuff, size, 0, 0); - if (!size) - { - ASSERT("WideCharToMultiByte failed. Error is %d\n", - GetLastError()); - PAL_free(newBuff); - return -1; - } - - if (Store) - { - if (Type == SCANF_TYPE_BRACKETS) - { - WCHAR *strPtr; - int i; - - /* add a '*' to %[] --> %*[] */ - i = strlen(TempBuff) + 1; - while (i) - { - /* shift everything right one */ - TempBuff[i] = TempBuff[i - 1]; - --i; - } - TempBuff[0] = '%'; - TempBuff[1] = '*'; - - /* %n doesn't count as a conversion. Since we're - suppressing conversion of the %[], sscanf will - always return 0, so we can't use the return value - to determine success. Set n to 0 before the call; if - it's still 0 afterwards, we know the call failed */ - n = 0; - sscanf_s(newBuff, TempBuff, &n); - if(0 == n) - { - /* sscanf failed, nothing matched. set ret to 0, - so we know we have to break */ - ret = 0; - } - else - { - strPtr = va_arg(ap, WCHAR *); - for (i = 0; i < n; i++) - { - strPtr[i] = Buff[i]; - } - strPtr[n] = 0; /* end string */ - ret = 1; - } - } - else - { - voidPtr = va_arg(ap, LPVOID); - // sscanf_s requires that if we are trying to read "%s" or "%c", then - // the size of the buffer must follow the buffer we are trying to read into. - unsigned typeLen = 0; - if (Type == SCANF_TYPE_STRING) - { - // We don’t really know the size of the destination buffer provided by the - // caller. So we have to assume that the caller has allocated enough space - // to hold either the width specified in the format or the entire input - // string plus ‘\0’. - typeLen = ((Width > 0) ? Width : PAL_wcslen(Buffer)) + 1; - } - else if (Type == SCANF_TYPE_CHAR) - { - // Check whether the format string contains number of characters - // that should be read from the input string. - // Note: ‘\0’ does not get appended in the “%c” case. - typeLen = (Width > 0) ? Width : 1; - } - - if (typeLen > 0) - { - ret = sscanf_s(newBuff, TempBuff, voidPtr, typeLen, &n); - } - else - ret = sscanf_s(newBuff, TempBuff, voidPtr, &n); - } - } - else - { - ret = sscanf_s(newBuff, TempBuff, &n); - } - -#if SSCANF_CANNOT_HANDLE_MISSING_EXPONENT - if ((ret == 0) && (Type == SCANF_TYPE_FLOAT)) - { - ret = SscanfFloatCheckExponent(newBuff, TempBuff, voidPtr, &n); - } -#endif // SSCANF_CANNOT_HANDLE_MISSING_EXPONENT - - PAL_free(newBuff); - if (ret > 0) - { - Length += ret; - } - else - { - /* no match; break scan */ - break; - } - Buff += n; - } - } - else - { - /* grab, but not store */ - if (*Fmt == *Buff && Type != SCANF_TYPE_SPACE) - { - ++Fmt; - ++Buff; - } - /* doesn't match, break scan */ - else - { - break; - } - } - } - - return Length; -} - -/*++ -Function: - PAL_swscanf - -See MSDN doc. ---*/ -int -__cdecl -PAL_swscanf( - const wchar_16 *buffer, - const wchar_16 *format, - ...) -{ - int Length; - va_list ap; - - PERF_ENTRY(swscanf); - ENTRY("PAL_swscanf (buffer=%p (%S), format=%p (%S))\n", buffer, buffer, format, format); - - va_start(ap, format); - Length = PAL_wvsscanf(buffer, format, ap); - va_end(ap); - - LOGEXIT("PAL_swscanf returns int %d\n", Length); - PERF_EXIT(swscanf); - return Length; -} - - -#if SSCANF_CANNOT_HANDLE_MISSING_EXPONENT -/*++ -Function: - SscanfFloatCheckExponent - - Parameters: - buff: pointer to the buffer to be parsed; the target float must be at - the beginning of the buffer, except for any number of leading - spaces - floatFmt: must be "%e%n" (or "%f%n" or "%g%n") - voidptr: optional pointer to output variable (which should be a float) - pn: pointer to an int to receive the number of bytes parsed. - - Notes: - On some platforms (specifically AIX) sscanf fails to parse a float from - a string such as 12.34e (while it succeeds for e.g. 12.34a). Sscanf - initially interprets the 'e' as the keyword for the beginning of a - 10-exponent of a floating point in scientific notation (as in 12.34e5), - but then it fails to parse the actual exponent. At this point sscanf should - be able to fall back on the narrower pattern, and parse the floating point - in common decimal notation (i.e. 12.34). However AIX's sscanf fails to do - so and it does not parse any number. - This function checks the given string for a such case and removes - the 'e' before parsing the float. - ---*/ - -static int SscanfFloatCheckExponent(LPCSTR buff, LPCSTR floatFmt, - void * voidPtr, int * pn) -{ - int ret = 0; - int digits = 0; - int points = 0; - LPCSTR pos = buff; - - /* skip initial spaces */ - while (*pos && isspace(*pos)) - pos++; - - /* go to the end of a float, if there is one */ - while (*pos) - { - if (isdigit(*pos)) - digits++; - else if (*pos == '.') - { - if (++points > 1) - break; - } - else - break; - - pos++; - } - - /* check if it is something like 12.34e and the trailing 'e' is not - the suffix of a valid exponent of 10, such as 12.34e+5 */ - if ( digits > 0 && *pos && tolower(*pos) == 'e' && - !( *(pos+1) && - ( isdigit(*(pos+1)) || - ( (*(pos+1) == '+' || *(pos+1) == '-') && isdigit(*(pos+2)) ) - ) - ) - ) - { - CHAR * pLocBuf = (CHAR *)PAL_malloc((pos-buff+1)*sizeof(CHAR)); - if (pLocBuf) - { - memcpy(pLocBuf, buff, (pos-buff)*sizeof(CHAR)); - pLocBuf[pos-buff] = 0; - if (voidPtr) - ret = sscanf_s(pLocBuf, floatFmt, voidPtr, pn); - else - ret = sscanf_s(pLocBuf, floatFmt, pn); - PAL_free (pLocBuf); - } - } - return ret; -} -#endif // SSCANF_CANNOT_HANDLE_MISSING_EXPONENT diff --git a/src/shared/pal/src/cruntime/printfcpp.cpp b/src/shared/pal/src/cruntime/printfcpp.cpp deleted file mode 100644 index fee79c91df..0000000000 --- a/src/shared/pal/src/cruntime/printfcpp.cpp +++ /dev/null @@ -1,1782 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - printfcpp.cpp - -Abstract: - - Implementation of suspension safe printf functions. - -Revision History: - - - ---*/ - -#include "pal/corunix.hpp" -#include "pal/thread.hpp" -#include "pal/malloc.hpp" -#include "pal/file.hpp" -#include "pal/printfcpp.hpp" -#include "pal/palinternal.h" -#include "pal/dbgmsg.h" -#include "pal/cruntime.h" - -#include - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - -using namespace CorUnix; - -static const char __nullstring[] = "(null)"; /* string to print on null ptr */ -static const WCHAR __wnullstring[] = W("(null)"); /* string to print on null ptr */ - -int CoreVfprintf(CPalThread *pthrCurrent, PAL_FILE *stream, const char *format, va_list ap); -int CoreVfwprintf(CPalThread *pthrCurrent, PAL_FILE *stream, const wchar_16 *format, va_list ap); - -extern "C" -{ - -/******************************************************************************* -Function: - Internal_Convertfwrite - This function is a wrapper around fwrite for cases where the buffer has - to be converted from WideChar to MultiByte -*******************************************************************************/ - -static int Internal_Convertfwrite(CPalThread *pthrCurrent, const void *buffer, size_t size, size_t count, FILE *stream, BOOL convert) -{ - int ret; - int iError = 0; - -#if FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL - clearerr (stream); -#endif - - - if(convert) - { - int nsize; - LPSTR newBuff = 0; - nsize = WideCharToMultiByte(CP_ACP, 0,(LPCWSTR)buffer, count, 0, 0, 0, 0); - if (!nsize) - { - if (count == 0) - return 0; - ASSERT("WideCharToMultiByte failed. Error is %d\n", GetLastError()); - return -1; - } - newBuff = (LPSTR) InternalMalloc(nsize); - if (!newBuff) - { - ERROR("InternalMalloc failed\n"); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return -1; - } - nsize = WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)buffer, count, newBuff, nsize, 0, 0); - if (!nsize) - { - ASSERT("WideCharToMultiByte failed. Error is %d\n", GetLastError()); - free(newBuff); - return -1; - } - ret = InternalFwrite(newBuff, 1, nsize, stream, &iError); - if (iError != 0) - { - ERROR("InternalFwrite did not write the whole buffer. Error is %d\n", iError); - free(newBuff); - return -1; - } - free(newBuff); - } - else - { - ret = InternalFwrite(buffer, size, count, stream, &iError); - if (iError != 0) - { - ERROR("InternalFwrite did not write the whole buffer. Error is %d\n", iError); - return -1; - } - } - return ret; - -} - -/******************************************************************************* -Function: - Internal_ExtractFormatA - -Paramaters: - Fmt - - format string to parse - - first character must be a '%' - - paramater gets updated to point to the character after - the % format string - Out - - buffer will contain the % format string - Flags - - paramater will be set with the PRINTF_FORMAT_FLAGS defined above - Width - - will contain the width specified by the format string - - -1 if none given - Precision - - will contain the precision specified in the format string - - -1 if none given - Prefix - - an enumeration of the type prefix - Type - - an enumeration of the type value - -Notes: - - I'm also handling the undocumented %ws, %wc, %w... - - %#10x, when we have a width greater than the length (i.e padding) the - length of the padding is not consistent with MS's wsprintf - (MS adds an extra 2 padding chars, length of "0x") - - MS's wsprintf seems to ingore a 'h' prefix for number types - - MS's "%p" is different than gcc's - e.g. printf("%p", NULL); - MS --> 00000000 - gcc --> 0x0 - - the length of the exponent (precision) for floating types is different - between MS and gcc - e.g. printf("%E", 256.0); - MS --> 2.560000E+002 - gcc --> 2.560000E+02 -*******************************************************************************/ -BOOL Internal_ExtractFormatA(CPalThread *pthrCurrent, LPCSTR *Fmt, LPSTR Out, LPINT Flags, - LPINT Width, LPINT Precision, LPINT Prefix, LPINT Type) -{ - BOOL Result = FALSE; - LPSTR TempStr; - LPSTR TempStrPtr; - - *Width = WIDTH_DEFAULT; - *Precision = PRECISION_DEFAULT; - *Flags = PFF_NONE; - *Prefix = PFF_PREFIX_DEFAULT; - *Type = PFF_TYPE_DEFAULT; - - if (*Fmt && **Fmt == '%') - { - *Out++ = *(*Fmt)++; - } - else - { - return Result; - } - - /* we'll never need a temp string longer than the original */ - TempStrPtr = TempStr = (LPSTR) InternalMalloc(strlen(*Fmt)+1); - if (!TempStr) - { - ERROR("InternalMalloc failed\n"); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return Result; - } - - /* parse flags */ - while (**Fmt && (**Fmt == '-' || **Fmt == '+' || - **Fmt == '0' || **Fmt == ' ' || **Fmt == '#')) - { - switch (**Fmt) - { - case '-': - *Flags |= PFF_MINUS; break; - case '+': - *Flags |= PFF_PLUS; break; - case '0': - *Flags |= PFF_ZERO; break; - case ' ': - *Flags |= PFF_SPACE; break; - case '#': - *Flags |= PFF_POUND; break; - } - *Out++ = *(*Fmt)++; - } - /* '-' flag negates '0' flag */ - if ((*Flags & PFF_MINUS) && (*Flags & PFF_ZERO)) - { - *Flags -= PFF_ZERO; - } - - /* grab width specifier */ - if (isdigit((unsigned char) **Fmt)) - { - TempStrPtr = TempStr; - while (isdigit((unsigned char) **Fmt)) - { - *TempStrPtr++ = **Fmt; - *Out++ = *(*Fmt)++; - } - *TempStrPtr = 0; /* end string */ - *Width = atoi(TempStr); - if (*Width < 0) - { - ERROR("atoi returned a negative value indicative of an overflow.\n"); - pthrCurrent->SetLastError(ERROR_INTERNAL_ERROR); - goto EXIT; - } - } - else if (**Fmt == '*') - { - *Width = WIDTH_STAR; - *Out++ = *(*Fmt)++; - if (isdigit((unsigned char) **Fmt)) - { - /* this is an invalid width because we have a * then a number */ - /* printf handles this by just printing the whole string */ - *Width = WIDTH_INVALID; - while (isdigit((unsigned char) **Fmt)) - { - *Out++ = *(*Fmt)++; - } - } - } - - - /* grab precision specifier */ - if (**Fmt == '.') - { - *Out++ = *(*Fmt)++; - if (isdigit((unsigned char) **Fmt)) - { - TempStrPtr = TempStr; - while (isdigit((unsigned char) **Fmt)) - { - *TempStrPtr++ = **Fmt; - *Out++ = *(*Fmt)++; - } - *TempStrPtr = 0; /* end string */ - *Precision = atoi(TempStr); - if (*Precision < 0) - { - ERROR("atoi returned a negative value indicative of an overflow.\n"); - pthrCurrent->SetLastError(ERROR_INTERNAL_ERROR); - goto EXIT; - } - } - else if (**Fmt == '*') - { - *Precision = PRECISION_STAR; - *Out++ = *(*Fmt)++; - if (isdigit((unsigned char) **Fmt)) - { - /* this is an invalid precision because we have a .* then a number */ - /* printf handles this by just printing the whole string */ - *Precision = PRECISION_INVALID; - while (isdigit((unsigned char) **Fmt)) - { - *Out++ = *(*Fmt)++; - } - } - } - else - { - *Precision = PRECISION_DOT; - } - } - -#ifdef HOST_64BIT - if (**Fmt == 'p') - { - *Prefix = PFF_PREFIX_LONGLONG; - } -#endif - if ((*Fmt)[0] == 'I') - { - /* grab prefix of 'I64' for __int64 */ - if ((*Fmt)[1] == '6' && (*Fmt)[2] == '4') - { - /* convert to 'll' so that Unix snprintf can handle it */ - *Fmt += 3; - *Prefix = PFF_PREFIX_LONGLONG; - } - /* grab prefix of 'I32' for __int32 */ - else if ((*Fmt)[1] == '3' && (*Fmt)[2] == '2') - { - *Fmt += 3; - } - else - { - ++(*Fmt); - #ifdef HOST_64BIT - /* convert to 'll' so that Unix snprintf can handle it */ - *Prefix = PFF_PREFIX_LONGLONG; - #endif - } - } - /* grab a prefix of 'h' */ - else if (**Fmt == 'h') - { - *Prefix = PFF_PREFIX_SHORT; - ++(*Fmt); - } - /* grab prefix of 'l' or the undocumented 'w' (at least in MSDN) */ - else if (**Fmt == 'l' || **Fmt == 'w') - { - ++(*Fmt); -#ifdef HOST_64BIT - // Only want to change the prefix on 64 bit when printing characters. - if (**Fmt == 'c' || **Fmt == 's') -#endif - { - *Prefix = PFF_PREFIX_LONG; - } - if (**Fmt == 'l') - { - *Prefix = PFF_PREFIX_LONGLONG; - ++(*Fmt); - } - } - else if (**Fmt == 'L') - { - /* a prefix of 'L' seems to be ignored */ - ++(*Fmt); - } - - /* grab type 'c' */ - if (**Fmt == 'c' || **Fmt == 'C') - { - *Type = PFF_TYPE_CHAR; - if (*Prefix != PFF_PREFIX_SHORT && **Fmt == 'C') - { - *Prefix = PFF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == PFF_PREFIX_LONG) - { - *Out++ = 'l'; - } - *Out++ = 'c'; - ++(*Fmt); - Result = TRUE; - } - /* grab type 's' */ - else if (**Fmt == 's' || **Fmt == 'S') - { - *Type = PFF_TYPE_STRING; - if (*Prefix != PFF_PREFIX_SHORT && **Fmt == 'S') - { - *Prefix = PFF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == PFF_PREFIX_LONG) - { - *Out++ = 'l'; - } - *Out++ = 's'; - ++(*Fmt); - Result = TRUE; - } - /* grab int types */ - else if (**Fmt == 'd' || **Fmt == 'i' || **Fmt == 'o' || - **Fmt == 'u' || **Fmt == 'x' || **Fmt == 'X') - { - *Type = PFF_TYPE_INT; - if (*Prefix == PFF_PREFIX_SHORT) - { - *Out++ = 'h'; - } - else if (*Prefix == PFF_PREFIX_LONG) - { - *Out++ = 'l'; - } - else if (*Prefix == PFF_PREFIX_LONGLONG) - { - *Out++ = 'l'; - *Out++ = 'l'; - } - *Out++ = *(*Fmt)++; - Result = TRUE; - } - else if (**Fmt == 'e' || **Fmt == 'E' || **Fmt == 'f' || - **Fmt == 'g' || **Fmt == 'G') - { - /* we can safely ignore the prefixes and only add the type*/ - *Type = PFF_TYPE_FLOAT; - *Out++ = *(*Fmt)++; - Result = TRUE; - } - else if (**Fmt == 'n') - { - if (*Prefix == PFF_PREFIX_SHORT) - { - *Out++ = 'h'; - } - *Out++ = *(*Fmt)++; - *Type = PFF_TYPE_N; - Result = TRUE; - } - else if (**Fmt == 'p') - { - *Type = PFF_TYPE_P; - (*Fmt)++; - - if (*Prefix == PFF_PREFIX_LONGLONG) - { - if (*Precision == PRECISION_DEFAULT) - { - *Precision = 16; - *Out++ = '.'; - *Out++ = '1'; - *Out++ = '6'; - } - /* native *printf does not support %I64p - (actually %llp), so we need to cheat a little bit */ - *Out++ = 'l'; - *Out++ = 'l'; - } - else - { - if (*Precision == PRECISION_DEFAULT) - { - *Precision = 8; - *Out++ = '.'; - *Out++ = '8'; - } - } - *Out++ = 'X'; - Result = TRUE; - } - - *Out = 0; /* end the string */ - -EXIT: - free(TempStr); - return Result; -} - -/******************************************************************************* -Function: - Internal_ExtractFormatW - - -- see Internal_ExtractFormatA above -*******************************************************************************/ -BOOL Internal_ExtractFormatW(CPalThread *pthrCurrent, LPCWSTR *Fmt, LPSTR Out, LPINT Flags, - LPINT Width, LPINT Precision, LPINT Prefix, LPINT Type) -{ - BOOL Result = FALSE; - LPSTR TempStr; - LPSTR TempStrPtr; - - *Width = WIDTH_DEFAULT; - *Precision = PRECISION_DEFAULT; - *Flags = PFF_NONE; - *Prefix = PFF_PREFIX_DEFAULT; - *Type = PFF_TYPE_DEFAULT; - - if (*Fmt && **Fmt == '%') - { - *Out++ = (CHAR) *(*Fmt)++; - } - else - { - return Result; - } - - /* we'll never need a temp string longer than the original */ - TempStrPtr = TempStr = (LPSTR) InternalMalloc(PAL_wcslen(*Fmt)+1); - if (!TempStr) - { - ERROR("InternalMalloc failed\n"); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return Result; - } - - /* parse flags */ - while (**Fmt && (**Fmt == '-' || **Fmt == '+' || - **Fmt == '0' || **Fmt == ' ' || **Fmt == '#')) - { - switch (**Fmt) - { - case '-': - *Flags |= PFF_MINUS; break; - case '+': - *Flags |= PFF_PLUS; break; - case '0': - *Flags |= PFF_ZERO; break; - case ' ': - *Flags |= PFF_SPACE; break; - case '#': - *Flags |= PFF_POUND; break; - } - *Out++ = (CHAR) *(*Fmt)++; - } - /* '-' flag negates '0' flag */ - if ((*Flags & PFF_MINUS) && (*Flags & PFF_ZERO)) - { - *Flags -= PFF_ZERO; - } - - /* grab width specifier */ - if (isdigit(**Fmt)) - { - TempStrPtr = TempStr; - while (isdigit(**Fmt)) - { - *TempStrPtr++ = (CHAR) **Fmt; - *Out++ = (CHAR) *(*Fmt)++; - } - *TempStrPtr = 0; /* end string */ - *Width = atoi(TempStr); - if (*Width < 0) - { - ERROR("atoi returned a negative value indicative of an overflow.\n"); - pthrCurrent->SetLastError(ERROR_INTERNAL_ERROR); - goto EXIT; - } - } - else if (**Fmt == '*') - { - *Width = WIDTH_STAR; - *Out++ = (CHAR) *(*Fmt)++; - if (isdigit(**Fmt)) - { - /* this is an invalid width because we have a * then a number */ - /* printf handles this by just printing the whole string */ - *Width = WIDTH_INVALID; - while (isdigit(**Fmt)) - { - *Out++ = (CHAR) *(*Fmt)++; - } - } - } - - /* grab precision specifier */ - if (**Fmt == '.') - { - *Out++ = (CHAR) *(*Fmt)++; - if (isdigit(**Fmt)) - { - TempStrPtr = TempStr; - while (isdigit(**Fmt)) - { - *TempStrPtr++ = (CHAR) **Fmt; - *Out++ = (CHAR) *(*Fmt)++; - } - *TempStrPtr = 0; /* end string */ - *Precision = atoi(TempStr); - if (*Precision < 0) - { - ERROR("atoi returned a negative value indicative of an overflow.\n"); - pthrCurrent->SetLastError(ERROR_INTERNAL_ERROR); - goto EXIT; - } - } - else if (**Fmt == '*') - { - *Precision = PRECISION_STAR; - *Out++ = (CHAR) *(*Fmt)++; - if (isdigit(**Fmt)) - { - /* this is an invalid precision because we have a .* then a number */ - /* printf handles this by just printing the whole string */ - *Precision = PRECISION_INVALID; - while (isdigit(**Fmt)) - { - *Out++ = (CHAR) *(*Fmt)++; - } - } - } - else - { - *Precision = PRECISION_DOT; - } - } - -#ifdef HOST_64BIT - if (**Fmt == 'p') - { - *Prefix = PFF_PREFIX_LONGLONG; - } -#endif - if ((*Fmt)[0] == 'I') - { - /* grab prefix of 'I64' for __int64 */ - if ((*Fmt)[1] == '6' && (*Fmt)[2] == '4') - { - /* convert to 'll' so that Unix snprintf can handle it */ - *Fmt += 3; - *Prefix = PFF_PREFIX_LONGLONG; - } - /* grab prefix of 'I32' for __int32 */ - else if ((*Fmt)[1] == '3' && (*Fmt)[2] == '2') - { - *Fmt += 3; - } - else - { - ++(*Fmt); - #ifdef HOST_64BIT - /* convert to 'll' so that Unix snprintf can handle it */ - *Prefix = PFF_PREFIX_LONGLONG; - #endif - } - } - /* grab a prefix of 'h' */ - else if (**Fmt == 'h') - { - *Prefix = PFF_PREFIX_SHORT; - ++(*Fmt); - } - else if (**Fmt == 'l' || **Fmt == 'w') - { - ++(*Fmt); - #ifdef HOST_64BIT - // Only want to change the prefix on 64 bit when printing characters. - if (**Fmt == 'C' || **Fmt == 'S') -#endif - { - *Prefix = PFF_PREFIX_LONG_W; - } - if (**Fmt == 'l') - { - *Prefix = PFF_PREFIX_LONGLONG; - ++(*Fmt); - } - } - else if (**Fmt == 'L') - { - /* a prefix of 'L' seems to be ignored */ - ++(*Fmt); - } - - - /* grab type 'c' */ - if (**Fmt == 'c' || **Fmt == 'C') - { - *Type = PFF_TYPE_CHAR; - if (*Prefix != PFF_PREFIX_SHORT && **Fmt == 'c') - { - *Prefix = PFF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == PFF_PREFIX_LONG || *Prefix == PFF_PREFIX_LONG_W) - { - *Out++ = 'l'; - *Prefix = PFF_PREFIX_LONG; - } - *Out++ = 'c'; - ++(*Fmt); - Result = TRUE; - } - /* grab type 's' */ - else if (**Fmt == 's' || **Fmt == 'S' ) - { - if ( **Fmt == 'S' ) - { - *Type = PFF_TYPE_WSTRING; - } - else - { - *Type = PFF_TYPE_STRING; - } - if (*Prefix != PFF_PREFIX_SHORT && **Fmt == 's') - { - *Prefix = PFF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == PFF_PREFIX_LONG) - { - *Out++ = 'l'; - } - - *Out++ = 's'; - ++(*Fmt); - Result = TRUE; - } - /* grab int types */ - else if (**Fmt == 'd' || **Fmt == 'i' || **Fmt == 'o' || - **Fmt == 'u' || **Fmt == 'x' || **Fmt == 'X') - { - *Type = PFF_TYPE_INT; - if (*Prefix == PFF_PREFIX_SHORT) - { - *Out++ = 'h'; - } - else if (*Prefix == PFF_PREFIX_LONG || *Prefix == PFF_PREFIX_LONG_W) - { - *Out++ = 'l'; - *Prefix = PFF_PREFIX_LONG; - } - else if (*Prefix == PFF_PREFIX_LONGLONG) - { - *Out++ = 'l'; - *Out++ = 'l'; - } - *Out++ = *(*Fmt)++; - Result = TRUE; - } - else if (**Fmt == 'e' || **Fmt == 'E' || **Fmt == 'f' || - **Fmt == 'g' || **Fmt == 'G') - { - /* we can safely ignore the prefixes and only add the type*/ - if (*Prefix == PFF_PREFIX_LONG_W) - { - *Prefix = PFF_PREFIX_LONG; - } - - *Type = PFF_TYPE_FLOAT; - *Out++ = *(*Fmt)++; - Result = TRUE; - } - else if (**Fmt == 'n') - { - if (*Prefix == PFF_PREFIX_LONG_W) - { - *Prefix = PFF_PREFIX_LONG; - } - - if (*Prefix == PFF_PREFIX_SHORT) - { - *Out++ = 'h'; - } - *Out++ = *(*Fmt)++; - *Type = PFF_TYPE_N; - Result = TRUE; - } - else if (**Fmt == 'p') - { - *Type = PFF_TYPE_P; - (*Fmt)++; - - if (*Prefix == PFF_PREFIX_LONGLONG) - { - if (*Precision == PRECISION_DEFAULT) - { - *Precision = 16; - *Out++ = '.'; - *Out++ = '1'; - *Out++ = '6'; - } - /* native *printf does not support %I64p - (actually %llp), so we need to cheat a little bit */ - *Out++ = 'l'; - *Out++ = 'l'; - } - else - { - if (*Precision == PRECISION_DEFAULT) - { - *Precision = 8; - *Out++ = '.'; - *Out++ = '8'; - } - if (*Prefix == PFF_PREFIX_LONG_W) - { - *Prefix = PFF_PREFIX_LONG; - } - } - *Out++ = 'X'; - Result = TRUE; - } - - *Out = 0; /* end the string */ - -EXIT: - free(TempStr); - return Result; -} - -/******************************************************************************* -Function: - Internal_AddPaddingVfprintf - -Parameters: - stream - - file stream to place padding and given string (In) - In - - string to place into (Out) accompanied with padding - Padding - - number of padding chars to add - Flags - - padding style flags (PRINTF_FORMAT_FLAGS) -*******************************************************************************/ - -INT Internal_AddPaddingVfprintf(CPalThread *pthrCurrent, PAL_FILE *stream, LPCSTR In, - INT Padding, INT Flags) -{ - LPSTR Out; - INT LengthInStr; - INT Length; - LPSTR OutOriginal; - INT Written; - - LengthInStr = strlen(In); - Length = LengthInStr; - - if (Padding > 0) - { - Length += Padding; - } - Out = (LPSTR) InternalMalloc(Length+1); - int iLength = Length+1; - if (!Out) - { - ERROR("InternalMalloc failed\n"); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return -1; - } - OutOriginal = Out; - - if (Flags & PFF_MINUS) /* pad on right */ - { - if (strcpy_s(Out, iLength, In) != SAFECRT_SUCCESS) - { - ERROR("strcpy_s failed\n"); - pthrCurrent->SetLastError(ERROR_INSUFFICIENT_BUFFER); - Written = -1; - goto Done; - } - - Out += LengthInStr; - iLength -= LengthInStr; - } - if (Padding > 0) - { - iLength -= Padding; - if (Flags & PFF_ZERO) /* '0', pad with zeros */ - { - while (Padding--) - { - *Out++ = '0'; - } - } - else /* pad with spaces */ - { - while (Padding--) - { - *Out++ = ' '; - } - } - } - if (!(Flags & PFF_MINUS)) /* put 'In' after padding */ - { - if (strcpy_s(Out, iLength, In) != SAFECRT_SUCCESS) - { - ERROR("strcpy_s failed\n"); - pthrCurrent->SetLastError(ERROR_INSUFFICIENT_BUFFER); - Written = -1; - goto Done; - } - - Out += LengthInStr; - iLength -= LengthInStr; - } - -#if FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL - clearerr (stream->bsdFilePtr); -#endif - - Written = InternalFwrite(OutOriginal, 1, Length, stream->bsdFilePtr, &stream->PALferrorCode); - if (stream->PALferrorCode == PAL_FILE_ERROR) - { - ERROR("fwrite() failed with errno == %d\n", errno); - } - -Done: - free(OutOriginal); - - return Written; -} - -/******************************************************************************* -Function: - Internal_AddPaddingVfwprintf - -Parameters: - stream - - file stream to place padding and given string (In) - In - - string to place into (Out) accompanied with padding - Padding - - number of padding chars to add - Flags - - padding style flags (PRINTF_FORMAT_FLAGS) -*******************************************************************************/ -static INT Internal_AddPaddingVfwprintf(CPalThread *pthrCurrent, PAL_FILE *stream, LPWSTR In, - INT Padding, INT Flags,BOOL convert) -{ - LPWSTR Out; - LPWSTR OutOriginal; - INT LengthInStr; - INT Length; - INT Written = -1; - - LengthInStr = PAL_wcslen(In); - Length = LengthInStr; - - if (Padding > 0) - { - Length += Padding; - } - - int iLen = (Length+1); - Out = (LPWSTR) InternalMalloc(iLen * sizeof(WCHAR)); - if (!Out) - { - ERROR("InternalMalloc failed\n"); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return -1; - } - OutOriginal = Out; - - if (Flags & PFF_MINUS) /* pad on right */ - { - if (wcscpy_s(Out, iLen, In) != SAFECRT_SUCCESS) - { - ERROR("wcscpy_s failed!\n"); - pthrCurrent->SetLastError(ERROR_INSUFFICIENT_BUFFER); - goto EXIT; - } - Out += LengthInStr; - iLen -= LengthInStr; - } - if (Padding > 0) - { - iLen -= Padding; - if (Flags & PFF_ZERO) /* '0', pad with zeros */ - { - while (Padding--) - { - *Out++ = '0'; - } - } - else /* pad with spaces */ - { - while (Padding--) - { - *Out++ = ' '; - } - } - } - if (!(Flags & PFF_MINUS)) /* put 'In' after padding */ - { - if (wcscpy_s(Out, iLen, In) != SAFECRT_SUCCESS) - { - ERROR("wcscpy_s failed!\n"); - pthrCurrent->SetLastError(ERROR_INSUFFICIENT_BUFFER); - goto EXIT; - } - - Out += LengthInStr; - iLen -= LengthInStr; - } - - if (Length > 0) { - Written = Internal_Convertfwrite(pthrCurrent, OutOriginal, sizeof(wchar_16), Length, - (FILE*)(stream->bsdFilePtr), convert); - - if (-1 == Written) - { - ERROR("fwrite() failed with errno == %d\n", errno); - } - } - else - { - Written = 0; - } - -EXIT: - free(OutOriginal); - return Written; -} - -/******************************************************************************* -Function: - PAL_vfprintf - -Parameters: - stream - - out stream - Format - - format string - ap - - stdarg parameter list -*******************************************************************************/ - -int __cdecl PAL_vfprintf(PAL_FILE *stream, const char *format, va_list ap) -{ - return CoreVfprintf(InternalGetCurrentThread(), stream, format, ap); -} - -/******************************************************************************* -Function: - PAL_vfwprintf - -Parameters: - stream - - out stream - Format - - format string - ap - - stdarg parameter list -*******************************************************************************/ - -int __cdecl PAL_vfwprintf(PAL_FILE *stream, const wchar_16 *format, va_list ap) -{ - return CoreVfwprintf(InternalGetCurrentThread(), stream, format, ap); -} - -} // end extern "C" - -int CorUnix::InternalVfprintf(CPalThread *pthrCurrent, PAL_FILE *stream, const char *format, va_list ap) -{ - return CoreVfprintf(pthrCurrent, stream, format, ap); -} - -int CoreVfwprintf(CPalThread *pthrCurrent, PAL_FILE *stream, const wchar_16 *format, va_list aparg) -{ - CHAR TempBuff[1024]; /* used to hold a single % format string */ - LPCWSTR Fmt = format; - LPCWSTR TempWStr = NULL; - LPWSTR AllocedTempWStr = NULL; - LPWSTR WorkingWStr = NULL; - WCHAR TempWChar[2]; - INT Flags; - INT Width; - INT Precision; - INT Prefix; - INT Type; - INT TempInt; - int mbtowcResult; - int written=0; - int paddingReturnValue; - int ret; - va_list ap; - - /* fwprintf for now in the PAL is always used on file opened - in text mode. In those case the output should be ANSI not Unicode */ - BOOL textMode = TRUE; - - PERF_ENTRY(vfwprintf); - ENTRY("vfwprintf (stream=%p, format=%p (%S))\n", - stream, format, format); - - va_copy(ap, aparg); - - while (*Fmt) - { - if(*Fmt == '%' && - TRUE == Internal_ExtractFormatW(pthrCurrent, &Fmt, TempBuff, &Flags, - &Width, &Precision, - &Prefix, &Type)) - { - if (((Prefix == PFF_PREFIX_LONG || Prefix == PFF_PREFIX_LONG_W) && - (Type == PFF_TYPE_STRING || Type == PFF_TYPE_WSTRING)) || - (Type == PFF_TYPE_WSTRING && (Flags & PFF_ZERO) != 0)) - { - AllocedTempWStr = NULL; - - if (WIDTH_STAR == Width) - { - Width = va_arg(ap, INT); - } - else if (WIDTH_INVALID == Width) - { - /* both a '*' and a number, ignore, but remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - if (PRECISION_STAR == Precision) - { - Precision = va_arg(ap, INT); - } - else if (PRECISION_INVALID == Precision) - { - /* both a '*' and a number, ignore, but remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - if (Type == PFF_TYPE_STRING || Prefix == PFF_PREFIX_LONG_W) - { - TempWStr = va_arg(ap, LPWSTR); - } - else - { - /* %lS assumes a LPSTR argument. */ - LPCSTR s = va_arg(ap, LPSTR ); - if (s == NULL) - { - TempWStr = NULL; - } - else - { - UINT Length = 0; - Length = MultiByteToWideChar( CP_ACP, 0, s, -1, NULL, 0 ); - if ( Length != 0 ) - { - AllocedTempWStr = - (LPWSTR)InternalMalloc( (Length) * sizeof( WCHAR ) ); - - if ( AllocedTempWStr ) - { - MultiByteToWideChar( CP_ACP, 0, s, -1, - AllocedTempWStr, Length ); - TempWStr = AllocedTempWStr; - } - else - { - ERROR( "InternalMalloc failed.\n" ); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - va_end(ap); - return -1; - } - } - else - { - ASSERT( "Unable to convert from multibyte " - " to wide char.\n" ); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - va_end(ap); - return -1; - } - } - } - - if (TempWStr == NULL) - { - TempWStr = __wnullstring; - } - - INT Length = PAL_wcslen(TempWStr); - WorkingWStr = (LPWSTR) InternalMalloc((sizeof(WCHAR) * (Length + 1))); - if (!WorkingWStr) - { - ERROR("InternalMalloc failed\n"); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - free(AllocedTempWStr); - va_end(ap); - return -1; - } - if (PRECISION_DOT == Precision) - { - /* copy nothing */ - *WorkingWStr = 0; - Length = 0; - } - else if (Precision > 0 && Precision < Length) - { - if (wcsncpy_s(WorkingWStr, (Length + 1), TempWStr, Precision+1) != SAFECRT_SUCCESS) - { - ERROR("Internal_AddPaddingVfwprintf failed\n"); - free(AllocedTempWStr); - free(WorkingWStr); - LOGEXIT("wcsncpy_s failed!\n"); - PERF_EXIT(vfwprintf); - va_end(ap); - return (-1); - } - - Length = Precision; - } - /* copy everything */ - else - { - PAL_wcscpy(WorkingWStr, TempWStr); - } - - - /* do the padding (if needed)*/ - paddingReturnValue = - Internal_AddPaddingVfwprintf( pthrCurrent, stream, WorkingWStr, - Width - Length, - Flags,textMode); - - if (paddingReturnValue == -1) - { - ERROR("Internal_AddPaddingVfwprintf failed\n"); - free(AllocedTempWStr); - free(WorkingWStr); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - va_end(ap); - return (-1); - } - written += paddingReturnValue; - - free(WorkingWStr); - free(AllocedTempWStr); - } - else if (Prefix == PFF_PREFIX_LONG && Type == PFF_TYPE_CHAR) - { - if (WIDTH_STAR == Width || - WIDTH_INVALID == Width) - { - /* ignore (because it's a char), and remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - if (PRECISION_STAR == Precision || - PRECISION_INVALID == Precision) - { - /* ignore (because it's a char), and remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - TempWChar[0] = va_arg(ap, int); - TempWChar[1] = 0; - - /* do the padding (if needed)*/ - paddingReturnValue = - Internal_AddPaddingVfwprintf(pthrCurrent, stream, TempWChar, - Width - 1, - Flags,textMode); - if (paddingReturnValue == -1) - { - ERROR("Internal_AddPaddingVfwprintf failed\n"); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - va_end(ap); - return(-1); - } - written += paddingReturnValue; - } - /* this places the number of bytes written to the buffer in the - next arg */ - else if (Type == PFF_TYPE_N) - { - if (WIDTH_STAR == Width) - { - Width = va_arg(ap, INT); - } - - if (PRECISION_STAR == Precision) - { - Precision = va_arg(ap, INT); - } - - if (Prefix == PFF_PREFIX_SHORT) - { - *(va_arg(ap, short *)) = written; - } - else - { - *(va_arg(ap, LPLONG)) = written; - } - } - else - { - // Types that sprintf can handle. - - /* note: I'm using the wide buffer as a (char *) buffer when I - pass it to sprintf(). After I get the buffer back I make a - backup of the chars copied and then convert them to wide - and place them in the buffer (BufferPtr) */ - - // This argument will be limited to 1024 characters. - // It should be enough. - size_t TEMP_COUNT = 1024; - char TempSprintfStrBuffer[1024]; - char *TempSprintfStrPtr = NULL; - char *TempSprintfStr = TempSprintfStrBuffer; - LPWSTR TempWideBuffer; - - TempInt = 0; - // %h (short) doesn't seem to be handled properly by local sprintf, - // so we do the truncation ourselves for some cases. - if (Type == PFF_TYPE_P && Prefix == PFF_PREFIX_SHORT) - { - // Convert from pointer -> int -> short to avoid warnings. - long trunc1; - short trunc2; - - trunc1 = va_arg(ap, LONG); - trunc2 = (short)trunc1; - trunc1 = trunc2; - - TempInt = snprintf(TempSprintfStr, TEMP_COUNT, TempBuff, trunc1); - - if (TempInt < 0 || static_cast(TempInt) >= TEMP_COUNT) - { - if (NULL == (TempSprintfStrPtr = (char*)InternalMalloc(++TempInt))) - { - ERROR("InternalMalloc failed\n"); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - va_end(ap); - return -1; - } - - TempSprintfStr = TempSprintfStrPtr; - snprintf(TempSprintfStr, TempInt, TempBuff, trunc2); - } - } - else if (Type == PFF_TYPE_INT && Prefix == PFF_PREFIX_SHORT) - { - // Convert explicitly from int to short to get - // correct sign extension for shorts on all systems. - int n; - short s; - - n = va_arg(ap, int); - s = (short) n; - - TempInt = snprintf(TempSprintfStr, TEMP_COUNT, TempBuff, s); - - if (TempInt < 0 || static_cast(TempInt) >= TEMP_COUNT) - { - if (NULL == (TempSprintfStrPtr = (char*)InternalMalloc(++TempInt))) - { - ERROR("InternalMalloc failed\n"); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - va_end(ap); - return -1; - } - - TempSprintfStr = TempSprintfStrPtr; - snprintf(TempSprintfStr, TempInt, TempBuff, s); - } - } - else - { - va_list apcopy; - - va_copy(apcopy, ap); - TempInt = _vsnprintf_s(TempSprintfStr, TEMP_COUNT, _TRUNCATE, TempBuff, apcopy); - va_end(apcopy); - PAL_printf_arg_remover(&ap, Width, Precision, Type, Prefix); - - if (TempInt < 0 || static_cast(TempInt) >= TEMP_COUNT) - { - if (NULL == (TempSprintfStrPtr = (char*)InternalMalloc(++TempInt))) - { - ERROR("InternalMalloc failed\n"); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - va_end(ap); - return -1; - } - - TempSprintfStr = TempSprintfStrPtr; - va_copy(apcopy, ap); - _vsnprintf_s(TempSprintfStr, TempInt, _TRUNCATE, TempBuff, apcopy); - va_end(apcopy); - PAL_printf_arg_remover(&ap, Width, Precision, Type, Prefix); - } - } - - mbtowcResult = MultiByteToWideChar(CP_ACP, 0, - TempSprintfStr, -1, - NULL, 0); - - if (mbtowcResult == 0) - { - ERROR("MultiByteToWideChar failed\n"); - if(TempSprintfStrPtr) - { - free(TempSprintfStrPtr); - } - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - va_end(ap); - return -1; - } - - TempWideBuffer = (LPWSTR) InternalMalloc(mbtowcResult*sizeof(WCHAR)); - if (!TempWideBuffer) - { - ERROR("InternalMalloc failed\n"); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - if(TempSprintfStrPtr) - { - free(TempSprintfStrPtr); - } - va_end(ap); - return -1; - } - - MultiByteToWideChar(CP_ACP, 0, TempSprintfStr, -1, - TempWideBuffer, mbtowcResult); - - ret = Internal_Convertfwrite( - pthrCurrent, - TempWideBuffer, - sizeof(wchar_16), - mbtowcResult-1, - (FILE*)stream->bsdFilePtr, - textMode); - - if (-1 == ret) - { - ERROR("fwrite() failed with errno == %d (%s)\n", errno, strerror(errno)); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - free(TempWideBuffer); - if(TempSprintfStrPtr) - { - free(TempSprintfStrPtr); - } - va_end(ap); - return -1; - } - if(TempSprintfStrPtr) - { - free(TempSprintfStrPtr); - } - free(TempWideBuffer); - } - } - else - { - ret = Internal_Convertfwrite( - pthrCurrent, - Fmt++, - sizeof(wchar_16), - 1, - (FILE*)stream->bsdFilePtr, - textMode); /* copy regular chars into buffer */ - - if (-1 == ret) - { - ERROR("fwrite() failed with errno == %d\n", errno); - LOGEXIT("vfwprintf returns int -1\n"); - PERF_EXIT(vfwprintf); - va_end(ap); - return -1; - } - ++written; - } - } - - LOGEXIT("vfwprintf returns int %d\n", written); - PERF_EXIT(vfwprintf); - va_end(ap); - return (written); -} - -int CoreVfprintf(CPalThread *pthrCurrent, PAL_FILE *stream, const char *format, va_list aparg) -{ - CHAR TempBuff[1024]; /* used to hold a single % format string */ - LPCSTR Fmt = format; - LPCWSTR TempWStr; - LPSTR TempStr; - WCHAR TempWChar; - INT Flags; - INT Width; - INT Precision; - INT Prefix; - INT Type; - INT Length; - INT TempInt; - int wctombResult; - int written = 0; - int paddingReturnValue; - va_list ap; - - PERF_ENTRY(vfprintf); - - va_copy(ap, aparg); - - while (*Fmt) - { - if (*Fmt == '%' && - TRUE == Internal_ExtractFormatA(pthrCurrent, &Fmt, TempBuff, &Flags, - &Width, &Precision, - &Prefix, &Type)) - { - if (Prefix == PFF_PREFIX_LONG && Type == PFF_TYPE_STRING) - { - if (WIDTH_STAR == Width) - { - Width = va_arg(ap, INT); - } - else if (WIDTH_INVALID == Width) - { - /* both a '*' and a number, ignore, but remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - if (PRECISION_STAR == Precision) - { - Precision = va_arg(ap, INT); - } - else if (PRECISION_INVALID == Precision) - { - /* both a '*' and a number, ignore, but remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - TempWStr = va_arg(ap, LPWSTR); - if (TempWStr == NULL)\ - { - TempWStr = __wnullstring; - } - Length = WideCharToMultiByte(CP_ACP, 0, TempWStr, -1, 0, - 0, 0, 0); - if (!Length) - { - ASSERT("WideCharToMultiByte failed. Error is %d\n", - GetLastError()); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - TempStr = (LPSTR) InternalMalloc(Length); - if (!TempStr) - { - ERROR("InternalMalloc failed\n"); - pthrCurrent->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - if (PRECISION_DOT == Precision) - { - /* copy nothing */ - *TempStr = 0; - Length = 0; - } - else if (Precision > 0 && Precision < Length - 1) - { - Length = WideCharToMultiByte(CP_ACP, 0, TempWStr, - Precision, TempStr, Length, - 0, 0); - if (!Length) - { - ASSERT("WideCharToMultiByte failed. Error is %d\n", - GetLastError()); - free(TempStr); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - TempStr[Length] = 0; - Length = Precision; - } - /* copy everything */ - else - { - wctombResult = WideCharToMultiByte(CP_ACP, 0, TempWStr, -1, - TempStr, Length, 0, 0); - if (!wctombResult) - { - ASSERT("WideCharToMultiByte failed. Error is %d\n", - GetLastError()); - free(TempStr); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - --Length; /* exclude null char */ - } - - /* do the padding (if needed)*/ - paddingReturnValue = - Internal_AddPaddingVfprintf(pthrCurrent, stream, TempStr, - Width - Length, Flags); - if (-1 == paddingReturnValue) - { - ERROR("Internal_AddPaddingVfprintf failed\n"); - free(TempStr); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - written += paddingReturnValue; - - free(TempStr); - } - else if (Prefix == PFF_PREFIX_LONG && Type == PFF_TYPE_CHAR) - { - CHAR TempBuffer[5]; - if (WIDTH_STAR == Width || - WIDTH_INVALID == Width) - { - /* ignore (because it's a char), and remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - if (PRECISION_STAR == Precision || - PRECISION_INVALID == Precision) - { - /* ignore (because it's a char), and remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - TempWChar = va_arg(ap, int); - Length = WideCharToMultiByte(CP_ACP, 0, &TempWChar, 1, - TempBuffer, sizeof(TempBuffer), - 0, 0); - if (!Length) - { - ASSERT("WideCharToMultiByte failed. Error is %d\n", - GetLastError()); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - TempBuffer[Length] = 0; - - /* do the padding (if needed)*/ - paddingReturnValue = - Internal_AddPaddingVfprintf(pthrCurrent, stream, TempBuffer, - Width - Length, Flags); - if (-1 == paddingReturnValue) - { - ERROR("Internal_AddPaddingVfprintf failed\n"); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - written += paddingReturnValue; - - } - /* this places the number of bytes written to the buffer in the - next arg */ - else if (Type == PFF_TYPE_N) - { - if (WIDTH_STAR == Width) - { - Width = va_arg(ap, INT); - } - if (PRECISION_STAR == Precision) - { - Precision = va_arg(ap, INT); - } - - if (Prefix == PFF_PREFIX_SHORT) - { - *(va_arg(ap, short *)) = written; - } - else - { - *(va_arg(ap, LPLONG)) = written; - } - } - else if (Type == PFF_TYPE_CHAR && (Flags & PFF_ZERO) != 0) - { - // Some versions of fprintf don't support 0-padded chars, - // so we handle them here. - char ch[2]; - - ch[0] = (char) va_arg(ap, int); - ch[1] = '\0'; - Length = 1; - paddingReturnValue = Internal_AddPaddingVfprintf( - pthrCurrent, - stream, - ch, - Width - Length, - Flags); - if (-1 == paddingReturnValue) - { - ERROR("Internal_AddPaddingVfprintf failed\n"); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - written += paddingReturnValue; - } - else if (Type == PFF_TYPE_STRING && (Flags & PFF_ZERO) != 0) - { - // Some versions of fprintf don't support 0-padded strings, - // so we handle them here. - const char *tempStr; - - tempStr = va_arg(ap, char *); - if (tempStr == NULL) - { - tempStr = __nullstring; - } - Length = strlen(tempStr); - paddingReturnValue = Internal_AddPaddingVfprintf( - pthrCurrent, - stream, - tempStr, - Width - Length, - Flags); - if (-1 == paddingReturnValue) - { - ERROR("Internal_AddPaddingVfprintf failed\n"); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - written += paddingReturnValue; - } - else - { - // Types that fprintf can handle. - TempInt = 0; - - // %h (short) doesn't seem to be handled properly by local sprintf, - // so we do the truncation ourselves for some cases. - if (Type == PFF_TYPE_P && Prefix == PFF_PREFIX_SHORT) - { - // Convert from pointer -> int -> short to avoid warnings. - long trunc1; - short trunc2; - - trunc1 = va_arg(ap, LONG); - trunc2 = (short)trunc1; - trunc1 = trunc2; - - TempInt = fprintf(stream->bsdFilePtr, TempBuff, trunc1); - } - else if (Type == PFF_TYPE_INT && Prefix == PFF_PREFIX_SHORT) - { - // Convert explicitly from int to short to get - // correct sign extension for shorts on all systems. - int n; - short s; - - n = va_arg(ap, int); - s = (short) n; - - TempInt = fprintf( stream->bsdFilePtr, TempBuff, s); - } - else - { - va_list apcopy; - va_copy(apcopy, ap); - TempInt = vfprintf(stream->bsdFilePtr, TempBuff, apcopy); - va_end(apcopy); - PAL_printf_arg_remover(&ap, Width, Precision, Type, Prefix); - } - - if (-1 == TempInt) - { - ERROR("vfprintf returned an error\n"); - } - else - { - written += TempInt; - } - } - } - else - { - -#if FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL - clearerr (stream->bsdFilePtr); -#endif - - InternalFwrite(Fmt++, 1, 1, stream->bsdFilePtr, &stream->PALferrorCode); /* copy regular chars into buffer */ - if (stream->PALferrorCode == PAL_FILE_ERROR) - { - ERROR("fwrite() failed with errno == %d\n", errno); - PERF_EXIT(vfprintf); - va_end(ap); - return -1; - } - ++written; - } - } - - va_end(ap); - - PERF_EXIT(vfprintf); - return written; -} diff --git a/src/shared/pal/src/cruntime/silent_printf.cpp b/src/shared/pal/src/cruntime/silent_printf.cpp deleted file mode 100644 index 17e3007c76..0000000000 --- a/src/shared/pal/src/cruntime/silent_printf.cpp +++ /dev/null @@ -1,710 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - silent_printf.c - -Abstract: - - Implementation of a silent version of PAL_vsprintf and PAL_vfprintf function. - (without any reference to TRACE/ERROR/... macros, needed by the tracing macros) - -Revision History: - - - ---*/ - - -#include "pal/palinternal.h" -#include "pal/cruntime.h" -#include "pal/printfcpp.hpp" -#include "pal/thread.hpp" - -/* clip strings (%s, %S) at this number of characters */ -#define MAX_STR_LEN 300 - -static int Silent_WideCharToMultiByte(LPCWSTR lpWideCharStr, int cchWideChar, - LPSTR lpMultiByteStr, int cbMultiByte); -static BOOL Silent_ExtractFormatA(LPCSTR *Fmt, LPSTR Out, LPINT Flags, LPINT Width, - LPINT Precision, LPINT Prefix, LPINT Type); -static INT Silent_AddPaddingVfprintf(PAL_FILE *stream, LPSTR In, INT Padding, - INT Flags); - -static size_t Silent_PAL_wcslen(const wchar_16 *string); - -/*++ -Function: - PAL_vfprintf (silent version) - - for more details, see PAL_vfprintf in printf.c ---*/ -int Silent_PAL_vfprintf(PAL_FILE *stream, const char *format, va_list aparg) -{ - CHAR TempBuff[1024]; /* used to hold a single % format string */ - LPCSTR Fmt = format; - LPWSTR TempWStr; - LPSTR TempStr; - WCHAR TempWChar; - INT Flags; - INT Width; - INT Precision; - INT Prefix; - INT Type; - INT Length; - INT TempInt; - int wctombResult; - int written = 0; - int paddingReturnValue; - va_list ap; - - va_copy(ap, aparg); - - while (*Fmt) - { - if (*Fmt == '%' && - TRUE == Silent_ExtractFormatA(&Fmt, TempBuff, &Flags, &Width, - &Precision, &Prefix, &Type)) - { - if (Prefix == PFF_PREFIX_LONG && Type == PFF_TYPE_STRING) - { - if (WIDTH_STAR == Width) - { - Width = va_arg(ap, INT); - } - else if (WIDTH_INVALID == Width) - { - /* both a '*' and a number, ignore, but remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - if (PRECISION_STAR == Precision) - { - Precision = va_arg(ap, INT); - } - else if (PRECISION_INVALID == Precision) - { - /* both a '*' and a number, ignore, but remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - TempWStr = va_arg(ap, LPWSTR); - Length = Silent_WideCharToMultiByte(TempWStr, -1, 0, 0); - if (!Length) - { - va_end(ap); - return -1; - } - TempStr = (LPSTR) PAL_malloc(Length); - if (!TempStr) - { - va_end(ap); - return -1; - } - if (PRECISION_DOT == Precision) - { - /* copy nothing */ - *TempStr = 0; - Length = 0; - } - else if (Precision > 0 && Precision < Length - 1) - { - Length = Silent_WideCharToMultiByte(TempWStr, Precision, - TempStr, Length); - if (!Length) - { - PAL_free(TempStr); - va_end(ap); - return -1; - } - TempStr[Length] = 0; - Length = Precision; - } - /* copy everything */ - else - { - wctombResult = Silent_WideCharToMultiByte(TempWStr, -1, - TempStr, Length); - if (!wctombResult) - { - PAL_free(TempStr); - va_end(ap); - return -1; - } - --Length; /* exclude null char */ - } - - /* do the padding (if needed)*/ - paddingReturnValue = - Silent_AddPaddingVfprintf(stream, TempStr, Width - Length, Flags); - if (-1 == paddingReturnValue) - { - PAL_free(TempStr); - va_end(ap); - return -1; - } - written += paddingReturnValue; - - PAL_free(TempStr); - } - else if (Prefix == PFF_PREFIX_LONG && Type == PFF_TYPE_CHAR) - { - CHAR TempBuffer[4]; - if (WIDTH_STAR == Width || - WIDTH_INVALID == Width) - { - /* ignore (because it's a char), and remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - if (PRECISION_STAR == Precision || - PRECISION_INVALID == Precision) - { - /* ignore (because it's a char), and remove arg */ - TempInt = va_arg(ap, INT); /* value not used */ - } - - TempWChar = va_arg(ap, int); - Length = Silent_WideCharToMultiByte(&TempWChar, 1, TempBuffer, 4); - if (!Length) - { - va_end(ap); - return -1; - } - TempBuffer[Length] = 0; - - /* do the padding (if needed)*/ - paddingReturnValue = - Silent_AddPaddingVfprintf(stream, TempBuffer, - Width - Length, Flags); - if (-1 == paddingReturnValue) - { - va_end(ap); - return -1; - } - written += paddingReturnValue; - - } - /* this places the number of bytes written to the buffer in the - next arg */ - else if (Type == PFF_TYPE_N) - { - if (WIDTH_STAR == Width) - { - Width = va_arg(ap, INT); - } - if (PRECISION_STAR == Precision) - { - Precision = va_arg(ap, INT); - } - - if (Prefix == PFF_PREFIX_SHORT) - { - *(va_arg(ap, short *)) = written; - } - else - { - *(va_arg(ap, LPLONG)) = written; - } - } - /* types that sprintf can handle */ - else - { - TempInt = 0; - - /* %h (short) doesn't seem to be handled properly by local sprintf, - so lets do the truncation ourselves. (ptr -> int -> short to avoid - warnings */ - if (Type == PFF_TYPE_P && Prefix == PFF_PREFIX_SHORT) - { - long trunc1; - short trunc2; - - trunc1 = va_arg(ap, LONG); - trunc2 = (short)trunc1; - - TempInt = fprintf((FILE*)stream, TempBuff, trunc2); - } - else if (Type == PFF_TYPE_INT && Prefix == PFF_PREFIX_SHORT) - { - // Convert explicitly from int to short to get - // correct sign extension for shorts on all systems. - int n; - short s; - - n = va_arg(ap, int); - s = (short)n; - - TempInt = fprintf((FILE*)stream, TempBuff, s); - } - else - { - va_list apcopy; - va_copy(apcopy, ap); - TempInt = PAL_vfprintf(stream, TempBuff, apcopy); - va_end(apcopy); - PAL_printf_arg_remover(&ap, Width, Precision, Type, Prefix); - } - - if (-1 != TempInt) - { - written += TempInt; - } - } - } - else - { -#if FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL - clearerr((FILE*)stream); -#endif - - PAL_fwrite(Fmt++, 1, 1, stream); /* copy regular chars into buffer */ - if (stream->PALferrorCode == PAL_FILE_ERROR) - { - va_end(ap); - return -1; - } - ++written; - } - } - - va_end(ap); - return written; -} - -/*++ -Function: - WideCharToMultiByte (reduced and silent version) - -See MSDN doc. ---*/ -int Silent_WideCharToMultiByte(LPCWSTR lpWideCharStr, int cchWideChar, - LPSTR lpMultiByteStr, int cbMultiByte) -{ - INT retval =0; - - if ((lpWideCharStr == NULL)|| - (lpWideCharStr == (LPCWSTR) lpMultiByteStr)) - { - goto EXIT; - } - - if (cchWideChar == -1) - { - cchWideChar = Silent_PAL_wcslen(lpWideCharStr) + 1; - } - - if (cbMultiByte == 0) - { - retval = cchWideChar; - goto EXIT; - } - else if(cbMultiByte < cchWideChar) - { - retval = 0; - goto EXIT; - } - - retval = cchWideChar; - while(cchWideChar > 0) - { - if(*lpWideCharStr > 255) - { - *lpMultiByteStr = '?'; - } - else - { - *lpMultiByteStr = (unsigned char)*lpWideCharStr; - } - lpMultiByteStr++; - lpWideCharStr++; - cchWideChar--; - } - -EXIT: - return retval; -} - -/******************************************************************************* -Function: - Internal_ExtractFormatA (silent version) - - see Internal_ExtractFormatA function in printf.c -*******************************************************************************/ -BOOL Silent_ExtractFormatA(LPCSTR *Fmt, LPSTR Out, LPINT Flags, LPINT Width, LPINT Precision, LPINT Prefix, LPINT Type) -{ - BOOL Result = FALSE; - LPSTR TempStr; - LPSTR TempStrPtr; - - *Width = WIDTH_DEFAULT; - *Precision = PRECISION_DEFAULT; - *Flags = PFF_NONE; - *Prefix = PFF_PREFIX_DEFAULT; - *Type = PFF_TYPE_DEFAULT; - - if (*Fmt && **Fmt == '%') - { - *Out++ = *(*Fmt)++; - } - else - { - return Result; - } - - /* we'll never need a temp string longer than the original */ - TempStrPtr = TempStr = (LPSTR) PAL_malloc(strlen(*Fmt)+1); - if (!TempStr) - { - return Result; - } - - /* parse flags */ - while (**Fmt && (**Fmt == '-' || **Fmt == '+' || - **Fmt == '0' || **Fmt == ' ' || **Fmt == '#')) - { - switch (**Fmt) - { - case '-': - *Flags |= PFF_MINUS; break; - case '+': - *Flags |= PFF_PLUS; break; - case '0': - *Flags |= PFF_ZERO; break; - case ' ': - *Flags |= PFF_SPACE; break; - case '#': - *Flags |= PFF_POUND; break; - } - *Out++ = *(*Fmt)++; - } - /* '-' flag negates '0' flag */ - if ((*Flags & PFF_MINUS) && (*Flags & PFF_ZERO)) - { - *Flags -= PFF_ZERO; - } - - /* grab width specifier */ - if (isdigit((unsigned char) **Fmt)) - { - TempStrPtr = TempStr; - while (isdigit((unsigned char) **Fmt)) - { - *TempStrPtr++ = **Fmt; - *Out++ = *(*Fmt)++; - } - *TempStrPtr = 0; /* end string */ - *Width = atoi(TempStr); - if (*Width < 0) - { - SetLastError(ERROR_INTERNAL_ERROR); - goto EXIT; - } - } - else if (**Fmt == '*') - { - *Width = WIDTH_STAR; - *Out++ = *(*Fmt)++; - if (isdigit((unsigned char) **Fmt)) - { - /* this is an invalid width because we have a * then a number */ - /* printf handles this by just printing the whole string */ - *Width = WIDTH_INVALID; - while (isdigit((unsigned char) **Fmt)) - { - *Out++ = *(*Fmt)++; - } - } - } - - - /* grab precision specifier */ - if (**Fmt == '.') - { - *Out++ = *(*Fmt)++; - if (isdigit((unsigned char) **Fmt)) - { - TempStrPtr = TempStr; - while (isdigit((unsigned char) **Fmt)) - { - *TempStrPtr++ = **Fmt; - *Out++ = *(*Fmt)++; - } - *TempStrPtr = 0; /* end string */ - *Precision = atoi(TempStr); - if (*Precision < 0) - { - SetLastError(ERROR_INTERNAL_ERROR); - goto EXIT; - } - } - else if (**Fmt == '*') - { - *Precision = PRECISION_STAR; - *Out++ = *(*Fmt)++; - if (isdigit((unsigned char) **Fmt)) - { - /* this is an invalid precision because we have a .* then a - number */ - /* printf handles this by just printing the whole string */ - *Precision = PRECISION_INVALID; - while (isdigit((unsigned char) **Fmt)) - { - *Out++ = *(*Fmt)++; - } - } - } - else - { - *Precision = PRECISION_DOT; - } - } - -#ifdef HOST_64BIT - if (**Fmt == 'p') - { - *Prefix = PFF_PREFIX_LONGLONG; - } -#endif - /* grab prefix of 'I64' for __int64 */ - if ((*Fmt)[0] == 'I' && (*Fmt)[1] == '6' && (*Fmt)[2] == '4') - { - /* convert to 'll' so BSD's snprintf can handle it */ - *Fmt += 3; - *Prefix = PFF_PREFIX_LONGLONG; - } - /* grab a prefix of 'h' */ - else if (**Fmt == 'h') - { - *Prefix = PFF_PREFIX_SHORT; - ++(*Fmt); - } - /* grab prefix of 'l' or the undocumented 'w' (at least in MSDN) */ - else if (**Fmt == 'l' || **Fmt == 'w') - { - ++(*Fmt); -#ifdef HOST_64BIT - // Only want to change the prefix on 64 bit when printing characters. - if (**Fmt == 'c' || **Fmt == 's') -#endif - { - *Prefix = PFF_PREFIX_LONG; - } - } - else if (**Fmt == 'L') - { - /* a prefix of 'L' seems to be ignored */ - ++(*Fmt); - } - - /* grab type 'c' */ - if (**Fmt == 'c' || **Fmt == 'C') - { - *Type = PFF_TYPE_CHAR; - if (*Prefix != PFF_PREFIX_SHORT && **Fmt == 'C') - { - *Prefix = PFF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == PFF_PREFIX_LONG) - { - *Out++ = 'l'; - } - *Out++ = 'c'; - ++(*Fmt); - Result = TRUE; - } - /* grab type 's' */ - else if (**Fmt == 's' || **Fmt == 'S') - { - *Type = PFF_TYPE_STRING; - if (*Prefix != PFF_PREFIX_SHORT && **Fmt == 'S') - { - *Prefix = PFF_PREFIX_LONG; /* give it a wide prefix */ - } - if (*Prefix == PFF_PREFIX_LONG) - { - *Out++ = 'l'; - } - *Out++ = 's'; - ++(*Fmt); - Result = TRUE; - } - /* grab int types types */ - else if (**Fmt == 'd' || **Fmt == 'i' || **Fmt == 'o' || - **Fmt == 'u' || **Fmt == 'x' || **Fmt == 'X') - { - *Type = PFF_TYPE_INT; - if (*Prefix == PFF_PREFIX_SHORT) - { - *Out++ = 'h'; - } - else if (*Prefix == PFF_PREFIX_LONG) - { - *Out++ = 'l'; - } - else if (*Prefix == PFF_PREFIX_LONGLONG) - { - *Out++ = 'l'; - *Out++ = 'l'; - } - *Out++ = *(*Fmt)++; - Result = TRUE; - } - else if (**Fmt == 'e' || **Fmt == 'E' || **Fmt == 'f' || - **Fmt == 'g' || **Fmt == 'G') - { - /* we can safely ignore the prefixes and only add the type*/ - *Type = PFF_TYPE_FLOAT; - *Out++ = *(*Fmt)++; - Result = TRUE; - } - else if (**Fmt == 'n') - { - if (*Prefix == PFF_PREFIX_SHORT) - { - *Out++ = 'h'; - } - *Out++ = *(*Fmt)++; - *Type = PFF_TYPE_N; - Result = TRUE; - } - else if (**Fmt == 'p') - { - *Type = PFF_TYPE_P; - *Out++ = *(*Fmt)++; - - if (*Prefix == PFF_PREFIX_LONGLONG) - { - if (*Precision == PRECISION_DEFAULT) - { - *Precision = 16; - } - } - else - { - if (*Precision == PRECISION_DEFAULT) - { - *Precision = 8; - } - } - Result = TRUE; - } - - *Out = 0; /* end the string */ - -EXIT: - PAL_free(TempStr); - return Result; -} - -/******************************************************************************* -Function: - AddPaddingVfprintf (silent version) - see Internal_AddPaddingVfprintf in printf.c -*******************************************************************************/ -INT Silent_AddPaddingVfprintf(PAL_FILE *stream, LPSTR In, INT Padding, INT Flags) -{ - LPSTR Out; - INT LengthInStr; - INT Length; - LPSTR OutOriginal; - INT Written; - - LengthInStr = strlen(In); - Length = LengthInStr; - - - if (Padding > 0) - { - Length += Padding; - } - Out = (LPSTR) PAL_malloc(Length+1); - int iLen = Length+1; - if (!Out) - { - return -1; - } - OutOriginal = Out; - - if (Flags & PFF_MINUS) /* pad on right */ - { - if (strcpy_s(Out, iLen, In) != SAFECRT_SUCCESS) - { - Written = -1; - goto Done; - } - - Out += LengthInStr; - iLen -= LengthInStr; - } - if (Padding > 0) - { - iLen -= Padding; - if (Flags & PFF_ZERO) /* '0', pad with zeros */ - { - while (Padding--) - { - *Out++ = '0'; - } - } - else /* pad with spaces */ - { - while (Padding--) - { - *Out++ = ' '; - } - } - } - if (!(Flags & PFF_MINUS)) /* put 'In' after padding */ - { - if (strcpy_s(Out, Length+1, In) != SAFECRT_SUCCESS) - { - Written = -1; - goto Done; - } - - Out += LengthInStr; - iLen -= LengthInStr; - } - -#if FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL - clearerr((FILE*)stream); -#endif - - Written = PAL_fwrite(OutOriginal, 1, Length, stream); - if (stream->PALferrorCode == PAL_FILE_ERROR) - { - Written = -1; - } - -Done: - PAL_free(OutOriginal); - return Written; -} - -/*++ -Function: - PAL_wcslen (silent version) - -See MSDN or the man page for wcslen. - ---*/ -size_t Silent_PAL_wcslen(const wchar_16 *string) -{ - size_t nChar = 0; - - if ( !string ) - { - return 0; - } - while (*string++) - { - nChar++; - } - - return nChar; -} diff --git a/src/shared/pal/src/cruntime/string.cpp b/src/shared/pal/src/cruntime/string.cpp deleted file mode 100644 index b66c3b20f5..0000000000 --- a/src/shared/pal/src/cruntime/string.cpp +++ /dev/null @@ -1,295 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - string.cpp - -Abstract: - - Implementation of the string functions in the C runtime library that are Windows specific. - - - ---*/ - -#include "pal/palinternal.h" -#include "pal/dbgmsg.h" -#include "pal/cruntime.h" - -#include -#include -#include -#include -#include -#include - - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - -/*++ -Function: - _strnicmp - -compare at most count characters from two strings, ignoring case - -The strnicmp() function compares, with case insensitivity, at most count -characters from s1 to s2. All uppercase characters from s1 and s2 are -mapped to lowercase for the purposes of doing the comparison. - -Returns: - -Value Meaning - -< 0 s1 is less than s2 -0 s1 is equal to s2 -> 0 s1 is greater than s2 - ---*/ -int -__cdecl -_strnicmp( const char *s1, const char *s2, size_t count ) -{ - int ret; - - PERF_ENTRY(_strnicmp); - ENTRY("_strnicmp (s1=%p (%s), s2=%p (%s), count=%d)\n", s1?s1:"NULL", s1?s1:"NULL", s2?s2:"NULL", s2?s2:"NULL", count); - - ret = strncasecmp(s1, s2, count ); - - LOGEXIT("_strnicmp returning int %d\n", ret); - PERF_EXIT(_strnicmp); - return ret; -} - -/*++ -Function: - _stricmp - -compare two strings, ignoring case - -The stricmp() function compares, with case insensitivity, the string -pointed to by s1 to the string pointed to by s2. All uppercase -characters from s1 and s2 are mapped to lowercase for the purposes of -doing the comparison. - -Returns: - -Value Meaning - -< 0 s1 is less than s2 -0 s1 is equal to s2 -> 0 s1 is greater than s2 - ---*/ -int -__cdecl -_stricmp( - const char *s1, - const char *s2) -{ - int ret; - - PERF_ENTRY(_stricmp); - ENTRY("_stricmp (s1=%p (%s), s2=%p (%s))\n", s1?s1:"NULL", s1?s1:"NULL", s2?s2:"NULL", s2?s2:"NULL"); - - ret = strcasecmp(s1, s2); - - LOGEXIT("_stricmp returning int %d\n", ret); - PERF_EXIT(_stricmp); - return ret; -} - - -/*++ -Function: - PAL_strtoul - -Convert string to an unsigned long-integer value. - -Return Value - -strtoul returns the converted value, if any, or UINT32_MAX on -overflow. It returns 0 if no conversion can be performed. errno is -set to ERANGE if overflow or underflow occurs. - -Parameters - -szNumber Null-terminated string to convert to a ULONG -pszEnd Pointer to character that stops scan -nBase Number base to use - -Remarks - -strtoul stops reading the string szNumber at the first character it cannot -recognize as part of a number. This may be the terminating null -character, or it may be the first numeric character greater than or -equal to base. The LC_NUMERIC category setting of the current locale -determines recognition of the radix character in szNumber; for more -information, see setlocale. If pszEnd is not NULL, a pointer to the -character that stopped the scan is stored at the location pointed to -by pszEnd. If no conversion can be performed (no valid digits were -found or an invalid base was specified), the value of szNumber is stored -at the location pointed to by pszEnd. - -Notes : - MSDN states that only space and tab are accepted as leading whitespace, but - tests indicate that other whitespace characters (newline, carriage return, - etc) are also accepted. This matches the behavior on Unix systems. - - For strtoul, we need to check if the value to be returned - is outside the 32 bit range. If so, the returned value needs to be set - as appropriate, according to the MSDN pages and in all instances errno - must be set to ERANGE (The one exception is converting a string - representing a negative value to unsigned long). - Note that on 64 bit Windows, long's are still 32 bit. Thus, to match - Windows behavior, we must return long's in the 32 bit range. - --*/ - -/* The use of ULONG is by design, to ensure that a 32 bit value is always -returned from this function. If "unsigned long" is used instead of ULONG, -then a 64 bit value could be returned on 64 bit platforms like HP-UX, thus -breaking Windows behavior. */ -ULONG -__cdecl -PAL_strtoul(const char *szNumber, char **pszEnd, int nBase) -{ - unsigned long ulResult; - - PERF_ENTRY(strtoul); - ENTRY("strtoul (szNumber=%p (%s), pszEnd=%p, nBase=%d)\n", - szNumber?szNumber:"NULL", - szNumber?szNumber:"NULL", - pszEnd, - nBase); - - ulResult = strtoul(szNumber, pszEnd, nBase); - -#ifdef HOST_64BIT - if (ulResult > UINT32_MAX) - { - char ch = *szNumber; - while (isspace(ch)) - { - ch = *szNumber++; - } - /* If the string represents a positive number that is greater than - _UI32_MAX, set errno to ERANGE. Otherwise, don't set errno - to match Windows behavior. */ - if (ch != '-') - { - ulResult = UINT32_MAX; - errno = ERANGE; - } - } -#endif - - LOGEXIT("strtoul returning unsigned long %lu\n", ulResult); - PERF_EXIT(wcstoul); - - /* When returning unsigned long res from this function, it will be - implicitly cast to ULONG. This handles situations where a string that - represents a negative number is passed in to strtoul. The Windows - behavior is analogous to taking the binary equivalent of the negative - value and treating it as a positive number. Returning a ULONG from - this function, as opposed to native unsigned long, allows us to match - this behavior. The explicit cast to ULONG below is used to silence any - potential warnings due to the implicit casting. */ - return (ULONG)ulResult; - -} - -/*++ -Function: - PAL_strtoull - -Convert string to an unsigned long long-integer value. - -Return Value - -strtoull returns the converted value, if any, or UINT64_MAX on -overflow. It returns 0 if no conversion can be performed. errno is -set to ERANGE if overflow or underflow occurs. - -Parameters - -szNumber Null-terminated string to convert to a ULONGLONG -pszEnd Pointer to character that stops scan -nBase Number base to use - -Remarks - -strtoull stops reading the string szNumber at the first character it cannot -recognize as part of a number. This may be the terminating null -character, or it may be the first numeric character greater than or -equal to base. The LC_NUMERIC category setting of the current locale -determines recognition of the radix character in szNumber; for more -information, see setlocale. If pszEnd is not NULL, a pointer to the -character that stopped the scan is stored at the location pointed to -by pszEnd. If no conversion can be performed (no valid digits were -found or an invalid base was specified), the value of szNumber is stored -at the location pointed to by pszEnd. - -Notes : - MSDN states that only space and tab are accepted as leading whitespace, but - tests indicate that other whitespace characters (newline, carriage return, - etc) are also accepted. This matches the behavior on Unix systems. - - For strtoull, we need to check if the value to be returned - is outside the 64 bit range. If so, the returned value needs to be set - as appropriate, according to the MSDN pages and in all instances errno - must be set to ERANGE (The one exception is converting a string - representing a negative value to unsigned long). - --*/ - -/* The use of ULONGLONG is by design, to ensure that a 64 bit value is always -returned from this function. */ -ULONGLONG -__cdecl -PAL_strtoull(const char *szNumber, char **pszEnd, int nBase) -{ - unsigned long long ullResult; - - PERF_ENTRY(strtoull); - ENTRY("strtoull (szNumber=%p (%s), pszEnd=%p, nBase=%d)\n", - szNumber?szNumber:"NULL", - szNumber?szNumber:"NULL", - pszEnd, - nBase); - - ullResult = strtoull(szNumber, pszEnd, nBase); - - if (ullResult > UINT64_MAX) - { - char ch = *szNumber; - while (isspace(ch)) - { - ch = *szNumber++; - } - /* If the string represents a positive number that is greater than - UINT64_MAX, set errno to ERANGE. Otherwise, don't set errno - to match Windows behavior. */ - if (ch != '-') - { - ullResult = UINT64_MAX; - errno = ERANGE; - } - } - - LOGEXIT("strtoull returning unsigned long long %llu\n", ullResult); - PERF_EXIT(strtoull); - - /* When returning unsigned long long res from this function, it will be - implicitly cast to ULONGLONG. This handles situations where a string that - represents a negative number is passed in to strtoull. The Windows - behavior is analogous to taking the binary equivalent of the negative - value and treating it as a positive number. Returning a ULONGLONG from - this function, as opposed to native unsigned long long, allows us to match - this behavior. The explicit cast to ULONGLONG below is used to silence any - potential warnings due to the implicit casting. */ - return (ULONGLONG)ullResult; -} diff --git a/src/shared/pal/src/cruntime/stringtls.cpp b/src/shared/pal/src/cruntime/stringtls.cpp deleted file mode 100644 index a080e1dd84..0000000000 --- a/src/shared/pal/src/cruntime/stringtls.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - stringtls.cpp - -Abstract: - - Implementation of the string functions in the C runtime library that - are Windows specific and depend on per-thread data - - - ---*/ - -#include "pal/thread.hpp" -#include "pal/dbgmsg.h" - -#include -#include -#include -#include -#include - -using namespace CorUnix; - -SET_DEFAULT_DEBUG_CHANNEL(CRT); - -/*++ -Function: - PAL_strtok - -Finds the next token in a string. - -Return value: - -A pointer to the next token found in strToken. Returns NULL when no more -tokens are found. Each call modifies strToken by substituting a NULL -character for each delimiter that is encountered. - -Parameters: -strToken String cotaining token(s) -strDelimit Set of delimiter characters - -Remarks: -In FreeBSD, strtok is not re-entrant, strtok_r is. It manages re-entrancy -by using a passed-in context pointer (which will be stored in thread local -storage) According to the strtok MSDN documentation, "Calling these functions -simultaneously from multiple threads does not have undesirable effects", so -we need to use strtok_r. ---*/ -char * -__cdecl -PAL_strtok(char *strToken, const char *strDelimit) -{ - CPalThread *pThread = NULL; - char *retval=NULL; - - PERF_ENTRY(strtok); - ENTRY("strtok (strToken=%p (%s), strDelimit=%p (%s))\n", - strToken?strToken:"NULL", - strToken?strToken:"NULL", strDelimit?strDelimit:"NULL", strDelimit?strDelimit:"NULL"); - - pThread = InternalGetCurrentThread(); - - retval = strtok_r(strToken, strDelimit, &pThread->crtInfo.strtokContext); - - LOGEXIT("strtok returns %p (%s)\n", retval?retval:"NULL", retval?retval:"NULL"); - PERF_EXIT(strtok); - - return retval; -} diff --git a/src/shared/pal/src/cruntime/wchar.cpp b/src/shared/pal/src/cruntime/wchar.cpp index 6a404217d1..fb24f6e35c 100644 --- a/src/shared/pal/src/cruntime/wchar.cpp +++ b/src/shared/pal/src/cruntime/wchar.cpp @@ -24,7 +24,6 @@ Module Name: #include "config.h" #endif -#include #include #include @@ -55,10 +54,10 @@ _wtoi( GetLastError()); return -1; } - tempStr = (char *) PAL_malloc(len); + tempStr = (char *) malloc(len); if (!tempStr) { - ERROR("PAL_malloc failed\n"); + ERROR("malloc failed\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); return -1; } @@ -67,12 +66,12 @@ _wtoi( { ASSERT("WideCharToMultiByte failed. Error is %d\n", GetLastError()); - PAL_free(tempStr); + free(tempStr); return -1; } ret = atoi(tempStr); - PAL_free(tempStr); + free(tempStr); LOGEXIT("_wtoi returns int %d\n", ret); PERF_EXIT(_wtoi); return ret; @@ -104,9 +103,9 @@ count Number of characters to compare Remarks -The _strnicmp function lexicographically compares, at most, the first +The _wcsnicmp function lexicographically compares, at most, the first count characters of string1 and string2. The comparison is performed -without regard to case; _strnicmp is a case-insensitive version of +without regard to case; _wcsnicmp is a case-insensitive version of strncmp. The comparison ends if a terminating null character is reached in either string before count characters are compared. If the strings are equal when a terminating null character is reached in @@ -261,10 +260,10 @@ PAL_wcstoul( res = 0; goto PAL_wcstoulExit; } - s_nptr = (char *)PAL_malloc(size); + s_nptr = (char *)malloc(size); if (!s_nptr) { - ERROR("PAL_malloc failed\n"); + ERROR("malloc failed\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); res = 0; goto PAL_wcstoulExit; @@ -310,7 +309,7 @@ PAL_wcstoul( } PAL_wcstoulExit: - PAL_free(s_nptr); + free(s_nptr); LOGEXIT("wcstoul returning unsigned long %lu\n", res); PERF_EXIT(wcstoul); @@ -351,10 +350,10 @@ PAL__wcstoui64( res = 0; goto PAL__wcstoui64Exit; } - s_nptr = (char *)PAL_malloc(size); + s_nptr = (char *)malloc(size); if (!s_nptr) { - ERROR("PAL_malloc failed\n"); + ERROR("malloc failed\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); res = 0; goto PAL__wcstoui64Exit; @@ -381,7 +380,7 @@ PAL__wcstoui64( } PAL__wcstoui64Exit: - PAL_free(s_nptr); + free(s_nptr); LOGEXIT("_wcstoui64 returning unsigned long long %llu\n", res); PERF_EXIT(_wcstoui64); @@ -896,7 +895,7 @@ PAL_wcstod( const wchar_16 * nptr, wchar_16 **endptr ) if ( lpEndOfExpression != lpStartOfExpression ) { Length = lpEndOfExpression - lpStartOfExpression; - lpStringRep = (LPSTR)PAL_malloc( Length + 1); + lpStringRep = (LPSTR)malloc( Length + 1); if ( lpStringRep ) { @@ -939,7 +938,7 @@ PAL_wcstod( const wchar_16 * nptr, wchar_16 **endptr ) *endptr = lpEndOfExpression; } - PAL_free( lpStringRep ); + free( lpStringRep ); LOGEXIT( "wcstod returning %f.\n", RetVal ); PERF_EXIT(wcstod); return RetVal; @@ -947,68 +946,48 @@ PAL_wcstod( const wchar_16 * nptr, wchar_16 **endptr ) /*++ Function: + _wfopen - iswprint - -See MSDN for more details. ---*/ -int -__cdecl -PAL_iswprint( wchar_16 c ) -{ - int ret; - - - PERF_ENTRY(iswprint); - ENTRY("PAL_iswprint (%#X)\n", c); - - ret = iswprint(c); - - LOGEXIT("PAL_iswprint returns %d\n", ret); - PERF_EXIT(iswprint); - return (ret); -} - -/*++ -Function: - - PAL_wcscspn - -Finds the number of consecutive characters from the start of the string -that are not in the set. - -Return value: - -The number of characters from the start of the string that are not in -the set. - -Parameters: -string String -strCharSet Set of delimiter characters +see MSDN doc. --*/ -size_t +extern "C" +FILE * __cdecl -PAL_wcscspn(const wchar_16 *string, const wchar_16 *strCharSet) +_wfopen( + const wchar_16 *fileName, + const wchar_16 *mode) { - const wchar_16 *temp; - size_t count = 0; + CHAR mbFileName[ _MAX_PATH ]; + CHAR mbMode[ 10 ]; + FILE * filePtr = NULL; - PERF_ENTRY(wcscspn); + PERF_ENTRY(_wfopen); + ENTRY("_wfopen(fileName:%p (%S), mode:%p (%S))\n", fileName, fileName, mode, mode); - while(*string != 0) + _ASSERTE(fileName != NULL); + _ASSERTE(mode != NULL); + + /* Convert the parameters to ASCII and defer to PAL_fopen */ + if ( WideCharToMultiByte( CP_ACP, 0, fileName, -1, mbFileName, + sizeof mbFileName, NULL, NULL ) != 0 ) { - for(temp = strCharSet; *temp != 0; temp++) + if ( WideCharToMultiByte( CP_ACP, 0, mode, -1, mbMode, + sizeof mbMode, NULL, NULL ) != 0 ) { - if (*string == *temp) - { - PERF_EXIT(wcscspn); - return count; - } + filePtr = fopen(mbFileName, mbMode); } - count++; - string++; + else + { + ERROR( "An error occurred while converting mode to ANSI.\n" ); + } + } + else + { + ERROR( "An error occurred while converting" + " fileName to ANSI string.\n" ); } - PERF_EXIT(wcscspn); - return count; + LOGEXIT("_wfopen returning FILE* %p\n", filePtr); + PERF_EXIT(_wfopen); + return filePtr; } diff --git a/src/shared/pal/src/debug/debug.cpp b/src/shared/pal/src/debug/debug.cpp index 3c9cd5d210..d6d89c86ab 100644 --- a/src/shared/pal/src/debug/debug.cpp +++ b/src/shared/pal/src/debug/debug.cpp @@ -37,6 +37,7 @@ SET_DEFAULT_DEBUG_CHANNEL(DEBUG); // some headers have code with asserts, so do #include #include +#include #include #include #include @@ -112,7 +113,7 @@ OutputDebugStringW( } /* strLen includes the null terminator */ - if ((lpOutputStringA = (LPSTR) InternalMalloc((strLen * sizeof(CHAR)))) == NULL) + if ((lpOutputStringA = (LPSTR) malloc((strLen * sizeof(CHAR)))) == NULL) { ERROR("Insufficient memory available !\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); diff --git a/src/shared/pal/src/file/directory.cpp b/src/shared/pal/src/file/directory.cpp index edaafa344f..388afbc5c6 100644 --- a/src/shared/pal/src/file/directory.cpp +++ b/src/shared/pal/src/file/directory.cpp @@ -75,11 +75,11 @@ CreateDirectoryW( goto done; } - if (((mb_dir = (char *)PAL_malloc(mb_size)) == NULL) || + if (((mb_dir = (char *)malloc(mb_size)) == NULL) || (WideCharToMultiByte( CP_ACP, 0, lpPathName, -1, mb_dir, mb_size, NULL, NULL) != mb_size)) { - ASSERT("WideCharToMultiByte or PAL_malloc failure! LastError:%d errno:%d\n", + ASSERT("WideCharToMultiByte or malloc failure! LastError:%d errno:%d\n", GetLastError(), errno); dwLastError = ERROR_INTERNAL_ERROR; goto done; @@ -93,7 +93,7 @@ CreateDirectoryW( } if (mb_dir != NULL) { - PAL_free(mb_dir); + free(mb_dir); } LOGEXIT("CreateDirectoryW returns BOOL %d\n", bRet); PERF_EXIT(CreateDirectoryW); @@ -131,8 +131,6 @@ RemoveDirectoryHelper ( BOOL bRet = FALSE; *dwLastError = 0; - FILEDosToUnixPathA( lpPathName ); - if ( rmdir(lpPathName) != 0 ) { TRACE("Removal of directory [%s] was unsuccessful, errno = %d.\n", @@ -328,7 +326,7 @@ GetCurrentDirectoryA(PathCharString& lpBuffer) dwDirLen = strlen( current_dir ); lpBuffer.Set(current_dir, dwDirLen); - PAL_free(current_dir); + free(current_dir); done: if ( dwLastError ) @@ -341,100 +339,6 @@ GetCurrentDirectoryA(PathCharString& lpBuffer) return dwDirLen; } -/*++ -Function: - GetCurrentDirectoryA - -See MSDN doc. ---*/ -DWORD -PALAPI -GetCurrentDirectoryA( - IN DWORD nBufferLength, - OUT LPSTR lpBuffer) -{ - - PathCharString lpBufferString; - DWORD dwDirLen = GetCurrentDirectoryA(lpBufferString); - - /* if the supplied buffer isn't long enough, return the required - length, including room for the NULL terminator */ - if ( nBufferLength <= dwDirLen ) - { - ++dwDirLen; /* include space for the NULL */ - } - else - { - strcpy_s( lpBuffer, nBufferLength, lpBufferString ); - } - - return dwDirLen; -} - -/*++ -Function: - GetCurrentDirectoryW - -See MSDN doc. ---*/ -DWORD -PALAPI -GetCurrentDirectoryW( - IN DWORD nBufferLength, - OUT LPWSTR lpBuffer) -{ - DWORD dwWideLen = 0; - DWORD dwLastError = ERROR_BAD_PATHNAME; - int dir_len; - PathCharString current_dir; - - PERF_ENTRY(GetCurrentDirectoryW); - ENTRY("GetCurrentDirectoryW(nBufferLength=%u, lpBuffer=%p)\n", - nBufferLength, lpBuffer); - - - dir_len = GetCurrentDirectoryA(current_dir); - - if( dir_len == 0) - { - dwLastError = DIRGetLastErrorFromErrno(); - goto done; - } - - dwWideLen = MultiByteToWideChar( CP_ACP, 0, - current_dir, dir_len, - NULL, 0 ); - - /* if the supplied buffer isn't long enough, return the required - length, including room for the NULL terminator */ - if ( nBufferLength > dwWideLen ) - { - if(!MultiByteToWideChar( CP_ACP, 0, current_dir, dir_len + 1, - lpBuffer, nBufferLength )) - { - ASSERT("MultiByteToWideChar failure!\n"); - dwWideLen = 0; - dwLastError = ERROR_INTERNAL_ERROR; - } - } - else - { - ++dwWideLen; /* include the space for the NULL */ - } - -done: - - if ( dwLastError ) - { - SetLastError(dwLastError); - } - - LOGEXIT("GetCurrentDirectoryW returns DWORD %u\n", dwWideLen); - PERF_EXIT(GetCurrentDirectoryW); - return dwWideLen; -} - - /*++ Function: SetCurrentDirectoryW @@ -548,14 +452,13 @@ CreateDirectoryA( goto done; } - unixPathName = PAL__strdup(lpPathName); + unixPathName = strdup(lpPathName); if (unixPathName == NULL ) { - ERROR("PAL__strdup() failed\n"); + ERROR("strdup() failed\n"); dwLastError = ERROR_NOT_ENOUGH_MEMORY; goto done; } - FILEDosToUnixPathA( unixPathName ); // Remove any trailing slashes at the end because mkdir might not // handle them appropriately on all platforms. pathLength = strlen(unixPathName); @@ -629,7 +532,7 @@ CreateDirectoryA( { SetLastError( dwLastError ); } - PAL_free( unixPathName ); + free( unixPathName ); LOGEXIT("CreateDirectoryA returns BOOL %d\n", bRet); PERF_EXIT(CreateDirectoryA); return bRet; @@ -649,7 +552,6 @@ SetCurrentDirectoryA( BOOL bRet = FALSE; DWORD dwLastError = 0; int result; - LPSTR unixPathName = NULL; PERF_ENTRY(SetCurrentDirectoryA); ENTRY("SetCurrentDirectoryA(lpPathName=%p (%s))\n", @@ -665,17 +567,8 @@ SetCurrentDirectoryA( goto done; } - unixPathName = PAL__strdup(lpPathName); - if (unixPathName == NULL ) - { - ERROR("PAL__strdup() failed\n"); - dwLastError = ERROR_NOT_ENOUGH_MEMORY; - goto done; - } - FILEDosToUnixPathA( unixPathName ); - - TRACE("Attempting to open Unix dir [%s]\n", unixPathName); - result = chdir(unixPathName); + TRACE("Attempting to open Unix dir [%s]\n", lpPathName); + result = chdir(lpPathName); if ( result == 0 ) { @@ -687,7 +580,7 @@ SetCurrentDirectoryA( { struct stat stat_data; - if ( stat( unixPathName, &stat_data) == 0 && + if ( stat( lpPathName, &stat_data) == 0 && (stat_data.st_mode & S_IFMT) == S_IFREG ) { /* Not a directory, it is a file. */ @@ -695,7 +588,7 @@ SetCurrentDirectoryA( } else { - FILEGetProperNotFoundError( unixPathName, &dwLastError ); + FILEGetProperNotFoundError( lpPathName, &dwLastError ); } TRACE("chdir() failed, path was invalid.\n"); } @@ -713,11 +606,6 @@ SetCurrentDirectoryA( SetLastError(dwLastError); } - if(unixPathName != NULL) - { - PAL_free( unixPathName ); - } - LOGEXIT("SetCurrentDirectoryA returns BOOL %d\n", bRet); PERF_EXIT(SetCurrentDirectoryA); return bRet; diff --git a/src/shared/pal/src/file/file.cpp b/src/shared/pal/src/file/file.cpp index 393154a955..23d99e4dbd 100644 --- a/src/shared/pal/src/file/file.cpp +++ b/src/shared/pal/src/file/file.cpp @@ -3,8 +3,6 @@ /*++ - - Module Name: file.cpp @@ -13,8 +11,6 @@ Module Name: Implementation of the file WIN API for the PAL - - --*/ #include "pal/dbgmsg.h" @@ -39,6 +35,7 @@ SET_DEFAULT_DEBUG_CHANNEL(FILE); // some headers have code with asserts, so do t #include #include #include +#include using namespace CorUnix; @@ -341,7 +338,7 @@ CorUnix::InternalCanonicalizeRealPath(LPCSTR lpUnixPath, PathCharString& lpBuffe // check if we are going to truncate the "/" corresponding to the // root folder (e.g. case of "/Volumes"). If so: // - // 1) Set the seperator to point to the NULL terminator of the specified + // 1) Set the separator to point to the NULL terminator of the specified // file/folder name. // // 2) Null terminate lpBuffer @@ -465,8 +462,6 @@ CorUnix::InternalCreateFile( goto done; } - FILEDosToUnixPathA( lpUnixPath ); - // Compute the absolute pathname to the file. This pathname is used // to determine if two file names represent the same file. palError = InternalCanonicalizeRealPath(lpUnixPath, lpFullUnixPath); @@ -1035,8 +1030,6 @@ DeleteFileA( goto done; } - FILEDosToUnixPathA( lpunixFileName ); - // Compute the absolute pathname to the file. This pathname is used // to determine if two file names represent the same file. palError = InternalCanonicalizeRealPath(lpunixFileName, lpFullunixFileName); @@ -1072,314 +1065,6 @@ DeleteFileA( return bRet; } -/*++ -Function: - DeleteFileW - -See MSDN doc. ---*/ -BOOL -PALAPI -DeleteFileW( - IN LPCWSTR lpFileName) -{ - CPalThread *pThread; - int size; - PathCharString namePS; - char * name; - int length = 0; - BOOL bRet = FALSE; - - PERF_ENTRY(DeleteFileW); - ENTRY("DeleteFileW(lpFileName=%p (%S))\n", - lpFileName?lpFileName:W16_NULLSTRING, - lpFileName?lpFileName:W16_NULLSTRING); - - pThread = InternalGetCurrentThread(); - - if (lpFileName != NULL) - { - length = (PAL_wcslen(lpFileName)+1) * MaxWCharToAcpLengthFactor; - } - - name = namePS.OpenStringBuffer(length); - if (NULL == name) - { - pThread->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto done; - } - - size = WideCharToMultiByte( CP_ACP, 0, lpFileName, -1, name, length, - NULL, NULL ); - - if( size == 0 ) - { - namePS.CloseBuffer(0); - DWORD dwLastError = GetLastError(); - ASSERT("WideCharToMultiByte failure! error is %d\n", dwLastError); - pThread->SetLastError(ERROR_INTERNAL_ERROR); - bRet = FALSE; - goto done; - } - - namePS.CloseBuffer(size - 1); - bRet = DeleteFileA( name ); - -done: - LOGEXIT("DeleteFileW returns BOOL %d\n", bRet); - PERF_EXIT(DeleteFileW); - return bRet; -} - - -/*++ -Function: - MoveFileExA - -See MSDN doc. ---*/ -BOOL -PALAPI -MoveFileExA( - IN LPCSTR lpExistingFileName, - IN LPCSTR lpNewFileName, - IN DWORD dwFlags) -{ - CPalThread *pThread; - int result; - PathCharString source; - PathCharString dest; - BOOL bRet = TRUE; - DWORD dwLastError = 0; - - PERF_ENTRY(MoveFileExA); - ENTRY("MoveFileExA(lpExistingFileName=%p (%S), lpNewFileName=%p (%S), " - "dwFlags=%#x)\n", - lpExistingFileName?lpExistingFileName:"NULL", - lpExistingFileName?lpExistingFileName:"NULL", - lpNewFileName?lpNewFileName:"NULL", - lpNewFileName?lpNewFileName:"NULL", dwFlags); - - pThread = InternalGetCurrentThread(); - /* only two flags are accepted */ - if ( dwFlags & ~(MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING) ) - { - ASSERT( "dwFlags is invalid\n" ); - dwLastError = ERROR_INVALID_PARAMETER; - goto done; - } - - - if( !source.Set(lpExistingFileName, strlen(lpExistingFileName))) - { - dwLastError = ERROR_NOT_ENOUGH_MEMORY; - goto done; - } - - FILEDosToUnixPathA( source ); - - if( !dest.Set(lpNewFileName, strlen(lpNewFileName))) - { - dwLastError = ERROR_NOT_ENOUGH_MEMORY; - goto done; - } - - FILEDosToUnixPathA( dest ); - - if ( !(dwFlags & MOVEFILE_REPLACE_EXISTING) ) - { -#if HAVE_CASE_SENSITIVE_FILESYSTEM - if ( strcmp(source, dest) != 0 ) -#else // HAVE_CASE_SENSITIVE_FILESYSTEM - if ( strcasecmp(source, dest) != 0 ) -#endif // HAVE_CASE_SENSITIVE_FILESYSTEM - { - // Let things proceed normally if source and - // dest are the same. - if ( access(dest, F_OK) == 0 ) - { - dwLastError = ERROR_ALREADY_EXISTS; - goto done; - } - } - } - - result = rename( source, dest ); - if ((result < 0) && (dwFlags & MOVEFILE_REPLACE_EXISTING) && - ((errno == ENOTDIR) || (errno == EEXIST))) - { - bRet = DeleteFileA( lpNewFileName ); - - if ( bRet ) - { - result = rename( source, dest ); - } - else - { - dwLastError = GetLastError(); - } - } - - if ( result < 0 ) - { - switch( errno ) - { - case EXDEV: /* we tried to link across devices */ - - if ( dwFlags & MOVEFILE_COPY_ALLOWED ) - { - BOOL bFailIfExists = !(dwFlags & MOVEFILE_REPLACE_EXISTING); - - /* if CopyFile fails here, so should MoveFailEx */ - bRet = CopyFileA( lpExistingFileName, - lpNewFileName, - bFailIfExists ); - /* CopyFile should set the appropriate error */ - if ( !bRet ) - { - dwLastError = GetLastError(); - } - else - { - if (!DeleteFileA(lpExistingFileName)) - { - ERROR("Failed to delete the source file\n"); - dwLastError = GetLastError(); - - /* Delete the destination file if we're unable to delete - the source file */ - if (!DeleteFileA(lpNewFileName)) - { - ERROR("Failed to delete the destination file\n"); - } - } - } - } - else - { - dwLastError = ERROR_ACCESS_DENIED; - } - break; - case EINVAL: // tried to rename "." or ".." - dwLastError = ERROR_SHARING_VIOLATION; - break; - case ENOENT: - { - struct stat buf; - if (lstat(source, &buf) == -1) - { - FILEGetProperNotFoundError(source, &dwLastError); - } - else - { - dwLastError = ERROR_PATH_NOT_FOUND; - } - } - break; - default: - dwLastError = FILEGetLastErrorFromErrno(); - break; - } - } - -done: - if ( dwLastError ) - { - pThread->SetLastError( dwLastError ); - bRet = FALSE; - } - - LOGEXIT( "MoveFileExA returns BOOL %d\n", bRet ); - PERF_EXIT(MoveFileExA); - return bRet; -} - -/*++ -Function: - MoveFileExW - -See MSDN doc. ---*/ -BOOL -PALAPI -MoveFileExW( - IN LPCWSTR lpExistingFileName, - IN LPCWSTR lpNewFileName, - IN DWORD dwFlags) -{ - CPalThread *pThread; - PathCharString sourcePS; - PathCharString destPS; - char * source; - char * dest; - int length = 0; - int src_size,dest_size; - BOOL bRet = FALSE; - - PERF_ENTRY(MoveFileExW); - ENTRY("MoveFileExW(lpExistingFileName=%p (%S), lpNewFileName=%p (%S), dwFlags=%#x)\n", - lpExistingFileName?lpExistingFileName:W16_NULLSTRING, - lpExistingFileName?lpExistingFileName:W16_NULLSTRING, - lpNewFileName?lpNewFileName:W16_NULLSTRING, - lpNewFileName?lpNewFileName:W16_NULLSTRING, dwFlags); - - pThread = InternalGetCurrentThread(); - - if (lpExistingFileName != NULL) - { - length = (PAL_wcslen(lpExistingFileName)+1) * MaxWCharToAcpLengthFactor; - } - - source = sourcePS.OpenStringBuffer(length); - if (NULL == source) - { - pThread->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto done; - } - src_size = WideCharToMultiByte( CP_ACP, 0, lpExistingFileName, -1, source, length, - NULL, NULL ); - if( src_size == 0 ) - { - sourcePS.CloseBuffer(0); - DWORD dwLastError = GetLastError(); - ASSERT("WideCharToMultiByte failure! error is %d\n", dwLastError); - pThread->SetLastError(ERROR_INTERNAL_ERROR); - goto done; - } - - sourcePS.CloseBuffer(src_size - 1); - length = 0; - if (lpNewFileName != NULL) - { - length = (PAL_wcslen(lpNewFileName)+1) * MaxWCharToAcpLengthFactor; - } - - dest = destPS.OpenStringBuffer(length); - if (NULL == dest) - { - pThread->SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto done; - } - dest_size = WideCharToMultiByte( CP_ACP, 0, lpNewFileName, -1, dest, length, - NULL, NULL ); - - if( dest_size == 0 ) - { - destPS.CloseBuffer(0); - DWORD dwLastError = GetLastError(); - ASSERT("WideCharToMultiByte failure! error is %d\n", dwLastError); - pThread->SetLastError(ERROR_INTERNAL_ERROR); - goto done; - } - - destPS.CloseBuffer(dest_size - 1); - bRet = MoveFileExA(source,dest,dwFlags); - -done: - LOGEXIT("MoveFileExW returns BOOL %d\n", bRet); - PERF_EXIT(MoveFileExW); - return bRet; -} /*++ Function: @@ -1415,7 +1100,6 @@ GetFileAttributesA( struct stat stat_data; DWORD dwAttr = 0; DWORD dwLastError = 0; - PathCharString unixFileName; PERF_ENTRY(GetFileAttributesA); ENTRY("GetFileAttributesA(lpFileName=%p (%s))\n", lpFileName?lpFileName:"NULL", lpFileName?lpFileName:"NULL"); @@ -1427,18 +1111,9 @@ GetFileAttributesA( goto done; } - - if( !unixFileName.Set(lpFileName, strlen(lpFileName))) + if ( stat(lpFileName, &stat_data) != 0 ) { - dwLastError = ERROR_NOT_ENOUGH_MEMORY; - goto done; - } - - FILEDosToUnixPathA( unixFileName ); - - if ( stat(unixFileName, &stat_data) != 0 ) - { - dwLastError = FILEGetLastErrorFromErrnoAndFilename(unixFileName); + dwLastError = FILEGetLastErrorFromErrnoAndFilename(lpFileName); goto done; } @@ -1623,7 +1298,6 @@ GetFileAttributesExW( goto done; } - FILEDosToUnixPathA(name); /* do the stat */ if ( stat(name, &stat_data) != 0 ) { @@ -1678,6 +1352,230 @@ GetFileAttributesExW( return bRet; } +/*++ +Function: + SetFileAttributesA + +Notes: + Used for setting read-only attribute on file only. + +--*/ +BOOL +PALAPI +SetFileAttributesA( + IN LPCSTR lpFileName, + IN DWORD dwFileAttributes) +{ + CPalThread *pThread; + struct stat stat_data; + mode_t new_mode; + + DWORD dwLastError = 0; + BOOL bRet = FALSE; + + PERF_ENTRY(SetFileAttributesA); + ENTRY("SetFileAttributesA(lpFileName=%p (%s), dwFileAttributes=%#x)\n", + lpFileName?lpFileName:"NULL", + lpFileName?lpFileName:"NULL", dwFileAttributes); + + pThread = InternalGetCurrentThread(); + + /* Windows behavior for SetFileAttributes is that any valid attributes + are set on a file and any invalid attributes are ignored. SetFileAttributes + returns success and does not set an error even if some or all of the + attributes are invalid. If all the attributes are invalid, SetFileAttributes + sets a file's attribute to NORMAL. */ + + /* If dwFileAttributes does not contain READONLY or NORMAL, set it to NORMAL + and print a warning message. */ + if ( !(dwFileAttributes & (FILE_ATTRIBUTE_READONLY |FILE_ATTRIBUTE_NORMAL)) ) + { + dwFileAttributes = FILE_ATTRIBUTE_NORMAL; + WARN("dwFileAttributes(%#x) contains attributes that are either not supported " + "or cannot be set via SetFileAttributes.\n"); + } + + if ( (dwFileAttributes & FILE_ATTRIBUTE_NORMAL) && + (dwFileAttributes != FILE_ATTRIBUTE_NORMAL) ) + { + WARN("Ignoring FILE_ATTRIBUTE_NORMAL -- it must be used alone\n"); + } + + if (lpFileName == NULL) + { + dwLastError = ERROR_FILE_NOT_FOUND; + goto done; + } + + if ( stat(lpFileName, &stat_data) != 0 ) + { + TRACE("stat failed on %s; errno is %d (%s)\n", + lpFileName, errno, strerror(errno)); + dwLastError = FILEGetLastErrorFromErrnoAndFilename(lpFileName); + goto done; + } + + new_mode = stat_data.st_mode; + TRACE("st_mode is %#x\n", new_mode); + + /* if we can't do GetFileAttributesA on it, don't do SetFileAttributesA */ + if ( !(new_mode & S_IFREG) && !(new_mode & S_IFDIR) ) + { + ERROR("Not a regular file or directory, S_IFMT is %#x\n", + new_mode & S_IFMT); + dwLastError = ERROR_ACCESS_DENIED; + goto done; + } + + /* set or unset the "read-only" attribute */ + if (dwFileAttributes & FILE_ATTRIBUTE_READONLY) + { + /* remove the write bit from everybody */ + new_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH); + } + else + { + /* give write permission to the owner if the owner + * already has read permission */ + if ( new_mode & S_IRUSR ) + { + new_mode |= S_IWUSR; + } + } + TRACE("new mode is %#x\n", new_mode); + + bRet = TRUE; + if ( new_mode != stat_data.st_mode ) + { + if ( chmod(lpFileName, new_mode) != 0 ) + { + ERROR("chmod(%s, %#x) failed\n", lpFileName, new_mode); + dwLastError = FILEGetLastErrorFromErrnoAndFilename(lpFileName); + bRet = FALSE; + } + } + +done: + if (dwLastError) + { + pThread->SetLastError(dwLastError); + } + + LOGEXIT("SetFileAttributesA returns BOOL %d\n", bRet); + PERF_EXIT(SetFileAttributesA); + return bRet; +} + +/*++ +Function: + SetFileAttributesW + +Notes: + Used for setting read-only attribute on file only. + +--*/ +BOOL +PALAPI +SetFileAttributesW( + IN LPCWSTR lpFileName, + IN DWORD dwFileAttributes) +{ + CPalThread *pThread; + char * name; + PathCharString namePS; + int length = 0; + int size; + + DWORD dwLastError = 0; + BOOL bRet = FALSE; + + PERF_ENTRY(SetFileAttributesW); + ENTRY("SetFileAttributesW(lpFileName=%p (%S), dwFileAttributes=%#x)\n", + lpFileName?lpFileName:W16_NULLSTRING, + lpFileName?lpFileName:W16_NULLSTRING, dwFileAttributes); + + pThread = InternalGetCurrentThread(); + if (lpFileName == NULL) + { + dwLastError = ERROR_PATH_NOT_FOUND; + goto done; + } + + length = (PAL_wcslen(lpFileName)+1) * MaxWCharToAcpLengthFactor; + name = namePS.OpenStringBuffer(length); + if (NULL == name) + { + dwLastError = ERROR_NOT_ENOUGH_MEMORY; + goto done; + } + size = WideCharToMultiByte( CP_ACP, 0, lpFileName, -1, name, length, + NULL, NULL ); + + if( size == 0 ) + { + namePS.CloseBuffer(0); + dwLastError = GetLastError(); + ASSERT("WideCharToMultiByte failure! error is %d\n", dwLastError); + dwLastError = ERROR_INVALID_PARAMETER; + goto done; + } + namePS.CloseBuffer(size - 1); + bRet = SetFileAttributesA(name,dwFileAttributes); + +done: + if (dwLastError) pThread->SetLastError(dwLastError); + + LOGEXIT("SetFileAttributes returns BOOL %d\n", bRet); + PERF_EXIT(SetFileAttributesW); + return bRet; +} + +/*++ +InternalOpen + +Wrapper for open. + +Input parameters: + +szPath = pointer to a pathname of a file to be opened +nFlags = arguments that control how the file should be accessed +mode = file permission settings that are used only when a file is created + +Return value: + File descriptor on success, -1 on failure +--*/ +int +CorUnix::InternalOpen( + const char *szPath, + int nFlags, + ... + ) +{ + int nRet = -1; + int mode = 0; + va_list ap; + + // If nFlags does not contain O_CREAT, the mode parameter will be ignored. + if (nFlags & O_CREAT) + { + va_start(ap, nFlags); + mode = va_arg(ap, int); + va_end(ap); + } + + do + { +#if OPEN64_IS_USED_INSTEAD_OF_OPEN + nRet = open64(szPath, nFlags, mode); +#else + nRet = open(szPath, nFlags, mode); +#endif + } + while ((nRet == -1) && (errno == EINTR)); + + return nRet; +} + PAL_ERROR CorUnix::InternalWriteFile( CPalThread *pThread, @@ -2067,179 +1965,6 @@ GetStdHandle( return hRet; } -PAL_ERROR -CorUnix::InternalSetEndOfFile( - CPalThread *pThread, - HANDLE hFile - ) -{ - PAL_ERROR palError = 0; - IPalObject *pFileObject = NULL; - CFileProcessLocalData *pLocalData = NULL; - IDataLock *pLocalDataLock = NULL; - - off_t curr = 0; - - if (INVALID_HANDLE_VALUE == hFile) - { - ERROR( "Invalid file handle\n" ); - palError = ERROR_INVALID_HANDLE; - goto InternalSetEndOfFileExit; - } - - palError = g_pObjectManager->ReferenceObjectByHandle( - pThread, - hFile, - &aotFile, - &pFileObject - ); - - if (NO_ERROR != palError) - { - goto InternalSetEndOfFileExit; - } - - palError = pFileObject->GetProcessLocalData( - pThread, - ReadLock, - &pLocalDataLock, - reinterpret_cast(&pLocalData) - ); - - if (NO_ERROR != palError) - { - goto InternalSetEndOfFileExit; - } - - if (pLocalData->open_flags_deviceaccessonly == TRUE) - { - ERROR("File open for device access only\n"); - palError = ERROR_ACCESS_DENIED; - goto InternalSetEndOfFileExit; - } - - curr = lseek(pLocalData->unix_fd, 0, SEEK_CUR); - - TRACE("current file pointer offset is %u\n", curr); - if ( curr < 0 ) - { - ERROR("lseek returned %ld\n", curr); - palError = FILEGetLastErrorFromErrno(); - goto InternalSetEndOfFileExit; - } - -#if SIZEOF_OFF_T > 4 -#if !HAVE_FTRUNCATE_LARGE_LENGTH_SUPPORT - // ftruncate will return the wrong value for some large lengths. - // We'll short-circuit the process and simply return failure for - // the set of values that covers those cases, all of which would - // have failed anyway on any standard-sized hard drive. - if (curr >= 0xFFFFFFFF000ULL) - { - ERROR("Skipping ftruncate because the offset is too large\n"); - palError = ERROR_INVALID_PARAMETER; - goto InternalSetEndOfFileExit; - } -#endif // !HAVE_FTRUNCATE_LARGE_LENGTH_SUPPORT -#endif // SIZEOF_OFF_T - -#if HAS_FTRUNCATE_LENGTH_ISSUE - // Perform an additional check to make sure that there's likely to be enough free space to satisfy the - // request. Do this because it's been observed on Mac OSX that ftruncate can return failure but still - // extend the file to consume the remainder of free space. - // - struct statfs sFileSystemStats; - off_t cbFreeSpace; - if (fstatfs(pLocalData->unix_fd, &sFileSystemStats) != 0) - { - ERROR("fstatfs failed\n"); - palError = FILEGetLastErrorFromErrno(); - goto InternalSetEndOfFileExit; - } - - // Free space is free blocks times the size of each block in bytes. - cbFreeSpace = (off_t)sFileSystemStats.f_bavail * (off_t)sFileSystemStats.f_bsize; - - if (curr > cbFreeSpace) - { - ERROR("Not enough disk space for ftruncate\n"); - palError = ERROR_DISK_FULL; - goto InternalSetEndOfFileExit; - } -#endif // HAS_FTRUNCATE_LENGTH_ISSUE - - if ( ftruncate(pLocalData->unix_fd, curr) != 0 ) - { - ERROR("ftruncate failed\n"); - if ( errno == EACCES ) - { - ERROR("file may not be writable\n"); - } - palError = FILEGetLastErrorFromErrno(); - goto InternalSetEndOfFileExit; - } - - -InternalSetEndOfFileExit: - - // Windows starts returning ERROR_INVALID_PARAMETER at an arbitrary file size (~16TB). The file system - // underneath us may be able to support larger and it would be a shame to prevent that. As a compromise, - // if the operation fails and the file size was above the Windows limit map ERROR_DISK_FULL to - // ERROR_INVALID_PARAMETER. - // curr has been checked to be positive after getting the value from lseek. The following cast is put to - // suppress the compilation warning. - if (palError == ERROR_DISK_FULL && (static_cast(curr) > 0x00000fffffff0000ULL ) ) - palError = ERROR_INVALID_PARAMETER; - - if (NULL != pLocalDataLock) - { - pLocalDataLock->ReleaseLock(pThread, FALSE); - } - - if (NULL != pFileObject) - { - pFileObject->ReleaseReference(pThread); - } - - return palError; -} - - - -/*++ -Function: - SetEndOfFile - -See MSDN doc. ---*/ -BOOL -PALAPI -SetEndOfFile( - IN HANDLE hFile) -{ - PAL_ERROR palError = NO_ERROR; - CPalThread *pThread;; - - PERF_ENTRY(SetEndOfFile); - ENTRY("SetEndOfFile(hFile=%p)\n", hFile); - - pThread = InternalGetCurrentThread(); - - palError = InternalSetEndOfFile( - pThread, - hFile - ); - - if (NO_ERROR != palError) - { - pThread->SetLastError(palError); - } - - LOGEXIT("SetEndOfFile returns BOOL %d\n", NO_ERROR == palError); - PERF_EXIT(SetEndOfFile); - return NO_ERROR == palError; -} - // // We need to break out the actual mechanics of setting the file pointer // on the unix FD for InternalReadFile and InternalWriteFile, as they @@ -2261,8 +1986,8 @@ InternalSetFilePointerForUnixFd( { PAL_ERROR palError = NO_ERROR; int seek_whence = 0; - __int64 seek_offset = 0LL; - __int64 seek_res = 0LL; + int64_t seek_offset = 0LL; + int64_t seek_res = 0LL; off_t old_offset; switch( dwMoveMethod ) @@ -2291,7 +2016,7 @@ InternalSetFilePointerForUnixFd( if ( lpDistanceToMoveHigh ) { /* set the high 32 bits of the offset */ - seek_offset = ((__int64)*lpDistanceToMoveHigh << 32); + seek_offset = ((int64_t)*lpDistanceToMoveHigh << 32); /* set the low 32 bits */ /* cast to unsigned long to avoid sign extension */ @@ -2348,7 +2073,7 @@ InternalSetFilePointerForUnixFd( } } - seek_res = (__int64)lseek( iUnixFd, + seek_res = (int64_t)lseek( iUnixFd, seek_offset, seek_whence ); if ( seek_res < 0 ) @@ -2953,16 +2678,15 @@ GetTempFileNameA( file_templatePS.CloseBuffer(length); chLastPathNameChar = file_template[strlen(file_template)-1]; - if (chLastPathNameChar != '\\' && chLastPathNameChar != '/') + if (chLastPathNameChar != '/') { - strcat_s( file_template, file_templatePS.GetSizeOf(), "\\" ); + strcat_s( file_template, file_templatePS.GetSizeOf(), "/" ); } if ( lpPrefixString ) { strncat_s( file_template, file_templatePS.GetSizeOf(), lpPrefixString, MAX_PREFIX ); } - FILEDosToUnixPathA( file_template ); strncat_s( file_template, file_templatePS.GetSizeOf(), "%.4x.TMP", MAX_SEEDSIZE ); /* Create the file. */ @@ -3158,7 +2882,7 @@ GetTempFileNameW( prefix_stringPS.CloseBuffer(prefix_size - 1); } - tempfile_name = (char*)InternalMalloc(MAX_LONGPATH); + tempfile_name = (char*)malloc(MAX_LONGPATH); if (tempfile_name == NULL) { pThread->SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -3313,7 +3037,6 @@ CopyFileA( DWORD dwSrcFileAttributes; struct stat SrcFileStats; - LPSTR lpUnixPath = NULL; const int buffer_size = 16*1024; char *buffer = (char*)alloca(buffer_size); DWORD bytes_read; @@ -3361,18 +3084,10 @@ CopyFileA( } /* Need to preserve the owner/group and chmod() flags */ - lpUnixPath = strdup(lpExistingFileName); - if ( lpUnixPath == NULL ) - { - ERROR("strdup() failed\n"); - pThread->SetLastError(FILEGetLastErrorFromErrno()); - goto done; - } - FILEDosToUnixPathA(lpUnixPath); - if (stat (lpUnixPath, &SrcFileStats) == -1) + if (stat (lpExistingFileName, &SrcFileStats) == -1) { ERROR("stat() failed for %s\n", lpExistingFileName); - pThread->SetLastError(FILEGetLastErrorFromErrnoAndFilename(lpUnixPath)); + pThread->SetLastError(FILEGetLastErrorFromErrnoAndFilename(lpExistingFileName)); goto done; } @@ -3390,17 +3105,6 @@ CopyFileA( goto done; } - free(lpUnixPath); - lpUnixPath = strdup(lpNewFileName); - if ( lpUnixPath == NULL ) - { - ERROR("strdup() failed\n"); - pThread->SetLastError(FILEGetLastErrorFromErrno()); - goto done; - } - FILEDosToUnixPathA( lpUnixPath ); - - // We don't set file attributes in CreateFile. The only attribute // that is reflected on disk in Unix is read-only, and we set that // here. @@ -3411,11 +3115,11 @@ CopyFileA( } /* Make sure the new file has the same chmod() flags. */ - if (chmod(lpUnixPath, SrcFileStats.st_mode & permissions) == -1) + if (chmod(lpNewFileName, SrcFileStats.st_mode & permissions) == -1) { WARN ("chmod() failed to set mode 0x%x on new file\n", SrcFileStats.st_mode & permissions); - pThread->SetLastError(FILEGetLastErrorFromErrnoAndFilename(lpUnixPath)); + pThread->SetLastError(FILEGetLastErrorFromErrnoAndFilename(lpNewFileName)); goto done; } @@ -3451,17 +3155,12 @@ CopyFileA( { CloseHandle( hDest ); } - if (lpUnixPath) - { - free(lpUnixPath); - } LOGEXIT("CopyFileA returns BOOL %d\n", bGood); PERF_EXIT(CopyFileA); return bGood; } - PAL_ERROR CorUnix::InternalCreatePipe( CPalThread *pThread, @@ -3895,42 +3594,3 @@ BOOL FILEInitStdHandles(void) pStdErr = INVALID_HANDLE_VALUE; return FALSE; } - -/*++ -FILECleanupStdHandles - -Remove all regions, locked by a file pointer, from shared memory - -(no parameters) - ---*/ -void FILECleanupStdHandles(void) -{ - HANDLE stdin_handle; - HANDLE stdout_handle; - HANDLE stderr_handle; - - TRACE("closing standard handles\n"); - stdin_handle = pStdIn; - stdout_handle = pStdOut; - stderr_handle = pStdErr; - - pStdIn = INVALID_HANDLE_VALUE; - pStdOut = INVALID_HANDLE_VALUE; - pStdErr = INVALID_HANDLE_VALUE; - - if (stdin_handle != INVALID_HANDLE_VALUE) - { - CloseHandle(stdin_handle); - } - - if (stdout_handle != INVALID_HANDLE_VALUE) - { - CloseHandle(stdout_handle); - } - - if (stderr_handle != INVALID_HANDLE_VALUE) - { - CloseHandle(stderr_handle); - } -} diff --git a/src/shared/pal/src/file/filetime.cpp b/src/shared/pal/src/file/filetime.cpp index 768ee426c4..edff44949d 100644 --- a/src/shared/pal/src/file/filetime.cpp +++ b/src/shared/pal/src/file/filetime.cpp @@ -95,11 +95,11 @@ SET_DEFAULT_DEBUG_CHANNEL(FILE); This result is also confirmed in the MSDN documentation on how to convert a time_t value to a win32 FILETIME. */ -static const __int64 SECS_BETWEEN_1601_AND_1970_EPOCHS = 11644473600LL; -static const __int64 SECS_TO_100NS = 10000000; /* 10^7 */ +static const int64_t SECS_BETWEEN_1601_AND_1970_EPOCHS = 11644473600LL; +static const int64_t SECS_TO_100NS = 10000000; /* 10^7 */ #ifdef __APPLE__ -static const __int64 SECS_BETWEEN_1601_AND_2001_EPOCHS = 12622780800LL; +static const int64_t SECS_BETWEEN_1601_AND_2001_EPOCHS = 12622780800LL; #endif // __APPLE__ /*++ @@ -114,8 +114,8 @@ CompareFileTime( IN CONST FILETIME *lpFileTime1, IN CONST FILETIME *lpFileTime2) { - __int64 First; - __int64 Second; + int64_t First; + int64_t Second; long Ret; @@ -123,9 +123,9 @@ CompareFileTime( ENTRY("CompareFileTime(lpFileTime1=%p lpFileTime2=%p)\n", lpFileTime1, lpFileTime2); - First = ((__int64)lpFileTime1->dwHighDateTime << 32) + + First = ((int64_t)lpFileTime1->dwHighDateTime << 32) + lpFileTime1->dwLowDateTime; - Second = ((__int64)lpFileTime2->dwHighDateTime << 32) + + Second = ((int64_t)lpFileTime2->dwHighDateTime << 32) + lpFileTime2->dwLowDateTime; if ( First < Second ) @@ -188,35 +188,6 @@ GetSystemTimeAsFileTime( } -#ifdef __APPLE__ -/*++ -Function: - FILECFAbsoluteTimeToFileTime - -Convert a CFAbsoluteTime value to a win32 FILETIME structure, as described -in MSDN documentation. CFAbsoluteTime is the number of seconds elapsed since -00:00 01 January 2001 UTC (Mac OS X epoch), while FILETIME represents a -64-bit number of 100-nanosecond intervals that have passed since 00:00 -01 January 1601 UTC (win32 epoch). ---*/ -FILETIME FILECFAbsoluteTimeToFileTime( CFAbsoluteTime sec ) -{ - __int64 Result; - FILETIME Ret; - - Result = ((__int64)sec + SECS_BETWEEN_1601_AND_2001_EPOCHS) * SECS_TO_100NS; - - Ret.dwLowDateTime = (DWORD)Result; - Ret.dwHighDateTime = (DWORD)(Result >> 32); - - TRACE("CFAbsoluteTime = [%9f] converts to Win32 FILETIME = [%#x:%#x]\n", - sec, Ret.dwHighDateTime, Ret.dwLowDateTime); - - return Ret; -} -#endif // __APPLE__ - - /*++ Function: FILEUnixTimeToFileTime @@ -229,10 +200,10 @@ MSDN documentation. time_t is the number of seconds elapsed since --*/ FILETIME FILEUnixTimeToFileTime( time_t sec, long nsec ) { - __int64 Result; + int64_t Result; FILETIME Ret; - Result = ((__int64)sec + SECS_BETWEEN_1601_AND_1970_EPOCHS) * SECS_TO_100NS + + Result = ((int64_t)sec + SECS_BETWEEN_1601_AND_1970_EPOCHS) * SECS_TO_100NS + (nsec / 100); Ret.dwLowDateTime = (DWORD)Result; @@ -292,18 +263,24 @@ BOOL PALAPI FileTimeToSystemTime( CONST FILETIME * lpFileTime, #else /* HAVE_GMTIME_R */ UnixSystemTime = gmtime( &UnixFileTime ); #endif /* HAVE_GMTIME_R */ - + if (!UnixSystemTime) + { + ERROR( "gmtime failed.\n" ); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + /* Convert unix system time to Windows system time. */ - lpSystemTime->wDay = UnixSystemTime->tm_mday; + lpSystemTime->wDay = (WORD)UnixSystemTime->tm_mday; /* Unix time counts January as a 0, under Windows it is 1*/ - lpSystemTime->wMonth = UnixSystemTime->tm_mon + 1; + lpSystemTime->wMonth = (WORD)UnixSystemTime->tm_mon + 1; /* Unix time returns the year - 1900, Windows returns the current year*/ - lpSystemTime->wYear = UnixSystemTime->tm_year + 1900; + lpSystemTime->wYear = (WORD)UnixSystemTime->tm_year + 1900; - lpSystemTime->wSecond = UnixSystemTime->tm_sec; - lpSystemTime->wMinute = UnixSystemTime->tm_min; - lpSystemTime->wHour = UnixSystemTime->tm_hour; + lpSystemTime->wSecond = (WORD)UnixSystemTime->tm_sec; + lpSystemTime->wMinute = (WORD)UnixSystemTime->tm_min; + lpSystemTime->wHour = (WORD)UnixSystemTime->tm_hour; return TRUE; } else diff --git a/src/shared/pal/src/file/find.cpp b/src/shared/pal/src/file/find.cpp index 8f2431abfa..ead5c4335e 100644 --- a/src/shared/pal/src/file/find.cpp +++ b/src/shared/pal/src/file/find.cpp @@ -138,7 +138,7 @@ FindFirstFileA( goto done; } - find_data = (find_obj *)InternalMalloc(sizeof(find_obj)); + find_data = (find_obj *)malloc(sizeof(find_obj)); if ( find_data == NULL ) { ERROR("Unable to allocate memory for find_data\n"); @@ -177,7 +177,6 @@ FindFirstFileA( SetLastError( ERROR_INTERNAL_ERROR ); goto done; } - FILEDosToUnixPathA( lpTemp ); FILEGetProperNotFoundError( lpTemp, &dwLastError ); if ( ERROR_PATH_NOT_FOUND == dwLastError ) @@ -909,11 +908,6 @@ static BOOL FILEDosGlobA( CPalThread *pthrCurrent, goto done; } - if (Dir[0] != 0) - { - FILEDosToUnixPathA( Dir ); - } - /* The meat of the routine happens below. Basically, there are three special things to check for: diff --git a/src/shared/pal/src/file/path.cpp b/src/shared/pal/src/file/path.cpp index 469756e6ce..62418b240d 100644 --- a/src/shared/pal/src/file/path.cpp +++ b/src/shared/pal/src/file/path.cpp @@ -73,7 +73,7 @@ GetFullPathNameA( } /* find out if lpFileName is a partial or full path */ - if ('\\' == *lpFileName || '/' == *lpFileName) + if ('/' == *lpFileName) { fullPath = TRUE; } @@ -112,8 +112,6 @@ GetFullPathNameA( } unixPathBuf = unixPath.OpenStringBuffer(unixPath.GetCount()); - /* do conversion to Unix path */ - FILEDosToUnixPathA( unixPathBuf ); /* now we can canonicalize this */ FILECanonicalizePath(unixPathBuf); @@ -433,57 +431,6 @@ GetTempPathW( } - -/*++ -Function: - FileDosToUnixPathA - -Abstract: - Change a DOS path to a Unix path. - - Replaces '\' by '/' - -Parameter: - IN/OUT lpPath: path to be modified ---*/ -void -FILEDosToUnixPathA( - LPSTR lpPath) -{ - LPSTR p; - - TRACE("Original DOS path = [%s]\n", lpPath); - - if (!lpPath) - { - return; - } - - for (p = lpPath; *p; p++) - { - /* Replace \ with / */ - if (*p == '\\') - { - *p = '/'; - } - } - - TRACE("Resulting Unix path = [%s]\n", lpPath); -} - -void -FILEDosToUnixPathA( - PathCharString& lpPath) -{ - - SIZE_T len = lpPath.GetCount(); - LPSTR lpPathBuf = lpPath.OpenStringBuffer(len); - FILEDosToUnixPathA(lpPathBuf); - lpPath.CloseBuffer(len); - -} - - /*++ Function: FILEGetDirectoryFromFullPathA @@ -506,7 +453,7 @@ DWORD FILEGetDirectoryFromFullPathA( LPCSTR lpFullPath, /* look for the first path separator backwards */ lpDirEnd = lpFullPath + full_len - 1; - while( lpDirEnd >= lpFullPath && *lpDirEnd != '/' && *lpDirEnd != '\\') + while( lpDirEnd >= lpFullPath && *lpDirEnd != '/') --lpDirEnd; dir_len = lpDirEnd - lpFullPath + 1; /* +1 for fencepost */ @@ -646,7 +593,7 @@ void FILECanonicalizePath(LPSTR lpUnixPath) } } - /* step 5 : remove a traling '/.' */ + /* step 5 : remove a trailing '/.' */ slashdotptr = strstr(lpUnixPath,"/."); if (slashdotptr != NULL && slashdotptr[2] == '\0') @@ -734,7 +681,7 @@ SearchPathW( /* special case : if file name contains absolute path, don't search the provided path */ - if('\\' == lpFileName[0] || '/' == lpFileName[0]) + if(L'/' == lpFileName[0]) { /* Canonicalize the path to deal with back-to-back '/', etc. */ length = MAX_LONGPATH; //Use it for first try @@ -935,43 +882,3 @@ SearchPathW( PERF_EXIT(SearchPathW); return nRet; } - -/*++ -Function: - PathFindFileNameW - -See MSDN doc. ---*/ -LPWSTR -PALAPI -PathFindFileNameW( - IN LPCWSTR pPath - ) -{ - PERF_ENTRY(PathFindFileNameW); - ENTRY("PathFindFileNameW(pPath=%p (%S))\n", - pPath?pPath:W16_NULLSTRING, - pPath?pPath:W16_NULLSTRING); - - LPWSTR ret = (LPWSTR)pPath; - if (ret != NULL && *ret != W('\0')) - { - ret = PAL_wcschr(ret, W('\0')) - 1; - if (ret > pPath && *ret == W('/')) - { - ret--; - } - while (ret > pPath && *ret != W('/')) - { - ret--; - } - if (*ret == W('/') && *(ret + 1) != W('\0')) - { - ret++; - } - } - - LOGEXIT("PathFindFileNameW returns %S\n", ret); - PERF_EXIT(PathFindFileNameW); - return ret; -} diff --git a/src/shared/pal/src/handlemgr/handlemgr.cpp b/src/shared/pal/src/handlemgr/handlemgr.cpp index 5dc198c7f5..09405f1ec5 100644 --- a/src/shared/pal/src/handlemgr/handlemgr.cpp +++ b/src/shared/pal/src/handlemgr/handlemgr.cpp @@ -51,7 +51,7 @@ CSimpleHandleManager::Initialize( field, with the head in the global 'm_hiFreeListStart'. */ m_dwTableSize = m_dwTableGrowthRate; - m_rghteHandleTable = reinterpret_cast(InternalMalloc((m_dwTableSize * sizeof(HANDLE_TABLE_ENTRY)))); + m_rghteHandleTable = reinterpret_cast(malloc((m_dwTableSize * sizeof(HANDLE_TABLE_ENTRY)))); if(NULL == m_rghteHandleTable) { ERROR("Unable to create initial handle table array"); @@ -108,7 +108,7 @@ CSimpleHandleManager::AllocateHandle( } /* grow handle table */ - rghteTempTable = reinterpret_cast(InternalRealloc( + rghteTempTable = reinterpret_cast(realloc( m_rghteHandleTable, (m_dwTableSize + m_dwTableGrowthRate) * sizeof(HANDLE_TABLE_ENTRY))); diff --git a/src/shared/pal/src/include/pal/corunix.hpp b/src/shared/pal/src/include/pal/corunix.hpp index 79bdf02600..efc8e49bf8 100644 --- a/src/shared/pal/src/include/pal/corunix.hpp +++ b/src/shared/pal/src/include/pal/corunix.hpp @@ -141,7 +141,7 @@ namespace CorUnix // have already deleted it. ($$REIVEW -- would someone ever need access // to the shared data in order to cleanup process local state?) // - // When the third paramter (fShutdown) is TRUE the process is in + // When the third parameter (fShutdown) is TRUE the process is in // the act of exiting. The cleanup routine should not perform any // unnecessary cleanup operations (e.g., closing file descriptors, // since the OS will automatically close them when the process exits) @@ -183,7 +183,8 @@ namespace CorUnix enum PalObjectTypeId { - otiFile = 0, + otiMutex, + otiFile, otiFileMapping, otiProcess, otiThread, @@ -1094,7 +1095,7 @@ namespace CorUnix enum ThreadWakeupReason { WaitSucceeded, - MutexAbondoned, + MutexAbandoned, WaitTimeout, WaitFailed }; diff --git a/src/shared/pal/src/include/pal/cruntime.h b/src/shared/pal/src/include/pal/cruntime.h index dd19618f1b..b09559565f 100644 --- a/src/shared/pal/src/include/pal/cruntime.h +++ b/src/shared/pal/src/include/pal/cruntime.h @@ -27,158 +27,6 @@ Module Name: #ifdef __cplusplus typedef char16_t wchar_16; // __wchar_16 (which is defined in palinternal.h) is defined as wchar_16_cpp. -extern "C" -{ -#endif // __cplusplus - -typedef enum -{ - PFF_NONE = 0, - PFF_MINUS = 1, - PFF_POUND = 2, - PFF_ZERO = 4, - PFF_SPACE = 8, - PFF_PLUS = 16 -}PRINTF_FORMAT_FLAGS; - -typedef enum -{ - WIDTH_DEFAULT = -1, - WIDTH_STAR = -2, /* e.g. "%*.10s" */ - WIDTH_INVALID = -3 /* e.g. "%*3.10s" */ -}WIDTH_FLAGS; - -typedef enum -{ - PRECISION_DEFAULT = -1, - PRECISION_STAR = -2, /* e.g. "%10.*s" */ - PRECISION_DOT = -3, /* e.g. "%10.s" */ - PRECISION_INVALID = -4 /* e.g. "%10.*3s" */ -}PRECISION_FLAGS; - -typedef enum -{ - PFF_PREFIX_DEFAULT = -1, - PFF_PREFIX_SHORT = 1, - PFF_PREFIX_LONG = 2, - PFF_PREFIX_LONGLONG = 3, - PFF_PREFIX_LONG_W = 4 -}PRINTF_PREFIXES; - -typedef enum -{ - PFF_TYPE_DEFAULT = -1, - PFF_TYPE_CHAR = 1, - PFF_TYPE_STRING = 2, - PFF_TYPE_WSTRING = 3, - PFF_TYPE_INT = 4, - PFF_TYPE_P = 5, - PFF_TYPE_N = 6, - PFF_TYPE_FLOAT = 7 -}PRINTF_TYPES; - -typedef enum -{ - SCANF_PREFIX_SHORT = 1, - SCANF_PREFIX_LONG = 2, - SCANF_PREFIX_LONGLONG = 3 -}SCANF_PREFIXES; - -typedef enum -{ - SCANF_TYPE_CHAR = 1, - SCANF_TYPE_STRING = 2, - SCANF_TYPE_INT = 3, - SCANF_TYPE_N = 4, - SCANF_TYPE_FLOAT = 5, - SCANF_TYPE_BRACKETS = 6, - SCANF_TYPE_SPACE = 7 -}SCANF_TYPES; - -/******************************************************************************* -Function: - PAL_printf_arg_remover - -Parameters: - ap - - pointer to the va_list from which to remove arguments - Width - - the width of the current format option - Precision - - the precision of the current format option - Type - - the type of the argument for the current format option - Prefix - - the prefix for the current format option -*******************************************************************************/ -void PAL_printf_arg_remover(va_list *ap, INT Width, INT Precision, INT Type, INT Prefix); - -/*++ -Function: - Silent_PAL_vsnprintf - -See MSDN doc. ---*/ -INT Silent_PAL_vsnprintf(LPSTR Buffer, INT Count, LPCSTR Format, va_list ap); - -/*++ -Function: - Silent_PAL_vfprintf - -See MSDN doc. ---*/ -int Silent_PAL_vfprintf(PAL_FILE *stream, const char *format, va_list ap); - - - - -/*++ - -struct PAL_FILE. -Used to mimic the behavior of windows. -fwrite under windows can set the ferror flag, -under BSD fwrite doesn't. ---*/ -struct _FILE -{ - FILE * bsdFilePtr; /* The BSD file to be passed to the - functions needing it. */ - - INT PALferrorCode; /* The ferror code that fwrite sets, - incase of error */ - - BOOL bTextMode; /* Boolean variable to denote that the - fle is opened in text/binary mode*/ -#if UNGETC_NOT_RETURN_EOF - BOOL bWriteOnlyMode;/* Boolean variable to denote that the - fle is opened in write-only mode*/ -#endif //UNGETC_NOT_RETURN_EOF -}; - -enum CRT_ERROR_CODES -{ - PAL_FILE_NOERROR = 0, - PAL_FILE_ERROR -}; - -/* Global variables storing the std streams. Defined in cruntime/file.c. */ -extern PAL_FILE PAL_Stdout; -extern PAL_FILE PAL_Stdin; -extern PAL_FILE PAL_Stderr; - -/*++ - -Functio: - - CRTInitStdStreams. - - Initilizes the standard streams. - Returns TRUE on success, FALSE otherwise. ---*/ -BOOL CRTInitStdStreams( void ); - -#ifdef __cplusplus -} #endif // __cplusplus #endif /* _PAL_CRUNTIME_H_ */ diff --git a/src/shared/pal/src/include/pal/cs.hpp b/src/shared/pal/src/include/pal/cs.hpp index 5fc1d2e325..cb374ffa1e 100644 --- a/src/shared/pal/src/include/pal/cs.hpp +++ b/src/shared/pal/src/include/pal/cs.hpp @@ -38,10 +38,6 @@ namespace CorUnix CRITICAL_SECTION *pcs ); - bool InternalTryEnterCriticalSection( - CPalThread * pThread, - PCRITICAL_SECTION pCriticalSection); - #ifdef _DEBUG void PALCS_ReportStatisticalData(void); void PALCS_DumpCSList(); diff --git a/src/shared/pal/src/include/pal/dbgmsg.h b/src/shared/pal/src/include/pal/dbgmsg.h index e5694a7f59..ca8d1454de 100644 --- a/src/shared/pal/src/include/pal/dbgmsg.h +++ b/src/shared/pal/src/include/pal/dbgmsg.h @@ -27,7 +27,7 @@ Available macros : This defines the channel to use with the macros TRACE, ERROR, etc Use this macro once at the beginning of your source file. (impl. details : this declares a constant static variable defdbgchan and - sets it to the apropriate channel) + sets it to the appropriate channel) usage : SET_DEFAULT_DEBUG_CHANNEL(somechannel); diff --git a/src/shared/pal/src/include/pal/file.h b/src/shared/pal/src/include/pal/file.h index d56d5df8b6..0ec765317d 100644 --- a/src/shared/pal/src/include/pal/file.h +++ b/src/shared/pal/src/include/pal/file.h @@ -25,6 +25,7 @@ Revision History: #include "pal/stackstring.hpp" #include #include +#include #ifdef __cplusplus extern "C" @@ -59,19 +60,6 @@ Notes : --*/ void FILECanonicalizePath(LPSTR lpUnixPath); -/*++ -Function: - FileDosToUnixPathA - -Abstract: - Change a DOS path to a Unix path. Replace '\' by '/'. - -Parameter: - IN/OUT lpPath: path to be modified ---*/ -void -FILEDosToUnixPathA(LPSTR lpPath); - /*++ Function: FILEGetDirectoryFromFullPathA @@ -114,15 +102,6 @@ Return value: --*/ BOOL FILEInitStdHandles(void); -/*++ -FILECleanupStdHandles - -Close promary handles for stdin, stdout and stderr - -(no parameters, no return value) ---*/ -void FILECleanupStdHandles(void); - /*++ Function : @@ -136,86 +115,6 @@ Windows behavoir. */ void FILEGetProperNotFoundError( LPCSTR lpPath, LPDWORD lpErrorCode ); -/*++ -PAL_fflush - -Calls fflush - -Input parameters: - -PAL_FILE *stream = stream to be flushed. - -Return value: - 0 is returned on success, otherwise EOF is returned. ---*/ -int _cdecl PAL_fflush( PAL_FILE *stream ); - -/*++ -PAL_fgets - -Wrapper function for InternalFgets. - -Input parameters: - -sz = stores characters read from the given file stream -nSize = number of characters to be read -pf = stream to read characters from - -Return value: - Returns a pointer to the string storing the characters on success - and NULL on failure. ---*/ -char * __cdecl PAL_fgets(char *sz, int nSize, PAL_FILE *pf); - -/*++ -PAL_fwrite - -Wrapper function for InternalFwrite - -Input parameters: - -pvBuffer = array of objects to write to the given file stream -nSize = size of a object in bytes -nCount = number of objects to write -pf = stream to write characters to - -Return value: - Returns the number of objects written. ---*/ -size_t __cdecl PAL_fwrite(const void *pvBuffer, size_t nSize, size_t nCount, PAL_FILE *pf); - -/*++ -PAL__open - -Wrapper function for InternalOpen. - -Input parameters: - -szPath = pointer to a pathname of a file to be opened -nFlags = arguments that control how the file should be accessed -mode = file permission settings that are used only when a file is created - -Return value: - File descriptor on success, -1 on failure ---*/ -int __cdecl PAL__open(const char *szPath, int nFlags, ...); - -/*++ -PAL_fseek - -Wrapper function for fseek - -Input parameters: - -pf = a given file stream -lOffset = distance from position to set file-position indicator -nWhence = method used to determine the file_position indicator location relative to lOffset - -Return value: - 0 on success, -1 on failure. ---*/ -int _cdecl PAL_fseek(PAL_FILE *pf, LONG lOffset, int nWhence); - #ifdef __cplusplus } #endif // __cplusplus diff --git a/src/shared/pal/src/include/pal/file.hpp b/src/shared/pal/src/include/pal/file.hpp index d16a3ee197..9f162b70ff 100644 --- a/src/shared/pal/src/include/pal/file.hpp +++ b/src/shared/pal/src/include/pal/file.hpp @@ -76,12 +76,6 @@ namespace CorUnix LPOVERLAPPED lpOverlapped ); - PAL_ERROR - InternalSetEndOfFile( - CPalThread *pThread, - HANDLE hFile - ); - PAL_ERROR InternalGetFileSize( CPalThread *pThread, @@ -132,31 +126,6 @@ namespace CorUnix PathCharString& lpBuffer ); - /*++ - InternalFgets - Wraps fgets - --*/ - char * - InternalFgets( - char *sz, - int nSize, - FILE *f, - bool fTextMode - ); - - /*++ - InternalFwrite - Wraps fwrite - --*/ - size_t - InternalFwrite( - const void *pvBuffer, - size_t nSize, - size_t nCount, - FILE *f, - INT *pnErrorCode - ); - /*++ InternalOpen Wraps open @@ -174,7 +143,7 @@ extern "C" // // These routines should all be separated out into something along the lines -// of fileutils.* (instead of being commingled with the core file object +// of fileutils.* (instead of being comingled with the core file object // code). // @@ -196,19 +165,6 @@ Notes : --*/ void FILECanonicalizePath(LPSTR lpUnixPath); -/*++ -Function: - FileDosToUnixPathA - -Abstract: - Change a DOS path to a Unix path. Replace '\' by '/'. - -Parameter: - IN/OUT lpPath: path to be modified ---*/ -void -FILEDosToUnixPathA(LPSTR lpPath); - /*++ Function: FILEGetDirectoryFromFullPathA @@ -243,15 +199,6 @@ Return value: --*/ BOOL FILEInitStdHandles(void); -/*++ -FILECleanupStdHandles - -Close primary handles for stdin, stdout and stderr - -(no parameters, no return value) ---*/ -void FILECleanupStdHandles(void); - /*++ Function : diff --git a/src/shared/pal/src/include/pal/filetime.h b/src/shared/pal/src/include/pal/filetime.h index 5a06cb5c30..cf177058be 100644 --- a/src/shared/pal/src/include/pal/filetime.h +++ b/src/shared/pal/src/include/pal/filetime.h @@ -63,12 +63,6 @@ extern "C" FILETIME FILEUnixTimeToFileTime( time_t sec, long nsec ); -#ifdef __APPLE__ -#include - -FILETIME FILECFAbsoluteTimeToFileTime( CFAbsoluteTime sec ); -#endif // __APPLE__ - #ifdef __cplusplus } #endif // __cplusplus diff --git a/src/shared/pal/src/include/pal/init.h b/src/shared/pal/src/include/pal/init.h index 9544a369d3..87eb04dd72 100644 --- a/src/shared/pal/src/include/pal/init.h +++ b/src/shared/pal/src/include/pal/init.h @@ -86,14 +86,14 @@ PALSetShutdownIntent(); Function: PALInitLock -Take the initializaiton critical section (init_critsec). necessary to serialize +Take the initialization critical section (init_critsec). necessary to serialize TerminateProcess along with PAL_Terminate and PAL_Initialize (no parameters) Return value : TRUE if critical section existed (and was acquired) - FALSE if critical section doens't exist yet + FALSE if critical section doesn't exist yet --*/ BOOL PALInitLock(void); diff --git a/src/shared/pal/src/include/pal/list.h b/src/shared/pal/src/include/pal/list.h index 5357e12f7a..8f4d734ba3 100644 --- a/src/shared/pal/src/include/pal/list.h +++ b/src/shared/pal/src/include/pal/list.h @@ -27,6 +27,8 @@ extern "C" { #endif // __cplusplus +#include + typedef struct _LIST_ENTRY { struct _LIST_ENTRY *Flink; struct _LIST_ENTRY *Blink; @@ -130,7 +132,7 @@ typedef struct _LIST_ENTRY { #define CONTAINING_RECORD(address, type, field) ((type *)( \ (PCHAR)(address) - \ - (ULONG_PTR)(&((type *)0)->field))) + (ULONG_PTR)offsetof(type, field))) #ifdef __cplusplus } diff --git a/src/shared/pal/src/include/pal/malloc.hpp b/src/shared/pal/src/include/pal/malloc.hpp index fb7c88d128..65715fa938 100644 --- a/src/shared/pal/src/include/pal/malloc.hpp +++ b/src/shared/pal/src/include/pal/malloc.hpp @@ -26,102 +26,17 @@ Module Name: #include #include -extern "C" -{ - void * - __cdecl - PAL_realloc( - void* pvMemblock, - size_t szSize - ); - - void * - __cdecl - PAL_malloc( - size_t szSize - ); - - void - __cdecl - PAL_free( - void *pvMem - ); - - char * - __cdecl - PAL__strdup( - const char *c_szStr - ); -} - namespace CorUnix{ - - void * - InternalRealloc( - void *pvMemblock, - size_t szSize - ); - - void * - InternalMalloc( - size_t szSize - ); - - // Define common code for "new" style allocators below. -#define INTERNAL_NEW_COMMON() \ - T *pMem = (T*)InternalMalloc(sizeof(T)); \ - if (pMem == NULL) \ - return NULL; - - // Define "new" style allocators (which allocate then call a constructor) for different numbers of - // constructor arguments. Added based on usage. - - // Default constructor (0 args) case. - template - T* InternalNew() + // Define "new" style allocators (which allocate then call a constructor). + template + T* InternalNew(Ts... args) { - INTERNAL_NEW_COMMON(); - return new (pMem) T(); - } + T* pMem = (T*)malloc(sizeof(T)); - // 1 arg case. - template - T* InternalNew(A1 arg1) - { - INTERNAL_NEW_COMMON(); - return new (pMem) T(arg1); - } - - // 2 args case. - template - T* InternalNew(A1 arg1, A2 arg2) - { - INTERNAL_NEW_COMMON(); - return new (pMem) T(arg1, arg2); - } - - // 3 args case. - template - T* InternalNew(A1 arg1, A2 arg2, A3 arg3) - { - INTERNAL_NEW_COMMON(); - return new (pMem) T(arg1, arg2, arg3); - } - - // 4 args case. - template - T* InternalNew(A1 arg1, A2 arg2, A3 arg3, A4 arg4) - { - INTERNAL_NEW_COMMON(); - return new (pMem) T(arg1, arg2, arg3, arg4); - } + if (pMem == NULL) + return NULL; - // 5 args case. - template - T* InternalNew(A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5) - { - INTERNAL_NEW_COMMON(); - return new (pMem) T(arg1, arg2, arg3, arg4, arg5); + return new (pMem) T(args...); } template T* InternalNewArray(size_t cElements) @@ -129,7 +44,7 @@ namespace CorUnix{ size_t cbSize = (cElements * sizeof(T)) + sizeof(size_t); T *pMem; - pMem = (T*)InternalMalloc(cbSize); + pMem = (T*)malloc(cbSize); if (pMem == NULL) return NULL; diff --git a/src/shared/pal/src/include/pal/misc.h b/src/shared/pal/src/include/pal/misc.h index aa5b2b4852..ffa6448ed7 100644 --- a/src/shared/pal/src/include/pal/misc.h +++ b/src/shared/pal/src/include/pal/misc.h @@ -25,23 +25,6 @@ extern "C" { #endif // __cplusplus -/*++ -Function : - - PAL_rand - - Calls rand and mitigates the difference between RAND_MAX - on Windows and FreeBSD. ---*/ -int __cdecl PAL_rand(void); - -/*++ -Function : - - PAL_time ---*/ -PAL_time_t __cdecl PAL_time(PAL_time_t*); - /*++ Function : MsgBoxInitialize diff --git a/src/shared/pal/src/include/pal/module.h b/src/shared/pal/src/include/pal/module.h index 2dfda9ec0a..622a5bf9b4 100644 --- a/src/shared/pal/src/include/pal/module.h +++ b/src/shared/pal/src/include/pal/module.h @@ -134,21 +134,6 @@ Return --*/ void UnlockModuleList(); -/*++ -Function : - LOADGetPalLibrary - - Load and initialize the PAL module. - -Parameters : - None - -Return value : - handle to loaded module - ---*/ -MODSTRUCT *LOADGetPalLibrary(); - #ifdef __cplusplus } #endif // __cplusplus diff --git a/src/shared/pal/src/include/pal/palinternal.h b/src/shared/pal/src/include/pal/palinternal.h index d7da7ef7c4..3fa16f38cf 100644 --- a/src/shared/pal/src/include/pal/palinternal.h +++ b/src/shared/pal/src/include/pal/palinternal.h @@ -33,7 +33,7 @@ There are 2 types of namespace collisions that must be handled. about the multiple declarations. To avoid this, the inclusion of pal.h must be wrapped in a - #define/#undef pair, which will effectiveily "hide" the pal.h + #define/#undef pair, which will effectively "hide" the pal.h declaration by renaming it to something else. this is done by palinternal.h in this way : @@ -89,7 +89,7 @@ There are 2 types of namespace collisions that must be handled. implementation (with some_function) [side note : for the Win32 PAL, this can be accomplished without touching - pal.h. In Windows, symbols in in dynamic libraries are resolved at + pal.h. In Windows, symbols in dynamic libraries are resolved at compile time. if an application that uses some_function is only linked to pal.dll, some_function will be resolved to the version in that DLL, even if other DLLs in the system provide other implementations. In addition, @@ -145,7 +145,6 @@ function_name() to call the system's implementation /* Include our configuration information so it's always present when compiling PAL implementation files. */ #include "config.h" -#include #ifdef DEBUG #define _ENABLE_DEBUG_MESSAGES_ 1 @@ -162,148 +161,6 @@ function_name() to call the system's implementation #include "pal_perf.h" #endif -/* C runtime functions needed to be renamed to avoid duplicate definition - of those functions when including standard C header files */ -#if !defined(_DEBUG) -#define memcpy DUMMY_memcpy -#endif //!defined(_DEBUG) -#define memcmp DUMMY_memcmp -#define memset DUMMY_memset -#define memmove DUMMY_memmove -#define memchr DUMMY_memchr -#define atoll DUMMY_atoll -#define strlen DUMMY_strlen -#define stricmp DUMMY_stricmp -#define strstr DUMMY_strstr -#define strcmp DUMMY_strcmp -#define strcat DUMMY_strcat -#define strncat DUMMY_strncat -#define strcpy DUMMY_strcpy -#define strcspn DUMMY_strcspn -#define strncmp DUMMY_strncmp -#define strncpy DUMMY_strncpy -#define strchr DUMMY_strchr -#define strrchr DUMMY_strrchr -#define strpbrk DUMMY_strpbrk -#define strtod DUMMY_strtod -#define strspn DUMMY_strspn -#define tolower DUMMY_tolower -#define toupper DUMMY_toupper -#define islower DUMMY_islower -#define isupper DUMMY_isupper -#define isprint DUMMY_isprint -#define isdigit DUMMY_isdigit -#define iswalpha DUMMY_iswalpha -#define iswdigit DUMMY_iswdigit -#define iswupper DUMMY_iswupper -#define towupper DUMMY_towupper -#define towlower DUMMY_towlower -#define iswspace DUMMY_iswspace -#define iswxdigit DUMMY_iswxdigit -#define wint_t DUMMY_wint_t -#define srand DUMMY_srand -#define atoi DUMMY_atoi -#define atof DUMMY_atof -#define size_t DUMMY_size_t -#define time_t PAL_time_t -#define va_list DUMMY_va_list -#define abs DUMMY_abs -#define llabs DUMMY_llabs -#define ceil DUMMY_ceil -#define cos DUMMY_cos -#define cosh DUMMY_cosh -#define fabs DUMMY_fabs -#define floor DUMMY_floor -#define fmod DUMMY_fmod -#define modf DUMMY_modf -#define sin DUMMY_sin -#define sinh DUMMY_sinh -#define sqrt DUMMY_sqrt -#define tan DUMMY_tan -#define tanh DUMMY_tanh -#define ceilf DUMMY_ceilf -#define cosf DUMMY_cosf -#define coshf DUMMY_coshf -#define fabsf DUMMY_fabsf -#define floorf DUMMY_floorf -#define fmodf DUMMY_fmodf -#define modff DUMMY_modff -#define sinf DUMMY_sinf -#define sinhf DUMMY_sinhf -#define sqrtf DUMMY_sqrtf -#define tanf DUMMY_tanf -#define tanhf DUMMY_tanhf - -/* RAND_MAX needed to be renamed to avoid duplicate definition when including - stdlib.h header files. PAL_RAND_MAX should have the same value as RAND_MAX - defined in pal.h */ -#define PAL_RAND_MAX 0x7fff - -/* The standard headers define isspace and isxdigit as macros and functions, - To avoid redefinition problems, undefine those macros. */ -#ifdef isspace -#undef isspace -#endif -#ifdef isxdigit -#undef isxdigit -#endif -#ifdef isalpha -#undef isalpha -#endif -#ifdef isalnum -#undef isalnum -#endif -#define isspace DUMMY_isspace -#define isxdigit DUMMY_isxdigit -#define isalpha DUMMY_isalpha -#define isalnum DUMMY_isalnum - -#ifdef stdin -#undef stdin -#endif -#ifdef stdout -#undef stdout -#endif -#ifdef stderr -#undef stderr -#endif - -#ifdef SCHAR_MIN -#undef SCHAR_MIN -#endif -#ifdef SCHAR_MAX -#undef SCHAR_MAX -#endif -#ifdef SHRT_MIN -#undef SHRT_MIN -#endif -#ifdef SHRT_MAX -#undef SHRT_MAX -#endif -#ifdef UCHAR_MAX -#undef UCHAR_MAX -#endif -#ifdef USHRT_MAX -#undef USHRT_MAX -#endif -#ifdef ULONG_MAX -#undef ULONG_MAX -#endif -#ifdef LONG_MIN -#undef LONG_MIN -#endif -#ifdef LONG_MAX -#undef LONG_MAX -#endif -#ifdef RAND_MAX -#undef RAND_MAX -#endif -#ifdef DBL_MAX -#undef DBL_MAX -#endif -#ifdef FLT_MAX -#undef FLT_MAX -#endif #ifdef __record_type_class #undef __record_type_class #endif @@ -311,23 +168,6 @@ function_name() to call the system's implementation #undef __real_type_class #endif -// The standard headers define va_start and va_end as macros, -// To avoid redefinition problems, undefine those macros. -#ifdef va_start -#undef va_start -#endif -#ifdef va_end -#undef va_end -#endif -#ifdef va_copy -#undef va_copy -#endif - -#define ptrdiff_t PAL_ptrdiff_t -#define intptr_t PAL_intptr_t -#define uintptr_t PAL_uintptr_t -#define timeval PAL_timeval -#define FILE PAL_FILE #include "pal.h" #include "palprivate.h" @@ -344,224 +184,6 @@ function_name() to call the system's implementation #undef _BitScanReverse64 #endif -/* pal.h defines alloca(3) as a compiler builtin. - Redefining it to native libc will result in undefined breakage because - a compiler is allowed to make assumptions about the stack and frame - pointers. */ - -/* Undef all functions and types previously defined so those functions and - types could be mapped to the C runtime and socket implementation of the - native OS */ -#undef exit -#undef memcpy -#undef memcmp -#undef memset -#undef memmove -#undef memchr -#undef atoll -#undef strlen -#undef strnlen -#undef wcsnlen -#undef stricmp -#undef strstr -#undef strcmp -#undef strcat -#undef strcspn -#undef strncat -#undef strcpy -#undef strncmp -#undef strncpy -#undef strchr -#undef strrchr -#undef strpbrk -#undef strtoul -#undef strtoull -#undef strtod -#undef strspn -#undef strtok -#undef strdup -#undef tolower -#undef toupper -#undef islower -#undef isupper -#undef isprint -#undef isdigit -#undef isspace -#undef iswdigit -#undef iswxdigit -#undef iswalpha -#undef iswprint -#undef isxdigit -#undef isalpha -#undef isalnum -#undef iswalpha -#undef iswdigit -#undef iswupper -#undef towupper -#undef towlower -#undef wint_t -#undef atoi -#undef atof -#undef malloc -#undef realloc -#undef free -#undef qsort -#undef bsearch -#undef time -#undef FILE -#undef fclose -#undef fopen -#undef fread -#undef ferror -#undef ftell -#undef fflush -#undef fwrite -#undef fgets -#undef fputs -#undef fseek -#undef fgetpos -#undef fsetpos -#undef getcwd -#undef _flushall -#undef setvbuf -#undef unlink -#undef size_t -#undef time_t -#undef va_list -#undef va_start -#undef va_end -#undef va_copy -#undef va_arg -#undef stdin -#undef stdout -#undef stderr -#undef abs -#undef llabs -#undef acos -#undef acosh -#undef asin -#undef asinh -#undef atan -#undef atanh -#undef atan2 -#undef cbrt -#undef ceil -#undef cos -#undef cosh -#undef exp -#undef fabs -#undef floor -#undef fmod -#undef fma -#undef ilogb -#undef log -#undef log2 -#undef log10 -#undef modf -#undef pow -#undef sin -#undef sincos -#undef sinh -#undef sqrt -#undef tan -#undef tanh -#undef acosf -#undef acoshf -#undef asinf -#undef asinhf -#undef atanf -#undef atanhf -#undef atan2f -#undef cbrtf -#undef ceilf -#undef cosf -#undef coshf -#undef expf -#undef fabsf -#undef floorf -#undef fmodf -#undef fmaf -#undef ilogbf -#undef logf -#undef log2f -#undef log10f -#undef modff -#undef powf -#undef sinf -#undef sincosf -#undef sinhf -#undef sqrtf -#undef tanf -#undef tanhf -#undef rand -#undef srand -#undef errno -#undef getenv -#undef open -#undef glob - -#undef ptrdiff_t -#undef intptr_t -#undef uintptr_t -#undef timeval - - -#undef printf -#undef fprintf -#undef fwprintf -#undef vfprintf -#undef vfwprintf -#undef vprintf -#undef wprintf -#undef wcstod -#undef wcstoul -#undef _wcstoui64 -#undef wcscat -#undef wcscpy -#undef wcslen -#undef wcsncmp -#undef wcschr -#undef wcsrchr -#undef swscanf -#undef wcspbrk -#undef wcsstr -#undef wcscmp -#undef wcsncpy -#undef wcstok -#undef wcscspn -#undef iswupper -#undef iswspace -#undef towlower -#undef towupper -#undef wvsnprintf - -#ifdef HOST_AMD64 -#undef _mm_getcsr -#undef _mm_setcsr -#endif // HOST_AMD64 - -#undef min -#undef max - -#undef SCHAR_MIN -#undef SCHAR_MAX -#undef UCHAR_MAX -#undef SHRT_MIN -#undef SHRT_MAX -#undef USHRT_MAX -#undef LONG_MIN -#undef LONG_MAX -#undef ULONG_MAX -#undef RAND_MAX -#undef DBL_MAX -#undef FLT_MAX -#undef __record_type_class -#undef __real_type_class - -#if HAVE_CHAR_BIT -#undef CHAR_BIT -#endif - // We need a sigsetjmp prototype in pal.h for the SEH macros, but we // can't use the "real" prototype (because we don't want to define sigjmp_buf). // So we must rename the "real" sigsetjmp to avoid redefinition errors. @@ -583,17 +205,6 @@ function_name() to call the system's implementation // https://gcc.gnu.org/ml/libstdc++/2016-01/msg00025.html #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS 1 -#define _WITH_GETLINE -#include -#include -#include -#include -#include -#include -#include -#include -#include - #ifdef __APPLE__ #undef GetCurrentThread @@ -658,9 +269,6 @@ typedef enum _TimeConversionConstants #ifdef __cplusplus } -bool -ReadMemoryValueFromFile(const char* filename, uint64_t* val); - #ifdef __APPLE__ bool GetApplicationContainerFolder(PathCharString& buffer, const char *applicationGroupId, int applicationGroupIdLength); @@ -703,11 +311,11 @@ inline T* InterlockedExchangePointerT( template inline T* InterlockedCompareExchangePointerT( T* volatile * destination, - int exchange, // When NULL is provided as argument. + std::nullptr_t exchange, // When NULL is provided as argument. T* comparand) { //STATIC_ASSERT(exchange == 0); - return InterlockedCompareExchangePointerT(destination, reinterpret_cast(exchange), comparand); + return InterlockedCompareExchangePointerT(destination, (T*)(void*)exchange, comparand); } template @@ -731,10 +339,6 @@ const char StackOverflowMessage[] = "Stack overflow.\n"; #endif // __cplusplus -#if __has_cpp_attribute(fallthrough) -#define FALLTHROUGH [[fallthrough]] -#else -#define FALLTHROUGH -#endif +DWORD PALAPI GetCurrentSessionId(); #endif /* _PAL_INTERNAL_H_ */ diff --git a/src/shared/pal/src/include/pal/printfcpp.hpp b/src/shared/pal/src/include/pal/printfcpp.hpp deleted file mode 100644 index fd04285c94..0000000000 --- a/src/shared/pal/src/include/pal/printfcpp.hpp +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - pal/printfcpp.hpp - -Abstract: - Declarations for suspension safe memory allocation functions - - - ---*/ - -#ifndef _PRINTFCPP_HPP -#define _PRINTFCPP_HPP - -#ifdef __cplusplus -#include "pal/threadinfo.hpp" -#endif - -#include - -#ifdef __cplusplus -typedef char16_t wchar_16; // __wchar_16_cpp (which is defined in palinternal.h) needs to be redefined to wchar_16. - -extern "C" -{ - int - __cdecl - PAL_vfprintf( - PAL_FILE *stream, - const char *format, - va_list ap); - - int - __cdecl - PAL_vfwprintf( - PAL_FILE *stream, - const wchar_16 *format, - va_list ap); -} - -namespace CorUnix -{ - int - InternalVfprintf( - CPalThread *pthrCurrent, - PAL_FILE *stream, - const char *format, - va_list ap); - -} -#else // __cplusplus - - int - __cdecl - PAL_vfprintf( - PAL_FILE *stream, - const char *format, - va_list ap); - - int - __cdecl - PAL_vfwprintf( - PAL_FILE *stream, - const wchar_16 *format, - va_list ap); - -#endif // __cplusplus - -#endif // _PRINTFCPP_HPP - diff --git a/src/shared/pal/src/include/pal/process.h b/src/shared/pal/src/include/pal/process.h index f023f840a5..7b210d57e5 100644 --- a/src/shared/pal/src/include/pal/process.h +++ b/src/shared/pal/src/include/pal/process.h @@ -94,10 +94,17 @@ VOID PROCProcessUnlock(VOID); Aborts the process after calling the shutdown cleanup handler. This function should be called instead of calling abort() directly. +Parameters: + signal - POSIX signal number + siginfo - POSIX signal info + Does not return --*/ +#if !defined(HOST_ARM) // PAL_NORETURN produces broken unwinding information for this method + // making crash dumps impossible to analyze PAL_NORETURN -VOID PROCAbort(); +#endif +VOID PROCAbort(int signal = SIGABRT, siginfo_t* siginfo = nullptr); #ifdef __cplusplus } diff --git a/src/shared/pal/src/include/pal/procobj.hpp b/src/shared/pal/src/include/pal/procobj.hpp index 4cf647e3ad..1148f05857 100644 --- a/src/shared/pal/src/include/pal/procobj.hpp +++ b/src/shared/pal/src/include/pal/procobj.hpp @@ -81,7 +81,9 @@ namespace CorUnix { }; - ~CProcProcessLocalData(); + ~CProcProcessLocalData() + { + }; DWORD dwProcessId; PROCESS_STATE ps; diff --git a/src/shared/pal/src/include/pal/stackstring.hpp b/src/shared/pal/src/include/pal/stackstring.hpp index 74253403f4..22e79a5715 100644 --- a/src/shared/pal/src/include/pal/stackstring.hpp +++ b/src/shared/pal/src/include/pal/stackstring.hpp @@ -21,7 +21,7 @@ class StackString void DeleteBuffer() { if (m_innerBuffer != m_buffer) - PAL_free(m_buffer); + free(m_buffer); m_buffer = NULL; return; @@ -44,7 +44,7 @@ class StackString m_buffer = NULL; } - T * newBuffer = (T *)PAL_realloc(m_buffer, (count_allocated + 1) * sizeof(T)); + T * newBuffer = (T *)realloc(m_buffer, (count_allocated + 1) * sizeof(T)); if (NULL == newBuffer) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -253,15 +253,6 @@ typedef StackString PathWCharString; #endif // Some Helper Definitions -BOOL -PAL_GetPALDirectoryW( - PathWCharString& lpDirectoryName); -BOOL -PAL_GetPALDirectoryA( - PathCharString& lpDirectoryName); DWORD GetCurrentDirectoryA( PathCharString& lpBuffer); -void -FILEDosToUnixPathA( - PathCharString& lpPath); diff --git a/src/shared/pal/src/include/pal/thread.hpp b/src/shared/pal/src/include/pal/thread.hpp index 735e060a80..e1fc63c922 100644 --- a/src/shared/pal/src/include/pal/thread.hpp +++ b/src/shared/pal/src/include/pal/thread.hpp @@ -87,15 +87,6 @@ namespace CorUnix HANDLE *phThread ); - /* In the windows CRT there is a constant defined for the max width - of a _ecvt conversion. That constant is 348. 348 for the value, plus - the exponent value, decimal, and sign if required. */ -#define ECVT_MAX_COUNT_SIZE 348 -#define ECVT_MAX_BUFFER_SIZE 357 - - /*STR_TIME_SIZE is defined as 26 the size of the - return val by ctime_r*/ -#define STR_TIME_SIZE 26 class CThreadCRTInfo : public CThreadInfoInitializer { @@ -165,7 +156,7 @@ namespace CorUnix // // The only other spot the refcount is touched is from within // CPalObjectBase::ReleaseReference -- incremented before the - // destructors for an ojbect are called, and decremented afterwords. + // destructors for an object are called, and decremented afterwords. // This permits the freeing of the thread structure to happen after // the freeing of the enclosing thread object has completed. // diff --git a/src/shared/pal/src/include/pal/threadinfo.hpp b/src/shared/pal/src/include/pal/threadinfo.hpp index e2fdeb2e59..f3ad4f0669 100644 --- a/src/shared/pal/src/include/pal/threadinfo.hpp +++ b/src/shared/pal/src/include/pal/threadinfo.hpp @@ -10,7 +10,7 @@ Module Name: include/pal/threadinfo.hpp Abstract: - Header file for thread info initialzer + Header file for thread info initializer diff --git a/src/shared/pal/src/include/pal/threadsusp.hpp b/src/shared/pal/src/include/pal/threadsusp.hpp index 0c84a5183e..99d9bcba8a 100644 --- a/src/shared/pal/src/include/pal/threadsusp.hpp +++ b/src/shared/pal/src/include/pal/threadsusp.hpp @@ -32,7 +32,6 @@ Module Name: // instantiation time. #include "pal/threadinfo.hpp" #include "pal/thread.hpp" -#include "pal/printfcpp.hpp" #include "pal/mutex.hpp" #include "pal/init.h" #include diff --git a/src/shared/pal/src/include/pal/unicodedata.h b/src/shared/pal/src/include/pal/unicodedata.h deleted file mode 100644 index c7e9347fe0..0000000000 --- a/src/shared/pal/src/include/pal/unicodedata.h +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#ifndef _PAL_UNICODEDATA_H_ -#define _PAL_UNICODEDATA_H_ - -#include "pal/palinternal.h" - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -#define UPPER_CASE 1 -#define LOWER_CASE 2 - -typedef struct -{ - WCHAR nUnicodeValue; - WORD nFlag; - WCHAR nOpposingCase; -} UnicodeDataRec; - -extern CONST UnicodeDataRec UnicodeData[]; -extern CONST UINT UNICODE_DATA_SIZE; - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif /* _UNICODE_DATA_H_ */ diff --git a/src/shared/pal/src/include/pal/utf8.h b/src/shared/pal/src/include/pal/utf8.h deleted file mode 100644 index fa417c0a02..0000000000 --- a/src/shared/pal/src/include/pal/utf8.h +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - include/pal/utf8.h - -Abstract: - Header file for UTF-8 conversion functions. - -Revision History: - - - ---*/ - -#ifndef _PAL_UTF8_H_ -#define _PAL_UTF8_H_ - -#include /* for WCHAR */ - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -/*++ -Function : - UTF8ToUnicode - - Convert a string from UTF-8 to UTF-16 (UCS-2) ---*/ -int UTF8ToUnicode(LPCSTR lpSrcStr, int cchSrc, LPWSTR lpDestStr, int cchDest, DWORD dwFlags); - - -/*++ -Function : - UnicodeToUTF8 - - Convert a string from UTF-16 (UCS-2) to UTF-8 ---*/ -int UnicodeToUTF8(LPCWSTR lpSrcStr, int cchSrc, LPSTR lpDestStr, int cchDest); - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif /* _PAL_UTF8_H_ */ diff --git a/src/shared/pal/src/include/pal/utils.h b/src/shared/pal/src/include/pal/utils.h index 83cf2b104c..980cdf56ab 100644 --- a/src/shared/pal/src/include/pal/utils.h +++ b/src/shared/pal/src/include/pal/utils.h @@ -194,7 +194,7 @@ class StringHolder StringHolder() : data(NULL) { } ~StringHolder() { - PAL_free( data); + free( data); } operator LPSTR () { return data;} @@ -212,3 +212,5 @@ class StringHolder }; #endif /* _PAL_UTILS_H_ */ + +const char *GetFriendlyErrorCodeString(int errorCode); diff --git a/src/shared/pal/src/include/pal/virtual.h b/src/shared/pal/src/include/pal/virtual.h index bac28112ba..9a30d083b8 100644 --- a/src/shared/pal/src/include/pal/virtual.h +++ b/src/shared/pal/src/include/pal/virtual.h @@ -34,13 +34,6 @@ typedef struct _CMI { DWORD accessProtection; /* Initial allocation access protection. */ DWORD allocationType; /* Initial allocation type. */ - - BYTE * pAllocState; /* Individual allocation type tracking for each */ - /* page in the region. */ - - BYTE * pProtectionState; /* Individual allocation type tracking for each */ - /* page in the region. */ - } CMI, * PCMI; enum VIRTUAL_CONSTANTS @@ -180,17 +173,24 @@ class ExecutableMemoryAllocator int32_t GenerateRandomStartOffset(); private: + // There does not seem to be an easy way find the size of a library on Unix. - // So this constant represents an approximation of the libcoreclr size (on debug build) + // So this constant represents an approximation of the libcoreclr size // that can be used to calculate an approximate location of the memory that // is in 2GB range from the coreclr library. In addition, having precise size of libcoreclr // is not necessary for the calculations. - static const int32_t CoreClrLibrarySize = 100 * 1024 * 1024; + static const int32_t CoreClrLibrarySize = 16 * 1024 * 1024; // This constant represent the max size of the virtual memory that this allocator // will try to reserve during initialization. We want all JIT-ed code and the - // entire libcoreclr to be located in a 2GB range. + // entire libcoreclr to be located in a 2GB range on x86 +#if defined(TARGET_ARM) || defined(TARGET_ARM64) + // It seems to be more difficult to reserve a 2Gb chunk on arm so we'll try smaller one + static const int32_t MaxExecutableMemorySize = 1024 * 1024 * 1024; +#else static const int32_t MaxExecutableMemorySize = 0x7FFF0000; +#endif + static const int32_t MaxExecutableMemorySizeNearCoreClr = MaxExecutableMemorySize - CoreClrLibrarySize; // Start address of the reserved virtual address space @@ -217,7 +217,7 @@ class ExecutableMemoryAllocator Function : ReserveMemoryFromExecutableAllocator - This function is used to reserve a region of virual memory (not commited) + This function is used to reserve a region of virual memory (not committed) that is located close to the coreclr library. The memory comes from the virtual address range that is managed by ExecutableMemoryAllocator. --*/ diff --git a/src/shared/pal/src/init/pal.cpp b/src/shared/pal/src/init/pal.cpp index 2aeb8e5f90..f6ea18445d 100644 --- a/src/shared/pal/src/init/pal.cpp +++ b/src/shared/pal/src/init/pal.cpp @@ -81,19 +81,17 @@ int CacheLineSize; #ifdef __FreeBSD__ #include -#include #endif #include using namespace CorUnix; -// -// $$TODO The C++ compiler doesn't like pal/cruntime.h so duplicate the -// necessary prototype here -// - -extern "C" BOOL CRTInitStdStreams( void ); +#if defined(HOST_ARM64) +// Flag to check if atomics feature is available on +// the machine +bool g_arm64_atomics_present = false; +#endif Volatile init_count = 0; Volatile shutdown_intent = 0; @@ -118,7 +116,7 @@ static bool RunningNatively() { int ret = 0; size_t sz = sizeof(ret); - if (sysctlbyname("sysctl.proc_native", &ret, &sz, NULL, 0) != 0) + if (sysctlbyname("sysctl.proc_native", &ret, &sz, nullptr, 0) != 0) { // if the sysctl failed, we'll assume this OS does not support // binary translation - so we must be running natively. @@ -212,8 +210,8 @@ Initialize( DWORD flags) { PAL_ERROR palError = ERROR_GEN_FAILURE; - CPalThread *pThread = NULL; - CSharedMemoryObjectManager *pshmom = NULL; + CPalThread *pThread = nullptr; + CSharedMemoryObjectManager *pshmom = nullptr; int retval = -1; bool fFirstTimeInit = false; @@ -235,18 +233,18 @@ Initialize( CriticalSectionSubSysInitialize(); - if(NULL == init_critsec) + if(nullptr == init_critsec) { pthread_mutex_lock(&init_critsec_mutex); // prevents race condition of two threads // initializing the critical section. - if(NULL == init_critsec) + if(nullptr == init_critsec) { static CRITICAL_SECTION temp_critsec; // Want this critical section to NOT be internal to avoid the use of unsafe region markers. InternalInitializeCriticalSectionAndSpinCount(&temp_critsec, 0, false); - if(NULL != InterlockedCompareExchangePointer(&init_critsec, &temp_critsec, NULL)) + if(nullptr != InterlockedCompareExchangePointer(&init_critsec, &temp_critsec, nullptr)) { // Another thread got in before us! shouldn't happen, if the PAL // isn't initialized there shouldn't be any other threads @@ -257,7 +255,7 @@ Initialize( pthread_mutex_unlock(&init_critsec_mutex); } - InternalEnterCriticalSection(pThread, init_critsec); // here pThread is always NULL + InternalEnterCriticalSection(pThread, init_critsec); // here pThread is always nullptr if (init_count == 0) { @@ -350,7 +348,7 @@ Initialize( // pshmom = InternalNew(); - if (NULL == pshmom) + if (nullptr == pshmom) { ERROR("Unable to allocate new object manager\n"); palError = ERROR_OUTOFMEMORY; @@ -373,7 +371,7 @@ Initialize( g_pSynchronizationManager = CPalSynchMgrController::CreatePalSynchronizationManager(); - if (NULL == g_pSynchronizationManager) + if (nullptr == g_pSynchronizationManager) { palError = ERROR_NOT_ENOUGH_MEMORY; ERROR("Failure creating synchronization manager\n"); @@ -442,13 +440,6 @@ Initialize( } } - if (FALSE == CRTInitStdStreams()) - { - ERROR("Unable to initialize CRT standard streams\n"); - palError = ERROR_PALINIT_STD_STREAMS; - goto CLEANUP15; - } - TRACE("First-time PAL initialization complete.\n"); init_count++; @@ -468,9 +459,6 @@ Initialize( } goto done; - /* No cleanup required for CRTInitStdStreams */ -CLEANUP15: - FILECleanupStdHandles(); CLEANUP14: CLEANUP13: VIRTUALCleanup(); @@ -507,7 +495,7 @@ Initialize( if (fFirstTimeInit && 0 == retval) { - _ASSERTE(NULL != pThread); + _ASSERTE(nullptr != pThread); } if (retval != 0 && GetLastError() == ERROR_SUCCESS) @@ -565,7 +553,7 @@ PAL_IsDebuggerPresent() struct kinfo_proc info = {}; size_t size = sizeof(info); int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; - int ret = sysctl(mib, sizeof(mib)/sizeof(*mib), &info, &size, NULL, 0); + int ret = sysctl(mib, sizeof(mib)/sizeof(*mib), &info, &size, nullptr, 0); if (ret == 0) #if defined(__APPLE__) @@ -582,12 +570,12 @@ PAL_IsDebuggerPresent() struct kinfo_proc *info; - kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open"); - if (kd == NULL) + kd = kvm_open(nullptr, nullptr, nullptr, KVM_NO_FILES, "kvm_open"); + if (kd == nullptr) return FALSE; info = kvm_getprocs(kd, KERN_PROC_PID, getpid(), &cnt); - if (info == NULL || cnt < 1) + if (info == nullptr || cnt < 1) { kvm_close(kd); return FALSE; @@ -683,14 +671,14 @@ void PALSetShutdownIntent() Function: PALInitLock -Take the initializaiton critical section (init_critsec). necessary to serialize +Take the initialization critical section (init_critsec). necessary to serialize TerminateProcess along with PAL_Terminate and PAL_Initialize (no parameters) Return value : TRUE if critical section existed (and was acquired) - FALSE if critical section doens't exist yet + FALSE if critical section doesn't exist yet --*/ BOOL PALInitLock(void) { @@ -700,7 +688,7 @@ BOOL PALInitLock(void) } CPalThread * pThread = - (PALIsThreadDataInitialized() ? InternalGetCurrentThread() : NULL); + (PALIsThreadDataInitialized() ? InternalGetCurrentThread() : nullptr); InternalEnterCriticalSection(pThread, init_critsec); return TRUE; @@ -722,7 +710,7 @@ void PALInitUnlock(void) } CPalThread * pThread = - (PALIsThreadDataInitialized() ? InternalGetCurrentThread() : NULL); + (PALIsThreadDataInitialized() ? InternalGetCurrentThread() : nullptr); InternalLeaveCriticalSection(pThread, init_critsec); } diff --git a/src/shared/pal/src/loader/module.cpp b/src/shared/pal/src/loader/module.cpp index d2c4c7b69c..be9b7350ca 100644 --- a/src/shared/pal/src/loader/module.cpp +++ b/src/shared/pal/src/loader/module.cpp @@ -79,7 +79,6 @@ CRITICAL_SECTION module_critsec; MODSTRUCT exe_module; MODSTRUCT *pal_module = nullptr; -char * g_szCoreCLRPath = nullptr; bool g_running_in_exe = false; int MaxWCharToAcpLength = 3; @@ -150,10 +149,9 @@ LoadLibraryExA( return nullptr; } - LPSTR lpstr = nullptr; HMODULE hModule = nullptr; - PERF_ENTRY(LoadLibraryA); + PERF_ENTRY(LoadLibraryExA); ENTRY("LoadLibraryExA (lpLibFileName=%p (%s)) \n", (lpLibFileName) ? lpLibFileName : "NULL", (lpLibFileName) ? lpLibFileName : "NULL"); @@ -164,23 +162,10 @@ LoadLibraryExA( } /* do the Dos/Unix conversion on our own copy of the name */ - lpstr = strdup(lpLibFileName); - if (!lpstr) - { - ERROR("strdup failure!\n"); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto Done; - } - FILEDosToUnixPathA(lpstr); - - hModule = LOADLoadLibrary(lpstr, TRUE); + hModule = LOADLoadLibrary(lpLibFileName, TRUE); /* let LOADLoadLibrary call SetLastError */ Done: - if (lpstr != nullptr) - { - free(lpstr); - } LOGEXIT("LoadLibraryExA returns HMODULE %p\n", hModule); PERF_EXIT(LoadLibraryExA); @@ -233,8 +218,6 @@ LoadLibraryExW( goto done; } - /* do the Dos/Unix conversion on our own copy of the name */ - FILEDosToUnixPathA(lpstr); pathstr.CloseBuffer(name_length); /* let LOADLoadLibrary call SetLastError in case of failure */ @@ -297,40 +280,7 @@ GetProcAddress( } // Get the symbol's address. - - // If we're looking for a symbol inside the PAL, we try the PAL_ variant - // first because otherwise we run the risk of having the non-PAL_ - // variant preferred over the PAL's implementation. - if (pal_module && module->dl_handle == pal_module->dl_handle) - { - int iLen = 4 + strlen(lpProcName) + 1; - LPSTR lpPALProcName = (LPSTR) alloca(iLen); - - if (strcpy_s(lpPALProcName, iLen, "PAL_") != SAFECRT_SUCCESS) - { - ERROR("strcpy_s failed!\n"); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - goto done; - } - - if (strcat_s(lpPALProcName, iLen, lpProcName) != SAFECRT_SUCCESS) - { - ERROR("strcat_s failed!\n"); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - goto done; - } - - ProcAddress = (FARPROC) dlsym(module->dl_handle, lpPALProcName); - symbolName = lpPALProcName; - } - - // If we aren't looking inside the PAL or we didn't find a PAL_ variant - // inside the PAL, fall back to a normal search. - if (ProcAddress == nullptr) - { - ProcAddress = (FARPROC) dlsym(module->dl_handle, lpProcName); - } - + ProcAddress = (FARPROC) dlsym(module->dl_handle, lpProcName); if (ProcAddress) { TRACE("Symbol %s found at address %p in module %p (named %S)\n", @@ -602,8 +552,6 @@ PAL_LoadLibraryDirect( goto done; } - /* do the Dos/Unix conversion on our own copy of the name */ - FILEDosToUnixPathA(lpstr); pathstr.CloseBuffer(name_length); lpcstr = FixLibCName(lpstr); @@ -1285,7 +1233,7 @@ Parameters : goes in MODSTRUCT::lib_name Return value: - a pointer to a new, initialized MODSTRUCT strucutre, or NULL on failure. + a pointer to a new, initialized MODSTRUCT structure, or NULL on failure. Notes : 'name' is used to initialize MODSTRUCT::lib_name. The other member is set to NULL @@ -1297,7 +1245,7 @@ static MODSTRUCT *LOADAllocModule(NATIVE_LIBRARY_HANDLE dl_handle, LPCSTR name) LPWSTR wide_name; /* no match found : try to create a new module structure */ - module = (MODSTRUCT *)InternalMalloc(sizeof(MODSTRUCT)); + module = (MODSTRUCT *)malloc(sizeof(MODSTRUCT)); if (nullptr == module) { ERROR("malloc() failed! errno is %d (%s)\n", errno, strerror(errno)); @@ -1498,68 +1446,6 @@ static HMODULE LOADLoadLibrary(LPCSTR shortAsciiName, BOOL fDynamic) return module; } -/*++ -Function : - LOADGetPalLibrary - - Load and initialize the PAL module. - -Parameters : - None - -Return value : - pointer to module struct - ---*/ -MODSTRUCT *LOADGetPalLibrary() -{ - if (pal_module == nullptr) - { - // Initialize the pal module (the module containing LOADGetPalLibrary). Assumes that - // the PAL is linked into the coreclr module because we use the module name containing - // this function for the coreclr path. - TRACE("Loading module for PAL library\n"); - - Dl_info info; - if (dladdr((PVOID)&LOADGetPalLibrary, &info) == 0) - { - ERROR("LOADGetPalLibrary: dladdr() failed.\n"); - goto exit; - } - // Stash a copy of the CoreCLR installation path in a global variable. - // Make sure it's terminated with a slash. - if (g_szCoreCLRPath == nullptr) - { - size_t cbszCoreCLRPath = strlen(info.dli_fname) + 1; - g_szCoreCLRPath = (char*) InternalMalloc(cbszCoreCLRPath); - - if (g_szCoreCLRPath == nullptr) - { - ERROR("LOADGetPalLibrary: InternalMalloc failed!"); - goto exit; - } - - if (strcpy_s(g_szCoreCLRPath, cbszCoreCLRPath, info.dli_fname) != SAFECRT_SUCCESS) - { - ERROR("LOADGetPalLibrary: strcpy_s failed!"); - goto exit; - } - } - - if (g_running_in_exe) - { - pal_module = (MODSTRUCT*)LOADLoadLibrary(nullptr, FALSE); - } - else - { - pal_module = (MODSTRUCT*)LOADLoadLibrary(info.dli_fname, FALSE); - } - } - -exit: - return pal_module; -} - /*++ Function: LockModuleList diff --git a/src/shared/pal/src/locale/unicode.cpp b/src/shared/pal/src/locale/unicode.cpp index f29eabc07d..e966e22821 100644 --- a/src/shared/pal/src/locale/unicode.cpp +++ b/src/shared/pal/src/locale/unicode.cpp @@ -2,21 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. /*++ - - - Module Name: - unicode.cpp Abstract: - Implementation of all functions related to Unicode support - -Revision History: - - - --*/ #include "pal/thread.hpp" @@ -24,10 +14,9 @@ Revision History: #include "pal/palinternal.h" #include "pal/dbgmsg.h" #include "pal/file.h" -#include "pal/utf8.h" +#include #include "pal/cruntime.h" #include "pal/stackstring.hpp" -#include "pal/unicodedata.h" #include #include @@ -39,138 +28,6 @@ using namespace CorUnix; SET_DEFAULT_DEBUG_CHANNEL(UNICODE); -/*++ -Function: -UnicodeDataComp -This is the comparison function used by the bsearch function to search -for unicode characters in the UnicodeData array. - -Parameter: -pnKey -The unicode character value to search for. -elem -A pointer to a UnicodeDataRec. - -Return value: -<0 if pnKey < elem->nUnicodeValue -0 if pnKey == elem->nUnicodeValue ->0 if pnKey > elem->nUnicodeValue ---*/ -static int UnicodeDataComp(const void *pnKey, const void *elem) -{ - WCHAR uValue = ((UnicodeDataRec*)elem)->nUnicodeValue; - - if (*((INT*)pnKey) < uValue) - { - return -1; - } - else if (*((INT*)pnKey) > uValue) - { - return 1; - } - else - { - return 0; - } -} - -/*++ -Function: -GetUnicodeData -This function is used to get information about a Unicode character. - -Parameters: -nUnicodeValue -The numeric value of the Unicode character to get information about. -pDataRec -The UnicodeDataRec to fill in with the data for the Unicode character. - -Return value: -TRUE if the Unicode character was found. - ---*/ -BOOL GetUnicodeData(INT nUnicodeValue, UnicodeDataRec *pDataRec) -{ - BOOL bRet; - - UnicodeDataRec *dataRec; - INT nNumOfChars = UNICODE_DATA_SIZE; - dataRec = (UnicodeDataRec *) bsearch(&nUnicodeValue, UnicodeData, nNumOfChars, - sizeof(UnicodeDataRec), UnicodeDataComp); - if (dataRec == NULL) - { - bRet = FALSE; - } - else - { - bRet = TRUE; - *pDataRec = *dataRec; - } - return bRet; -} - -wchar_16 -__cdecl -PAL_ToUpperInvariant( wchar_16 c ) -{ - UnicodeDataRec dataRec; - - PERF_ENTRY(PAL_ToUpperInvariant); - ENTRY("PAL_ToUpperInvariant (c=%d)\n", c); - - if (!GetUnicodeData(c, &dataRec)) - { - TRACE( "Unable to retrieve unicode data for the character %c.\n", c ); - LOGEXIT("PAL_ToUpperInvariant returns int %d\n", c ); - PERF_EXIT(PAL_ToUpperInvariant); - return c; - } - - if ( dataRec.nFlag != LOWER_CASE ) - { - LOGEXIT("PAL_ToUpperInvariant returns int %d\n", c ); - PERF_EXIT(PAL_ToUpperInvariant); - return c; - } - else - { - LOGEXIT("PAL_ToUpperInvariant returns int %d\n", dataRec.nOpposingCase ); - PERF_EXIT(PAL_ToUpperInvariant); - return dataRec.nOpposingCase; - } -} - -wchar_16 -__cdecl -PAL_ToLowerInvariant( wchar_16 c ) -{ - UnicodeDataRec dataRec; - - PERF_ENTRY(PAL_ToLowerInvariant); - ENTRY("PAL_ToLowerInvariant (c=%d)\n", c); - - if (!GetUnicodeData(c, &dataRec)) - { - TRACE( "Unable to retrieve unicode data for the character %c.\n", c ); - LOGEXIT("PAL_ToLowerInvariant returns int %d\n", c ); - PERF_EXIT(PAL_ToLowerInvariant); - return c; - } - - if ( dataRec.nFlag != UPPER_CASE ) - { - LOGEXIT("PAL_ToLowerInvariant returns int %d\n", c ); - PERF_EXIT(PAL_ToLowerInvariant); - return c; - } - else - { - LOGEXIT("PAL_ToLowerInvariant returns int %d\n", dataRec.nOpposingCase ); - PERF_EXIT(PAL_ToLowerInvariant); - return dataRec.nOpposingCase; - } -} - /*++ Function: GetConsoleOutputCP @@ -253,16 +110,20 @@ MultiByteToWideChar( goto EXIT; } - // Use UTF8ToUnicode on all systems, since it replaces - // invalid characters and Core Foundation doesn't do that. if (CodePage == CP_UTF8 || CodePage == CP_ACP) { - if (cbMultiByte <= -1) + if (cbMultiByte < 0) + cbMultiByte = strlen(lpMultiByteStr) + 1; + + if (!lpWideCharStr || cchWideChar == 0) + retval = minipal_get_length_utf8_to_utf16(lpMultiByteStr, cbMultiByte, dwFlags); + + if (lpWideCharStr) { - cbMultiByte = strlen(lpMultiByteStr) + 1; + if (cchWideChar == 0) cchWideChar = retval; + retval = minipal_convert_utf8_to_utf16(lpMultiByteStr, cbMultiByte, (CHAR16_T*)lpWideCharStr, cchWideChar, dwFlags); } - retval = UTF8ToUnicode(lpMultiByteStr, cbMultiByte, lpWideCharStr, cchWideChar, dwFlags); goto EXIT; } @@ -338,15 +199,20 @@ WideCharToMultiByte( defaultChar = *lpDefaultChar; } - // Use UnicodeToUTF8 on all systems because we use - // UTF8ToUnicode in MultiByteToWideChar() on all systems. if (CodePage == CP_UTF8 || CodePage == CP_ACP) { - if (cchWideChar == -1) - { + if (cchWideChar < 0) cchWideChar = PAL_wcslen(lpWideCharStr) + 1; + + if (!lpMultiByteStr || cbMultiByte == 0) + retval = minipal_get_length_utf16_to_utf8((CHAR16_T*)lpWideCharStr, cchWideChar, dwFlags); + + if (lpMultiByteStr) + { + if (cbMultiByte == 0) cbMultiByte = retval; + retval = minipal_convert_utf16_to_utf8((CHAR16_T*)lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, dwFlags); } - retval = UnicodeToUTF8(lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte); + goto EXIT; } diff --git a/src/shared/pal/src/locale/unicodedata.cpp b/src/shared/pal/src/locale/unicodedata.cpp deleted file mode 100644 index ec3a1f3655..0000000000 --- a/src/shared/pal/src/locale/unicodedata.cpp +++ /dev/null @@ -1,2361 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include "pal/unicodedata.h" - -// -// THIS FILE IS GENERATED. DO NOT HAND EDIT. -// - -CONST UnicodeDataRec UnicodeData[] = { - { 0x41, UPPER_CASE, 0x61 }, - { 0x42, UPPER_CASE, 0x62 }, - { 0x43, UPPER_CASE, 0x63 }, - { 0x44, UPPER_CASE, 0x64 }, - { 0x45, UPPER_CASE, 0x65 }, - { 0x46, UPPER_CASE, 0x66 }, - { 0x47, UPPER_CASE, 0x67 }, - { 0x48, UPPER_CASE, 0x68 }, - { 0x49, UPPER_CASE, 0x69 }, - { 0x4A, UPPER_CASE, 0x6A }, - { 0x4B, UPPER_CASE, 0x6B }, - { 0x4C, UPPER_CASE, 0x6C }, - { 0x4D, UPPER_CASE, 0x6D }, - { 0x4E, UPPER_CASE, 0x6E }, - { 0x4F, UPPER_CASE, 0x6F }, - { 0x50, UPPER_CASE, 0x70 }, - { 0x51, UPPER_CASE, 0x71 }, - { 0x52, UPPER_CASE, 0x72 }, - { 0x53, UPPER_CASE, 0x73 }, - { 0x54, UPPER_CASE, 0x74 }, - { 0x55, UPPER_CASE, 0x75 }, - { 0x56, UPPER_CASE, 0x76 }, - { 0x57, UPPER_CASE, 0x77 }, - { 0x58, UPPER_CASE, 0x78 }, - { 0x59, UPPER_CASE, 0x79 }, - { 0x5A, UPPER_CASE, 0x7A }, - { 0x61, LOWER_CASE, 0x41 }, - { 0x62, LOWER_CASE, 0x42 }, - { 0x63, LOWER_CASE, 0x43 }, - { 0x64, LOWER_CASE, 0x44 }, - { 0x65, LOWER_CASE, 0x45 }, - { 0x66, LOWER_CASE, 0x46 }, - { 0x67, LOWER_CASE, 0x47 }, - { 0x68, LOWER_CASE, 0x48 }, - { 0x69, LOWER_CASE, 0x49 }, - { 0x6A, LOWER_CASE, 0x4A }, - { 0x6B, LOWER_CASE, 0x4B }, - { 0x6C, LOWER_CASE, 0x4C }, - { 0x6D, LOWER_CASE, 0x4D }, - { 0x6E, LOWER_CASE, 0x4E }, - { 0x6F, LOWER_CASE, 0x4F }, - { 0x70, LOWER_CASE, 0x50 }, - { 0x71, LOWER_CASE, 0x51 }, - { 0x72, LOWER_CASE, 0x52 }, - { 0x73, LOWER_CASE, 0x53 }, - { 0x74, LOWER_CASE, 0x54 }, - { 0x75, LOWER_CASE, 0x55 }, - { 0x76, LOWER_CASE, 0x56 }, - { 0x77, LOWER_CASE, 0x57 }, - { 0x78, LOWER_CASE, 0x58 }, - { 0x79, LOWER_CASE, 0x59 }, - { 0x7A, LOWER_CASE, 0x5A }, - { 0xB5, LOWER_CASE, 0x39C }, - { 0xC0, UPPER_CASE, 0xE0 }, - { 0xC1, UPPER_CASE, 0xE1 }, - { 0xC2, UPPER_CASE, 0xE2 }, - { 0xC3, UPPER_CASE, 0xE3 }, - { 0xC4, UPPER_CASE, 0xE4 }, - { 0xC5, UPPER_CASE, 0xE5 }, - { 0xC6, UPPER_CASE, 0xE6 }, - { 0xC7, UPPER_CASE, 0xE7 }, - { 0xC8, UPPER_CASE, 0xE8 }, - { 0xC9, UPPER_CASE, 0xE9 }, - { 0xCA, UPPER_CASE, 0xEA }, - { 0xCB, UPPER_CASE, 0xEB }, - { 0xCC, UPPER_CASE, 0xEC }, - { 0xCD, UPPER_CASE, 0xED }, - { 0xCE, UPPER_CASE, 0xEE }, - { 0xCF, UPPER_CASE, 0xEF }, - { 0xD0, UPPER_CASE, 0xF0 }, - { 0xD1, UPPER_CASE, 0xF1 }, - { 0xD2, UPPER_CASE, 0xF2 }, - { 0xD3, UPPER_CASE, 0xF3 }, - { 0xD4, UPPER_CASE, 0xF4 }, - { 0xD5, UPPER_CASE, 0xF5 }, - { 0xD6, UPPER_CASE, 0xF6 }, - { 0xD8, UPPER_CASE, 0xF8 }, - { 0xD9, UPPER_CASE, 0xF9 }, - { 0xDA, UPPER_CASE, 0xFA }, - { 0xDB, UPPER_CASE, 0xFB }, - { 0xDC, UPPER_CASE, 0xFC }, - { 0xDD, UPPER_CASE, 0xFD }, - { 0xDE, UPPER_CASE, 0xFE }, - { 0xE0, LOWER_CASE, 0xC0 }, - { 0xE1, LOWER_CASE, 0xC1 }, - { 0xE2, LOWER_CASE, 0xC2 }, - { 0xE3, LOWER_CASE, 0xC3 }, - { 0xE4, LOWER_CASE, 0xC4 }, - { 0xE5, LOWER_CASE, 0xC5 }, - { 0xE6, LOWER_CASE, 0xC6 }, - { 0xE7, LOWER_CASE, 0xC7 }, - { 0xE8, LOWER_CASE, 0xC8 }, - { 0xE9, LOWER_CASE, 0xC9 }, - { 0xEA, LOWER_CASE, 0xCA }, - { 0xEB, LOWER_CASE, 0xCB }, - { 0xEC, LOWER_CASE, 0xCC }, - { 0xED, LOWER_CASE, 0xCD }, - { 0xEE, LOWER_CASE, 0xCE }, - { 0xEF, LOWER_CASE, 0xCF }, - { 0xF0, LOWER_CASE, 0xD0 }, - { 0xF1, LOWER_CASE, 0xD1 }, - { 0xF2, LOWER_CASE, 0xD2 }, - { 0xF3, LOWER_CASE, 0xD3 }, - { 0xF4, LOWER_CASE, 0xD4 }, - { 0xF5, LOWER_CASE, 0xD5 }, - { 0xF6, LOWER_CASE, 0xD6 }, - { 0xF8, LOWER_CASE, 0xD8 }, - { 0xF9, LOWER_CASE, 0xD9 }, - { 0xFA, LOWER_CASE, 0xDA }, - { 0xFB, LOWER_CASE, 0xDB }, - { 0xFC, LOWER_CASE, 0xDC }, - { 0xFD, LOWER_CASE, 0xDD }, - { 0xFE, LOWER_CASE, 0xDE }, - { 0xFF, LOWER_CASE, 0x178 }, - { 0x100, UPPER_CASE, 0x101 }, - { 0x101, LOWER_CASE, 0x100 }, - { 0x102, UPPER_CASE, 0x103 }, - { 0x103, LOWER_CASE, 0x102 }, - { 0x104, UPPER_CASE, 0x105 }, - { 0x105, LOWER_CASE, 0x104 }, - { 0x106, UPPER_CASE, 0x107 }, - { 0x107, LOWER_CASE, 0x106 }, - { 0x108, UPPER_CASE, 0x109 }, - { 0x109, LOWER_CASE, 0x108 }, - { 0x10A, UPPER_CASE, 0x10B }, - { 0x10B, LOWER_CASE, 0x10A }, - { 0x10C, UPPER_CASE, 0x10D }, - { 0x10D, LOWER_CASE, 0x10C }, - { 0x10E, UPPER_CASE, 0x10F }, - { 0x10F, LOWER_CASE, 0x10E }, - { 0x110, UPPER_CASE, 0x111 }, - { 0x111, LOWER_CASE, 0x110 }, - { 0x112, UPPER_CASE, 0x113 }, - { 0x113, LOWER_CASE, 0x112 }, - { 0x114, UPPER_CASE, 0x115 }, - { 0x115, LOWER_CASE, 0x114 }, - { 0x116, UPPER_CASE, 0x117 }, - { 0x117, LOWER_CASE, 0x116 }, - { 0x118, UPPER_CASE, 0x119 }, - { 0x119, LOWER_CASE, 0x118 }, - { 0x11A, UPPER_CASE, 0x11B }, - { 0x11B, LOWER_CASE, 0x11A }, - { 0x11C, UPPER_CASE, 0x11D }, - { 0x11D, LOWER_CASE, 0x11C }, - { 0x11E, UPPER_CASE, 0x11F }, - { 0x11F, LOWER_CASE, 0x11E }, - { 0x120, UPPER_CASE, 0x121 }, - { 0x121, LOWER_CASE, 0x120 }, - { 0x122, UPPER_CASE, 0x123 }, - { 0x123, LOWER_CASE, 0x122 }, - { 0x124, UPPER_CASE, 0x125 }, - { 0x125, LOWER_CASE, 0x124 }, - { 0x126, UPPER_CASE, 0x127 }, - { 0x127, LOWER_CASE, 0x126 }, - { 0x128, UPPER_CASE, 0x129 }, - { 0x129, LOWER_CASE, 0x128 }, - { 0x12A, UPPER_CASE, 0x12B }, - { 0x12B, LOWER_CASE, 0x12A }, - { 0x12C, UPPER_CASE, 0x12D }, - { 0x12D, LOWER_CASE, 0x12C }, - { 0x12E, UPPER_CASE, 0x12F }, - { 0x12F, LOWER_CASE, 0x12E }, - { 0x130, UPPER_CASE, 0x69 }, - { 0x131, LOWER_CASE, 0x49 }, - { 0x132, UPPER_CASE, 0x133 }, - { 0x133, LOWER_CASE, 0x132 }, - { 0x134, UPPER_CASE, 0x135 }, - { 0x135, LOWER_CASE, 0x134 }, - { 0x136, UPPER_CASE, 0x137 }, - { 0x137, LOWER_CASE, 0x136 }, - { 0x139, UPPER_CASE, 0x13A }, - { 0x13A, LOWER_CASE, 0x139 }, - { 0x13B, UPPER_CASE, 0x13C }, - { 0x13C, LOWER_CASE, 0x13B }, - { 0x13D, UPPER_CASE, 0x13E }, - { 0x13E, LOWER_CASE, 0x13D }, - { 0x13F, UPPER_CASE, 0x140 }, - { 0x140, LOWER_CASE, 0x13F }, - { 0x141, UPPER_CASE, 0x142 }, - { 0x142, LOWER_CASE, 0x141 }, - { 0x143, UPPER_CASE, 0x144 }, - { 0x144, LOWER_CASE, 0x143 }, - { 0x145, UPPER_CASE, 0x146 }, - { 0x146, LOWER_CASE, 0x145 }, - { 0x147, UPPER_CASE, 0x148 }, - { 0x148, LOWER_CASE, 0x147 }, - { 0x14A, UPPER_CASE, 0x14B }, - { 0x14B, LOWER_CASE, 0x14A }, - { 0x14C, UPPER_CASE, 0x14D }, - { 0x14D, LOWER_CASE, 0x14C }, - { 0x14E, UPPER_CASE, 0x14F }, - { 0x14F, LOWER_CASE, 0x14E }, - { 0x150, UPPER_CASE, 0x151 }, - { 0x151, LOWER_CASE, 0x150 }, - { 0x152, UPPER_CASE, 0x153 }, - { 0x153, LOWER_CASE, 0x152 }, - { 0x154, UPPER_CASE, 0x155 }, - { 0x155, LOWER_CASE, 0x154 }, - { 0x156, UPPER_CASE, 0x157 }, - { 0x157, LOWER_CASE, 0x156 }, - { 0x158, UPPER_CASE, 0x159 }, - { 0x159, LOWER_CASE, 0x158 }, - { 0x15A, UPPER_CASE, 0x15B }, - { 0x15B, LOWER_CASE, 0x15A }, - { 0x15C, UPPER_CASE, 0x15D }, - { 0x15D, LOWER_CASE, 0x15C }, - { 0x15E, UPPER_CASE, 0x15F }, - { 0x15F, LOWER_CASE, 0x15E }, - { 0x160, UPPER_CASE, 0x161 }, - { 0x161, LOWER_CASE, 0x160 }, - { 0x162, UPPER_CASE, 0x163 }, - { 0x163, LOWER_CASE, 0x162 }, - { 0x164, UPPER_CASE, 0x165 }, - { 0x165, LOWER_CASE, 0x164 }, - { 0x166, UPPER_CASE, 0x167 }, - { 0x167, LOWER_CASE, 0x166 }, - { 0x168, UPPER_CASE, 0x169 }, - { 0x169, LOWER_CASE, 0x168 }, - { 0x16A, UPPER_CASE, 0x16B }, - { 0x16B, LOWER_CASE, 0x16A }, - { 0x16C, UPPER_CASE, 0x16D }, - { 0x16D, LOWER_CASE, 0x16C }, - { 0x16E, UPPER_CASE, 0x16F }, - { 0x16F, LOWER_CASE, 0x16E }, - { 0x170, UPPER_CASE, 0x171 }, - { 0x171, LOWER_CASE, 0x170 }, - { 0x172, UPPER_CASE, 0x173 }, - { 0x173, LOWER_CASE, 0x172 }, - { 0x174, UPPER_CASE, 0x175 }, - { 0x175, LOWER_CASE, 0x174 }, - { 0x176, UPPER_CASE, 0x177 }, - { 0x177, LOWER_CASE, 0x176 }, - { 0x178, UPPER_CASE, 0xFF }, - { 0x179, UPPER_CASE, 0x17A }, - { 0x17A, LOWER_CASE, 0x179 }, - { 0x17B, UPPER_CASE, 0x17C }, - { 0x17C, LOWER_CASE, 0x17B }, - { 0x17D, UPPER_CASE, 0x17E }, - { 0x17E, LOWER_CASE, 0x17D }, - { 0x17F, LOWER_CASE, 0x53 }, - { 0x180, LOWER_CASE, 0x243 }, - { 0x181, UPPER_CASE, 0x253 }, - { 0x182, UPPER_CASE, 0x183 }, - { 0x183, LOWER_CASE, 0x182 }, - { 0x184, UPPER_CASE, 0x185 }, - { 0x185, LOWER_CASE, 0x184 }, - { 0x186, UPPER_CASE, 0x254 }, - { 0x187, UPPER_CASE, 0x188 }, - { 0x188, LOWER_CASE, 0x187 }, - { 0x189, UPPER_CASE, 0x256 }, - { 0x18A, UPPER_CASE, 0x257 }, - { 0x18B, UPPER_CASE, 0x18C }, - { 0x18C, LOWER_CASE, 0x18B }, - { 0x18E, UPPER_CASE, 0x1DD }, - { 0x18F, UPPER_CASE, 0x259 }, - { 0x190, UPPER_CASE, 0x25B }, - { 0x191, UPPER_CASE, 0x192 }, - { 0x192, LOWER_CASE, 0x191 }, - { 0x193, UPPER_CASE, 0x260 }, - { 0x194, UPPER_CASE, 0x263 }, - { 0x195, LOWER_CASE, 0x1F6 }, - { 0x196, UPPER_CASE, 0x269 }, - { 0x197, UPPER_CASE, 0x268 }, - { 0x198, UPPER_CASE, 0x199 }, - { 0x199, LOWER_CASE, 0x198 }, - { 0x19A, LOWER_CASE, 0x23D }, - { 0x19C, UPPER_CASE, 0x26F }, - { 0x19D, UPPER_CASE, 0x272 }, - { 0x19E, LOWER_CASE, 0x220 }, - { 0x19F, UPPER_CASE, 0x275 }, - { 0x1A0, UPPER_CASE, 0x1A1 }, - { 0x1A1, LOWER_CASE, 0x1A0 }, - { 0x1A2, UPPER_CASE, 0x1A3 }, - { 0x1A3, LOWER_CASE, 0x1A2 }, - { 0x1A4, UPPER_CASE, 0x1A5 }, - { 0x1A5, LOWER_CASE, 0x1A4 }, - { 0x1A6, UPPER_CASE, 0x280 }, - { 0x1A7, UPPER_CASE, 0x1A8 }, - { 0x1A8, LOWER_CASE, 0x1A7 }, - { 0x1A9, UPPER_CASE, 0x283 }, - { 0x1AC, UPPER_CASE, 0x1AD }, - { 0x1AD, LOWER_CASE, 0x1AC }, - { 0x1AE, UPPER_CASE, 0x288 }, - { 0x1AF, UPPER_CASE, 0x1B0 }, - { 0x1B0, LOWER_CASE, 0x1AF }, - { 0x1B1, UPPER_CASE, 0x28A }, - { 0x1B2, UPPER_CASE, 0x28B }, - { 0x1B3, UPPER_CASE, 0x1B4 }, - { 0x1B4, LOWER_CASE, 0x1B3 }, - { 0x1B5, UPPER_CASE, 0x1B6 }, - { 0x1B6, LOWER_CASE, 0x1B5 }, - { 0x1B7, UPPER_CASE, 0x292 }, - { 0x1B8, UPPER_CASE, 0x1B9 }, - { 0x1B9, LOWER_CASE, 0x1B8 }, - { 0x1BC, UPPER_CASE, 0x1BD }, - { 0x1BD, LOWER_CASE, 0x1BC }, - { 0x1BF, LOWER_CASE, 0x1F7 }, - { 0x1C4, UPPER_CASE, 0x1C6 }, - { 0x1C5, LOWER_CASE, 0x1C4 }, - { 0x1C6, LOWER_CASE, 0x1C4 }, - { 0x1C7, UPPER_CASE, 0x1C9 }, - { 0x1C8, LOWER_CASE, 0x1C7 }, - { 0x1C9, LOWER_CASE, 0x1C7 }, - { 0x1CA, UPPER_CASE, 0x1CC }, - { 0x1CB, LOWER_CASE, 0x1CA }, - { 0x1CC, LOWER_CASE, 0x1CA }, - { 0x1CD, UPPER_CASE, 0x1CE }, - { 0x1CE, LOWER_CASE, 0x1CD }, - { 0x1CF, UPPER_CASE, 0x1D0 }, - { 0x1D0, LOWER_CASE, 0x1CF }, - { 0x1D1, UPPER_CASE, 0x1D2 }, - { 0x1D2, LOWER_CASE, 0x1D1 }, - { 0x1D3, UPPER_CASE, 0x1D4 }, - { 0x1D4, LOWER_CASE, 0x1D3 }, - { 0x1D5, UPPER_CASE, 0x1D6 }, - { 0x1D6, LOWER_CASE, 0x1D5 }, - { 0x1D7, UPPER_CASE, 0x1D8 }, - { 0x1D8, LOWER_CASE, 0x1D7 }, - { 0x1D9, UPPER_CASE, 0x1DA }, - { 0x1DA, LOWER_CASE, 0x1D9 }, - { 0x1DB, UPPER_CASE, 0x1DC }, - { 0x1DC, LOWER_CASE, 0x1DB }, - { 0x1DD, LOWER_CASE, 0x18E }, - { 0x1DE, UPPER_CASE, 0x1DF }, - { 0x1DF, LOWER_CASE, 0x1DE }, - { 0x1E0, UPPER_CASE, 0x1E1 }, - { 0x1E1, LOWER_CASE, 0x1E0 }, - { 0x1E2, UPPER_CASE, 0x1E3 }, - { 0x1E3, LOWER_CASE, 0x1E2 }, - { 0x1E4, UPPER_CASE, 0x1E5 }, - { 0x1E5, LOWER_CASE, 0x1E4 }, - { 0x1E6, UPPER_CASE, 0x1E7 }, - { 0x1E7, LOWER_CASE, 0x1E6 }, - { 0x1E8, UPPER_CASE, 0x1E9 }, - { 0x1E9, LOWER_CASE, 0x1E8 }, - { 0x1EA, UPPER_CASE, 0x1EB }, - { 0x1EB, LOWER_CASE, 0x1EA }, - { 0x1EC, UPPER_CASE, 0x1ED }, - { 0x1ED, LOWER_CASE, 0x1EC }, - { 0x1EE, UPPER_CASE, 0x1EF }, - { 0x1EF, LOWER_CASE, 0x1EE }, - { 0x1F1, UPPER_CASE, 0x1F3 }, - { 0x1F2, LOWER_CASE, 0x1F1 }, - { 0x1F3, LOWER_CASE, 0x1F1 }, - { 0x1F4, UPPER_CASE, 0x1F5 }, - { 0x1F5, LOWER_CASE, 0x1F4 }, - { 0x1F6, UPPER_CASE, 0x195 }, - { 0x1F7, UPPER_CASE, 0x1BF }, - { 0x1F8, UPPER_CASE, 0x1F9 }, - { 0x1F9, LOWER_CASE, 0x1F8 }, - { 0x1FA, UPPER_CASE, 0x1FB }, - { 0x1FB, LOWER_CASE, 0x1FA }, - { 0x1FC, UPPER_CASE, 0x1FD }, - { 0x1FD, LOWER_CASE, 0x1FC }, - { 0x1FE, UPPER_CASE, 0x1FF }, - { 0x1FF, LOWER_CASE, 0x1FE }, - { 0x200, UPPER_CASE, 0x201 }, - { 0x201, LOWER_CASE, 0x200 }, - { 0x202, UPPER_CASE, 0x203 }, - { 0x203, LOWER_CASE, 0x202 }, - { 0x204, UPPER_CASE, 0x205 }, - { 0x205, LOWER_CASE, 0x204 }, - { 0x206, UPPER_CASE, 0x207 }, - { 0x207, LOWER_CASE, 0x206 }, - { 0x208, UPPER_CASE, 0x209 }, - { 0x209, LOWER_CASE, 0x208 }, - { 0x20A, UPPER_CASE, 0x20B }, - { 0x20B, LOWER_CASE, 0x20A }, - { 0x20C, UPPER_CASE, 0x20D }, - { 0x20D, LOWER_CASE, 0x20C }, - { 0x20E, UPPER_CASE, 0x20F }, - { 0x20F, LOWER_CASE, 0x20E }, - { 0x210, UPPER_CASE, 0x211 }, - { 0x211, LOWER_CASE, 0x210 }, - { 0x212, UPPER_CASE, 0x213 }, - { 0x213, LOWER_CASE, 0x212 }, - { 0x214, UPPER_CASE, 0x215 }, - { 0x215, LOWER_CASE, 0x214 }, - { 0x216, UPPER_CASE, 0x217 }, - { 0x217, LOWER_CASE, 0x216 }, - { 0x218, UPPER_CASE, 0x219 }, - { 0x219, LOWER_CASE, 0x218 }, - { 0x21A, UPPER_CASE, 0x21B }, - { 0x21B, LOWER_CASE, 0x21A }, - { 0x21C, UPPER_CASE, 0x21D }, - { 0x21D, LOWER_CASE, 0x21C }, - { 0x21E, UPPER_CASE, 0x21F }, - { 0x21F, LOWER_CASE, 0x21E }, - { 0x220, UPPER_CASE, 0x19E }, - { 0x222, UPPER_CASE, 0x223 }, - { 0x223, LOWER_CASE, 0x222 }, - { 0x224, UPPER_CASE, 0x225 }, - { 0x225, LOWER_CASE, 0x224 }, - { 0x226, UPPER_CASE, 0x227 }, - { 0x227, LOWER_CASE, 0x226 }, - { 0x228, UPPER_CASE, 0x229 }, - { 0x229, LOWER_CASE, 0x228 }, - { 0x22A, UPPER_CASE, 0x22B }, - { 0x22B, LOWER_CASE, 0x22A }, - { 0x22C, UPPER_CASE, 0x22D }, - { 0x22D, LOWER_CASE, 0x22C }, - { 0x22E, UPPER_CASE, 0x22F }, - { 0x22F, LOWER_CASE, 0x22E }, - { 0x230, UPPER_CASE, 0x231 }, - { 0x231, LOWER_CASE, 0x230 }, - { 0x232, UPPER_CASE, 0x233 }, - { 0x233, LOWER_CASE, 0x232 }, - { 0x23A, UPPER_CASE, 0x2C65 }, - { 0x23B, UPPER_CASE, 0x23C }, - { 0x23C, LOWER_CASE, 0x23B }, - { 0x23D, UPPER_CASE, 0x19A }, - { 0x23E, UPPER_CASE, 0x2C66 }, - { 0x23F, LOWER_CASE, 0x2C7E }, - { 0x240, LOWER_CASE, 0x2C7F }, - { 0x241, UPPER_CASE, 0x242 }, - { 0x242, LOWER_CASE, 0x241 }, - { 0x243, UPPER_CASE, 0x180 }, - { 0x244, UPPER_CASE, 0x289 }, - { 0x245, UPPER_CASE, 0x28C }, - { 0x246, UPPER_CASE, 0x247 }, - { 0x247, LOWER_CASE, 0x246 }, - { 0x248, UPPER_CASE, 0x249 }, - { 0x249, LOWER_CASE, 0x248 }, - { 0x24A, UPPER_CASE, 0x24B }, - { 0x24B, LOWER_CASE, 0x24A }, - { 0x24C, UPPER_CASE, 0x24D }, - { 0x24D, LOWER_CASE, 0x24C }, - { 0x24E, UPPER_CASE, 0x24F }, - { 0x24F, LOWER_CASE, 0x24E }, - { 0x250, LOWER_CASE, 0x2C6F }, - { 0x251, LOWER_CASE, 0x2C6D }, - { 0x252, LOWER_CASE, 0x2C70 }, - { 0x253, LOWER_CASE, 0x181 }, - { 0x254, LOWER_CASE, 0x186 }, - { 0x256, LOWER_CASE, 0x189 }, - { 0x257, LOWER_CASE, 0x18A }, - { 0x259, LOWER_CASE, 0x18F }, - { 0x25B, LOWER_CASE, 0x190 }, - { 0x25C, LOWER_CASE, 0xA7AB }, - { 0x260, LOWER_CASE, 0x193 }, - { 0x261, LOWER_CASE, 0xA7AC }, - { 0x263, LOWER_CASE, 0x194 }, - { 0x265, LOWER_CASE, 0xA78D }, - { 0x266, LOWER_CASE, 0xA7AA }, - { 0x268, LOWER_CASE, 0x197 }, - { 0x269, LOWER_CASE, 0x196 }, - { 0x26A, LOWER_CASE, 0xA7AE }, - { 0x26B, LOWER_CASE, 0x2C62 }, - { 0x26C, LOWER_CASE, 0xA7AD }, - { 0x26F, LOWER_CASE, 0x19C }, - { 0x271, LOWER_CASE, 0x2C6E }, - { 0x272, LOWER_CASE, 0x19D }, - { 0x275, LOWER_CASE, 0x19F }, - { 0x27D, LOWER_CASE, 0x2C64 }, - { 0x280, LOWER_CASE, 0x1A6 }, - { 0x282, LOWER_CASE, 0xA7C5 }, - { 0x283, LOWER_CASE, 0x1A9 }, - { 0x287, LOWER_CASE, 0xA7B1 }, - { 0x288, LOWER_CASE, 0x1AE }, - { 0x289, LOWER_CASE, 0x244 }, - { 0x28A, LOWER_CASE, 0x1B1 }, - { 0x28B, LOWER_CASE, 0x1B2 }, - { 0x28C, LOWER_CASE, 0x245 }, - { 0x292, LOWER_CASE, 0x1B7 }, - { 0x29D, LOWER_CASE, 0xA7B2 }, - { 0x29E, LOWER_CASE, 0xA7B0 }, - { 0x345, LOWER_CASE, 0x399 }, - { 0x370, UPPER_CASE, 0x371 }, - { 0x371, LOWER_CASE, 0x370 }, - { 0x372, UPPER_CASE, 0x373 }, - { 0x373, LOWER_CASE, 0x372 }, - { 0x376, UPPER_CASE, 0x377 }, - { 0x377, LOWER_CASE, 0x376 }, - { 0x37B, LOWER_CASE, 0x3FD }, - { 0x37C, LOWER_CASE, 0x3FE }, - { 0x37D, LOWER_CASE, 0x3FF }, - { 0x37F, UPPER_CASE, 0x3F3 }, - { 0x386, UPPER_CASE, 0x3AC }, - { 0x388, UPPER_CASE, 0x3AD }, - { 0x389, UPPER_CASE, 0x3AE }, - { 0x38A, UPPER_CASE, 0x3AF }, - { 0x38C, UPPER_CASE, 0x3CC }, - { 0x38E, UPPER_CASE, 0x3CD }, - { 0x38F, UPPER_CASE, 0x3CE }, - { 0x391, UPPER_CASE, 0x3B1 }, - { 0x392, UPPER_CASE, 0x3B2 }, - { 0x393, UPPER_CASE, 0x3B3 }, - { 0x394, UPPER_CASE, 0x3B4 }, - { 0x395, UPPER_CASE, 0x3B5 }, - { 0x396, UPPER_CASE, 0x3B6 }, - { 0x397, UPPER_CASE, 0x3B7 }, - { 0x398, UPPER_CASE, 0x3B8 }, - { 0x399, UPPER_CASE, 0x3B9 }, - { 0x39A, UPPER_CASE, 0x3BA }, - { 0x39B, UPPER_CASE, 0x3BB }, - { 0x39C, UPPER_CASE, 0x3BC }, - { 0x39D, UPPER_CASE, 0x3BD }, - { 0x39E, UPPER_CASE, 0x3BE }, - { 0x39F, UPPER_CASE, 0x3BF }, - { 0x3A0, UPPER_CASE, 0x3C0 }, - { 0x3A1, UPPER_CASE, 0x3C1 }, - { 0x3A3, UPPER_CASE, 0x3C3 }, - { 0x3A4, UPPER_CASE, 0x3C4 }, - { 0x3A5, UPPER_CASE, 0x3C5 }, - { 0x3A6, UPPER_CASE, 0x3C6 }, - { 0x3A7, UPPER_CASE, 0x3C7 }, - { 0x3A8, UPPER_CASE, 0x3C8 }, - { 0x3A9, UPPER_CASE, 0x3C9 }, - { 0x3AA, UPPER_CASE, 0x3CA }, - { 0x3AB, UPPER_CASE, 0x3CB }, - { 0x3AC, LOWER_CASE, 0x386 }, - { 0x3AD, LOWER_CASE, 0x388 }, - { 0x3AE, LOWER_CASE, 0x389 }, - { 0x3AF, LOWER_CASE, 0x38A }, - { 0x3B1, LOWER_CASE, 0x391 }, - { 0x3B2, LOWER_CASE, 0x392 }, - { 0x3B3, LOWER_CASE, 0x393 }, - { 0x3B4, LOWER_CASE, 0x394 }, - { 0x3B5, LOWER_CASE, 0x395 }, - { 0x3B6, LOWER_CASE, 0x396 }, - { 0x3B7, LOWER_CASE, 0x397 }, - { 0x3B8, LOWER_CASE, 0x398 }, - { 0x3B9, LOWER_CASE, 0x399 }, - { 0x3BA, LOWER_CASE, 0x39A }, - { 0x3BB, LOWER_CASE, 0x39B }, - { 0x3BC, LOWER_CASE, 0x39C }, - { 0x3BD, LOWER_CASE, 0x39D }, - { 0x3BE, LOWER_CASE, 0x39E }, - { 0x3BF, LOWER_CASE, 0x39F }, - { 0x3C0, LOWER_CASE, 0x3A0 }, - { 0x3C1, LOWER_CASE, 0x3A1 }, - { 0x3C2, LOWER_CASE, 0x3A3 }, - { 0x3C3, LOWER_CASE, 0x3A3 }, - { 0x3C4, LOWER_CASE, 0x3A4 }, - { 0x3C5, LOWER_CASE, 0x3A5 }, - { 0x3C6, LOWER_CASE, 0x3A6 }, - { 0x3C7, LOWER_CASE, 0x3A7 }, - { 0x3C8, LOWER_CASE, 0x3A8 }, - { 0x3C9, LOWER_CASE, 0x3A9 }, - { 0x3CA, LOWER_CASE, 0x3AA }, - { 0x3CB, LOWER_CASE, 0x3AB }, - { 0x3CC, LOWER_CASE, 0x38C }, - { 0x3CD, LOWER_CASE, 0x38E }, - { 0x3CE, LOWER_CASE, 0x38F }, - { 0x3CF, UPPER_CASE, 0x3D7 }, - { 0x3D0, LOWER_CASE, 0x392 }, - { 0x3D1, LOWER_CASE, 0x398 }, - { 0x3D5, LOWER_CASE, 0x3A6 }, - { 0x3D6, LOWER_CASE, 0x3A0 }, - { 0x3D7, LOWER_CASE, 0x3CF }, - { 0x3D8, UPPER_CASE, 0x3D9 }, - { 0x3D9, LOWER_CASE, 0x3D8 }, - { 0x3DA, UPPER_CASE, 0x3DB }, - { 0x3DB, LOWER_CASE, 0x3DA }, - { 0x3DC, UPPER_CASE, 0x3DD }, - { 0x3DD, LOWER_CASE, 0x3DC }, - { 0x3DE, UPPER_CASE, 0x3DF }, - { 0x3DF, LOWER_CASE, 0x3DE }, - { 0x3E0, UPPER_CASE, 0x3E1 }, - { 0x3E1, LOWER_CASE, 0x3E0 }, - { 0x3E2, UPPER_CASE, 0x3E3 }, - { 0x3E3, LOWER_CASE, 0x3E2 }, - { 0x3E4, UPPER_CASE, 0x3E5 }, - { 0x3E5, LOWER_CASE, 0x3E4 }, - { 0x3E6, UPPER_CASE, 0x3E7 }, - { 0x3E7, LOWER_CASE, 0x3E6 }, - { 0x3E8, UPPER_CASE, 0x3E9 }, - { 0x3E9, LOWER_CASE, 0x3E8 }, - { 0x3EA, UPPER_CASE, 0x3EB }, - { 0x3EB, LOWER_CASE, 0x3EA }, - { 0x3EC, UPPER_CASE, 0x3ED }, - { 0x3ED, LOWER_CASE, 0x3EC }, - { 0x3EE, UPPER_CASE, 0x3EF }, - { 0x3EF, LOWER_CASE, 0x3EE }, - { 0x3F0, LOWER_CASE, 0x39A }, - { 0x3F1, LOWER_CASE, 0x3A1 }, - { 0x3F2, LOWER_CASE, 0x3F9 }, - { 0x3F3, LOWER_CASE, 0x37F }, - { 0x3F4, UPPER_CASE, 0x3B8 }, - { 0x3F5, LOWER_CASE, 0x395 }, - { 0x3F7, UPPER_CASE, 0x3F8 }, - { 0x3F8, LOWER_CASE, 0x3F7 }, - { 0x3F9, UPPER_CASE, 0x3F2 }, - { 0x3FA, UPPER_CASE, 0x3FB }, - { 0x3FB, LOWER_CASE, 0x3FA }, - { 0x3FD, UPPER_CASE, 0x37B }, - { 0x3FE, UPPER_CASE, 0x37C }, - { 0x3FF, UPPER_CASE, 0x37D }, - { 0x400, UPPER_CASE, 0x450 }, - { 0x401, UPPER_CASE, 0x451 }, - { 0x402, UPPER_CASE, 0x452 }, - { 0x403, UPPER_CASE, 0x453 }, - { 0x404, UPPER_CASE, 0x454 }, - { 0x405, UPPER_CASE, 0x455 }, - { 0x406, UPPER_CASE, 0x456 }, - { 0x407, UPPER_CASE, 0x457 }, - { 0x408, UPPER_CASE, 0x458 }, - { 0x409, UPPER_CASE, 0x459 }, - { 0x40A, UPPER_CASE, 0x45A }, - { 0x40B, UPPER_CASE, 0x45B }, - { 0x40C, UPPER_CASE, 0x45C }, - { 0x40D, UPPER_CASE, 0x45D }, - { 0x40E, UPPER_CASE, 0x45E }, - { 0x40F, UPPER_CASE, 0x45F }, - { 0x410, UPPER_CASE, 0x430 }, - { 0x411, UPPER_CASE, 0x431 }, - { 0x412, UPPER_CASE, 0x432 }, - { 0x413, UPPER_CASE, 0x433 }, - { 0x414, UPPER_CASE, 0x434 }, - { 0x415, UPPER_CASE, 0x435 }, - { 0x416, UPPER_CASE, 0x436 }, - { 0x417, UPPER_CASE, 0x437 }, - { 0x418, UPPER_CASE, 0x438 }, - { 0x419, UPPER_CASE, 0x439 }, - { 0x41A, UPPER_CASE, 0x43A }, - { 0x41B, UPPER_CASE, 0x43B }, - { 0x41C, UPPER_CASE, 0x43C }, - { 0x41D, UPPER_CASE, 0x43D }, - { 0x41E, UPPER_CASE, 0x43E }, - { 0x41F, UPPER_CASE, 0x43F }, - { 0x420, UPPER_CASE, 0x440 }, - { 0x421, UPPER_CASE, 0x441 }, - { 0x422, UPPER_CASE, 0x442 }, - { 0x423, UPPER_CASE, 0x443 }, - { 0x424, UPPER_CASE, 0x444 }, - { 0x425, UPPER_CASE, 0x445 }, - { 0x426, UPPER_CASE, 0x446 }, - { 0x427, UPPER_CASE, 0x447 }, - { 0x428, UPPER_CASE, 0x448 }, - { 0x429, UPPER_CASE, 0x449 }, - { 0x42A, UPPER_CASE, 0x44A }, - { 0x42B, UPPER_CASE, 0x44B }, - { 0x42C, UPPER_CASE, 0x44C }, - { 0x42D, UPPER_CASE, 0x44D }, - { 0x42E, UPPER_CASE, 0x44E }, - { 0x42F, UPPER_CASE, 0x44F }, - { 0x430, LOWER_CASE, 0x410 }, - { 0x431, LOWER_CASE, 0x411 }, - { 0x432, LOWER_CASE, 0x412 }, - { 0x433, LOWER_CASE, 0x413 }, - { 0x434, LOWER_CASE, 0x414 }, - { 0x435, LOWER_CASE, 0x415 }, - { 0x436, LOWER_CASE, 0x416 }, - { 0x437, LOWER_CASE, 0x417 }, - { 0x438, LOWER_CASE, 0x418 }, - { 0x439, LOWER_CASE, 0x419 }, - { 0x43A, LOWER_CASE, 0x41A }, - { 0x43B, LOWER_CASE, 0x41B }, - { 0x43C, LOWER_CASE, 0x41C }, - { 0x43D, LOWER_CASE, 0x41D }, - { 0x43E, LOWER_CASE, 0x41E }, - { 0x43F, LOWER_CASE, 0x41F }, - { 0x440, LOWER_CASE, 0x420 }, - { 0x441, LOWER_CASE, 0x421 }, - { 0x442, LOWER_CASE, 0x422 }, - { 0x443, LOWER_CASE, 0x423 }, - { 0x444, LOWER_CASE, 0x424 }, - { 0x445, LOWER_CASE, 0x425 }, - { 0x446, LOWER_CASE, 0x426 }, - { 0x447, LOWER_CASE, 0x427 }, - { 0x448, LOWER_CASE, 0x428 }, - { 0x449, LOWER_CASE, 0x429 }, - { 0x44A, LOWER_CASE, 0x42A }, - { 0x44B, LOWER_CASE, 0x42B }, - { 0x44C, LOWER_CASE, 0x42C }, - { 0x44D, LOWER_CASE, 0x42D }, - { 0x44E, LOWER_CASE, 0x42E }, - { 0x44F, LOWER_CASE, 0x42F }, - { 0x450, LOWER_CASE, 0x400 }, - { 0x451, LOWER_CASE, 0x401 }, - { 0x452, LOWER_CASE, 0x402 }, - { 0x453, LOWER_CASE, 0x403 }, - { 0x454, LOWER_CASE, 0x404 }, - { 0x455, LOWER_CASE, 0x405 }, - { 0x456, LOWER_CASE, 0x406 }, - { 0x457, LOWER_CASE, 0x407 }, - { 0x458, LOWER_CASE, 0x408 }, - { 0x459, LOWER_CASE, 0x409 }, - { 0x45A, LOWER_CASE, 0x40A }, - { 0x45B, LOWER_CASE, 0x40B }, - { 0x45C, LOWER_CASE, 0x40C }, - { 0x45D, LOWER_CASE, 0x40D }, - { 0x45E, LOWER_CASE, 0x40E }, - { 0x45F, LOWER_CASE, 0x40F }, - { 0x460, UPPER_CASE, 0x461 }, - { 0x461, LOWER_CASE, 0x460 }, - { 0x462, UPPER_CASE, 0x463 }, - { 0x463, LOWER_CASE, 0x462 }, - { 0x464, UPPER_CASE, 0x465 }, - { 0x465, LOWER_CASE, 0x464 }, - { 0x466, UPPER_CASE, 0x467 }, - { 0x467, LOWER_CASE, 0x466 }, - { 0x468, UPPER_CASE, 0x469 }, - { 0x469, LOWER_CASE, 0x468 }, - { 0x46A, UPPER_CASE, 0x46B }, - { 0x46B, LOWER_CASE, 0x46A }, - { 0x46C, UPPER_CASE, 0x46D }, - { 0x46D, LOWER_CASE, 0x46C }, - { 0x46E, UPPER_CASE, 0x46F }, - { 0x46F, LOWER_CASE, 0x46E }, - { 0x470, UPPER_CASE, 0x471 }, - { 0x471, LOWER_CASE, 0x470 }, - { 0x472, UPPER_CASE, 0x473 }, - { 0x473, LOWER_CASE, 0x472 }, - { 0x474, UPPER_CASE, 0x475 }, - { 0x475, LOWER_CASE, 0x474 }, - { 0x476, UPPER_CASE, 0x477 }, - { 0x477, LOWER_CASE, 0x476 }, - { 0x478, UPPER_CASE, 0x479 }, - { 0x479, LOWER_CASE, 0x478 }, - { 0x47A, UPPER_CASE, 0x47B }, - { 0x47B, LOWER_CASE, 0x47A }, - { 0x47C, UPPER_CASE, 0x47D }, - { 0x47D, LOWER_CASE, 0x47C }, - { 0x47E, UPPER_CASE, 0x47F }, - { 0x47F, LOWER_CASE, 0x47E }, - { 0x480, UPPER_CASE, 0x481 }, - { 0x481, LOWER_CASE, 0x480 }, - { 0x48A, UPPER_CASE, 0x48B }, - { 0x48B, LOWER_CASE, 0x48A }, - { 0x48C, UPPER_CASE, 0x48D }, - { 0x48D, LOWER_CASE, 0x48C }, - { 0x48E, UPPER_CASE, 0x48F }, - { 0x48F, LOWER_CASE, 0x48E }, - { 0x490, UPPER_CASE, 0x491 }, - { 0x491, LOWER_CASE, 0x490 }, - { 0x492, UPPER_CASE, 0x493 }, - { 0x493, LOWER_CASE, 0x492 }, - { 0x494, UPPER_CASE, 0x495 }, - { 0x495, LOWER_CASE, 0x494 }, - { 0x496, UPPER_CASE, 0x497 }, - { 0x497, LOWER_CASE, 0x496 }, - { 0x498, UPPER_CASE, 0x499 }, - { 0x499, LOWER_CASE, 0x498 }, - { 0x49A, UPPER_CASE, 0x49B }, - { 0x49B, LOWER_CASE, 0x49A }, - { 0x49C, UPPER_CASE, 0x49D }, - { 0x49D, LOWER_CASE, 0x49C }, - { 0x49E, UPPER_CASE, 0x49F }, - { 0x49F, LOWER_CASE, 0x49E }, - { 0x4A0, UPPER_CASE, 0x4A1 }, - { 0x4A1, LOWER_CASE, 0x4A0 }, - { 0x4A2, UPPER_CASE, 0x4A3 }, - { 0x4A3, LOWER_CASE, 0x4A2 }, - { 0x4A4, UPPER_CASE, 0x4A5 }, - { 0x4A5, LOWER_CASE, 0x4A4 }, - { 0x4A6, UPPER_CASE, 0x4A7 }, - { 0x4A7, LOWER_CASE, 0x4A6 }, - { 0x4A8, UPPER_CASE, 0x4A9 }, - { 0x4A9, LOWER_CASE, 0x4A8 }, - { 0x4AA, UPPER_CASE, 0x4AB }, - { 0x4AB, LOWER_CASE, 0x4AA }, - { 0x4AC, UPPER_CASE, 0x4AD }, - { 0x4AD, LOWER_CASE, 0x4AC }, - { 0x4AE, UPPER_CASE, 0x4AF }, - { 0x4AF, LOWER_CASE, 0x4AE }, - { 0x4B0, UPPER_CASE, 0x4B1 }, - { 0x4B1, LOWER_CASE, 0x4B0 }, - { 0x4B2, UPPER_CASE, 0x4B3 }, - { 0x4B3, LOWER_CASE, 0x4B2 }, - { 0x4B4, UPPER_CASE, 0x4B5 }, - { 0x4B5, LOWER_CASE, 0x4B4 }, - { 0x4B6, UPPER_CASE, 0x4B7 }, - { 0x4B7, LOWER_CASE, 0x4B6 }, - { 0x4B8, UPPER_CASE, 0x4B9 }, - { 0x4B9, LOWER_CASE, 0x4B8 }, - { 0x4BA, UPPER_CASE, 0x4BB }, - { 0x4BB, LOWER_CASE, 0x4BA }, - { 0x4BC, UPPER_CASE, 0x4BD }, - { 0x4BD, LOWER_CASE, 0x4BC }, - { 0x4BE, UPPER_CASE, 0x4BF }, - { 0x4BF, LOWER_CASE, 0x4BE }, - { 0x4C0, UPPER_CASE, 0x4CF }, - { 0x4C1, UPPER_CASE, 0x4C2 }, - { 0x4C2, LOWER_CASE, 0x4C1 }, - { 0x4C3, UPPER_CASE, 0x4C4 }, - { 0x4C4, LOWER_CASE, 0x4C3 }, - { 0x4C5, UPPER_CASE, 0x4C6 }, - { 0x4C6, LOWER_CASE, 0x4C5 }, - { 0x4C7, UPPER_CASE, 0x4C8 }, - { 0x4C8, LOWER_CASE, 0x4C7 }, - { 0x4C9, UPPER_CASE, 0x4CA }, - { 0x4CA, LOWER_CASE, 0x4C9 }, - { 0x4CB, UPPER_CASE, 0x4CC }, - { 0x4CC, LOWER_CASE, 0x4CB }, - { 0x4CD, UPPER_CASE, 0x4CE }, - { 0x4CE, LOWER_CASE, 0x4CD }, - { 0x4CF, LOWER_CASE, 0x4C0 }, - { 0x4D0, UPPER_CASE, 0x4D1 }, - { 0x4D1, LOWER_CASE, 0x4D0 }, - { 0x4D2, UPPER_CASE, 0x4D3 }, - { 0x4D3, LOWER_CASE, 0x4D2 }, - { 0x4D4, UPPER_CASE, 0x4D5 }, - { 0x4D5, LOWER_CASE, 0x4D4 }, - { 0x4D6, UPPER_CASE, 0x4D7 }, - { 0x4D7, LOWER_CASE, 0x4D6 }, - { 0x4D8, UPPER_CASE, 0x4D9 }, - { 0x4D9, LOWER_CASE, 0x4D8 }, - { 0x4DA, UPPER_CASE, 0x4DB }, - { 0x4DB, LOWER_CASE, 0x4DA }, - { 0x4DC, UPPER_CASE, 0x4DD }, - { 0x4DD, LOWER_CASE, 0x4DC }, - { 0x4DE, UPPER_CASE, 0x4DF }, - { 0x4DF, LOWER_CASE, 0x4DE }, - { 0x4E0, UPPER_CASE, 0x4E1 }, - { 0x4E1, LOWER_CASE, 0x4E0 }, - { 0x4E2, UPPER_CASE, 0x4E3 }, - { 0x4E3, LOWER_CASE, 0x4E2 }, - { 0x4E4, UPPER_CASE, 0x4E5 }, - { 0x4E5, LOWER_CASE, 0x4E4 }, - { 0x4E6, UPPER_CASE, 0x4E7 }, - { 0x4E7, LOWER_CASE, 0x4E6 }, - { 0x4E8, UPPER_CASE, 0x4E9 }, - { 0x4E9, LOWER_CASE, 0x4E8 }, - { 0x4EA, UPPER_CASE, 0x4EB }, - { 0x4EB, LOWER_CASE, 0x4EA }, - { 0x4EC, UPPER_CASE, 0x4ED }, - { 0x4ED, LOWER_CASE, 0x4EC }, - { 0x4EE, UPPER_CASE, 0x4EF }, - { 0x4EF, LOWER_CASE, 0x4EE }, - { 0x4F0, UPPER_CASE, 0x4F1 }, - { 0x4F1, LOWER_CASE, 0x4F0 }, - { 0x4F2, UPPER_CASE, 0x4F3 }, - { 0x4F3, LOWER_CASE, 0x4F2 }, - { 0x4F4, UPPER_CASE, 0x4F5 }, - { 0x4F5, LOWER_CASE, 0x4F4 }, - { 0x4F6, UPPER_CASE, 0x4F7 }, - { 0x4F7, LOWER_CASE, 0x4F6 }, - { 0x4F8, UPPER_CASE, 0x4F9 }, - { 0x4F9, LOWER_CASE, 0x4F8 }, - { 0x4FA, UPPER_CASE, 0x4FB }, - { 0x4FB, LOWER_CASE, 0x4FA }, - { 0x4FC, UPPER_CASE, 0x4FD }, - { 0x4FD, LOWER_CASE, 0x4FC }, - { 0x4FE, UPPER_CASE, 0x4FF }, - { 0x4FF, LOWER_CASE, 0x4FE }, - { 0x500, UPPER_CASE, 0x501 }, - { 0x501, LOWER_CASE, 0x500 }, - { 0x502, UPPER_CASE, 0x503 }, - { 0x503, LOWER_CASE, 0x502 }, - { 0x504, UPPER_CASE, 0x505 }, - { 0x505, LOWER_CASE, 0x504 }, - { 0x506, UPPER_CASE, 0x507 }, - { 0x507, LOWER_CASE, 0x506 }, - { 0x508, UPPER_CASE, 0x509 }, - { 0x509, LOWER_CASE, 0x508 }, - { 0x50A, UPPER_CASE, 0x50B }, - { 0x50B, LOWER_CASE, 0x50A }, - { 0x50C, UPPER_CASE, 0x50D }, - { 0x50D, LOWER_CASE, 0x50C }, - { 0x50E, UPPER_CASE, 0x50F }, - { 0x50F, LOWER_CASE, 0x50E }, - { 0x510, UPPER_CASE, 0x511 }, - { 0x511, LOWER_CASE, 0x510 }, - { 0x512, UPPER_CASE, 0x513 }, - { 0x513, LOWER_CASE, 0x512 }, - { 0x514, UPPER_CASE, 0x515 }, - { 0x515, LOWER_CASE, 0x514 }, - { 0x516, UPPER_CASE, 0x517 }, - { 0x517, LOWER_CASE, 0x516 }, - { 0x518, UPPER_CASE, 0x519 }, - { 0x519, LOWER_CASE, 0x518 }, - { 0x51A, UPPER_CASE, 0x51B }, - { 0x51B, LOWER_CASE, 0x51A }, - { 0x51C, UPPER_CASE, 0x51D }, - { 0x51D, LOWER_CASE, 0x51C }, - { 0x51E, UPPER_CASE, 0x51F }, - { 0x51F, LOWER_CASE, 0x51E }, - { 0x520, UPPER_CASE, 0x521 }, - { 0x521, LOWER_CASE, 0x520 }, - { 0x522, UPPER_CASE, 0x523 }, - { 0x523, LOWER_CASE, 0x522 }, - { 0x524, UPPER_CASE, 0x525 }, - { 0x525, LOWER_CASE, 0x524 }, - { 0x526, UPPER_CASE, 0x527 }, - { 0x527, LOWER_CASE, 0x526 }, - { 0x528, UPPER_CASE, 0x529 }, - { 0x529, LOWER_CASE, 0x528 }, - { 0x52A, UPPER_CASE, 0x52B }, - { 0x52B, LOWER_CASE, 0x52A }, - { 0x52C, UPPER_CASE, 0x52D }, - { 0x52D, LOWER_CASE, 0x52C }, - { 0x52E, UPPER_CASE, 0x52F }, - { 0x52F, LOWER_CASE, 0x52E }, - { 0x531, UPPER_CASE, 0x561 }, - { 0x532, UPPER_CASE, 0x562 }, - { 0x533, UPPER_CASE, 0x563 }, - { 0x534, UPPER_CASE, 0x564 }, - { 0x535, UPPER_CASE, 0x565 }, - { 0x536, UPPER_CASE, 0x566 }, - { 0x537, UPPER_CASE, 0x567 }, - { 0x538, UPPER_CASE, 0x568 }, - { 0x539, UPPER_CASE, 0x569 }, - { 0x53A, UPPER_CASE, 0x56A }, - { 0x53B, UPPER_CASE, 0x56B }, - { 0x53C, UPPER_CASE, 0x56C }, - { 0x53D, UPPER_CASE, 0x56D }, - { 0x53E, UPPER_CASE, 0x56E }, - { 0x53F, UPPER_CASE, 0x56F }, - { 0x540, UPPER_CASE, 0x570 }, - { 0x541, UPPER_CASE, 0x571 }, - { 0x542, UPPER_CASE, 0x572 }, - { 0x543, UPPER_CASE, 0x573 }, - { 0x544, UPPER_CASE, 0x574 }, - { 0x545, UPPER_CASE, 0x575 }, - { 0x546, UPPER_CASE, 0x576 }, - { 0x547, UPPER_CASE, 0x577 }, - { 0x548, UPPER_CASE, 0x578 }, - { 0x549, UPPER_CASE, 0x579 }, - { 0x54A, UPPER_CASE, 0x57A }, - { 0x54B, UPPER_CASE, 0x57B }, - { 0x54C, UPPER_CASE, 0x57C }, - { 0x54D, UPPER_CASE, 0x57D }, - { 0x54E, UPPER_CASE, 0x57E }, - { 0x54F, UPPER_CASE, 0x57F }, - { 0x550, UPPER_CASE, 0x580 }, - { 0x551, UPPER_CASE, 0x581 }, - { 0x552, UPPER_CASE, 0x582 }, - { 0x553, UPPER_CASE, 0x583 }, - { 0x554, UPPER_CASE, 0x584 }, - { 0x555, UPPER_CASE, 0x585 }, - { 0x556, UPPER_CASE, 0x586 }, - { 0x561, LOWER_CASE, 0x531 }, - { 0x562, LOWER_CASE, 0x532 }, - { 0x563, LOWER_CASE, 0x533 }, - { 0x564, LOWER_CASE, 0x534 }, - { 0x565, LOWER_CASE, 0x535 }, - { 0x566, LOWER_CASE, 0x536 }, - { 0x567, LOWER_CASE, 0x537 }, - { 0x568, LOWER_CASE, 0x538 }, - { 0x569, LOWER_CASE, 0x539 }, - { 0x56A, LOWER_CASE, 0x53A }, - { 0x56B, LOWER_CASE, 0x53B }, - { 0x56C, LOWER_CASE, 0x53C }, - { 0x56D, LOWER_CASE, 0x53D }, - { 0x56E, LOWER_CASE, 0x53E }, - { 0x56F, LOWER_CASE, 0x53F }, - { 0x570, LOWER_CASE, 0x540 }, - { 0x571, LOWER_CASE, 0x541 }, - { 0x572, LOWER_CASE, 0x542 }, - { 0x573, LOWER_CASE, 0x543 }, - { 0x574, LOWER_CASE, 0x544 }, - { 0x575, LOWER_CASE, 0x545 }, - { 0x576, LOWER_CASE, 0x546 }, - { 0x577, LOWER_CASE, 0x547 }, - { 0x578, LOWER_CASE, 0x548 }, - { 0x579, LOWER_CASE, 0x549 }, - { 0x57A, LOWER_CASE, 0x54A }, - { 0x57B, LOWER_CASE, 0x54B }, - { 0x57C, LOWER_CASE, 0x54C }, - { 0x57D, LOWER_CASE, 0x54D }, - { 0x57E, LOWER_CASE, 0x54E }, - { 0x57F, LOWER_CASE, 0x54F }, - { 0x580, LOWER_CASE, 0x550 }, - { 0x581, LOWER_CASE, 0x551 }, - { 0x582, LOWER_CASE, 0x552 }, - { 0x583, LOWER_CASE, 0x553 }, - { 0x584, LOWER_CASE, 0x554 }, - { 0x585, LOWER_CASE, 0x555 }, - { 0x586, LOWER_CASE, 0x556 }, - { 0x10A0, UPPER_CASE, 0x2D00 }, - { 0x10A1, UPPER_CASE, 0x2D01 }, - { 0x10A2, UPPER_CASE, 0x2D02 }, - { 0x10A3, UPPER_CASE, 0x2D03 }, - { 0x10A4, UPPER_CASE, 0x2D04 }, - { 0x10A5, UPPER_CASE, 0x2D05 }, - { 0x10A6, UPPER_CASE, 0x2D06 }, - { 0x10A7, UPPER_CASE, 0x2D07 }, - { 0x10A8, UPPER_CASE, 0x2D08 }, - { 0x10A9, UPPER_CASE, 0x2D09 }, - { 0x10AA, UPPER_CASE, 0x2D0A }, - { 0x10AB, UPPER_CASE, 0x2D0B }, - { 0x10AC, UPPER_CASE, 0x2D0C }, - { 0x10AD, UPPER_CASE, 0x2D0D }, - { 0x10AE, UPPER_CASE, 0x2D0E }, - { 0x10AF, UPPER_CASE, 0x2D0F }, - { 0x10B0, UPPER_CASE, 0x2D10 }, - { 0x10B1, UPPER_CASE, 0x2D11 }, - { 0x10B2, UPPER_CASE, 0x2D12 }, - { 0x10B3, UPPER_CASE, 0x2D13 }, - { 0x10B4, UPPER_CASE, 0x2D14 }, - { 0x10B5, UPPER_CASE, 0x2D15 }, - { 0x10B6, UPPER_CASE, 0x2D16 }, - { 0x10B7, UPPER_CASE, 0x2D17 }, - { 0x10B8, UPPER_CASE, 0x2D18 }, - { 0x10B9, UPPER_CASE, 0x2D19 }, - { 0x10BA, UPPER_CASE, 0x2D1A }, - { 0x10BB, UPPER_CASE, 0x2D1B }, - { 0x10BC, UPPER_CASE, 0x2D1C }, - { 0x10BD, UPPER_CASE, 0x2D1D }, - { 0x10BE, UPPER_CASE, 0x2D1E }, - { 0x10BF, UPPER_CASE, 0x2D1F }, - { 0x10C0, UPPER_CASE, 0x2D20 }, - { 0x10C1, UPPER_CASE, 0x2D21 }, - { 0x10C2, UPPER_CASE, 0x2D22 }, - { 0x10C3, UPPER_CASE, 0x2D23 }, - { 0x10C4, UPPER_CASE, 0x2D24 }, - { 0x10C5, UPPER_CASE, 0x2D25 }, - { 0x10C7, UPPER_CASE, 0x2D27 }, - { 0x10CD, UPPER_CASE, 0x2D2D }, - { 0x10D0, LOWER_CASE, 0x1C90 }, - { 0x10D1, LOWER_CASE, 0x1C91 }, - { 0x10D2, LOWER_CASE, 0x1C92 }, - { 0x10D3, LOWER_CASE, 0x1C93 }, - { 0x10D4, LOWER_CASE, 0x1C94 }, - { 0x10D5, LOWER_CASE, 0x1C95 }, - { 0x10D6, LOWER_CASE, 0x1C96 }, - { 0x10D7, LOWER_CASE, 0x1C97 }, - { 0x10D8, LOWER_CASE, 0x1C98 }, - { 0x10D9, LOWER_CASE, 0x1C99 }, - { 0x10DA, LOWER_CASE, 0x1C9A }, - { 0x10DB, LOWER_CASE, 0x1C9B }, - { 0x10DC, LOWER_CASE, 0x1C9C }, - { 0x10DD, LOWER_CASE, 0x1C9D }, - { 0x10DE, LOWER_CASE, 0x1C9E }, - { 0x10DF, LOWER_CASE, 0x1C9F }, - { 0x10E0, LOWER_CASE, 0x1CA0 }, - { 0x10E1, LOWER_CASE, 0x1CA1 }, - { 0x10E2, LOWER_CASE, 0x1CA2 }, - { 0x10E3, LOWER_CASE, 0x1CA3 }, - { 0x10E4, LOWER_CASE, 0x1CA4 }, - { 0x10E5, LOWER_CASE, 0x1CA5 }, - { 0x10E6, LOWER_CASE, 0x1CA6 }, - { 0x10E7, LOWER_CASE, 0x1CA7 }, - { 0x10E8, LOWER_CASE, 0x1CA8 }, - { 0x10E9, LOWER_CASE, 0x1CA9 }, - { 0x10EA, LOWER_CASE, 0x1CAA }, - { 0x10EB, LOWER_CASE, 0x1CAB }, - { 0x10EC, LOWER_CASE, 0x1CAC }, - { 0x10ED, LOWER_CASE, 0x1CAD }, - { 0x10EE, LOWER_CASE, 0x1CAE }, - { 0x10EF, LOWER_CASE, 0x1CAF }, - { 0x10F0, LOWER_CASE, 0x1CB0 }, - { 0x10F1, LOWER_CASE, 0x1CB1 }, - { 0x10F2, LOWER_CASE, 0x1CB2 }, - { 0x10F3, LOWER_CASE, 0x1CB3 }, - { 0x10F4, LOWER_CASE, 0x1CB4 }, - { 0x10F5, LOWER_CASE, 0x1CB5 }, - { 0x10F6, LOWER_CASE, 0x1CB6 }, - { 0x10F7, LOWER_CASE, 0x1CB7 }, - { 0x10F8, LOWER_CASE, 0x1CB8 }, - { 0x10F9, LOWER_CASE, 0x1CB9 }, - { 0x10FA, LOWER_CASE, 0x1CBA }, - { 0x10FD, LOWER_CASE, 0x1CBD }, - { 0x10FE, LOWER_CASE, 0x1CBE }, - { 0x10FF, LOWER_CASE, 0x1CBF }, - { 0x13A0, UPPER_CASE, 0xAB70 }, - { 0x13A1, UPPER_CASE, 0xAB71 }, - { 0x13A2, UPPER_CASE, 0xAB72 }, - { 0x13A3, UPPER_CASE, 0xAB73 }, - { 0x13A4, UPPER_CASE, 0xAB74 }, - { 0x13A5, UPPER_CASE, 0xAB75 }, - { 0x13A6, UPPER_CASE, 0xAB76 }, - { 0x13A7, UPPER_CASE, 0xAB77 }, - { 0x13A8, UPPER_CASE, 0xAB78 }, - { 0x13A9, UPPER_CASE, 0xAB79 }, - { 0x13AA, UPPER_CASE, 0xAB7A }, - { 0x13AB, UPPER_CASE, 0xAB7B }, - { 0x13AC, UPPER_CASE, 0xAB7C }, - { 0x13AD, UPPER_CASE, 0xAB7D }, - { 0x13AE, UPPER_CASE, 0xAB7E }, - { 0x13AF, UPPER_CASE, 0xAB7F }, - { 0x13B0, UPPER_CASE, 0xAB80 }, - { 0x13B1, UPPER_CASE, 0xAB81 }, - { 0x13B2, UPPER_CASE, 0xAB82 }, - { 0x13B3, UPPER_CASE, 0xAB83 }, - { 0x13B4, UPPER_CASE, 0xAB84 }, - { 0x13B5, UPPER_CASE, 0xAB85 }, - { 0x13B6, UPPER_CASE, 0xAB86 }, - { 0x13B7, UPPER_CASE, 0xAB87 }, - { 0x13B8, UPPER_CASE, 0xAB88 }, - { 0x13B9, UPPER_CASE, 0xAB89 }, - { 0x13BA, UPPER_CASE, 0xAB8A }, - { 0x13BB, UPPER_CASE, 0xAB8B }, - { 0x13BC, UPPER_CASE, 0xAB8C }, - { 0x13BD, UPPER_CASE, 0xAB8D }, - { 0x13BE, UPPER_CASE, 0xAB8E }, - { 0x13BF, UPPER_CASE, 0xAB8F }, - { 0x13C0, UPPER_CASE, 0xAB90 }, - { 0x13C1, UPPER_CASE, 0xAB91 }, - { 0x13C2, UPPER_CASE, 0xAB92 }, - { 0x13C3, UPPER_CASE, 0xAB93 }, - { 0x13C4, UPPER_CASE, 0xAB94 }, - { 0x13C5, UPPER_CASE, 0xAB95 }, - { 0x13C6, UPPER_CASE, 0xAB96 }, - { 0x13C7, UPPER_CASE, 0xAB97 }, - { 0x13C8, UPPER_CASE, 0xAB98 }, - { 0x13C9, UPPER_CASE, 0xAB99 }, - { 0x13CA, UPPER_CASE, 0xAB9A }, - { 0x13CB, UPPER_CASE, 0xAB9B }, - { 0x13CC, UPPER_CASE, 0xAB9C }, - { 0x13CD, UPPER_CASE, 0xAB9D }, - { 0x13CE, UPPER_CASE, 0xAB9E }, - { 0x13CF, UPPER_CASE, 0xAB9F }, - { 0x13D0, UPPER_CASE, 0xABA0 }, - { 0x13D1, UPPER_CASE, 0xABA1 }, - { 0x13D2, UPPER_CASE, 0xABA2 }, - { 0x13D3, UPPER_CASE, 0xABA3 }, - { 0x13D4, UPPER_CASE, 0xABA4 }, - { 0x13D5, UPPER_CASE, 0xABA5 }, - { 0x13D6, UPPER_CASE, 0xABA6 }, - { 0x13D7, UPPER_CASE, 0xABA7 }, - { 0x13D8, UPPER_CASE, 0xABA8 }, - { 0x13D9, UPPER_CASE, 0xABA9 }, - { 0x13DA, UPPER_CASE, 0xABAA }, - { 0x13DB, UPPER_CASE, 0xABAB }, - { 0x13DC, UPPER_CASE, 0xABAC }, - { 0x13DD, UPPER_CASE, 0xABAD }, - { 0x13DE, UPPER_CASE, 0xABAE }, - { 0x13DF, UPPER_CASE, 0xABAF }, - { 0x13E0, UPPER_CASE, 0xABB0 }, - { 0x13E1, UPPER_CASE, 0xABB1 }, - { 0x13E2, UPPER_CASE, 0xABB2 }, - { 0x13E3, UPPER_CASE, 0xABB3 }, - { 0x13E4, UPPER_CASE, 0xABB4 }, - { 0x13E5, UPPER_CASE, 0xABB5 }, - { 0x13E6, UPPER_CASE, 0xABB6 }, - { 0x13E7, UPPER_CASE, 0xABB7 }, - { 0x13E8, UPPER_CASE, 0xABB8 }, - { 0x13E9, UPPER_CASE, 0xABB9 }, - { 0x13EA, UPPER_CASE, 0xABBA }, - { 0x13EB, UPPER_CASE, 0xABBB }, - { 0x13EC, UPPER_CASE, 0xABBC }, - { 0x13ED, UPPER_CASE, 0xABBD }, - { 0x13EE, UPPER_CASE, 0xABBE }, - { 0x13EF, UPPER_CASE, 0xABBF }, - { 0x13F0, UPPER_CASE, 0x13F8 }, - { 0x13F1, UPPER_CASE, 0x13F9 }, - { 0x13F2, UPPER_CASE, 0x13FA }, - { 0x13F3, UPPER_CASE, 0x13FB }, - { 0x13F4, UPPER_CASE, 0x13FC }, - { 0x13F5, UPPER_CASE, 0x13FD }, - { 0x13F8, LOWER_CASE, 0x13F0 }, - { 0x13F9, LOWER_CASE, 0x13F1 }, - { 0x13FA, LOWER_CASE, 0x13F2 }, - { 0x13FB, LOWER_CASE, 0x13F3 }, - { 0x13FC, LOWER_CASE, 0x13F4 }, - { 0x13FD, LOWER_CASE, 0x13F5 }, - { 0x1C80, LOWER_CASE, 0x412 }, - { 0x1C81, LOWER_CASE, 0x414 }, - { 0x1C82, LOWER_CASE, 0x41E }, - { 0x1C83, LOWER_CASE, 0x421 }, - { 0x1C84, LOWER_CASE, 0x422 }, - { 0x1C85, LOWER_CASE, 0x422 }, - { 0x1C86, LOWER_CASE, 0x42A }, - { 0x1C87, LOWER_CASE, 0x462 }, - { 0x1C88, LOWER_CASE, 0xA64A }, - { 0x1C90, UPPER_CASE, 0x10D0 }, - { 0x1C91, UPPER_CASE, 0x10D1 }, - { 0x1C92, UPPER_CASE, 0x10D2 }, - { 0x1C93, UPPER_CASE, 0x10D3 }, - { 0x1C94, UPPER_CASE, 0x10D4 }, - { 0x1C95, UPPER_CASE, 0x10D5 }, - { 0x1C96, UPPER_CASE, 0x10D6 }, - { 0x1C97, UPPER_CASE, 0x10D7 }, - { 0x1C98, UPPER_CASE, 0x10D8 }, - { 0x1C99, UPPER_CASE, 0x10D9 }, - { 0x1C9A, UPPER_CASE, 0x10DA }, - { 0x1C9B, UPPER_CASE, 0x10DB }, - { 0x1C9C, UPPER_CASE, 0x10DC }, - { 0x1C9D, UPPER_CASE, 0x10DD }, - { 0x1C9E, UPPER_CASE, 0x10DE }, - { 0x1C9F, UPPER_CASE, 0x10DF }, - { 0x1CA0, UPPER_CASE, 0x10E0 }, - { 0x1CA1, UPPER_CASE, 0x10E1 }, - { 0x1CA2, UPPER_CASE, 0x10E2 }, - { 0x1CA3, UPPER_CASE, 0x10E3 }, - { 0x1CA4, UPPER_CASE, 0x10E4 }, - { 0x1CA5, UPPER_CASE, 0x10E5 }, - { 0x1CA6, UPPER_CASE, 0x10E6 }, - { 0x1CA7, UPPER_CASE, 0x10E7 }, - { 0x1CA8, UPPER_CASE, 0x10E8 }, - { 0x1CA9, UPPER_CASE, 0x10E9 }, - { 0x1CAA, UPPER_CASE, 0x10EA }, - { 0x1CAB, UPPER_CASE, 0x10EB }, - { 0x1CAC, UPPER_CASE, 0x10EC }, - { 0x1CAD, UPPER_CASE, 0x10ED }, - { 0x1CAE, UPPER_CASE, 0x10EE }, - { 0x1CAF, UPPER_CASE, 0x10EF }, - { 0x1CB0, UPPER_CASE, 0x10F0 }, - { 0x1CB1, UPPER_CASE, 0x10F1 }, - { 0x1CB2, UPPER_CASE, 0x10F2 }, - { 0x1CB3, UPPER_CASE, 0x10F3 }, - { 0x1CB4, UPPER_CASE, 0x10F4 }, - { 0x1CB5, UPPER_CASE, 0x10F5 }, - { 0x1CB6, UPPER_CASE, 0x10F6 }, - { 0x1CB7, UPPER_CASE, 0x10F7 }, - { 0x1CB8, UPPER_CASE, 0x10F8 }, - { 0x1CB9, UPPER_CASE, 0x10F9 }, - { 0x1CBA, UPPER_CASE, 0x10FA }, - { 0x1CBD, UPPER_CASE, 0x10FD }, - { 0x1CBE, UPPER_CASE, 0x10FE }, - { 0x1CBF, UPPER_CASE, 0x10FF }, - { 0x1D79, LOWER_CASE, 0xA77D }, - { 0x1D7D, LOWER_CASE, 0x2C63 }, - { 0x1D8E, LOWER_CASE, 0xA7C6 }, - { 0x1E00, UPPER_CASE, 0x1E01 }, - { 0x1E01, LOWER_CASE, 0x1E00 }, - { 0x1E02, UPPER_CASE, 0x1E03 }, - { 0x1E03, LOWER_CASE, 0x1E02 }, - { 0x1E04, UPPER_CASE, 0x1E05 }, - { 0x1E05, LOWER_CASE, 0x1E04 }, - { 0x1E06, UPPER_CASE, 0x1E07 }, - { 0x1E07, LOWER_CASE, 0x1E06 }, - { 0x1E08, UPPER_CASE, 0x1E09 }, - { 0x1E09, LOWER_CASE, 0x1E08 }, - { 0x1E0A, UPPER_CASE, 0x1E0B }, - { 0x1E0B, LOWER_CASE, 0x1E0A }, - { 0x1E0C, UPPER_CASE, 0x1E0D }, - { 0x1E0D, LOWER_CASE, 0x1E0C }, - { 0x1E0E, UPPER_CASE, 0x1E0F }, - { 0x1E0F, LOWER_CASE, 0x1E0E }, - { 0x1E10, UPPER_CASE, 0x1E11 }, - { 0x1E11, LOWER_CASE, 0x1E10 }, - { 0x1E12, UPPER_CASE, 0x1E13 }, - { 0x1E13, LOWER_CASE, 0x1E12 }, - { 0x1E14, UPPER_CASE, 0x1E15 }, - { 0x1E15, LOWER_CASE, 0x1E14 }, - { 0x1E16, UPPER_CASE, 0x1E17 }, - { 0x1E17, LOWER_CASE, 0x1E16 }, - { 0x1E18, UPPER_CASE, 0x1E19 }, - { 0x1E19, LOWER_CASE, 0x1E18 }, - { 0x1E1A, UPPER_CASE, 0x1E1B }, - { 0x1E1B, LOWER_CASE, 0x1E1A }, - { 0x1E1C, UPPER_CASE, 0x1E1D }, - { 0x1E1D, LOWER_CASE, 0x1E1C }, - { 0x1E1E, UPPER_CASE, 0x1E1F }, - { 0x1E1F, LOWER_CASE, 0x1E1E }, - { 0x1E20, UPPER_CASE, 0x1E21 }, - { 0x1E21, LOWER_CASE, 0x1E20 }, - { 0x1E22, UPPER_CASE, 0x1E23 }, - { 0x1E23, LOWER_CASE, 0x1E22 }, - { 0x1E24, UPPER_CASE, 0x1E25 }, - { 0x1E25, LOWER_CASE, 0x1E24 }, - { 0x1E26, UPPER_CASE, 0x1E27 }, - { 0x1E27, LOWER_CASE, 0x1E26 }, - { 0x1E28, UPPER_CASE, 0x1E29 }, - { 0x1E29, LOWER_CASE, 0x1E28 }, - { 0x1E2A, UPPER_CASE, 0x1E2B }, - { 0x1E2B, LOWER_CASE, 0x1E2A }, - { 0x1E2C, UPPER_CASE, 0x1E2D }, - { 0x1E2D, LOWER_CASE, 0x1E2C }, - { 0x1E2E, UPPER_CASE, 0x1E2F }, - { 0x1E2F, LOWER_CASE, 0x1E2E }, - { 0x1E30, UPPER_CASE, 0x1E31 }, - { 0x1E31, LOWER_CASE, 0x1E30 }, - { 0x1E32, UPPER_CASE, 0x1E33 }, - { 0x1E33, LOWER_CASE, 0x1E32 }, - { 0x1E34, UPPER_CASE, 0x1E35 }, - { 0x1E35, LOWER_CASE, 0x1E34 }, - { 0x1E36, UPPER_CASE, 0x1E37 }, - { 0x1E37, LOWER_CASE, 0x1E36 }, - { 0x1E38, UPPER_CASE, 0x1E39 }, - { 0x1E39, LOWER_CASE, 0x1E38 }, - { 0x1E3A, UPPER_CASE, 0x1E3B }, - { 0x1E3B, LOWER_CASE, 0x1E3A }, - { 0x1E3C, UPPER_CASE, 0x1E3D }, - { 0x1E3D, LOWER_CASE, 0x1E3C }, - { 0x1E3E, UPPER_CASE, 0x1E3F }, - { 0x1E3F, LOWER_CASE, 0x1E3E }, - { 0x1E40, UPPER_CASE, 0x1E41 }, - { 0x1E41, LOWER_CASE, 0x1E40 }, - { 0x1E42, UPPER_CASE, 0x1E43 }, - { 0x1E43, LOWER_CASE, 0x1E42 }, - { 0x1E44, UPPER_CASE, 0x1E45 }, - { 0x1E45, LOWER_CASE, 0x1E44 }, - { 0x1E46, UPPER_CASE, 0x1E47 }, - { 0x1E47, LOWER_CASE, 0x1E46 }, - { 0x1E48, UPPER_CASE, 0x1E49 }, - { 0x1E49, LOWER_CASE, 0x1E48 }, - { 0x1E4A, UPPER_CASE, 0x1E4B }, - { 0x1E4B, LOWER_CASE, 0x1E4A }, - { 0x1E4C, UPPER_CASE, 0x1E4D }, - { 0x1E4D, LOWER_CASE, 0x1E4C }, - { 0x1E4E, UPPER_CASE, 0x1E4F }, - { 0x1E4F, LOWER_CASE, 0x1E4E }, - { 0x1E50, UPPER_CASE, 0x1E51 }, - { 0x1E51, LOWER_CASE, 0x1E50 }, - { 0x1E52, UPPER_CASE, 0x1E53 }, - { 0x1E53, LOWER_CASE, 0x1E52 }, - { 0x1E54, UPPER_CASE, 0x1E55 }, - { 0x1E55, LOWER_CASE, 0x1E54 }, - { 0x1E56, UPPER_CASE, 0x1E57 }, - { 0x1E57, LOWER_CASE, 0x1E56 }, - { 0x1E58, UPPER_CASE, 0x1E59 }, - { 0x1E59, LOWER_CASE, 0x1E58 }, - { 0x1E5A, UPPER_CASE, 0x1E5B }, - { 0x1E5B, LOWER_CASE, 0x1E5A }, - { 0x1E5C, UPPER_CASE, 0x1E5D }, - { 0x1E5D, LOWER_CASE, 0x1E5C }, - { 0x1E5E, UPPER_CASE, 0x1E5F }, - { 0x1E5F, LOWER_CASE, 0x1E5E }, - { 0x1E60, UPPER_CASE, 0x1E61 }, - { 0x1E61, LOWER_CASE, 0x1E60 }, - { 0x1E62, UPPER_CASE, 0x1E63 }, - { 0x1E63, LOWER_CASE, 0x1E62 }, - { 0x1E64, UPPER_CASE, 0x1E65 }, - { 0x1E65, LOWER_CASE, 0x1E64 }, - { 0x1E66, UPPER_CASE, 0x1E67 }, - { 0x1E67, LOWER_CASE, 0x1E66 }, - { 0x1E68, UPPER_CASE, 0x1E69 }, - { 0x1E69, LOWER_CASE, 0x1E68 }, - { 0x1E6A, UPPER_CASE, 0x1E6B }, - { 0x1E6B, LOWER_CASE, 0x1E6A }, - { 0x1E6C, UPPER_CASE, 0x1E6D }, - { 0x1E6D, LOWER_CASE, 0x1E6C }, - { 0x1E6E, UPPER_CASE, 0x1E6F }, - { 0x1E6F, LOWER_CASE, 0x1E6E }, - { 0x1E70, UPPER_CASE, 0x1E71 }, - { 0x1E71, LOWER_CASE, 0x1E70 }, - { 0x1E72, UPPER_CASE, 0x1E73 }, - { 0x1E73, LOWER_CASE, 0x1E72 }, - { 0x1E74, UPPER_CASE, 0x1E75 }, - { 0x1E75, LOWER_CASE, 0x1E74 }, - { 0x1E76, UPPER_CASE, 0x1E77 }, - { 0x1E77, LOWER_CASE, 0x1E76 }, - { 0x1E78, UPPER_CASE, 0x1E79 }, - { 0x1E79, LOWER_CASE, 0x1E78 }, - { 0x1E7A, UPPER_CASE, 0x1E7B }, - { 0x1E7B, LOWER_CASE, 0x1E7A }, - { 0x1E7C, UPPER_CASE, 0x1E7D }, - { 0x1E7D, LOWER_CASE, 0x1E7C }, - { 0x1E7E, UPPER_CASE, 0x1E7F }, - { 0x1E7F, LOWER_CASE, 0x1E7E }, - { 0x1E80, UPPER_CASE, 0x1E81 }, - { 0x1E81, LOWER_CASE, 0x1E80 }, - { 0x1E82, UPPER_CASE, 0x1E83 }, - { 0x1E83, LOWER_CASE, 0x1E82 }, - { 0x1E84, UPPER_CASE, 0x1E85 }, - { 0x1E85, LOWER_CASE, 0x1E84 }, - { 0x1E86, UPPER_CASE, 0x1E87 }, - { 0x1E87, LOWER_CASE, 0x1E86 }, - { 0x1E88, UPPER_CASE, 0x1E89 }, - { 0x1E89, LOWER_CASE, 0x1E88 }, - { 0x1E8A, UPPER_CASE, 0x1E8B }, - { 0x1E8B, LOWER_CASE, 0x1E8A }, - { 0x1E8C, UPPER_CASE, 0x1E8D }, - { 0x1E8D, LOWER_CASE, 0x1E8C }, - { 0x1E8E, UPPER_CASE, 0x1E8F }, - { 0x1E8F, LOWER_CASE, 0x1E8E }, - { 0x1E90, UPPER_CASE, 0x1E91 }, - { 0x1E91, LOWER_CASE, 0x1E90 }, - { 0x1E92, UPPER_CASE, 0x1E93 }, - { 0x1E93, LOWER_CASE, 0x1E92 }, - { 0x1E94, UPPER_CASE, 0x1E95 }, - { 0x1E95, LOWER_CASE, 0x1E94 }, - { 0x1E9B, LOWER_CASE, 0x1E60 }, - { 0x1E9E, UPPER_CASE, 0xDF }, - { 0x1EA0, UPPER_CASE, 0x1EA1 }, - { 0x1EA1, LOWER_CASE, 0x1EA0 }, - { 0x1EA2, UPPER_CASE, 0x1EA3 }, - { 0x1EA3, LOWER_CASE, 0x1EA2 }, - { 0x1EA4, UPPER_CASE, 0x1EA5 }, - { 0x1EA5, LOWER_CASE, 0x1EA4 }, - { 0x1EA6, UPPER_CASE, 0x1EA7 }, - { 0x1EA7, LOWER_CASE, 0x1EA6 }, - { 0x1EA8, UPPER_CASE, 0x1EA9 }, - { 0x1EA9, LOWER_CASE, 0x1EA8 }, - { 0x1EAA, UPPER_CASE, 0x1EAB }, - { 0x1EAB, LOWER_CASE, 0x1EAA }, - { 0x1EAC, UPPER_CASE, 0x1EAD }, - { 0x1EAD, LOWER_CASE, 0x1EAC }, - { 0x1EAE, UPPER_CASE, 0x1EAF }, - { 0x1EAF, LOWER_CASE, 0x1EAE }, - { 0x1EB0, UPPER_CASE, 0x1EB1 }, - { 0x1EB1, LOWER_CASE, 0x1EB0 }, - { 0x1EB2, UPPER_CASE, 0x1EB3 }, - { 0x1EB3, LOWER_CASE, 0x1EB2 }, - { 0x1EB4, UPPER_CASE, 0x1EB5 }, - { 0x1EB5, LOWER_CASE, 0x1EB4 }, - { 0x1EB6, UPPER_CASE, 0x1EB7 }, - { 0x1EB7, LOWER_CASE, 0x1EB6 }, - { 0x1EB8, UPPER_CASE, 0x1EB9 }, - { 0x1EB9, LOWER_CASE, 0x1EB8 }, - { 0x1EBA, UPPER_CASE, 0x1EBB }, - { 0x1EBB, LOWER_CASE, 0x1EBA }, - { 0x1EBC, UPPER_CASE, 0x1EBD }, - { 0x1EBD, LOWER_CASE, 0x1EBC }, - { 0x1EBE, UPPER_CASE, 0x1EBF }, - { 0x1EBF, LOWER_CASE, 0x1EBE }, - { 0x1EC0, UPPER_CASE, 0x1EC1 }, - { 0x1EC1, LOWER_CASE, 0x1EC0 }, - { 0x1EC2, UPPER_CASE, 0x1EC3 }, - { 0x1EC3, LOWER_CASE, 0x1EC2 }, - { 0x1EC4, UPPER_CASE, 0x1EC5 }, - { 0x1EC5, LOWER_CASE, 0x1EC4 }, - { 0x1EC6, UPPER_CASE, 0x1EC7 }, - { 0x1EC7, LOWER_CASE, 0x1EC6 }, - { 0x1EC8, UPPER_CASE, 0x1EC9 }, - { 0x1EC9, LOWER_CASE, 0x1EC8 }, - { 0x1ECA, UPPER_CASE, 0x1ECB }, - { 0x1ECB, LOWER_CASE, 0x1ECA }, - { 0x1ECC, UPPER_CASE, 0x1ECD }, - { 0x1ECD, LOWER_CASE, 0x1ECC }, - { 0x1ECE, UPPER_CASE, 0x1ECF }, - { 0x1ECF, LOWER_CASE, 0x1ECE }, - { 0x1ED0, UPPER_CASE, 0x1ED1 }, - { 0x1ED1, LOWER_CASE, 0x1ED0 }, - { 0x1ED2, UPPER_CASE, 0x1ED3 }, - { 0x1ED3, LOWER_CASE, 0x1ED2 }, - { 0x1ED4, UPPER_CASE, 0x1ED5 }, - { 0x1ED5, LOWER_CASE, 0x1ED4 }, - { 0x1ED6, UPPER_CASE, 0x1ED7 }, - { 0x1ED7, LOWER_CASE, 0x1ED6 }, - { 0x1ED8, UPPER_CASE, 0x1ED9 }, - { 0x1ED9, LOWER_CASE, 0x1ED8 }, - { 0x1EDA, UPPER_CASE, 0x1EDB }, - { 0x1EDB, LOWER_CASE, 0x1EDA }, - { 0x1EDC, UPPER_CASE, 0x1EDD }, - { 0x1EDD, LOWER_CASE, 0x1EDC }, - { 0x1EDE, UPPER_CASE, 0x1EDF }, - { 0x1EDF, LOWER_CASE, 0x1EDE }, - { 0x1EE0, UPPER_CASE, 0x1EE1 }, - { 0x1EE1, LOWER_CASE, 0x1EE0 }, - { 0x1EE2, UPPER_CASE, 0x1EE3 }, - { 0x1EE3, LOWER_CASE, 0x1EE2 }, - { 0x1EE4, UPPER_CASE, 0x1EE5 }, - { 0x1EE5, LOWER_CASE, 0x1EE4 }, - { 0x1EE6, UPPER_CASE, 0x1EE7 }, - { 0x1EE7, LOWER_CASE, 0x1EE6 }, - { 0x1EE8, UPPER_CASE, 0x1EE9 }, - { 0x1EE9, LOWER_CASE, 0x1EE8 }, - { 0x1EEA, UPPER_CASE, 0x1EEB }, - { 0x1EEB, LOWER_CASE, 0x1EEA }, - { 0x1EEC, UPPER_CASE, 0x1EED }, - { 0x1EED, LOWER_CASE, 0x1EEC }, - { 0x1EEE, UPPER_CASE, 0x1EEF }, - { 0x1EEF, LOWER_CASE, 0x1EEE }, - { 0x1EF0, UPPER_CASE, 0x1EF1 }, - { 0x1EF1, LOWER_CASE, 0x1EF0 }, - { 0x1EF2, UPPER_CASE, 0x1EF3 }, - { 0x1EF3, LOWER_CASE, 0x1EF2 }, - { 0x1EF4, UPPER_CASE, 0x1EF5 }, - { 0x1EF5, LOWER_CASE, 0x1EF4 }, - { 0x1EF6, UPPER_CASE, 0x1EF7 }, - { 0x1EF7, LOWER_CASE, 0x1EF6 }, - { 0x1EF8, UPPER_CASE, 0x1EF9 }, - { 0x1EF9, LOWER_CASE, 0x1EF8 }, - { 0x1EFA, UPPER_CASE, 0x1EFB }, - { 0x1EFB, LOWER_CASE, 0x1EFA }, - { 0x1EFC, UPPER_CASE, 0x1EFD }, - { 0x1EFD, LOWER_CASE, 0x1EFC }, - { 0x1EFE, UPPER_CASE, 0x1EFF }, - { 0x1EFF, LOWER_CASE, 0x1EFE }, - { 0x1F00, LOWER_CASE, 0x1F08 }, - { 0x1F01, LOWER_CASE, 0x1F09 }, - { 0x1F02, LOWER_CASE, 0x1F0A }, - { 0x1F03, LOWER_CASE, 0x1F0B }, - { 0x1F04, LOWER_CASE, 0x1F0C }, - { 0x1F05, LOWER_CASE, 0x1F0D }, - { 0x1F06, LOWER_CASE, 0x1F0E }, - { 0x1F07, LOWER_CASE, 0x1F0F }, - { 0x1F08, UPPER_CASE, 0x1F00 }, - { 0x1F09, UPPER_CASE, 0x1F01 }, - { 0x1F0A, UPPER_CASE, 0x1F02 }, - { 0x1F0B, UPPER_CASE, 0x1F03 }, - { 0x1F0C, UPPER_CASE, 0x1F04 }, - { 0x1F0D, UPPER_CASE, 0x1F05 }, - { 0x1F0E, UPPER_CASE, 0x1F06 }, - { 0x1F0F, UPPER_CASE, 0x1F07 }, - { 0x1F10, LOWER_CASE, 0x1F18 }, - { 0x1F11, LOWER_CASE, 0x1F19 }, - { 0x1F12, LOWER_CASE, 0x1F1A }, - { 0x1F13, LOWER_CASE, 0x1F1B }, - { 0x1F14, LOWER_CASE, 0x1F1C }, - { 0x1F15, LOWER_CASE, 0x1F1D }, - { 0x1F18, UPPER_CASE, 0x1F10 }, - { 0x1F19, UPPER_CASE, 0x1F11 }, - { 0x1F1A, UPPER_CASE, 0x1F12 }, - { 0x1F1B, UPPER_CASE, 0x1F13 }, - { 0x1F1C, UPPER_CASE, 0x1F14 }, - { 0x1F1D, UPPER_CASE, 0x1F15 }, - { 0x1F20, LOWER_CASE, 0x1F28 }, - { 0x1F21, LOWER_CASE, 0x1F29 }, - { 0x1F22, LOWER_CASE, 0x1F2A }, - { 0x1F23, LOWER_CASE, 0x1F2B }, - { 0x1F24, LOWER_CASE, 0x1F2C }, - { 0x1F25, LOWER_CASE, 0x1F2D }, - { 0x1F26, LOWER_CASE, 0x1F2E }, - { 0x1F27, LOWER_CASE, 0x1F2F }, - { 0x1F28, UPPER_CASE, 0x1F20 }, - { 0x1F29, UPPER_CASE, 0x1F21 }, - { 0x1F2A, UPPER_CASE, 0x1F22 }, - { 0x1F2B, UPPER_CASE, 0x1F23 }, - { 0x1F2C, UPPER_CASE, 0x1F24 }, - { 0x1F2D, UPPER_CASE, 0x1F25 }, - { 0x1F2E, UPPER_CASE, 0x1F26 }, - { 0x1F2F, UPPER_CASE, 0x1F27 }, - { 0x1F30, LOWER_CASE, 0x1F38 }, - { 0x1F31, LOWER_CASE, 0x1F39 }, - { 0x1F32, LOWER_CASE, 0x1F3A }, - { 0x1F33, LOWER_CASE, 0x1F3B }, - { 0x1F34, LOWER_CASE, 0x1F3C }, - { 0x1F35, LOWER_CASE, 0x1F3D }, - { 0x1F36, LOWER_CASE, 0x1F3E }, - { 0x1F37, LOWER_CASE, 0x1F3F }, - { 0x1F38, UPPER_CASE, 0x1F30 }, - { 0x1F39, UPPER_CASE, 0x1F31 }, - { 0x1F3A, UPPER_CASE, 0x1F32 }, - { 0x1F3B, UPPER_CASE, 0x1F33 }, - { 0x1F3C, UPPER_CASE, 0x1F34 }, - { 0x1F3D, UPPER_CASE, 0x1F35 }, - { 0x1F3E, UPPER_CASE, 0x1F36 }, - { 0x1F3F, UPPER_CASE, 0x1F37 }, - { 0x1F40, LOWER_CASE, 0x1F48 }, - { 0x1F41, LOWER_CASE, 0x1F49 }, - { 0x1F42, LOWER_CASE, 0x1F4A }, - { 0x1F43, LOWER_CASE, 0x1F4B }, - { 0x1F44, LOWER_CASE, 0x1F4C }, - { 0x1F45, LOWER_CASE, 0x1F4D }, - { 0x1F48, UPPER_CASE, 0x1F40 }, - { 0x1F49, UPPER_CASE, 0x1F41 }, - { 0x1F4A, UPPER_CASE, 0x1F42 }, - { 0x1F4B, UPPER_CASE, 0x1F43 }, - { 0x1F4C, UPPER_CASE, 0x1F44 }, - { 0x1F4D, UPPER_CASE, 0x1F45 }, - { 0x1F51, LOWER_CASE, 0x1F59 }, - { 0x1F53, LOWER_CASE, 0x1F5B }, - { 0x1F55, LOWER_CASE, 0x1F5D }, - { 0x1F57, LOWER_CASE, 0x1F5F }, - { 0x1F59, UPPER_CASE, 0x1F51 }, - { 0x1F5B, UPPER_CASE, 0x1F53 }, - { 0x1F5D, UPPER_CASE, 0x1F55 }, - { 0x1F5F, UPPER_CASE, 0x1F57 }, - { 0x1F60, LOWER_CASE, 0x1F68 }, - { 0x1F61, LOWER_CASE, 0x1F69 }, - { 0x1F62, LOWER_CASE, 0x1F6A }, - { 0x1F63, LOWER_CASE, 0x1F6B }, - { 0x1F64, LOWER_CASE, 0x1F6C }, - { 0x1F65, LOWER_CASE, 0x1F6D }, - { 0x1F66, LOWER_CASE, 0x1F6E }, - { 0x1F67, LOWER_CASE, 0x1F6F }, - { 0x1F68, UPPER_CASE, 0x1F60 }, - { 0x1F69, UPPER_CASE, 0x1F61 }, - { 0x1F6A, UPPER_CASE, 0x1F62 }, - { 0x1F6B, UPPER_CASE, 0x1F63 }, - { 0x1F6C, UPPER_CASE, 0x1F64 }, - { 0x1F6D, UPPER_CASE, 0x1F65 }, - { 0x1F6E, UPPER_CASE, 0x1F66 }, - { 0x1F6F, UPPER_CASE, 0x1F67 }, - { 0x1F70, LOWER_CASE, 0x1FBA }, - { 0x1F71, LOWER_CASE, 0x1FBB }, - { 0x1F72, LOWER_CASE, 0x1FC8 }, - { 0x1F73, LOWER_CASE, 0x1FC9 }, - { 0x1F74, LOWER_CASE, 0x1FCA }, - { 0x1F75, LOWER_CASE, 0x1FCB }, - { 0x1F76, LOWER_CASE, 0x1FDA }, - { 0x1F77, LOWER_CASE, 0x1FDB }, - { 0x1F78, LOWER_CASE, 0x1FF8 }, - { 0x1F79, LOWER_CASE, 0x1FF9 }, - { 0x1F7A, LOWER_CASE, 0x1FEA }, - { 0x1F7B, LOWER_CASE, 0x1FEB }, - { 0x1F7C, LOWER_CASE, 0x1FFA }, - { 0x1F7D, LOWER_CASE, 0x1FFB }, - { 0x1F80, LOWER_CASE, 0x1F88 }, - { 0x1F81, LOWER_CASE, 0x1F89 }, - { 0x1F82, LOWER_CASE, 0x1F8A }, - { 0x1F83, LOWER_CASE, 0x1F8B }, - { 0x1F84, LOWER_CASE, 0x1F8C }, - { 0x1F85, LOWER_CASE, 0x1F8D }, - { 0x1F86, LOWER_CASE, 0x1F8E }, - { 0x1F87, LOWER_CASE, 0x1F8F }, - { 0x1F88, UPPER_CASE, 0x1F80 }, - { 0x1F89, UPPER_CASE, 0x1F81 }, - { 0x1F8A, UPPER_CASE, 0x1F82 }, - { 0x1F8B, UPPER_CASE, 0x1F83 }, - { 0x1F8C, UPPER_CASE, 0x1F84 }, - { 0x1F8D, UPPER_CASE, 0x1F85 }, - { 0x1F8E, UPPER_CASE, 0x1F86 }, - { 0x1F8F, UPPER_CASE, 0x1F87 }, - { 0x1F90, LOWER_CASE, 0x1F98 }, - { 0x1F91, LOWER_CASE, 0x1F99 }, - { 0x1F92, LOWER_CASE, 0x1F9A }, - { 0x1F93, LOWER_CASE, 0x1F9B }, - { 0x1F94, LOWER_CASE, 0x1F9C }, - { 0x1F95, LOWER_CASE, 0x1F9D }, - { 0x1F96, LOWER_CASE, 0x1F9E }, - { 0x1F97, LOWER_CASE, 0x1F9F }, - { 0x1F98, UPPER_CASE, 0x1F90 }, - { 0x1F99, UPPER_CASE, 0x1F91 }, - { 0x1F9A, UPPER_CASE, 0x1F92 }, - { 0x1F9B, UPPER_CASE, 0x1F93 }, - { 0x1F9C, UPPER_CASE, 0x1F94 }, - { 0x1F9D, UPPER_CASE, 0x1F95 }, - { 0x1F9E, UPPER_CASE, 0x1F96 }, - { 0x1F9F, UPPER_CASE, 0x1F97 }, - { 0x1FA0, LOWER_CASE, 0x1FA8 }, - { 0x1FA1, LOWER_CASE, 0x1FA9 }, - { 0x1FA2, LOWER_CASE, 0x1FAA }, - { 0x1FA3, LOWER_CASE, 0x1FAB }, - { 0x1FA4, LOWER_CASE, 0x1FAC }, - { 0x1FA5, LOWER_CASE, 0x1FAD }, - { 0x1FA6, LOWER_CASE, 0x1FAE }, - { 0x1FA7, LOWER_CASE, 0x1FAF }, - { 0x1FA8, UPPER_CASE, 0x1FA0 }, - { 0x1FA9, UPPER_CASE, 0x1FA1 }, - { 0x1FAA, UPPER_CASE, 0x1FA2 }, - { 0x1FAB, UPPER_CASE, 0x1FA3 }, - { 0x1FAC, UPPER_CASE, 0x1FA4 }, - { 0x1FAD, UPPER_CASE, 0x1FA5 }, - { 0x1FAE, UPPER_CASE, 0x1FA6 }, - { 0x1FAF, UPPER_CASE, 0x1FA7 }, - { 0x1FB0, LOWER_CASE, 0x1FB8 }, - { 0x1FB1, LOWER_CASE, 0x1FB9 }, - { 0x1FB3, LOWER_CASE, 0x1FBC }, - { 0x1FB8, UPPER_CASE, 0x1FB0 }, - { 0x1FB9, UPPER_CASE, 0x1FB1 }, - { 0x1FBA, UPPER_CASE, 0x1F70 }, - { 0x1FBB, UPPER_CASE, 0x1F71 }, - { 0x1FBC, UPPER_CASE, 0x1FB3 }, - { 0x1FBE, LOWER_CASE, 0x399 }, - { 0x1FC3, LOWER_CASE, 0x1FCC }, - { 0x1FC8, UPPER_CASE, 0x1F72 }, - { 0x1FC9, UPPER_CASE, 0x1F73 }, - { 0x1FCA, UPPER_CASE, 0x1F74 }, - { 0x1FCB, UPPER_CASE, 0x1F75 }, - { 0x1FCC, UPPER_CASE, 0x1FC3 }, - { 0x1FD0, LOWER_CASE, 0x1FD8 }, - { 0x1FD1, LOWER_CASE, 0x1FD9 }, - { 0x1FD8, UPPER_CASE, 0x1FD0 }, - { 0x1FD9, UPPER_CASE, 0x1FD1 }, - { 0x1FDA, UPPER_CASE, 0x1F76 }, - { 0x1FDB, UPPER_CASE, 0x1F77 }, - { 0x1FE0, LOWER_CASE, 0x1FE8 }, - { 0x1FE1, LOWER_CASE, 0x1FE9 }, - { 0x1FE5, LOWER_CASE, 0x1FEC }, - { 0x1FE8, UPPER_CASE, 0x1FE0 }, - { 0x1FE9, UPPER_CASE, 0x1FE1 }, - { 0x1FEA, UPPER_CASE, 0x1F7A }, - { 0x1FEB, UPPER_CASE, 0x1F7B }, - { 0x1FEC, UPPER_CASE, 0x1FE5 }, - { 0x1FF3, LOWER_CASE, 0x1FFC }, - { 0x1FF8, UPPER_CASE, 0x1F78 }, - { 0x1FF9, UPPER_CASE, 0x1F79 }, - { 0x1FFA, UPPER_CASE, 0x1F7C }, - { 0x1FFB, UPPER_CASE, 0x1F7D }, - { 0x1FFC, UPPER_CASE, 0x1FF3 }, - { 0x2126, UPPER_CASE, 0x3C9 }, - { 0x212A, UPPER_CASE, 0x6B }, - { 0x212B, UPPER_CASE, 0xE5 }, - { 0x2132, UPPER_CASE, 0x214E }, - { 0x214E, LOWER_CASE, 0x2132 }, - { 0x2160, UPPER_CASE, 0x2170 }, - { 0x2161, UPPER_CASE, 0x2171 }, - { 0x2162, UPPER_CASE, 0x2172 }, - { 0x2163, UPPER_CASE, 0x2173 }, - { 0x2164, UPPER_CASE, 0x2174 }, - { 0x2165, UPPER_CASE, 0x2175 }, - { 0x2166, UPPER_CASE, 0x2176 }, - { 0x2167, UPPER_CASE, 0x2177 }, - { 0x2168, UPPER_CASE, 0x2178 }, - { 0x2169, UPPER_CASE, 0x2179 }, - { 0x216A, UPPER_CASE, 0x217A }, - { 0x216B, UPPER_CASE, 0x217B }, - { 0x216C, UPPER_CASE, 0x217C }, - { 0x216D, UPPER_CASE, 0x217D }, - { 0x216E, UPPER_CASE, 0x217E }, - { 0x216F, UPPER_CASE, 0x217F }, - { 0x2170, LOWER_CASE, 0x2160 }, - { 0x2171, LOWER_CASE, 0x2161 }, - { 0x2172, LOWER_CASE, 0x2162 }, - { 0x2173, LOWER_CASE, 0x2163 }, - { 0x2174, LOWER_CASE, 0x2164 }, - { 0x2175, LOWER_CASE, 0x2165 }, - { 0x2176, LOWER_CASE, 0x2166 }, - { 0x2177, LOWER_CASE, 0x2167 }, - { 0x2178, LOWER_CASE, 0x2168 }, - { 0x2179, LOWER_CASE, 0x2169 }, - { 0x217A, LOWER_CASE, 0x216A }, - { 0x217B, LOWER_CASE, 0x216B }, - { 0x217C, LOWER_CASE, 0x216C }, - { 0x217D, LOWER_CASE, 0x216D }, - { 0x217E, LOWER_CASE, 0x216E }, - { 0x217F, LOWER_CASE, 0x216F }, - { 0x2183, UPPER_CASE, 0x2184 }, - { 0x2184, LOWER_CASE, 0x2183 }, - { 0x24B6, UPPER_CASE, 0x24D0 }, - { 0x24B7, UPPER_CASE, 0x24D1 }, - { 0x24B8, UPPER_CASE, 0x24D2 }, - { 0x24B9, UPPER_CASE, 0x24D3 }, - { 0x24BA, UPPER_CASE, 0x24D4 }, - { 0x24BB, UPPER_CASE, 0x24D5 }, - { 0x24BC, UPPER_CASE, 0x24D6 }, - { 0x24BD, UPPER_CASE, 0x24D7 }, - { 0x24BE, UPPER_CASE, 0x24D8 }, - { 0x24BF, UPPER_CASE, 0x24D9 }, - { 0x24C0, UPPER_CASE, 0x24DA }, - { 0x24C1, UPPER_CASE, 0x24DB }, - { 0x24C2, UPPER_CASE, 0x24DC }, - { 0x24C3, UPPER_CASE, 0x24DD }, - { 0x24C4, UPPER_CASE, 0x24DE }, - { 0x24C5, UPPER_CASE, 0x24DF }, - { 0x24C6, UPPER_CASE, 0x24E0 }, - { 0x24C7, UPPER_CASE, 0x24E1 }, - { 0x24C8, UPPER_CASE, 0x24E2 }, - { 0x24C9, UPPER_CASE, 0x24E3 }, - { 0x24CA, UPPER_CASE, 0x24E4 }, - { 0x24CB, UPPER_CASE, 0x24E5 }, - { 0x24CC, UPPER_CASE, 0x24E6 }, - { 0x24CD, UPPER_CASE, 0x24E7 }, - { 0x24CE, UPPER_CASE, 0x24E8 }, - { 0x24CF, UPPER_CASE, 0x24E9 }, - { 0x24D0, LOWER_CASE, 0x24B6 }, - { 0x24D1, LOWER_CASE, 0x24B7 }, - { 0x24D2, LOWER_CASE, 0x24B8 }, - { 0x24D3, LOWER_CASE, 0x24B9 }, - { 0x24D4, LOWER_CASE, 0x24BA }, - { 0x24D5, LOWER_CASE, 0x24BB }, - { 0x24D6, LOWER_CASE, 0x24BC }, - { 0x24D7, LOWER_CASE, 0x24BD }, - { 0x24D8, LOWER_CASE, 0x24BE }, - { 0x24D9, LOWER_CASE, 0x24BF }, - { 0x24DA, LOWER_CASE, 0x24C0 }, - { 0x24DB, LOWER_CASE, 0x24C1 }, - { 0x24DC, LOWER_CASE, 0x24C2 }, - { 0x24DD, LOWER_CASE, 0x24C3 }, - { 0x24DE, LOWER_CASE, 0x24C4 }, - { 0x24DF, LOWER_CASE, 0x24C5 }, - { 0x24E0, LOWER_CASE, 0x24C6 }, - { 0x24E1, LOWER_CASE, 0x24C7 }, - { 0x24E2, LOWER_CASE, 0x24C8 }, - { 0x24E3, LOWER_CASE, 0x24C9 }, - { 0x24E4, LOWER_CASE, 0x24CA }, - { 0x24E5, LOWER_CASE, 0x24CB }, - { 0x24E6, LOWER_CASE, 0x24CC }, - { 0x24E7, LOWER_CASE, 0x24CD }, - { 0x24E8, LOWER_CASE, 0x24CE }, - { 0x24E9, LOWER_CASE, 0x24CF }, - { 0x2C00, UPPER_CASE, 0x2C30 }, - { 0x2C01, UPPER_CASE, 0x2C31 }, - { 0x2C02, UPPER_CASE, 0x2C32 }, - { 0x2C03, UPPER_CASE, 0x2C33 }, - { 0x2C04, UPPER_CASE, 0x2C34 }, - { 0x2C05, UPPER_CASE, 0x2C35 }, - { 0x2C06, UPPER_CASE, 0x2C36 }, - { 0x2C07, UPPER_CASE, 0x2C37 }, - { 0x2C08, UPPER_CASE, 0x2C38 }, - { 0x2C09, UPPER_CASE, 0x2C39 }, - { 0x2C0A, UPPER_CASE, 0x2C3A }, - { 0x2C0B, UPPER_CASE, 0x2C3B }, - { 0x2C0C, UPPER_CASE, 0x2C3C }, - { 0x2C0D, UPPER_CASE, 0x2C3D }, - { 0x2C0E, UPPER_CASE, 0x2C3E }, - { 0x2C0F, UPPER_CASE, 0x2C3F }, - { 0x2C10, UPPER_CASE, 0x2C40 }, - { 0x2C11, UPPER_CASE, 0x2C41 }, - { 0x2C12, UPPER_CASE, 0x2C42 }, - { 0x2C13, UPPER_CASE, 0x2C43 }, - { 0x2C14, UPPER_CASE, 0x2C44 }, - { 0x2C15, UPPER_CASE, 0x2C45 }, - { 0x2C16, UPPER_CASE, 0x2C46 }, - { 0x2C17, UPPER_CASE, 0x2C47 }, - { 0x2C18, UPPER_CASE, 0x2C48 }, - { 0x2C19, UPPER_CASE, 0x2C49 }, - { 0x2C1A, UPPER_CASE, 0x2C4A }, - { 0x2C1B, UPPER_CASE, 0x2C4B }, - { 0x2C1C, UPPER_CASE, 0x2C4C }, - { 0x2C1D, UPPER_CASE, 0x2C4D }, - { 0x2C1E, UPPER_CASE, 0x2C4E }, - { 0x2C1F, UPPER_CASE, 0x2C4F }, - { 0x2C20, UPPER_CASE, 0x2C50 }, - { 0x2C21, UPPER_CASE, 0x2C51 }, - { 0x2C22, UPPER_CASE, 0x2C52 }, - { 0x2C23, UPPER_CASE, 0x2C53 }, - { 0x2C24, UPPER_CASE, 0x2C54 }, - { 0x2C25, UPPER_CASE, 0x2C55 }, - { 0x2C26, UPPER_CASE, 0x2C56 }, - { 0x2C27, UPPER_CASE, 0x2C57 }, - { 0x2C28, UPPER_CASE, 0x2C58 }, - { 0x2C29, UPPER_CASE, 0x2C59 }, - { 0x2C2A, UPPER_CASE, 0x2C5A }, - { 0x2C2B, UPPER_CASE, 0x2C5B }, - { 0x2C2C, UPPER_CASE, 0x2C5C }, - { 0x2C2D, UPPER_CASE, 0x2C5D }, - { 0x2C2E, UPPER_CASE, 0x2C5E }, - { 0x2C30, LOWER_CASE, 0x2C00 }, - { 0x2C31, LOWER_CASE, 0x2C01 }, - { 0x2C32, LOWER_CASE, 0x2C02 }, - { 0x2C33, LOWER_CASE, 0x2C03 }, - { 0x2C34, LOWER_CASE, 0x2C04 }, - { 0x2C35, LOWER_CASE, 0x2C05 }, - { 0x2C36, LOWER_CASE, 0x2C06 }, - { 0x2C37, LOWER_CASE, 0x2C07 }, - { 0x2C38, LOWER_CASE, 0x2C08 }, - { 0x2C39, LOWER_CASE, 0x2C09 }, - { 0x2C3A, LOWER_CASE, 0x2C0A }, - { 0x2C3B, LOWER_CASE, 0x2C0B }, - { 0x2C3C, LOWER_CASE, 0x2C0C }, - { 0x2C3D, LOWER_CASE, 0x2C0D }, - { 0x2C3E, LOWER_CASE, 0x2C0E }, - { 0x2C3F, LOWER_CASE, 0x2C0F }, - { 0x2C40, LOWER_CASE, 0x2C10 }, - { 0x2C41, LOWER_CASE, 0x2C11 }, - { 0x2C42, LOWER_CASE, 0x2C12 }, - { 0x2C43, LOWER_CASE, 0x2C13 }, - { 0x2C44, LOWER_CASE, 0x2C14 }, - { 0x2C45, LOWER_CASE, 0x2C15 }, - { 0x2C46, LOWER_CASE, 0x2C16 }, - { 0x2C47, LOWER_CASE, 0x2C17 }, - { 0x2C48, LOWER_CASE, 0x2C18 }, - { 0x2C49, LOWER_CASE, 0x2C19 }, - { 0x2C4A, LOWER_CASE, 0x2C1A }, - { 0x2C4B, LOWER_CASE, 0x2C1B }, - { 0x2C4C, LOWER_CASE, 0x2C1C }, - { 0x2C4D, LOWER_CASE, 0x2C1D }, - { 0x2C4E, LOWER_CASE, 0x2C1E }, - { 0x2C4F, LOWER_CASE, 0x2C1F }, - { 0x2C50, LOWER_CASE, 0x2C20 }, - { 0x2C51, LOWER_CASE, 0x2C21 }, - { 0x2C52, LOWER_CASE, 0x2C22 }, - { 0x2C53, LOWER_CASE, 0x2C23 }, - { 0x2C54, LOWER_CASE, 0x2C24 }, - { 0x2C55, LOWER_CASE, 0x2C25 }, - { 0x2C56, LOWER_CASE, 0x2C26 }, - { 0x2C57, LOWER_CASE, 0x2C27 }, - { 0x2C58, LOWER_CASE, 0x2C28 }, - { 0x2C59, LOWER_CASE, 0x2C29 }, - { 0x2C5A, LOWER_CASE, 0x2C2A }, - { 0x2C5B, LOWER_CASE, 0x2C2B }, - { 0x2C5C, LOWER_CASE, 0x2C2C }, - { 0x2C5D, LOWER_CASE, 0x2C2D }, - { 0x2C5E, LOWER_CASE, 0x2C2E }, - { 0x2C60, UPPER_CASE, 0x2C61 }, - { 0x2C61, LOWER_CASE, 0x2C60 }, - { 0x2C62, UPPER_CASE, 0x26B }, - { 0x2C63, UPPER_CASE, 0x1D7D }, - { 0x2C64, UPPER_CASE, 0x27D }, - { 0x2C65, LOWER_CASE, 0x23A }, - { 0x2C66, LOWER_CASE, 0x23E }, - { 0x2C67, UPPER_CASE, 0x2C68 }, - { 0x2C68, LOWER_CASE, 0x2C67 }, - { 0x2C69, UPPER_CASE, 0x2C6A }, - { 0x2C6A, LOWER_CASE, 0x2C69 }, - { 0x2C6B, UPPER_CASE, 0x2C6C }, - { 0x2C6C, LOWER_CASE, 0x2C6B }, - { 0x2C6D, UPPER_CASE, 0x251 }, - { 0x2C6E, UPPER_CASE, 0x271 }, - { 0x2C6F, UPPER_CASE, 0x250 }, - { 0x2C70, UPPER_CASE, 0x252 }, - { 0x2C72, UPPER_CASE, 0x2C73 }, - { 0x2C73, LOWER_CASE, 0x2C72 }, - { 0x2C75, UPPER_CASE, 0x2C76 }, - { 0x2C76, LOWER_CASE, 0x2C75 }, - { 0x2C7E, UPPER_CASE, 0x23F }, - { 0x2C7F, UPPER_CASE, 0x240 }, - { 0x2C80, UPPER_CASE, 0x2C81 }, - { 0x2C81, LOWER_CASE, 0x2C80 }, - { 0x2C82, UPPER_CASE, 0x2C83 }, - { 0x2C83, LOWER_CASE, 0x2C82 }, - { 0x2C84, UPPER_CASE, 0x2C85 }, - { 0x2C85, LOWER_CASE, 0x2C84 }, - { 0x2C86, UPPER_CASE, 0x2C87 }, - { 0x2C87, LOWER_CASE, 0x2C86 }, - { 0x2C88, UPPER_CASE, 0x2C89 }, - { 0x2C89, LOWER_CASE, 0x2C88 }, - { 0x2C8A, UPPER_CASE, 0x2C8B }, - { 0x2C8B, LOWER_CASE, 0x2C8A }, - { 0x2C8C, UPPER_CASE, 0x2C8D }, - { 0x2C8D, LOWER_CASE, 0x2C8C }, - { 0x2C8E, UPPER_CASE, 0x2C8F }, - { 0x2C8F, LOWER_CASE, 0x2C8E }, - { 0x2C90, UPPER_CASE, 0x2C91 }, - { 0x2C91, LOWER_CASE, 0x2C90 }, - { 0x2C92, UPPER_CASE, 0x2C93 }, - { 0x2C93, LOWER_CASE, 0x2C92 }, - { 0x2C94, UPPER_CASE, 0x2C95 }, - { 0x2C95, LOWER_CASE, 0x2C94 }, - { 0x2C96, UPPER_CASE, 0x2C97 }, - { 0x2C97, LOWER_CASE, 0x2C96 }, - { 0x2C98, UPPER_CASE, 0x2C99 }, - { 0x2C99, LOWER_CASE, 0x2C98 }, - { 0x2C9A, UPPER_CASE, 0x2C9B }, - { 0x2C9B, LOWER_CASE, 0x2C9A }, - { 0x2C9C, UPPER_CASE, 0x2C9D }, - { 0x2C9D, LOWER_CASE, 0x2C9C }, - { 0x2C9E, UPPER_CASE, 0x2C9F }, - { 0x2C9F, LOWER_CASE, 0x2C9E }, - { 0x2CA0, UPPER_CASE, 0x2CA1 }, - { 0x2CA1, LOWER_CASE, 0x2CA0 }, - { 0x2CA2, UPPER_CASE, 0x2CA3 }, - { 0x2CA3, LOWER_CASE, 0x2CA2 }, - { 0x2CA4, UPPER_CASE, 0x2CA5 }, - { 0x2CA5, LOWER_CASE, 0x2CA4 }, - { 0x2CA6, UPPER_CASE, 0x2CA7 }, - { 0x2CA7, LOWER_CASE, 0x2CA6 }, - { 0x2CA8, UPPER_CASE, 0x2CA9 }, - { 0x2CA9, LOWER_CASE, 0x2CA8 }, - { 0x2CAA, UPPER_CASE, 0x2CAB }, - { 0x2CAB, LOWER_CASE, 0x2CAA }, - { 0x2CAC, UPPER_CASE, 0x2CAD }, - { 0x2CAD, LOWER_CASE, 0x2CAC }, - { 0x2CAE, UPPER_CASE, 0x2CAF }, - { 0x2CAF, LOWER_CASE, 0x2CAE }, - { 0x2CB0, UPPER_CASE, 0x2CB1 }, - { 0x2CB1, LOWER_CASE, 0x2CB0 }, - { 0x2CB2, UPPER_CASE, 0x2CB3 }, - { 0x2CB3, LOWER_CASE, 0x2CB2 }, - { 0x2CB4, UPPER_CASE, 0x2CB5 }, - { 0x2CB5, LOWER_CASE, 0x2CB4 }, - { 0x2CB6, UPPER_CASE, 0x2CB7 }, - { 0x2CB7, LOWER_CASE, 0x2CB6 }, - { 0x2CB8, UPPER_CASE, 0x2CB9 }, - { 0x2CB9, LOWER_CASE, 0x2CB8 }, - { 0x2CBA, UPPER_CASE, 0x2CBB }, - { 0x2CBB, LOWER_CASE, 0x2CBA }, - { 0x2CBC, UPPER_CASE, 0x2CBD }, - { 0x2CBD, LOWER_CASE, 0x2CBC }, - { 0x2CBE, UPPER_CASE, 0x2CBF }, - { 0x2CBF, LOWER_CASE, 0x2CBE }, - { 0x2CC0, UPPER_CASE, 0x2CC1 }, - { 0x2CC1, LOWER_CASE, 0x2CC0 }, - { 0x2CC2, UPPER_CASE, 0x2CC3 }, - { 0x2CC3, LOWER_CASE, 0x2CC2 }, - { 0x2CC4, UPPER_CASE, 0x2CC5 }, - { 0x2CC5, LOWER_CASE, 0x2CC4 }, - { 0x2CC6, UPPER_CASE, 0x2CC7 }, - { 0x2CC7, LOWER_CASE, 0x2CC6 }, - { 0x2CC8, UPPER_CASE, 0x2CC9 }, - { 0x2CC9, LOWER_CASE, 0x2CC8 }, - { 0x2CCA, UPPER_CASE, 0x2CCB }, - { 0x2CCB, LOWER_CASE, 0x2CCA }, - { 0x2CCC, UPPER_CASE, 0x2CCD }, - { 0x2CCD, LOWER_CASE, 0x2CCC }, - { 0x2CCE, UPPER_CASE, 0x2CCF }, - { 0x2CCF, LOWER_CASE, 0x2CCE }, - { 0x2CD0, UPPER_CASE, 0x2CD1 }, - { 0x2CD1, LOWER_CASE, 0x2CD0 }, - { 0x2CD2, UPPER_CASE, 0x2CD3 }, - { 0x2CD3, LOWER_CASE, 0x2CD2 }, - { 0x2CD4, UPPER_CASE, 0x2CD5 }, - { 0x2CD5, LOWER_CASE, 0x2CD4 }, - { 0x2CD6, UPPER_CASE, 0x2CD7 }, - { 0x2CD7, LOWER_CASE, 0x2CD6 }, - { 0x2CD8, UPPER_CASE, 0x2CD9 }, - { 0x2CD9, LOWER_CASE, 0x2CD8 }, - { 0x2CDA, UPPER_CASE, 0x2CDB }, - { 0x2CDB, LOWER_CASE, 0x2CDA }, - { 0x2CDC, UPPER_CASE, 0x2CDD }, - { 0x2CDD, LOWER_CASE, 0x2CDC }, - { 0x2CDE, UPPER_CASE, 0x2CDF }, - { 0x2CDF, LOWER_CASE, 0x2CDE }, - { 0x2CE0, UPPER_CASE, 0x2CE1 }, - { 0x2CE1, LOWER_CASE, 0x2CE0 }, - { 0x2CE2, UPPER_CASE, 0x2CE3 }, - { 0x2CE3, LOWER_CASE, 0x2CE2 }, - { 0x2CEB, UPPER_CASE, 0x2CEC }, - { 0x2CEC, LOWER_CASE, 0x2CEB }, - { 0x2CED, UPPER_CASE, 0x2CEE }, - { 0x2CEE, LOWER_CASE, 0x2CED }, - { 0x2CF2, UPPER_CASE, 0x2CF3 }, - { 0x2CF3, LOWER_CASE, 0x2CF2 }, - { 0x2D00, LOWER_CASE, 0x10A0 }, - { 0x2D01, LOWER_CASE, 0x10A1 }, - { 0x2D02, LOWER_CASE, 0x10A2 }, - { 0x2D03, LOWER_CASE, 0x10A3 }, - { 0x2D04, LOWER_CASE, 0x10A4 }, - { 0x2D05, LOWER_CASE, 0x10A5 }, - { 0x2D06, LOWER_CASE, 0x10A6 }, - { 0x2D07, LOWER_CASE, 0x10A7 }, - { 0x2D08, LOWER_CASE, 0x10A8 }, - { 0x2D09, LOWER_CASE, 0x10A9 }, - { 0x2D0A, LOWER_CASE, 0x10AA }, - { 0x2D0B, LOWER_CASE, 0x10AB }, - { 0x2D0C, LOWER_CASE, 0x10AC }, - { 0x2D0D, LOWER_CASE, 0x10AD }, - { 0x2D0E, LOWER_CASE, 0x10AE }, - { 0x2D0F, LOWER_CASE, 0x10AF }, - { 0x2D10, LOWER_CASE, 0x10B0 }, - { 0x2D11, LOWER_CASE, 0x10B1 }, - { 0x2D12, LOWER_CASE, 0x10B2 }, - { 0x2D13, LOWER_CASE, 0x10B3 }, - { 0x2D14, LOWER_CASE, 0x10B4 }, - { 0x2D15, LOWER_CASE, 0x10B5 }, - { 0x2D16, LOWER_CASE, 0x10B6 }, - { 0x2D17, LOWER_CASE, 0x10B7 }, - { 0x2D18, LOWER_CASE, 0x10B8 }, - { 0x2D19, LOWER_CASE, 0x10B9 }, - { 0x2D1A, LOWER_CASE, 0x10BA }, - { 0x2D1B, LOWER_CASE, 0x10BB }, - { 0x2D1C, LOWER_CASE, 0x10BC }, - { 0x2D1D, LOWER_CASE, 0x10BD }, - { 0x2D1E, LOWER_CASE, 0x10BE }, - { 0x2D1F, LOWER_CASE, 0x10BF }, - { 0x2D20, LOWER_CASE, 0x10C0 }, - { 0x2D21, LOWER_CASE, 0x10C1 }, - { 0x2D22, LOWER_CASE, 0x10C2 }, - { 0x2D23, LOWER_CASE, 0x10C3 }, - { 0x2D24, LOWER_CASE, 0x10C4 }, - { 0x2D25, LOWER_CASE, 0x10C5 }, - { 0x2D27, LOWER_CASE, 0x10C7 }, - { 0x2D2D, LOWER_CASE, 0x10CD }, - { 0xA640, UPPER_CASE, 0xA641 }, - { 0xA641, LOWER_CASE, 0xA640 }, - { 0xA642, UPPER_CASE, 0xA643 }, - { 0xA643, LOWER_CASE, 0xA642 }, - { 0xA644, UPPER_CASE, 0xA645 }, - { 0xA645, LOWER_CASE, 0xA644 }, - { 0xA646, UPPER_CASE, 0xA647 }, - { 0xA647, LOWER_CASE, 0xA646 }, - { 0xA648, UPPER_CASE, 0xA649 }, - { 0xA649, LOWER_CASE, 0xA648 }, - { 0xA64A, UPPER_CASE, 0xA64B }, - { 0xA64B, LOWER_CASE, 0xA64A }, - { 0xA64C, UPPER_CASE, 0xA64D }, - { 0xA64D, LOWER_CASE, 0xA64C }, - { 0xA64E, UPPER_CASE, 0xA64F }, - { 0xA64F, LOWER_CASE, 0xA64E }, - { 0xA650, UPPER_CASE, 0xA651 }, - { 0xA651, LOWER_CASE, 0xA650 }, - { 0xA652, UPPER_CASE, 0xA653 }, - { 0xA653, LOWER_CASE, 0xA652 }, - { 0xA654, UPPER_CASE, 0xA655 }, - { 0xA655, LOWER_CASE, 0xA654 }, - { 0xA656, UPPER_CASE, 0xA657 }, - { 0xA657, LOWER_CASE, 0xA656 }, - { 0xA658, UPPER_CASE, 0xA659 }, - { 0xA659, LOWER_CASE, 0xA658 }, - { 0xA65A, UPPER_CASE, 0xA65B }, - { 0xA65B, LOWER_CASE, 0xA65A }, - { 0xA65C, UPPER_CASE, 0xA65D }, - { 0xA65D, LOWER_CASE, 0xA65C }, - { 0xA65E, UPPER_CASE, 0xA65F }, - { 0xA65F, LOWER_CASE, 0xA65E }, - { 0xA660, UPPER_CASE, 0xA661 }, - { 0xA661, LOWER_CASE, 0xA660 }, - { 0xA662, UPPER_CASE, 0xA663 }, - { 0xA663, LOWER_CASE, 0xA662 }, - { 0xA664, UPPER_CASE, 0xA665 }, - { 0xA665, LOWER_CASE, 0xA664 }, - { 0xA666, UPPER_CASE, 0xA667 }, - { 0xA667, LOWER_CASE, 0xA666 }, - { 0xA668, UPPER_CASE, 0xA669 }, - { 0xA669, LOWER_CASE, 0xA668 }, - { 0xA66A, UPPER_CASE, 0xA66B }, - { 0xA66B, LOWER_CASE, 0xA66A }, - { 0xA66C, UPPER_CASE, 0xA66D }, - { 0xA66D, LOWER_CASE, 0xA66C }, - { 0xA680, UPPER_CASE, 0xA681 }, - { 0xA681, LOWER_CASE, 0xA680 }, - { 0xA682, UPPER_CASE, 0xA683 }, - { 0xA683, LOWER_CASE, 0xA682 }, - { 0xA684, UPPER_CASE, 0xA685 }, - { 0xA685, LOWER_CASE, 0xA684 }, - { 0xA686, UPPER_CASE, 0xA687 }, - { 0xA687, LOWER_CASE, 0xA686 }, - { 0xA688, UPPER_CASE, 0xA689 }, - { 0xA689, LOWER_CASE, 0xA688 }, - { 0xA68A, UPPER_CASE, 0xA68B }, - { 0xA68B, LOWER_CASE, 0xA68A }, - { 0xA68C, UPPER_CASE, 0xA68D }, - { 0xA68D, LOWER_CASE, 0xA68C }, - { 0xA68E, UPPER_CASE, 0xA68F }, - { 0xA68F, LOWER_CASE, 0xA68E }, - { 0xA690, UPPER_CASE, 0xA691 }, - { 0xA691, LOWER_CASE, 0xA690 }, - { 0xA692, UPPER_CASE, 0xA693 }, - { 0xA693, LOWER_CASE, 0xA692 }, - { 0xA694, UPPER_CASE, 0xA695 }, - { 0xA695, LOWER_CASE, 0xA694 }, - { 0xA696, UPPER_CASE, 0xA697 }, - { 0xA697, LOWER_CASE, 0xA696 }, - { 0xA698, UPPER_CASE, 0xA699 }, - { 0xA699, LOWER_CASE, 0xA698 }, - { 0xA69A, UPPER_CASE, 0xA69B }, - { 0xA69B, LOWER_CASE, 0xA69A }, - { 0xA722, UPPER_CASE, 0xA723 }, - { 0xA723, LOWER_CASE, 0xA722 }, - { 0xA724, UPPER_CASE, 0xA725 }, - { 0xA725, LOWER_CASE, 0xA724 }, - { 0xA726, UPPER_CASE, 0xA727 }, - { 0xA727, LOWER_CASE, 0xA726 }, - { 0xA728, UPPER_CASE, 0xA729 }, - { 0xA729, LOWER_CASE, 0xA728 }, - { 0xA72A, UPPER_CASE, 0xA72B }, - { 0xA72B, LOWER_CASE, 0xA72A }, - { 0xA72C, UPPER_CASE, 0xA72D }, - { 0xA72D, LOWER_CASE, 0xA72C }, - { 0xA72E, UPPER_CASE, 0xA72F }, - { 0xA72F, LOWER_CASE, 0xA72E }, - { 0xA732, UPPER_CASE, 0xA733 }, - { 0xA733, LOWER_CASE, 0xA732 }, - { 0xA734, UPPER_CASE, 0xA735 }, - { 0xA735, LOWER_CASE, 0xA734 }, - { 0xA736, UPPER_CASE, 0xA737 }, - { 0xA737, LOWER_CASE, 0xA736 }, - { 0xA738, UPPER_CASE, 0xA739 }, - { 0xA739, LOWER_CASE, 0xA738 }, - { 0xA73A, UPPER_CASE, 0xA73B }, - { 0xA73B, LOWER_CASE, 0xA73A }, - { 0xA73C, UPPER_CASE, 0xA73D }, - { 0xA73D, LOWER_CASE, 0xA73C }, - { 0xA73E, UPPER_CASE, 0xA73F }, - { 0xA73F, LOWER_CASE, 0xA73E }, - { 0xA740, UPPER_CASE, 0xA741 }, - { 0xA741, LOWER_CASE, 0xA740 }, - { 0xA742, UPPER_CASE, 0xA743 }, - { 0xA743, LOWER_CASE, 0xA742 }, - { 0xA744, UPPER_CASE, 0xA745 }, - { 0xA745, LOWER_CASE, 0xA744 }, - { 0xA746, UPPER_CASE, 0xA747 }, - { 0xA747, LOWER_CASE, 0xA746 }, - { 0xA748, UPPER_CASE, 0xA749 }, - { 0xA749, LOWER_CASE, 0xA748 }, - { 0xA74A, UPPER_CASE, 0xA74B }, - { 0xA74B, LOWER_CASE, 0xA74A }, - { 0xA74C, UPPER_CASE, 0xA74D }, - { 0xA74D, LOWER_CASE, 0xA74C }, - { 0xA74E, UPPER_CASE, 0xA74F }, - { 0xA74F, LOWER_CASE, 0xA74E }, - { 0xA750, UPPER_CASE, 0xA751 }, - { 0xA751, LOWER_CASE, 0xA750 }, - { 0xA752, UPPER_CASE, 0xA753 }, - { 0xA753, LOWER_CASE, 0xA752 }, - { 0xA754, UPPER_CASE, 0xA755 }, - { 0xA755, LOWER_CASE, 0xA754 }, - { 0xA756, UPPER_CASE, 0xA757 }, - { 0xA757, LOWER_CASE, 0xA756 }, - { 0xA758, UPPER_CASE, 0xA759 }, - { 0xA759, LOWER_CASE, 0xA758 }, - { 0xA75A, UPPER_CASE, 0xA75B }, - { 0xA75B, LOWER_CASE, 0xA75A }, - { 0xA75C, UPPER_CASE, 0xA75D }, - { 0xA75D, LOWER_CASE, 0xA75C }, - { 0xA75E, UPPER_CASE, 0xA75F }, - { 0xA75F, LOWER_CASE, 0xA75E }, - { 0xA760, UPPER_CASE, 0xA761 }, - { 0xA761, LOWER_CASE, 0xA760 }, - { 0xA762, UPPER_CASE, 0xA763 }, - { 0xA763, LOWER_CASE, 0xA762 }, - { 0xA764, UPPER_CASE, 0xA765 }, - { 0xA765, LOWER_CASE, 0xA764 }, - { 0xA766, UPPER_CASE, 0xA767 }, - { 0xA767, LOWER_CASE, 0xA766 }, - { 0xA768, UPPER_CASE, 0xA769 }, - { 0xA769, LOWER_CASE, 0xA768 }, - { 0xA76A, UPPER_CASE, 0xA76B }, - { 0xA76B, LOWER_CASE, 0xA76A }, - { 0xA76C, UPPER_CASE, 0xA76D }, - { 0xA76D, LOWER_CASE, 0xA76C }, - { 0xA76E, UPPER_CASE, 0xA76F }, - { 0xA76F, LOWER_CASE, 0xA76E }, - { 0xA779, UPPER_CASE, 0xA77A }, - { 0xA77A, LOWER_CASE, 0xA779 }, - { 0xA77B, UPPER_CASE, 0xA77C }, - { 0xA77C, LOWER_CASE, 0xA77B }, - { 0xA77D, UPPER_CASE, 0x1D79 }, - { 0xA77E, UPPER_CASE, 0xA77F }, - { 0xA77F, LOWER_CASE, 0xA77E }, - { 0xA780, UPPER_CASE, 0xA781 }, - { 0xA781, LOWER_CASE, 0xA780 }, - { 0xA782, UPPER_CASE, 0xA783 }, - { 0xA783, LOWER_CASE, 0xA782 }, - { 0xA784, UPPER_CASE, 0xA785 }, - { 0xA785, LOWER_CASE, 0xA784 }, - { 0xA786, UPPER_CASE, 0xA787 }, - { 0xA787, LOWER_CASE, 0xA786 }, - { 0xA78B, UPPER_CASE, 0xA78C }, - { 0xA78C, LOWER_CASE, 0xA78B }, - { 0xA78D, UPPER_CASE, 0x265 }, - { 0xA790, UPPER_CASE, 0xA791 }, - { 0xA791, LOWER_CASE, 0xA790 }, - { 0xA792, UPPER_CASE, 0xA793 }, - { 0xA793, LOWER_CASE, 0xA792 }, - { 0xA794, LOWER_CASE, 0xA7C4 }, - { 0xA796, UPPER_CASE, 0xA797 }, - { 0xA797, LOWER_CASE, 0xA796 }, - { 0xA798, UPPER_CASE, 0xA799 }, - { 0xA799, LOWER_CASE, 0xA798 }, - { 0xA79A, UPPER_CASE, 0xA79B }, - { 0xA79B, LOWER_CASE, 0xA79A }, - { 0xA79C, UPPER_CASE, 0xA79D }, - { 0xA79D, LOWER_CASE, 0xA79C }, - { 0xA79E, UPPER_CASE, 0xA79F }, - { 0xA79F, LOWER_CASE, 0xA79E }, - { 0xA7A0, UPPER_CASE, 0xA7A1 }, - { 0xA7A1, LOWER_CASE, 0xA7A0 }, - { 0xA7A2, UPPER_CASE, 0xA7A3 }, - { 0xA7A3, LOWER_CASE, 0xA7A2 }, - { 0xA7A4, UPPER_CASE, 0xA7A5 }, - { 0xA7A5, LOWER_CASE, 0xA7A4 }, - { 0xA7A6, UPPER_CASE, 0xA7A7 }, - { 0xA7A7, LOWER_CASE, 0xA7A6 }, - { 0xA7A8, UPPER_CASE, 0xA7A9 }, - { 0xA7A9, LOWER_CASE, 0xA7A8 }, - { 0xA7AA, UPPER_CASE, 0x266 }, - { 0xA7AB, UPPER_CASE, 0x25C }, - { 0xA7AC, UPPER_CASE, 0x261 }, - { 0xA7AD, UPPER_CASE, 0x26C }, - { 0xA7AE, UPPER_CASE, 0x26A }, - { 0xA7B0, UPPER_CASE, 0x29E }, - { 0xA7B1, UPPER_CASE, 0x287 }, - { 0xA7B2, UPPER_CASE, 0x29D }, - { 0xA7B3, UPPER_CASE, 0xAB53 }, - { 0xA7B4, UPPER_CASE, 0xA7B5 }, - { 0xA7B5, LOWER_CASE, 0xA7B4 }, - { 0xA7B6, UPPER_CASE, 0xA7B7 }, - { 0xA7B7, LOWER_CASE, 0xA7B6 }, - { 0xA7B8, UPPER_CASE, 0xA7B9 }, - { 0xA7B9, LOWER_CASE, 0xA7B8 }, - { 0xA7BA, UPPER_CASE, 0xA7BB }, - { 0xA7BB, LOWER_CASE, 0xA7BA }, - { 0xA7BC, UPPER_CASE, 0xA7BD }, - { 0xA7BD, LOWER_CASE, 0xA7BC }, - { 0xA7BE, UPPER_CASE, 0xA7BF }, - { 0xA7BF, LOWER_CASE, 0xA7BE }, - { 0xA7C2, UPPER_CASE, 0xA7C3 }, - { 0xA7C3, LOWER_CASE, 0xA7C2 }, - { 0xA7C4, UPPER_CASE, 0xA794 }, - { 0xA7C5, UPPER_CASE, 0x282 }, - { 0xA7C6, UPPER_CASE, 0x1D8E }, - { 0xA7C7, UPPER_CASE, 0xA7C8 }, - { 0xA7C8, LOWER_CASE, 0xA7C7 }, - { 0xA7C9, UPPER_CASE, 0xA7CA }, - { 0xA7CA, LOWER_CASE, 0xA7C9 }, - { 0xA7F5, UPPER_CASE, 0xA7F6 }, - { 0xA7F6, LOWER_CASE, 0xA7F5 }, - { 0xAB53, LOWER_CASE, 0xA7B3 }, - { 0xAB70, LOWER_CASE, 0x13A0 }, - { 0xAB71, LOWER_CASE, 0x13A1 }, - { 0xAB72, LOWER_CASE, 0x13A2 }, - { 0xAB73, LOWER_CASE, 0x13A3 }, - { 0xAB74, LOWER_CASE, 0x13A4 }, - { 0xAB75, LOWER_CASE, 0x13A5 }, - { 0xAB76, LOWER_CASE, 0x13A6 }, - { 0xAB77, LOWER_CASE, 0x13A7 }, - { 0xAB78, LOWER_CASE, 0x13A8 }, - { 0xAB79, LOWER_CASE, 0x13A9 }, - { 0xAB7A, LOWER_CASE, 0x13AA }, - { 0xAB7B, LOWER_CASE, 0x13AB }, - { 0xAB7C, LOWER_CASE, 0x13AC }, - { 0xAB7D, LOWER_CASE, 0x13AD }, - { 0xAB7E, LOWER_CASE, 0x13AE }, - { 0xAB7F, LOWER_CASE, 0x13AF }, - { 0xAB80, LOWER_CASE, 0x13B0 }, - { 0xAB81, LOWER_CASE, 0x13B1 }, - { 0xAB82, LOWER_CASE, 0x13B2 }, - { 0xAB83, LOWER_CASE, 0x13B3 }, - { 0xAB84, LOWER_CASE, 0x13B4 }, - { 0xAB85, LOWER_CASE, 0x13B5 }, - { 0xAB86, LOWER_CASE, 0x13B6 }, - { 0xAB87, LOWER_CASE, 0x13B7 }, - { 0xAB88, LOWER_CASE, 0x13B8 }, - { 0xAB89, LOWER_CASE, 0x13B9 }, - { 0xAB8A, LOWER_CASE, 0x13BA }, - { 0xAB8B, LOWER_CASE, 0x13BB }, - { 0xAB8C, LOWER_CASE, 0x13BC }, - { 0xAB8D, LOWER_CASE, 0x13BD }, - { 0xAB8E, LOWER_CASE, 0x13BE }, - { 0xAB8F, LOWER_CASE, 0x13BF }, - { 0xAB90, LOWER_CASE, 0x13C0 }, - { 0xAB91, LOWER_CASE, 0x13C1 }, - { 0xAB92, LOWER_CASE, 0x13C2 }, - { 0xAB93, LOWER_CASE, 0x13C3 }, - { 0xAB94, LOWER_CASE, 0x13C4 }, - { 0xAB95, LOWER_CASE, 0x13C5 }, - { 0xAB96, LOWER_CASE, 0x13C6 }, - { 0xAB97, LOWER_CASE, 0x13C7 }, - { 0xAB98, LOWER_CASE, 0x13C8 }, - { 0xAB99, LOWER_CASE, 0x13C9 }, - { 0xAB9A, LOWER_CASE, 0x13CA }, - { 0xAB9B, LOWER_CASE, 0x13CB }, - { 0xAB9C, LOWER_CASE, 0x13CC }, - { 0xAB9D, LOWER_CASE, 0x13CD }, - { 0xAB9E, LOWER_CASE, 0x13CE }, - { 0xAB9F, LOWER_CASE, 0x13CF }, - { 0xABA0, LOWER_CASE, 0x13D0 }, - { 0xABA1, LOWER_CASE, 0x13D1 }, - { 0xABA2, LOWER_CASE, 0x13D2 }, - { 0xABA3, LOWER_CASE, 0x13D3 }, - { 0xABA4, LOWER_CASE, 0x13D4 }, - { 0xABA5, LOWER_CASE, 0x13D5 }, - { 0xABA6, LOWER_CASE, 0x13D6 }, - { 0xABA7, LOWER_CASE, 0x13D7 }, - { 0xABA8, LOWER_CASE, 0x13D8 }, - { 0xABA9, LOWER_CASE, 0x13D9 }, - { 0xABAA, LOWER_CASE, 0x13DA }, - { 0xABAB, LOWER_CASE, 0x13DB }, - { 0xABAC, LOWER_CASE, 0x13DC }, - { 0xABAD, LOWER_CASE, 0x13DD }, - { 0xABAE, LOWER_CASE, 0x13DE }, - { 0xABAF, LOWER_CASE, 0x13DF }, - { 0xABB0, LOWER_CASE, 0x13E0 }, - { 0xABB1, LOWER_CASE, 0x13E1 }, - { 0xABB2, LOWER_CASE, 0x13E2 }, - { 0xABB3, LOWER_CASE, 0x13E3 }, - { 0xABB4, LOWER_CASE, 0x13E4 }, - { 0xABB5, LOWER_CASE, 0x13E5 }, - { 0xABB6, LOWER_CASE, 0x13E6 }, - { 0xABB7, LOWER_CASE, 0x13E7 }, - { 0xABB8, LOWER_CASE, 0x13E8 }, - { 0xABB9, LOWER_CASE, 0x13E9 }, - { 0xABBA, LOWER_CASE, 0x13EA }, - { 0xABBB, LOWER_CASE, 0x13EB }, - { 0xABBC, LOWER_CASE, 0x13EC }, - { 0xABBD, LOWER_CASE, 0x13ED }, - { 0xABBE, LOWER_CASE, 0x13EE }, - { 0xABBF, LOWER_CASE, 0x13EF }, - { 0xFF21, UPPER_CASE, 0xFF41 }, - { 0xFF22, UPPER_CASE, 0xFF42 }, - { 0xFF23, UPPER_CASE, 0xFF43 }, - { 0xFF24, UPPER_CASE, 0xFF44 }, - { 0xFF25, UPPER_CASE, 0xFF45 }, - { 0xFF26, UPPER_CASE, 0xFF46 }, - { 0xFF27, UPPER_CASE, 0xFF47 }, - { 0xFF28, UPPER_CASE, 0xFF48 }, - { 0xFF29, UPPER_CASE, 0xFF49 }, - { 0xFF2A, UPPER_CASE, 0xFF4A }, - { 0xFF2B, UPPER_CASE, 0xFF4B }, - { 0xFF2C, UPPER_CASE, 0xFF4C }, - { 0xFF2D, UPPER_CASE, 0xFF4D }, - { 0xFF2E, UPPER_CASE, 0xFF4E }, - { 0xFF2F, UPPER_CASE, 0xFF4F }, - { 0xFF30, UPPER_CASE, 0xFF50 }, - { 0xFF31, UPPER_CASE, 0xFF51 }, - { 0xFF32, UPPER_CASE, 0xFF52 }, - { 0xFF33, UPPER_CASE, 0xFF53 }, - { 0xFF34, UPPER_CASE, 0xFF54 }, - { 0xFF35, UPPER_CASE, 0xFF55 }, - { 0xFF36, UPPER_CASE, 0xFF56 }, - { 0xFF37, UPPER_CASE, 0xFF57 }, - { 0xFF38, UPPER_CASE, 0xFF58 }, - { 0xFF39, UPPER_CASE, 0xFF59 }, - { 0xFF3A, UPPER_CASE, 0xFF5A }, - { 0xFF41, LOWER_CASE, 0xFF21 }, - { 0xFF42, LOWER_CASE, 0xFF22 }, - { 0xFF43, LOWER_CASE, 0xFF23 }, - { 0xFF44, LOWER_CASE, 0xFF24 }, - { 0xFF45, LOWER_CASE, 0xFF25 }, - { 0xFF46, LOWER_CASE, 0xFF26 }, - { 0xFF47, LOWER_CASE, 0xFF27 }, - { 0xFF48, LOWER_CASE, 0xFF28 }, - { 0xFF49, LOWER_CASE, 0xFF29 }, - { 0xFF4A, LOWER_CASE, 0xFF2A }, - { 0xFF4B, LOWER_CASE, 0xFF2B }, - { 0xFF4C, LOWER_CASE, 0xFF2C }, - { 0xFF4D, LOWER_CASE, 0xFF2D }, - { 0xFF4E, LOWER_CASE, 0xFF2E }, - { 0xFF4F, LOWER_CASE, 0xFF2F }, - { 0xFF50, LOWER_CASE, 0xFF30 }, - { 0xFF51, LOWER_CASE, 0xFF31 }, - { 0xFF52, LOWER_CASE, 0xFF32 }, - { 0xFF53, LOWER_CASE, 0xFF33 }, - { 0xFF54, LOWER_CASE, 0xFF34 }, - { 0xFF55, LOWER_CASE, 0xFF35 }, - { 0xFF56, LOWER_CASE, 0xFF36 }, - { 0xFF57, LOWER_CASE, 0xFF37 }, - { 0xFF58, LOWER_CASE, 0xFF38 }, - { 0xFF59, LOWER_CASE, 0xFF39 }, - { 0xFF5A, LOWER_CASE, 0xFF3A }, -}; -CONST UINT UNICODE_DATA_SIZE = sizeof(UnicodeData)/sizeof(UnicodeDataRec); diff --git a/src/shared/pal/src/locale/unicodedata.cs b/src/shared/pal/src/locale/unicodedata.cs deleted file mode 100644 index aafc67fc20..0000000000 --- a/src/shared/pal/src/locale/unicodedata.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.IO; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("// Licensed to the .NET Foundation under one or more agreements."); - Console.WriteLine("// The .NET Foundation licenses this file to you under the MIT license."); - Console.WriteLine(); - - Console.WriteLine("#include \"pal/unicodedata.h\""); - - Console.WriteLine(); - Console.WriteLine("//"); - Console.WriteLine("// THIS FILE IS GENERATED. DO NOT HAND EDIT."); - Console.WriteLine("//"); - Console.WriteLine(); - - Console.WriteLine("CONST UnicodeDataRec UnicodeData[] = {"); - - string sourceFileName = args[0]; - - using (StreamReader sourceFile = File.OpenText(sourceFileName)) - while (sourceFile.ReadLine() is string line) - { - var fields = line.Split(';'); - - var code = int.Parse(fields[0], NumberStyles.HexNumber); - - bool hasUpperCaseMapping = fields[12].Length != 0; - bool hasLowerCaseMapping = fields[13].Length != 0; - - if (!hasLowerCaseMapping && !hasUpperCaseMapping) - continue; - - - int opposingCase = hasUpperCaseMapping ? - int.Parse(fields[12], NumberStyles.HexNumber) : - int.Parse(fields[13], NumberStyles.HexNumber); - - // These won't fit in 16 bits - no point carrying them - if (code > 0xFFFF) - continue; - - Debug.Assert(opposingCase <= 0xFFFF); - - string specifier = hasUpperCaseMapping ? "LOWER_CASE" : "UPPER_CASE"; - - Console.WriteLine($" {{ 0x{code:X}, {specifier}, 0x{opposingCase:X} }},"); - } - - Console.WriteLine("};"); - - Console.WriteLine("CONST UINT UNICODE_DATA_SIZE = sizeof(UnicodeData)/sizeof(UnicodeDataRec);"); - } -} diff --git a/src/shared/pal/src/locale/utf8.cpp b/src/shared/pal/src/locale/utf8.cpp deleted file mode 100644 index 8ff3229fcb..0000000000 --- a/src/shared/pal/src/locale/utf8.cpp +++ /dev/null @@ -1,2937 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - -Module Name: - - unicode/utf8.c - -Abstract: - Functions to encode and decode UTF-8 strings. This is a port of the C# version from Utf8Encoding.cs. - -Revision History: - ---*/ - -#include "pal/utf8.h" -#include "pal/malloc.hpp" - -using namespace CorUnix; - -#define FASTLOOP - -struct CharUnicodeInfo -{ - static const WCHAR HIGH_SURROGATE_START = 0xd800; - static const WCHAR HIGH_SURROGATE_END = 0xdbff; - static const WCHAR LOW_SURROGATE_START = 0xdc00; - static const WCHAR LOW_SURROGATE_END = 0xdfff; -}; - -struct Char -{ - // Test if the wide character is a high surrogate - static bool IsHighSurrogate(const WCHAR c) - { - return (c & 0xFC00) == CharUnicodeInfo::HIGH_SURROGATE_START; - } - - // Test if the wide character is a low surrogate - static bool IsLowSurrogate(const WCHAR c) - { - return (c & 0xFC00) == CharUnicodeInfo::LOW_SURROGATE_START; - } - - // Test if the wide character is a surrogate half - static bool IsSurrogate(const WCHAR c) - { - return (c & 0xF800) == CharUnicodeInfo::HIGH_SURROGATE_START; - } - - // Test if the wide character is a high surrogate - static bool IsHighSurrogate(const WCHAR* s, int index) - { - return IsHighSurrogate(s[index]); - } - - // Test if the wide character is a low surrogate - static bool IsLowSurrogate(const WCHAR* s, int index) - { - return IsLowSurrogate(s[index]); - } - - // Test if the wide character is a surrogate half - static bool IsSurrogate(const WCHAR* s, int index) - { - return IsSurrogate(s[index]); - } -}; - -class ArgumentException -{ - -public: - ArgumentException(LPCSTR message) - { - } - - ArgumentException(LPCSTR message, LPCSTR argName) - { - } -}; - -class ArgumentNullException : public ArgumentException -{ -public: - ArgumentNullException(LPCSTR argName) - : ArgumentException("Argument is NULL", argName) - { - - } -}; - -class ArgumentOutOfRangeException : public ArgumentException -{ -public: - ArgumentOutOfRangeException(LPCSTR argName, LPCSTR message) - : ArgumentException(message, argName) - { - - } -}; - -class InsufficientBufferException : public ArgumentException -{ -public: - InsufficientBufferException(LPCSTR message, LPCSTR argName) - : ArgumentException(message, argName) - { - - } -}; - -class Contract -{ -public: - static void Assert(bool cond, LPCSTR str) - { - if (!cond) - { - throw ArgumentException(str); - } - } - - static void EndContractBlock() - { - } -}; - -class DecoderFallbackException : public ArgumentException -{ - BYTE *bytesUnknown; - int index; - -public: - DecoderFallbackException( - LPCSTR message, BYTE bytesUnknown[], int index) : ArgumentException(message) - { - this->bytesUnknown = bytesUnknown; - this->index = index; - } - - BYTE *BytesUnknown() - { - return (bytesUnknown); - } - - int GetIndex() - { - return index; - } -}; - -class DecoderFallbackBuffer; - -class DecoderFallback -{ -public: - - // Fallback - // - // Return the appropriate unicode string alternative to the character that need to fall back. - - virtual DecoderFallbackBuffer* CreateFallbackBuffer() = 0; - - // Maximum number of characters that this instance of this fallback could return - - virtual int GetMaxCharCount() = 0; -}; - -class DecoderReplacementFallback : public DecoderFallback -{ - // Our variables - WCHAR strDefault[2]; - int strDefaultLength; - -public: - // Construction. Default replacement fallback uses no best fit and ? replacement string - DecoderReplacementFallback() : DecoderReplacementFallback(W("?")) - { - } - - DecoderReplacementFallback(const WCHAR* replacement) - { - // Must not be null - if (replacement == nullptr) - throw ArgumentNullException("replacement"); - Contract::EndContractBlock(); - - // Make sure it doesn't have bad surrogate pairs - bool bFoundHigh = false; - int replacementLength = PAL_wcslen((const WCHAR *)replacement); - for (int i = 0; i < replacementLength; i++) - { - // Found a surrogate? - if (Char::IsSurrogate(replacement, i)) - { - // High or Low? - if (Char::IsHighSurrogate(replacement, i)) - { - // if already had a high one, stop - if (bFoundHigh) - break; // break & throw at the bFoundHIgh below - bFoundHigh = true; - } - else - { - // Low, did we have a high? - if (!bFoundHigh) - { - // Didn't have one, make if fail when we stop - bFoundHigh = true; - break; - } - - // Clear flag - bFoundHigh = false; - } - } - // If last was high we're in trouble (not surrogate so not low surrogate, so break) - else if (bFoundHigh) - break; - } - if (bFoundHigh) - throw ArgumentException("String 'replacement' contains invalid Unicode code points.", "replacement"); - - wcscpy_s(strDefault, ARRAY_SIZE(strDefault), replacement); - strDefaultLength = replacementLength; - } - - WCHAR* GetDefaultString() - { - return strDefault; - } - - virtual DecoderFallbackBuffer* CreateFallbackBuffer(); - - // Maximum number of characters that this instance of this fallback could return - virtual int GetMaxCharCount() - { - return strDefaultLength; - } -}; - -class DecoderFallbackBuffer -{ - friend class UTF8Encoding; - // Most implimentations will probably need an implimenation-specific constructor - - // internal methods that cannot be overriden that let us do our fallback thing - // These wrap the internal methods so that we can check for people doing stuff that's incorrect - -public: - virtual ~DecoderFallbackBuffer() = default; - - virtual bool Fallback(BYTE bytesUnknown[], int index, int size) = 0; - - // Get next character - virtual WCHAR GetNextChar() = 0; - - //Back up a character - virtual bool MovePrevious() = 0; - - // How many chars left in this fallback? - virtual int GetRemaining() = 0; - - // Clear the buffer - virtual void Reset() - { - while (GetNextChar() != (WCHAR)0); - } - - // Internal items to help us figure out what we're doing as far as error messages, etc. - // These help us with our performance and messages internally -protected: - BYTE* byteStart; - WCHAR* charEnd; - - // Internal reset - void InternalReset() - { - byteStart = nullptr; - Reset(); - } - - // Set the above values - // This can't be part of the constructor because EncoderFallbacks would have to know how to impliment these. - void InternalInitialize(BYTE* byteStart, WCHAR* charEnd) - { - this->byteStart = byteStart; - this->charEnd = charEnd; - } - - // Fallback the current byte by sticking it into the remaining char buffer. - // This can only be called by our encodings (other have to use the public fallback methods), so - // we can use our DecoderNLS here too (except we don't). - // Returns true if we are successful, false if we can't fallback the character (no buffer space) - // So caller needs to throw buffer space if return false. - // Right now this has both bytes and bytes[], since we might have extra bytes, hence the - // array, and we might need the index, hence the byte* - // Don't touch ref chars unless we succeed - virtual bool InternalFallback(BYTE bytes[], BYTE* pBytes, WCHAR** chars, int size) - { - - Contract::Assert(byteStart != nullptr, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); - - // See if there's a fallback character and we have an output buffer then copy our string. - if (this->Fallback(bytes, (int)(pBytes - byteStart - size), size)) - { - // Copy the chars to our output - WCHAR ch; - WCHAR* charTemp = *chars; - bool bHighSurrogate = false; - while ((ch = GetNextChar()) != 0) - { - // Make sure no mixed up surrogates - if (Char::IsSurrogate(ch)) - { - if (Char::IsHighSurrogate(ch)) - { - // High Surrogate - if (bHighSurrogate) - throw ArgumentException("String 'chars' contains invalid Unicode code points."); - bHighSurrogate = true; - } - else - { - // Low surrogate - if (!bHighSurrogate) - throw ArgumentException("String 'chars' contains invalid Unicode code points."); - bHighSurrogate = false; - } - } - - if (charTemp >= charEnd) - { - // No buffer space - return false; - } - - *(charTemp++) = ch; - } - - // Need to make sure that bHighSurrogate isn't true - if (bHighSurrogate) - throw ArgumentException("String 'chars' contains invalid Unicode code points."); - - // Now we aren't going to be false, so its OK to update chars - *chars = charTemp; - } - - return true; - } - - // This version just counts the fallback and doesn't actually copy anything. - virtual int InternalFallback(BYTE bytes[], BYTE* pBytes, int size) - // Right now this has both bytes[] and BYTE* bytes, since we might have extra bytes, hence the - // array, and we might need the index, hence the byte* - { - - Contract::Assert(byteStart != nullptr, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); - - // See if there's a fallback character and we have an output buffer then copy our string. - if (this->Fallback(bytes, (int)(pBytes - byteStart - size), size)) - { - int count = 0; - - WCHAR ch; - bool bHighSurrogate = false; - while ((ch = GetNextChar()) != 0) - { - // Make sure no mixed up surrogates - if (Char::IsSurrogate(ch)) - { - if (Char::IsHighSurrogate(ch)) - { - // High Surrogate - if (bHighSurrogate) - throw ArgumentException("String 'chars' contains invalid Unicode code points."); - bHighSurrogate = true; - } - else - { - // Low surrogate - if (!bHighSurrogate) - throw ArgumentException("String 'chars' contains invalid Unicode code points."); - bHighSurrogate = false; - } - } - - count++; - } - - // Need to make sure that bHighSurrogate isn't true - if (bHighSurrogate) - throw ArgumentException("String 'chars' contains invalid Unicode code points."); - - return count; - } - - // If no fallback return 0 - return 0; - } - - // private helper methods - void ThrowLastBytesRecursive(BYTE bytesUnknown[]) - { - throw ArgumentException("Recursive fallback not allowed"); - } -}; - -class DecoderReplacementFallbackBuffer : public DecoderFallbackBuffer -{ - // Store our default string - WCHAR strDefault[2]; - int strDefaultLength; - int fallbackCount = -1; - int fallbackIndex = -1; - -public: - // Construction - DecoderReplacementFallbackBuffer(DecoderReplacementFallback* fallback) - { - wcscpy_s(strDefault, ARRAY_SIZE(strDefault), fallback->GetDefaultString()); - strDefaultLength = PAL_wcslen((const WCHAR *)fallback->GetDefaultString()); - } - - // Fallback Methods - virtual bool Fallback(BYTE bytesUnknown[], int index, int size) - { - // We expect no previous fallback in our buffer - // We can't call recursively but others might (note, we don't test on last char!!!) - if (fallbackCount >= 1) - { - ThrowLastBytesRecursive(bytesUnknown); - } - - // Go ahead and get our fallback - if (strDefaultLength == 0) - return false; - - fallbackCount = strDefaultLength; - fallbackIndex = -1; - - return true; - } - - virtual WCHAR GetNextChar() - { - // We want it to get < 0 because == 0 means that the current/last character is a fallback - // and we need to detect recursion. We could have a flag but we already have this counter. - fallbackCount--; - fallbackIndex++; - - // Do we have anything left? 0 is now last fallback char, negative is nothing left - if (fallbackCount < 0) - return '\0'; - - // Need to get it out of the buffer. - // Make sure it didn't wrap from the fast count-- path - if (fallbackCount == INT_MAX) - { - fallbackCount = -1; - return '\0'; - } - - // Now make sure its in the expected range - Contract::Assert(fallbackIndex < strDefaultLength && fallbackIndex >= 0, - "Index exceeds buffer range"); - - return strDefault[fallbackIndex]; - } - - virtual bool MovePrevious() - { - // Back up one, only if we just processed the last character (or earlier) - if (fallbackCount >= -1 && fallbackIndex >= 0) - { - fallbackIndex--; - fallbackCount++; - return true; - } - - // Return false 'cause we couldn't do it. - return false; - } - - // How many characters left to output? - virtual int GetRemaining() - { - // Our count is 0 for 1 character left. - return (fallbackCount < 0) ? 0 : fallbackCount; - } - - // Clear the buffer - virtual void Reset() - { - fallbackCount = -1; - fallbackIndex = -1; - byteStart = nullptr; - } - - // This version just counts the fallback and doesn't actually copy anything. - virtual int InternalFallback(BYTE bytes[], BYTE* pBytes, int size) - // Right now this has both bytes and bytes[], since we might have extra bytes, hence the - // array, and we might need the index, hence the byte* - { - // return our replacement string Length - return strDefaultLength; - } -}; - -class DecoderExceptionFallbackBuffer : public DecoderFallbackBuffer -{ -public: - DecoderExceptionFallbackBuffer() - { - } - - virtual bool Fallback(BYTE bytesUnknown[], int index, int size) - { - throw DecoderFallbackException( - "Unable to translate UTF-8 character to Unicode", bytesUnknown, index); - } - - virtual WCHAR GetNextChar() - { - return 0; - } - - virtual bool MovePrevious() - { - // Exception fallback doesn't have anywhere to back up to. - return false; - } - - // Exceptions are always empty - virtual int GetRemaining() - { - return 0; - } - -}; - -class DecoderExceptionFallback : public DecoderFallback -{ - // Construction -public: - DecoderExceptionFallback() - { - } - - virtual DecoderFallbackBuffer* CreateFallbackBuffer() - { - return InternalNew(); - } - - // Maximum number of characters that this instance of this fallback could return - virtual int GetMaxCharCount() - { - return 0; - } -}; - -DecoderFallbackBuffer* DecoderReplacementFallback::CreateFallbackBuffer() -{ - return InternalNew(this); -} - -class EncoderFallbackException : public ArgumentException -{ - WCHAR charUnknown; - WCHAR charUnknownHigh; - WCHAR charUnknownLow; - int index; - -public: - EncoderFallbackException( - LPCSTR message, WCHAR charUnknown, int index) : ArgumentException(message) - { - this->charUnknown = charUnknown; - this->index = index; - } - - EncoderFallbackException( - LPCSTR message, WCHAR charUnknownHigh, WCHAR charUnknownLow, int index) : ArgumentException(message) - { - if (!Char::IsHighSurrogate(charUnknownHigh)) - { - throw ArgumentOutOfRangeException("charUnknownHigh", - "Argument out of range 0xD800..0xDBFF"); - } - if (!Char::IsLowSurrogate(charUnknownLow)) - { - throw ArgumentOutOfRangeException("charUnknownLow", - "Argument out of range 0xDC00..0xDFFF"); - } - Contract::EndContractBlock(); - - this->charUnknownHigh = charUnknownHigh; - this->charUnknownLow = charUnknownLow; - this->index = index; - } - - WCHAR GetCharUnknown() - { - return (charUnknown); - } - - WCHAR GetCharUnknownHigh() - { - return (charUnknownHigh); - } - - WCHAR GetCharUnknownLow() - { - return (charUnknownLow); - } - - int GetIndex() - { - return index; - } - - // Return true if the unknown character is a surrogate pair. - bool IsUnknownSurrogate() - { - return (charUnknownHigh != '\0'); - } -}; - -class EncoderFallbackBuffer; - -class EncoderFallback -{ -public: - - // Fallback - // - // Return the appropriate unicode string alternative to the character that need to fall back. - - virtual EncoderFallbackBuffer* CreateFallbackBuffer() = 0; - - // Maximum number of characters that this instance of this fallback could return - virtual int GetMaxCharCount() = 0; -}; - -class EncoderReplacementFallback : public EncoderFallback -{ - // Our variables - WCHAR strDefault[2]; - int strDefaultLength; - -public: - // Construction. Default replacement fallback uses no best fit and ? replacement string - EncoderReplacementFallback() : EncoderReplacementFallback(W("?")) - { - } - - EncoderReplacementFallback(const WCHAR* replacement) - { - // Must not be null - if (replacement == nullptr) - throw ArgumentNullException("replacement"); - Contract::EndContractBlock(); - - // Make sure it doesn't have bad surrogate pairs - bool bFoundHigh = false; - int replacementLength = PAL_wcslen((const WCHAR *)replacement); - for (int i = 0; i < replacementLength; i++) - { - // Found a surrogate? - if (Char::IsSurrogate(replacement, i)) - { - // High or Low? - if (Char::IsHighSurrogate(replacement, i)) - { - // if already had a high one, stop - if (bFoundHigh) - break; // break & throw at the bFoundHIgh below - bFoundHigh = true; - } - else - { - // Low, did we have a high? - if (!bFoundHigh) - { - // Didn't have one, make if fail when we stop - bFoundHigh = true; - break; - } - - // Clear flag - bFoundHigh = false; - } - } - // If last was high we're in trouble (not surrogate so not low surrogate, so break) - else if (bFoundHigh) - break; - } - if (bFoundHigh) - throw ArgumentException("String 'replacement' contains invalid Unicode code points.", "replacement"); - - wcscpy_s(strDefault, ARRAY_SIZE(strDefault), replacement); - strDefaultLength = replacementLength; - } - - WCHAR* GetDefaultString() - { - return strDefault; - } - - virtual EncoderFallbackBuffer* CreateFallbackBuffer(); - - // Maximum number of characters that this instance of this fallback could return - virtual int GetMaxCharCount() - { - return strDefaultLength; - } -}; - -class EncoderFallbackBuffer -{ - friend class UTF8Encoding; - // Most implementations will probably need an implemenation-specific constructor - - // Public methods that cannot be overriden that let us do our fallback thing - // These wrap the internal methods so that we can check for people doing stuff that is incorrect - -public: - virtual ~EncoderFallbackBuffer() = default; - - virtual bool Fallback(WCHAR charUnknown, int index) = 0; - - virtual bool Fallback(WCHAR charUnknownHigh, WCHAR charUnknownLow, int index) = 0; - - // Get next character - virtual WCHAR GetNextChar() = 0; - - // Back up a character - virtual bool MovePrevious() = 0; - - // How many chars left in this fallback? - virtual int GetRemaining() = 0; - - // Not sure if this should be public or not. - // Clear the buffer - virtual void Reset() - { - while (GetNextChar() != (WCHAR)0); - } - - // Internal items to help us figure out what we're doing as far as error messages, etc. - // These help us with our performance and messages internally -protected: - WCHAR* charStart; - WCHAR* charEnd; - bool setEncoder; - bool bUsedEncoder; - bool bFallingBack = false; - int iRecursionCount = 0; - static const int iMaxRecursion = 250; - - // Internal Reset - // For example, what if someone fails a conversion and wants to reset one of our fallback buffers? - void InternalReset() - { - charStart = nullptr; - bFallingBack = false; - iRecursionCount = 0; - Reset(); - } - - // Set the above values - // This can't be part of the constructor because EncoderFallbacks would have to know how to impliment these. - void InternalInitialize(WCHAR* charStart, WCHAR* charEnd, bool setEncoder) - { - this->charStart = charStart; - this->charEnd = charEnd; - this->setEncoder = setEncoder; - this->bUsedEncoder = false; - this->bFallingBack = false; - this->iRecursionCount = 0; - } - - WCHAR InternalGetNextChar() - { - WCHAR ch = GetNextChar(); - bFallingBack = (ch != 0); - if (ch == 0) iRecursionCount = 0; - return ch; - } - - // Fallback the current character using the remaining buffer and encoder if necessary - // This can only be called by our encodings (other have to use the public fallback methods), so - // we can use our EncoderNLS here too. - // setEncoder is true if we're calling from a GetBytes method, false if we're calling from a GetByteCount - // - // Note that this could also change the contents of this->encoder, which is the same - // object that the caller is using, so the caller could mess up the encoder for us - // if they aren't careful. - virtual bool InternalFallback(WCHAR ch, WCHAR** chars) - { - // Shouldn't have null charStart - Contract::Assert(charStart != nullptr, - "[EncoderFallback.InternalFallbackBuffer]Fallback buffer is not initialized"); - - // Get our index, remember chars was preincremented to point at next char, so have to -1 - int index = (int)(*chars - charStart) - 1; - - // See if it was a high surrogate - if (Char::IsHighSurrogate(ch)) - { - // See if there's a low surrogate to go with it - if (*chars >= this->charEnd) - { - // Nothing left in input buffer - // No input, return 0 - } - else - { - // Might have a low surrogate - WCHAR cNext = **chars; - if (Char::IsLowSurrogate(cNext)) - { - // If already falling back then fail - if (bFallingBack && iRecursionCount++ > iMaxRecursion) - ThrowLastCharRecursive(ch, cNext); - - // Next is a surrogate, add it as surrogate pair, and increment chars - (*chars)++; - bFallingBack = Fallback(ch, cNext, index); - return bFallingBack; - } - - // Next isn't a low surrogate, just fallback the high surrogate - } - } - - // If already falling back then fail - if (bFallingBack && iRecursionCount++ > iMaxRecursion) - ThrowLastCharRecursive((int)ch); - - // Fall back our char - bFallingBack = Fallback(ch, index); - - return bFallingBack; - } - - // private helper methods - void ThrowLastCharRecursive(WCHAR highSurrogate, WCHAR lowSurrogate) - { - // Throw it, using our complete character - throw ArgumentException("Recursive fallback not allowed", "chars"); - } - - void ThrowLastCharRecursive(int utf32Char) - { - throw ArgumentException("Recursive fallback not allowed", "chars"); - } - -}; - -class EncoderReplacementFallbackBuffer : public EncoderFallbackBuffer -{ - // Store our default string - WCHAR strDefault[4]; - int strDefaultLength; - int fallbackCount = -1; - int fallbackIndex = -1; -public: - // Construction - EncoderReplacementFallbackBuffer(EncoderReplacementFallback* fallback) - { - // 2X in case we're a surrogate pair - wcscpy_s(strDefault, ARRAY_SIZE(strDefault), fallback->GetDefaultString()); - wcscat_s(strDefault, ARRAY_SIZE(strDefault), fallback->GetDefaultString()); - strDefaultLength = 2 * PAL_wcslen((const WCHAR *)fallback->GetDefaultString()); - - } - - // Fallback Methods - virtual bool Fallback(WCHAR charUnknown, int index) - { - // If we had a buffer already we're being recursive, throw, it's probably at the suspect - // character in our array. - if (fallbackCount >= 1) - { - // If we're recursive we may still have something in our buffer that makes this a surrogate - if (Char::IsHighSurrogate(charUnknown) && fallbackCount >= 0 && - Char::IsLowSurrogate(strDefault[fallbackIndex + 1])) - ThrowLastCharRecursive(charUnknown, strDefault[fallbackIndex + 1]); - - // Nope, just one character - ThrowLastCharRecursive((int)charUnknown); - } - - // Go ahead and get our fallback - // Divide by 2 because we aren't a surrogate pair - fallbackCount = strDefaultLength / 2; - fallbackIndex = -1; - - return fallbackCount != 0; - } - - virtual bool Fallback(WCHAR charUnknownHigh, WCHAR charUnknownLow, int index) - { - // Double check input surrogate pair - if (!Char::IsHighSurrogate(charUnknownHigh)) - throw ArgumentOutOfRangeException("charUnknownHigh", - "Argument out of range 0xD800..0xDBFF"); - - if (!Char::IsLowSurrogate(charUnknownLow)) - throw ArgumentOutOfRangeException("charUnknownLow", - "Argument out of range 0xDC00..0xDFFF"); - Contract::EndContractBlock(); - - // If we had a buffer already we're being recursive, throw, it's probably at the suspect - // character in our array. - if (fallbackCount >= 1) - ThrowLastCharRecursive(charUnknownHigh, charUnknownLow); - - // Go ahead and get our fallback - fallbackCount = strDefaultLength; - fallbackIndex = -1; - - return fallbackCount != 0; - } - - virtual WCHAR GetNextChar() - { - // We want it to get < 0 because == 0 means that the current/last character is a fallback - // and we need to detect recursion. We could have a flag but we already have this counter. - fallbackCount--; - fallbackIndex++; - - // Do we have anything left? 0 is now last fallback char, negative is nothing left - if (fallbackCount < 0) - return '\0'; - - // Need to get it out of the buffer. - // Make sure it didn't wrap from the fast count-- path - if (fallbackCount == INT_MAX) - { - fallbackCount = -1; - return '\0'; - } - - // Now make sure its in the expected range - Contract::Assert(fallbackIndex < strDefaultLength && fallbackIndex >= 0, - "Index exceeds buffer range"); - - return strDefault[fallbackIndex]; - } - - virtual bool MovePrevious() - { - // Back up one, only if we just processed the last character (or earlier) - if (fallbackCount >= -1 && fallbackIndex >= 0) - { - fallbackIndex--; - fallbackCount++; - return true; - } - - // Return false 'cause we couldn't do it. - return false; - } - - // How many characters left to output? - virtual int GetRemaining() - { - // Our count is 0 for 1 character left. - return (fallbackCount < 0) ? 0 : fallbackCount; - } - - // Clear the buffer - virtual void Reset() - { - fallbackCount = -1; - fallbackIndex = 0; - charStart = nullptr; - bFallingBack = false; - } -}; - -class EncoderExceptionFallbackBuffer : public EncoderFallbackBuffer -{ -public: - EncoderExceptionFallbackBuffer() - { - } - - virtual bool Fallback(WCHAR charUnknown, int index) - { - // Fall back our char - throw EncoderFallbackException("Unable to translate Unicode character to UTF-8", charUnknown, index); - } - - virtual bool Fallback(WCHAR charUnknownHigh, WCHAR charUnknownLow, int index) - { - if (!Char::IsHighSurrogate(charUnknownHigh)) - { - throw ArgumentOutOfRangeException("charUnknownHigh", - "Argument out of range 0xD800..0xDBFF"); - } - if (!Char::IsLowSurrogate(charUnknownLow)) - { - throw ArgumentOutOfRangeException("charUnknownLow", - "Argument out of range 0xDC00..0xDFFF"); - } - Contract::EndContractBlock(); - - //int iTemp = Char::ConvertToUtf32(charUnknownHigh, charUnknownLow); - - // Fall back our char - throw EncoderFallbackException( - "Unable to translate Unicode character to UTF-8", charUnknownHigh, charUnknownLow, index); - } - - virtual WCHAR GetNextChar() - { - return 0; - } - - virtual bool MovePrevious() - { - // Exception fallback doesn't have anywhere to back up to. - return false; - } - - // Exceptions are always empty - virtual int GetRemaining() - { - return 0; - } -}; - -class EncoderExceptionFallback : public EncoderFallback -{ - // Construction -public: - EncoderExceptionFallback() - { - } - - virtual EncoderFallbackBuffer* CreateFallbackBuffer() - { - return InternalNew(); - } - - // Maximum number of characters that this instance of this fallback could return - virtual int GetMaxCharCount() - { - return 0; - } -}; - -EncoderFallbackBuffer* EncoderReplacementFallback::CreateFallbackBuffer() -{ - return InternalNew(this); -} - -class UTF8Encoding -{ - EncoderFallback* encoderFallback; - // Instances of the two possible fallbacks. The constructor parameter - // determines which one to use. - EncoderReplacementFallback encoderReplacementFallback; - EncoderExceptionFallback encoderExceptionFallback; - - DecoderFallback* decoderFallback; - // Instances of the two possible fallbacks. The constructor parameter - // determines which one to use. - DecoderReplacementFallback decoderReplacementFallback; - DecoderExceptionFallback decoderExceptionFallback; - - bool InRange(WCHAR c, WCHAR begin, WCHAR end) - { - return begin <= c && c <= end; - } - - size_t PtrDiff(WCHAR* ptr1, WCHAR* ptr2) - { - return ptr1 - ptr2; - } - - size_t PtrDiff(BYTE* ptr1, BYTE* ptr2) - { - return ptr1 - ptr2; - } - - void ThrowBytesOverflow() - { - // Special message to include fallback type in case fallback's GetMaxCharCount is broken - // This happens if user has implimented an encoder fallback with a broken GetMaxCharCount - throw InsufficientBufferException("The output byte buffer is too small to contain the encoded data", "bytes"); - } - - void ThrowBytesOverflow(bool nothingEncoded) - { - // Special message to include fallback type in case fallback's GetMaxCharCount is broken - // This happens if user has implimented an encoder fallback with a broken GetMaxCharCount - if (nothingEncoded){ - ThrowBytesOverflow(); - } - } - - void ThrowCharsOverflow() - { - // Special message to include fallback type in case fallback's GetMaxCharCount is broken - // This happens if user has implimented a decoder fallback with a broken GetMaxCharCount - throw InsufficientBufferException("The output char buffer is too small to contain the encoded data", "chars"); - } - - void ThrowCharsOverflow(bool nothingEncoded) - { - // Special message to include fallback type in case fallback's GetMaxCharCount is broken - // This happens if user has implimented an decoder fallback with a broken GetMaxCharCount - if (nothingEncoded){ - ThrowCharsOverflow(); - } - } - - // During GetChars we had an invalid byte sequence - // pSrc is backed up to the start of the bad sequence if we didn't have room to - // fall it back. Otherwise pSrc remains where it is. - bool FallbackInvalidByteSequence(BYTE** pSrc, int ch, DecoderFallbackBuffer* fallback, WCHAR** pTarget) - { - // Get our byte[] - BYTE* pStart = *pSrc; - BYTE bytesUnknown[3]; - int size = GetBytesUnknown(pStart, ch, bytesUnknown); - - // Do the actual fallback - if (!fallback->InternalFallback(bytesUnknown, *pSrc, pTarget, size)) - { - // Oops, it failed, back up to pStart - *pSrc = pStart; - return false; - } - - // It worked - return true; - } - - int FallbackInvalidByteSequence(BYTE* pSrc, int ch, DecoderFallbackBuffer *fallback) - { - // Get our byte[] - BYTE bytesUnknown[3]; - int size = GetBytesUnknown(pSrc, ch, bytesUnknown); - - // Do the actual fallback - int count = fallback->InternalFallback(bytesUnknown, pSrc, size); - - // # of fallback chars expected. - // Note that we only get here for "long" sequences, and have already unreserved - // the count that we prereserved for the input bytes - return count; - } - - int GetBytesUnknown(BYTE* pSrc, int ch, BYTE* bytesUnknown) - { - int size; - - // See if it was a plain char - // (have to check >= 0 because we have all sorts of wierd bit flags) - if (ch < 0x100 && ch >= 0) - { - pSrc--; - bytesUnknown[0] = (BYTE)ch; - size = 1; - } - // See if its an unfinished 2 byte sequence - else if ((ch & (SupplimentarySeq | ThreeByteSeq)) == 0) - { - pSrc--; - bytesUnknown[0] = (BYTE)((ch & 0x1F) | 0xc0); - size = 1; - } - // So now we're either 2nd byte of 3 or 4 byte sequence or - // we hit a non-trail byte or we ran out of space for 3rd byte of 4 byte sequence - // 1st check if its a 4 byte sequence - else if ((ch & SupplimentarySeq) != 0) - { - // 3rd byte of 4 byte sequence? - if ((ch & (FinalByte >> 6)) != 0) - { - // 3rd byte of 4 byte sequence - pSrc -= 3; - bytesUnknown[0] = (BYTE)(((ch >> 12) & 0x07) | 0xF0); - bytesUnknown[1] = (BYTE)(((ch >> 6) & 0x3F) | 0x80); - bytesUnknown[2] = (BYTE)(((ch)& 0x3F) | 0x80); - size = 3; - } - else if ((ch & (FinalByte >> 12)) != 0) - { - // 2nd byte of a 4 byte sequence - pSrc -= 2; - bytesUnknown[0] = (BYTE)(((ch >> 6) & 0x07) | 0xF0); - bytesUnknown[1] = (BYTE)(((ch)& 0x3F) | 0x80); - size = 2; - } - else - { - // 4th byte of a 4 byte sequence - pSrc--; - bytesUnknown[0] = (BYTE)(((ch)& 0x07) | 0xF0); - size = 1; - } - } - else - { - // 2nd byte of 3 byte sequence? - if ((ch & (FinalByte >> 6)) != 0) - { - // So its 2nd byte of a 3 byte sequence - pSrc -= 2; - bytesUnknown[0] = (BYTE)(((ch >> 6) & 0x0F) | 0xE0); - bytesUnknown[1] = (BYTE)(((ch)& 0x3F) | 0x80); - size = 2; - } - else - { - // 1st byte of a 3 byte sequence - pSrc--; - bytesUnknown[0] = (BYTE)(((ch)& 0x0F) | 0xE0); - size = 1; - } - } - - return size; - } - -public: - - UTF8Encoding(bool isThrowException) - : encoderReplacementFallback(W("\xFFFD")), decoderReplacementFallback(W("\xFFFD")) - { - if (isThrowException) - { - encoderFallback = &encoderExceptionFallback; - decoderFallback = &decoderExceptionFallback; - } - else - { - encoderFallback = &encoderReplacementFallback; - decoderFallback = &decoderReplacementFallback; - } - } - - // These are bitmasks used to maintain the state in the decoder. They occupy the higher bits - // while the actual character is being built in the lower bits. They are shifted together - // with the actual bits of the character. - - // bits 30 & 31 are used for pending bits fixup - const int FinalByte = 1 << 29; - const int SupplimentarySeq = 1 << 28; - const int ThreeByteSeq = 1 << 27; - - int GetCharCount(BYTE* bytes, int count) - { - Contract::Assert(bytes != nullptr, "[UTF8Encoding.GetCharCount]bytes!=nullptr"); - Contract::Assert(count >= 0, "[UTF8Encoding.GetCharCount]count >=0"); - - // Initialize stuff - BYTE *pSrc = bytes; - BYTE *pEnd = pSrc + count; - - // Start by assuming we have as many as count, charCount always includes the adjustment - // for the character being decoded - int charCount = count; - int ch = 0; - DecoderFallbackBuffer *fallback = nullptr; - - while (true) - { - // SLOWLOOP: does all range checks, handles all special cases, but it is slow - if (pSrc >= pEnd) { - break; - } - - // read next byte. The JIT optimization seems to be getting confused when - // compiling "ch = *pSrc++;", so rather use "ch = *pSrc; pSrc++;" instead - int cha = *pSrc; - - if (ch == 0) { - // no pending bits - goto ReadChar; - } - - pSrc++; - - // we are expecting to see trailing bytes like 10vvvvvv - if ((cha & 0xC0) != 0x80) { - // This can be a valid starting byte for another UTF8 byte sequence, so let's put - // the current byte back, and try to see if this is a valid byte for another UTF8 byte sequence - pSrc--; - charCount += (ch >> 30); - goto InvalidByteSequence; - } - - // fold in the new byte - ch = (ch << 6) | (cha & 0x3F); - - if ((ch & FinalByte) == 0) { - Contract::Assert((ch & (SupplimentarySeq | ThreeByteSeq)) != 0, - "[UTF8Encoding.GetChars]Invariant volation"); - - if ((ch & SupplimentarySeq) != 0) { - if ((ch & (FinalByte >> 6)) != 0) { - // this is 3rd byte (of 4 byte supplimentary) - nothing to do - continue; - } - - // 2nd byte, check for non-shortest form of supplimentary char and the valid - // supplimentary characters in range 0x010000 - 0x10FFFF at the same time - if (!InRange(ch & 0x1F0, 0x10, 0x100)) { - goto InvalidByteSequence; - } - } - else { - // Must be 2nd byte of a 3-byte sequence - // check for non-shortest form of 3 byte seq - if ((ch & (0x1F << 5)) == 0 || // non-shortest form - (ch & (0xF800 >> 6)) == (0xD800 >> 6)) // illegal individually encoded surrogate - { - goto InvalidByteSequence; - } - } - continue; - } - - // ready to punch - - // adjust for surrogates in non-shortest form - if ((ch & (SupplimentarySeq | 0x1F0000)) == SupplimentarySeq) { - charCount--; - } - goto EncodeChar; - - InvalidByteSequence: - // this code fragment should be close to the gotos referencing it - // Have to do fallback for invalid bytes - if (fallback == nullptr) - { - fallback = decoderFallback->CreateFallbackBuffer(); - fallback->InternalInitialize(bytes, nullptr); - } - charCount += FallbackInvalidByteSequence(pSrc, ch, fallback); - - ch = 0; - continue; - - ReadChar: - ch = *pSrc; - pSrc++; - - ProcessChar: - if (ch > 0x7F) { - // If its > 0x7F, its start of a new multi-byte sequence - - // Long sequence, so unreserve our char. - charCount--; - - // bit 6 has to be non-zero for start of multibyte chars. - if ((ch & 0x40) == 0) { - // Unexpected trail byte - goto InvalidByteSequence; - } - - // start a new long code - if ((ch & 0x20) != 0) { - if ((ch & 0x10) != 0) { - // 4 byte encoding - supplimentary character (2 surrogates) - - ch &= 0x0F; - - // check that bit 4 is zero and the valid supplimentary character - // range 0x000000 - 0x10FFFF at the same time - if (ch > 0x04) { - ch |= 0xf0; - goto InvalidByteSequence; - } - - // Add bit flags so that when we check new characters & rotate we'll be flagged correctly. - // Final byte flag, count fix if we don't make final byte & supplimentary sequence flag. - ch |= (FinalByte >> 3 * 6) | // Final byte is 3 more bytes from now - (1 << 30) | // If it dies on next byte we'll need an extra char - (3 << (30 - 2 * 6)) | // If it dies on last byte we'll need to subtract a char - (SupplimentarySeq) | (SupplimentarySeq >> 6) | - (SupplimentarySeq >> 2 * 6) | (SupplimentarySeq >> 3 * 6); - - // Our character count will be 2 characters for these 4 bytes, so subtract another char - charCount--; - } - else { - // 3 byte encoding - // Add bit flags so that when we check new characters & rotate we'll be flagged correctly. - ch = (ch & 0x0F) | ((FinalByte >> 2 * 6) | (1 << 30) | - (ThreeByteSeq) | (ThreeByteSeq >> 6) | (ThreeByteSeq >> 2 * 6)); - - // We'll expect 1 character for these 3 bytes, so subtract another char. - charCount--; - } - } - else { - // 2 byte encoding - - ch &= 0x1F; - - // check for non-shortest form - if (ch <= 1) { - ch |= 0xc0; - goto InvalidByteSequence; - } - - // Add bit flags so we'll be flagged correctly - ch |= (FinalByte >> 6); - } - continue; - } - - EncodeChar: - -#ifdef FASTLOOP - int availableBytes = PtrDiff(pEnd, pSrc); - - // don't fall into the fast decoding loop if we don't have enough bytes - if (availableBytes <= 13) { - // try to get over the remainder of the ascii characters fast though - BYTE* pLocalEnd = pEnd; // hint to get pLocalEnd enregistered - while (pSrc < pLocalEnd) { - ch = *pSrc; - pSrc++; - - if (ch > 0x7F) - goto ProcessChar; - } - // we are done - ch = 0; - break; - } - - // To compute the upper bound, assume that all characters are ASCII characters at this point, - // the boundary will be decreased for every non-ASCII character we encounter - // Also, we need 7 chars reserve for the unrolled ansi decoding loop and for decoding of multibyte sequences - BYTE *pStop = pSrc + availableBytes - 7; - - while (pSrc < pStop) { - ch = *pSrc; - pSrc++; - - if (ch > 0x7F) { - goto LongCode; - } - - // get pSrc 2-byte aligned - if (((size_t)pSrc & 0x1) != 0) { - ch = *pSrc; - pSrc++; - if (ch > 0x7F) { - goto LongCode; - } - } - - // get pSrc 4-byte aligned - if (((size_t)pSrc & 0x2) != 0) { - ch = *(USHORT*)pSrc; - if ((ch & 0x8080) != 0) { - goto LongCodeWithMask16; - } - pSrc += 2; - } - - - // Run 8 + 8 characters at a time! - while (pSrc < pStop) { - ch = *(int*)pSrc; - int chb = *(int*)(pSrc + 4); - if (((ch | chb) & (int)0x80808080) != 0) { - goto LongCodeWithMask32; - } - pSrc += 8; - - // This is a really small loop - unroll it - if (pSrc >= pStop) - break; - - ch = *(int*)pSrc; - chb = *(int*)(pSrc + 4); - if (((ch | chb) & (int)0x80808080) != 0) { - goto LongCodeWithMask32; - } - pSrc += 8; - } - break; - -#if BIGENDIAN - LongCodeWithMask32 : - // be careful about the sign extension - ch = (int)(((uint)ch) >> 16); - LongCodeWithMask16: - ch = (int)(((uint)ch) >> 8); -#else // BIGENDIAN - LongCodeWithMask32: - LongCodeWithMask16: - ch &= 0xFF; -#endif // BIGENDIAN - pSrc++; - if (ch <= 0x7F) { - continue; - } - - LongCode: - int chc = *pSrc; - pSrc++; - - if ( - // bit 6 has to be zero - (ch & 0x40) == 0 || - // we are expecting to see trailing bytes like 10vvvvvv - (chc & 0xC0) != 0x80) - { - goto BadLongCode; - } - - chc &= 0x3F; - - // start a new long code - if ((ch & 0x20) != 0) { - - // fold the first two bytes together - chc |= (ch & 0x0F) << 6; - - if ((ch & 0x10) != 0) { - // 4 byte encoding - surrogate - ch = *pSrc; - if ( - // check that bit 4 is zero, the non-shortest form of surrogate - // and the valid surrogate range 0x000000 - 0x10FFFF at the same time - !InRange(chc >> 4, 0x01, 0x10) || - // we are expecting to see trailing bytes like 10vvvvvv - (ch & 0xC0) != 0x80) - { - goto BadLongCode; - } - - chc = (chc << 6) | (ch & 0x3F); - - ch = *(pSrc + 1); - // we are expecting to see trailing bytes like 10vvvvvv - if ((ch & 0xC0) != 0x80) { - goto BadLongCode; - } - pSrc += 2; - - // extra byte - charCount--; - } - else { - // 3 byte encoding - ch = *pSrc; - if ( - // check for non-shortest form of 3 byte seq - (chc & (0x1F << 5)) == 0 || - // Can't have surrogates here. - (chc & (0xF800 >> 6)) == (0xD800 >> 6) || - // we are expecting to see trailing bytes like 10vvvvvv - (ch & 0xC0) != 0x80) - { - goto BadLongCode; - } - pSrc++; - - // extra byte - charCount--; - } - } - else { - // 2 byte encoding - - // check for non-shortest form - if ((ch & 0x1E) == 0) { - goto BadLongCode; - } - } - - // extra byte - charCount--; - } -#endif // FASTLOOP - - // no pending bits at this point - ch = 0; - continue; - - BadLongCode: - pSrc -= 2; - ch = 0; - continue; - } - - // May have a problem if we have to flush - if (ch != 0) - { - // We were already adjusting for these, so need to unadjust - charCount += (ch >> 30); - // Have to do fallback for invalid bytes - if (fallback == nullptr) - { - fallback = decoderFallback->CreateFallbackBuffer(); - fallback->InternalInitialize(bytes, nullptr); - } - charCount += FallbackInvalidByteSequence(pSrc, ch, fallback); - } - - // Shouldn't have anything in fallback buffer for GetCharCount - // (don't have to check m_throwOnOverflow for count) - Contract::Assert(fallback == nullptr || fallback->GetRemaining() == 0, - "[UTF8Encoding.GetCharCount]Expected empty fallback buffer at end"); - - InternalDelete(fallback); - - return charCount; - - } - - int GetChars(BYTE* bytes, int byteCount, WCHAR* chars, int charCount) - { - Contract::Assert(chars != nullptr, "[UTF8Encoding.GetChars]chars!=nullptr"); - Contract::Assert(byteCount >= 0, "[UTF8Encoding.GetChars]byteCount >=0"); - Contract::Assert(charCount >= 0, "[UTF8Encoding.GetChars]charCount >=0"); - Contract::Assert(bytes != nullptr, "[UTF8Encoding.GetChars]bytes!=nullptr"); - - BYTE *pSrc = bytes; - WCHAR *pTarget = chars; - - BYTE *pEnd = pSrc + byteCount; - WCHAR *pAllocatedBufferEnd = pTarget + charCount; - - int ch = 0; - - DecoderFallbackBuffer *fallback = nullptr; - - while (true) - { - // SLOWLOOP: does all range checks, handles all special cases, but it is slow - - if (pSrc >= pEnd) { - break; - } - - // read next byte. The JIT optimization seems to be getting confused when - // compiling "ch = *pSrc++;", so rather use "ch = *pSrc; pSrc++;" instead - int cha = *pSrc; - - if (ch == 0) { - // no pending bits - goto ReadChar; - } - - pSrc++; - - // we are expecting to see trailing bytes like 10vvvvvv - if ((cha & 0xC0) != 0x80) { - // This can be a valid starting byte for another UTF8 byte sequence, so let's put - // the current byte back, and try to see if this is a valid byte for another UTF8 byte sequence - pSrc--; - goto InvalidByteSequence; - } - - // fold in the new byte - ch = (ch << 6) | (cha & 0x3F); - - if ((ch & FinalByte) == 0) { - // Not at last byte yet - Contract::Assert((ch & (SupplimentarySeq | ThreeByteSeq)) != 0, - "[UTF8Encoding.GetChars]Invariant volation"); - - if ((ch & SupplimentarySeq) != 0) { - // Its a 4-byte supplimentary sequence - if ((ch & (FinalByte >> 6)) != 0) { - // this is 3rd byte of 4 byte sequence - nothing to do - continue; - } - - // 2nd byte of 4 bytes - // check for non-shortest form of surrogate and the valid surrogate - // range 0x000000 - 0x10FFFF at the same time - if (!InRange(ch & 0x1F0, 0x10, 0x100)) { - goto InvalidByteSequence; - } - } - else { - // Must be 2nd byte of a 3-byte sequence - // check for non-shortest form of 3 byte seq - if ((ch & (0x1F << 5)) == 0 || // non-shortest form - (ch & (0xF800 >> 6)) == (0xD800 >> 6)) // illegal individually encoded surrogate - { - goto InvalidByteSequence; - } - } - continue; - } - - // ready to punch - - // surrogate in shortest form? - // Might be possible to get rid of this? Already did non-shortest check for 4-byte sequence when reading 2nd byte? - if ((ch & (SupplimentarySeq | 0x1F0000)) > SupplimentarySeq) { - // let the range check for the second char throw the exception - if (pTarget < pAllocatedBufferEnd) { - *pTarget = (WCHAR)(((ch >> 10) & 0x7FF) + - (SHORT)((CharUnicodeInfo::HIGH_SURROGATE_START - (0x10000 >> 10)))); - pTarget++; - - ch = (ch & 0x3FF) + - (int)(CharUnicodeInfo::LOW_SURROGATE_START); - } - } - - goto EncodeChar; - - InvalidByteSequence: - // this code fragment should be close to the gotos referencing it - // Have to do fallback for invalid bytes - if (fallback == nullptr) - { - fallback = decoderFallback->CreateFallbackBuffer(); - fallback->InternalInitialize(bytes, pAllocatedBufferEnd); - } - - // That'll back us up the appropriate # of bytes if we didn't get anywhere - if (!FallbackInvalidByteSequence(&pSrc, ch, fallback, &pTarget)) - { - // Ran out of buffer space - // Need to throw an exception? - Contract::Assert(pSrc >= bytes || pTarget == chars, - "[UTF8Encoding.GetChars]Expected to throw or remain in byte buffer after fallback"); - fallback->InternalReset(); - ThrowCharsOverflow(pTarget == chars); - ch = 0; - break; - } - Contract::Assert(pSrc >= bytes, - "[UTF8Encoding.GetChars]Expected invalid byte sequence to have remained within the byte array"); - ch = 0; - continue; - - ReadChar: - ch = *pSrc; - pSrc++; - - ProcessChar: - if (ch > 0x7F) { - // If its > 0x7F, its start of a new multi-byte sequence - - // bit 6 has to be non-zero - if ((ch & 0x40) == 0) { - goto InvalidByteSequence; - } - - // start a new long code - if ((ch & 0x20) != 0) { - if ((ch & 0x10) != 0) { - // 4 byte encoding - supplimentary character (2 surrogates) - - ch &= 0x0F; - - // check that bit 4 is zero and the valid supplimentary character - // range 0x000000 - 0x10FFFF at the same time - if (ch > 0x04) { - ch |= 0xf0; - goto InvalidByteSequence; - } - - ch |= (FinalByte >> 3 * 6) | (1 << 30) | (3 << (30 - 2 * 6)) | - (SupplimentarySeq) | (SupplimentarySeq >> 6) | - (SupplimentarySeq >> 2 * 6) | (SupplimentarySeq >> 3 * 6); - } - else { - // 3 byte encoding - ch = (ch & 0x0F) | ((FinalByte >> 2 * 6) | (1 << 30) | - (ThreeByteSeq) | (ThreeByteSeq >> 6) | (ThreeByteSeq >> 2 * 6)); - } - } - else { - // 2 byte encoding - - ch &= 0x1F; - - // check for non-shortest form - if (ch <= 1) { - ch |= 0xc0; - goto InvalidByteSequence; - } - - ch |= (FinalByte >> 6); - } - continue; - } - - EncodeChar: - // write the pending character - if (pTarget >= pAllocatedBufferEnd) - { - // Fix chars so we make sure to throw if we didn't output anything - ch &= 0x1fffff; - if (ch > 0x7f) - { - if (ch > 0x7ff) - { - if (ch >= CharUnicodeInfo::LOW_SURROGATE_START && - ch <= CharUnicodeInfo::LOW_SURROGATE_END) - { - pSrc--; // It was 4 bytes - pTarget--; // 1 was stored already, but we can't remember 1/2, so back up - } - else if (ch > 0xffff) - { - pSrc--; // It was 4 bytes, nothing was stored - } - pSrc--; // It was at least 3 bytes - } - pSrc--; // It was at least 2 bytes - } - pSrc--; - - // Throw that we don't have enough room (pSrc could be < chars if we had started to process - // a 4 byte sequence already) - Contract::Assert(pSrc >= bytes || pTarget == chars, - "[UTF8Encoding.GetChars]Expected pSrc to be within input buffer or throw due to no output]"); - ThrowCharsOverflow(pTarget == chars); - - // Don't store ch in decoder, we already backed up to its start - ch = 0; - - // Didn't throw, just use this buffer size. - break; - } - *pTarget = (WCHAR)ch; - pTarget++; - -#ifdef FASTLOOP - int availableChars = PtrDiff(pAllocatedBufferEnd, pTarget); - int availableBytes = PtrDiff(pEnd, pSrc); - - // don't fall into the fast decoding loop if we don't have enough bytes - // Test for availableChars is done because pStop would be <= pTarget. - if (availableBytes <= 13) { - // we may need as many as 1 character per byte - if (availableChars < availableBytes) { - // not enough output room. no pending bits at this point - ch = 0; - continue; - } - - // try to get over the remainder of the ascii characters fast though - BYTE* pLocalEnd = pEnd; // hint to get pLocalEnd enregistered - while (pSrc < pLocalEnd) { - ch = *pSrc; - pSrc++; - - if (ch > 0x7F) - goto ProcessChar; - - *pTarget = (WCHAR)ch; - pTarget++; - } - // we are done - ch = 0; - break; - } - - // we may need as many as 1 character per byte, so reduce the byte count if necessary. - // If availableChars is too small, pStop will be before pTarget and we won't do fast loop. - if (availableChars < availableBytes) { - availableBytes = availableChars; - } - - // To compute the upper bound, assume that all characters are ASCII characters at this point, - // the boundary will be decreased for every non-ASCII character we encounter - // Also, we need 7 chars reserve for the unrolled ansi decoding loop and for decoding of multibyte sequences - WCHAR *pStop = pTarget + availableBytes - 7; - - while (pTarget < pStop) { - ch = *pSrc; - pSrc++; - - if (ch > 0x7F) { - goto LongCode; - } - *pTarget = (WCHAR)ch; - pTarget++; - - // get pSrc to be 2-byte aligned - if ((((size_t)pSrc) & 0x1) != 0) { - ch = *pSrc; - pSrc++; - if (ch > 0x7F) { - goto LongCode; - } - *pTarget = (WCHAR)ch; - pTarget++; - } - - // get pSrc to be 4-byte aligned - if ((((size_t)pSrc) & 0x2) != 0) { - ch = *(USHORT*)pSrc; - if ((ch & 0x8080) != 0) { - goto LongCodeWithMask16; - } - - // Unfortunately, this is endianess sensitive -#if BIGENDIAN - *pTarget = (WCHAR)((ch >> 8) & 0x7F); - pSrc += 2; - *(pTarget + 1) = (WCHAR)(ch & 0x7F); - pTarget += 2; -#else // BIGENDIAN - *pTarget = (WCHAR)(ch & 0x7F); - pSrc += 2; - *(pTarget + 1) = (WCHAR)((ch >> 8) & 0x7F); - pTarget += 2; -#endif // BIGENDIAN - } - - // Run 8 characters at a time! - while (pTarget < pStop) { - ch = *(int*)pSrc; - int chb = *(int*)(pSrc + 4); - if (((ch | chb) & (int)0x80808080) != 0) { - goto LongCodeWithMask32; - } - - // Unfortunately, this is endianess sensitive -#if BIGENDIAN - *pTarget = (WCHAR)((ch >> 24) & 0x7F); - *(pTarget + 1) = (WCHAR)((ch >> 16) & 0x7F); - *(pTarget + 2) = (WCHAR)((ch >> 8) & 0x7F); - *(pTarget + 3) = (WCHAR)(ch & 0x7F); - pSrc += 8; - *(pTarget + 4) = (WCHAR)((chb >> 24) & 0x7F); - *(pTarget + 5) = (WCHAR)((chb >> 16) & 0x7F); - *(pTarget + 6) = (WCHAR)((chb >> 8) & 0x7F); - *(pTarget + 7) = (WCHAR)(chb & 0x7F); - pTarget += 8; -#else // BIGENDIAN - *pTarget = (WCHAR)(ch & 0x7F); - *(pTarget + 1) = (WCHAR)((ch >> 8) & 0x7F); - *(pTarget + 2) = (WCHAR)((ch >> 16) & 0x7F); - *(pTarget + 3) = (WCHAR)((ch >> 24) & 0x7F); - pSrc += 8; - *(pTarget + 4) = (WCHAR)(chb & 0x7F); - *(pTarget + 5) = (WCHAR)((chb >> 8) & 0x7F); - *(pTarget + 6) = (WCHAR)((chb >> 16) & 0x7F); - *(pTarget + 7) = (WCHAR)((chb >> 24) & 0x7F); - pTarget += 8; -#endif // BIGENDIAN - } - break; - -#if BIGENDIAN - LongCodeWithMask32 : - // be careful about the sign extension - ch = (int)(((uint)ch) >> 16); - LongCodeWithMask16: - ch = (int)(((uint)ch) >> 8); -#else // BIGENDIAN - LongCodeWithMask32: - LongCodeWithMask16: - ch &= 0xFF; -#endif // BIGENDIAN - pSrc++; - if (ch <= 0x7F) { - *pTarget = (WCHAR)ch; - pTarget++; - continue; - } - - LongCode: - int chc = *pSrc; - pSrc++; - - if ( - // bit 6 has to be zero - (ch & 0x40) == 0 || - // we are expecting to see trailing bytes like 10vvvvvv - (chc & 0xC0) != 0x80) - { - goto BadLongCode; - } - - chc &= 0x3F; - - // start a new long code - if ((ch & 0x20) != 0) { - - // fold the first two bytes together - chc |= (ch & 0x0F) << 6; - - if ((ch & 0x10) != 0) { - // 4 byte encoding - surrogate - ch = *pSrc; - if ( - // check that bit 4 is zero, the non-shortest form of surrogate - // and the valid surrogate range 0x000000 - 0x10FFFF at the same time - !InRange(chc >> 4, 0x01, 0x10) || - // we are expecting to see trailing bytes like 10vvvvvv - (ch & 0xC0) != 0x80) - { - goto BadLongCode; - } - - chc = (chc << 6) | (ch & 0x3F); - - ch = *(pSrc + 1); - // we are expecting to see trailing bytes like 10vvvvvv - if ((ch & 0xC0) != 0x80) { - goto BadLongCode; - } - pSrc += 2; - - ch = (chc << 6) | (ch & 0x3F); - - *pTarget = (WCHAR)(((ch >> 10) & 0x7FF) + - (SHORT)(CharUnicodeInfo::HIGH_SURROGATE_START - (0x10000 >> 10))); - pTarget++; - - ch = (ch & 0x3FF) + - (SHORT)(CharUnicodeInfo::LOW_SURROGATE_START); - - // extra byte, we're already planning 2 chars for 2 of these bytes, - // but the big loop is testing the target against pStop, so we need - // to subtract 2 more or we risk overrunning the input. Subtract - // one here and one below. - pStop--; - } - else { - // 3 byte encoding - ch = *pSrc; - if ( - // check for non-shortest form of 3 byte seq - (chc & (0x1F << 5)) == 0 || - // Can't have surrogates here. - (chc & (0xF800 >> 6)) == (0xD800 >> 6) || - // we are expecting to see trailing bytes like 10vvvvvv - (ch & 0xC0) != 0x80) - { - goto BadLongCode; - } - pSrc++; - - ch = (chc << 6) | (ch & 0x3F); - - // extra byte, we're only expecting 1 char for each of these 3 bytes, - // but the loop is testing the target (not source) against pStop, so - // we need to subtract 2 more or we risk overrunning the input. - // Subtract 1 here and one more below - pStop--; - } - } - else { - // 2 byte encoding - - ch &= 0x1F; - - // check for non-shortest form - if (ch <= 1) { - goto BadLongCode; - } - ch = (ch << 6) | chc; - } - - *pTarget = (WCHAR)ch; - pTarget++; - - // extra byte, we're only expecting 1 char for each of these 2 bytes, - // but the loop is testing the target (not source) against pStop. - // subtract an extra count from pStop so that we don't overrun the input. - pStop--; - } -#endif // FASTLOOP - - Contract::Assert(pTarget <= pAllocatedBufferEnd, "[UTF8Encoding.GetChars]pTarget <= pAllocatedBufferEnd"); - - // no pending bits at this point - ch = 0; - continue; - - BadLongCode: - pSrc -= 2; - ch = 0; - continue; - } - - if (ch != 0) - { - // Have to do fallback for invalid bytes - if (fallback == nullptr) - { - fallback = decoderFallback->CreateFallbackBuffer(); - fallback->InternalInitialize(bytes, pAllocatedBufferEnd); - } - - // This'll back us up the appropriate # of bytes if we didn't get anywhere - if (!FallbackInvalidByteSequence(pSrc, ch, fallback)) - { - Contract::Assert(pSrc >= bytes || pTarget == chars, - "[UTF8Encoding.GetChars]Expected to throw or remain in byte buffer while flushing"); - - // Ran out of buffer space - // Need to throw an exception? - fallback->InternalReset(); - ThrowCharsOverflow(pTarget == chars); - } - Contract::Assert(pSrc >= bytes, - "[UTF8Encoding.GetChars]Expected flushing invalid byte sequence to have remained within the byte array"); - ch = 0; - } - - // Shouldn't have anything in fallback buffer for GetChars - // (don't have to check m_throwOnOverflow for chars) - Contract::Assert(fallback == nullptr || fallback->GetRemaining() == 0, - "[UTF8Encoding.GetChars]Expected empty fallback buffer at end"); - - InternalDelete(fallback); - - return PtrDiff(pTarget, chars); - } - - int GetBytes(WCHAR* chars, int charCount, BYTE* bytes, int byteCount) - { - Contract::Assert(chars != nullptr, "[UTF8Encoding.GetBytes]chars!=nullptr"); - Contract::Assert(byteCount >= 0, "[UTF8Encoding.GetBytes]byteCount >=0"); - Contract::Assert(charCount >= 0, "[UTF8Encoding.GetBytes]charCount >=0"); - Contract::Assert(bytes != nullptr, "[UTF8Encoding.GetBytes]bytes!=nullptr"); - - // For fallback we may need a fallback buffer. - // We wait to initialize it though in case we don't have any broken input unicode - EncoderFallbackBuffer* fallbackBuffer = nullptr; - WCHAR *pSrc = chars; - BYTE *pTarget = bytes; - - WCHAR *pEnd = pSrc + charCount; - BYTE *pAllocatedBufferEnd = pTarget + byteCount; - - int ch = 0; - - // assume that JIT will enregister pSrc, pTarget and ch - - while (true) { - // SLOWLOOP: does all range checks, handles all special cases, but it is slow - - if (pSrc >= pEnd) { - - if (ch == 0) { - // Check if there's anything left to get out of the fallback buffer - ch = fallbackBuffer != nullptr ? fallbackBuffer->InternalGetNextChar() : 0; - if (ch > 0) { - goto ProcessChar; - } - } - else { - // Case of leftover surrogates in the fallback buffer - if (fallbackBuffer != nullptr && fallbackBuffer->bFallingBack) { - Contract::Assert(ch >= 0xD800 && ch <= 0xDBFF, - "[UTF8Encoding.GetBytes]expected high surrogate"); //, not 0x" + ((int)ch).ToString("X4", CultureInfo.InvariantCulture)); - - int cha = ch; - - ch = fallbackBuffer->InternalGetNextChar(); - - if (InRange(ch, CharUnicodeInfo::LOW_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) { - ch = ch + (cha << 10) + (0x10000 - CharUnicodeInfo::LOW_SURROGATE_START - (CharUnicodeInfo::HIGH_SURROGATE_START << 10)); - goto EncodeChar; - } - else if (ch > 0){ - goto ProcessChar; - } - else { - break; - } - } - } - - // attempt to encode the partial surrogate (will fail or ignore) - if (ch > 0) - goto EncodeChar; - - // We're done - break; - } - - if (ch > 0) { - // We have a high surrogate left over from a previous loop. - Contract::Assert(ch >= 0xD800 && ch <= 0xDBFF, - "[UTF8Encoding.GetBytes]expected high surrogate");//, not 0x" + ((int)ch).ToString("X4", CultureInfo.InvariantCulture)); - - // use separate helper variables for local contexts so that the jit optimizations - // won't get confused about the variable lifetimes - int cha = *pSrc; - - // In previous byte, we encountered a high surrogate, so we are expecting a low surrogate here. - // if (IsLowSurrogate(cha)) { - if (InRange(cha, CharUnicodeInfo::LOW_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) { - ch = cha + (ch << 10) + - (0x10000 - - CharUnicodeInfo::LOW_SURROGATE_START - - (CharUnicodeInfo::HIGH_SURROGATE_START << 10)); - - pSrc++; - } - // else ch is still high surrogate and encoding will fail - - // attempt to encode the surrogate or partial surrogate - goto EncodeChar; - } - - // If we've used a fallback, then we have to check for it - if (fallbackBuffer != nullptr) - { - ch = fallbackBuffer->InternalGetNextChar(); - if (ch > 0) goto ProcessChar; - } - - // read next char. The JIT optimization seems to be getting confused when - // compiling "ch = *pSrc++;", so rather use "ch = *pSrc; pSrc++;" instead - ch = *pSrc; - pSrc++; - - ProcessChar: - if (InRange(ch, CharUnicodeInfo::HIGH_SURROGATE_START, CharUnicodeInfo::HIGH_SURROGATE_END)) { - continue; - } - // either good char or partial surrogate - - EncodeChar: - // throw exception on partial surrogate if necessary - if (InRange(ch, CharUnicodeInfo::HIGH_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) - { - // Lone surrogates aren't allowed, we have to do fallback for them - // Have to make a fallback buffer if we don't have one - if (fallbackBuffer == nullptr) - { - // wait on fallbacks if we can - // For fallback we may need a fallback buffer - fallbackBuffer = encoderFallback->CreateFallbackBuffer(); - - // Set our internal fallback interesting things. - fallbackBuffer->InternalInitialize(chars, pEnd, true); - } - - // Do our fallback. Actually we already know its a mixed up surrogate, - // so the ref pSrc isn't gonna do anything. - fallbackBuffer->InternalFallback((WCHAR)ch, &pSrc); - - // Ignore it if we don't throw - ch = 0; - continue; - } - - // Count bytes needed - int bytesNeeded = 1; - if (ch > 0x7F) { - if (ch > 0x7FF) { - if (ch > 0xFFFF) { - bytesNeeded++; // 4 bytes (surrogate pair) - } - bytesNeeded++; // 3 bytes (800-FFFF) - } - bytesNeeded++; // 2 bytes (80-7FF) - } - - if (pTarget > pAllocatedBufferEnd - bytesNeeded) { - // Left over surrogate from last time will cause pSrc == chars, so we'll throw - if (fallbackBuffer != nullptr && fallbackBuffer->bFallingBack) - { - fallbackBuffer->MovePrevious(); // Didn't use this fallback char - if (ch > 0xFFFF) - fallbackBuffer->MovePrevious(); // Was surrogate, didn't use 2nd part either - } - else - { - pSrc--; // Didn't use this char - if (ch > 0xFFFF) - pSrc--; // Was surrogate, didn't use 2nd part either - } - Contract::Assert(pSrc >= chars || pTarget == bytes, - "[UTF8Encoding.GetBytes]Expected pSrc to be within buffer or to throw with insufficient room."); - ThrowBytesOverflow(pTarget == bytes); // Throw if we must - ch = 0; // Nothing left over (we backed up to start of pair if supplimentary) - break; - } - - if (ch <= 0x7F) { - *pTarget = (BYTE)ch; - } - else { - // use separate helper variables for local contexts so that the jit optimizations - // won't get confused about the variable lifetimes - int chb; - if (ch <= 0x7FF) { - // 2 BYTE encoding - chb = (BYTE)(0xC0 | (ch >> 6)); - } - else - { - if (ch <= 0xFFFF) { - chb = (BYTE)(0xE0 | (ch >> 12)); - } - else - { - *pTarget = (BYTE)(0xF0 | (ch >> 18)); - pTarget++; - - chb = 0x80 | ((ch >> 12) & 0x3F); - } - *pTarget = (BYTE)chb; - pTarget++; - - chb = 0x80 | ((ch >> 6) & 0x3F); - } - *pTarget = (BYTE)chb; - pTarget++; - - *pTarget = (BYTE)0x80 | (ch & 0x3F); - } - pTarget++; - - -#ifdef FASTLOOP - // If still have fallback don't do fast loop - if (fallbackBuffer != nullptr && (ch = fallbackBuffer->InternalGetNextChar()) != 0) - goto ProcessChar; - - int availableChars = PtrDiff(pEnd, pSrc); - int availableBytes = PtrDiff(pAllocatedBufferEnd, pTarget); - - // don't fall into the fast decoding loop if we don't have enough characters - // Note that if we don't have enough bytes, pStop will prevent us from entering the fast loop. - if (availableChars <= 13) { - // we are hoping for 1 BYTE per char - if (availableBytes < availableChars) { - // not enough output room. no pending bits at this point - ch = 0; - continue; - } - - // try to get over the remainder of the ascii characters fast though - WCHAR* pLocalEnd = pEnd; // hint to get pLocalEnd enregistered - while (pSrc < pLocalEnd) { - ch = *pSrc; - pSrc++; - - // Not ASCII, need more than 1 BYTE per char - if (ch > 0x7F) - goto ProcessChar; - - *pTarget = (BYTE)ch; - pTarget++; - } - // we are done, let ch be 0 to clear encoder - ch = 0; - break; - } - - // we need at least 1 BYTE per character, but Convert might allow us to convert - // only part of the input, so try as much as we can. Reduce charCount if necessary - if (availableBytes < availableChars) - { - availableChars = availableBytes; - } - - // FASTLOOP: - // - optimistic range checks - // - fallbacks to the slow loop for all special cases, exception throwing, etc. - - // To compute the upper bound, assume that all characters are ASCII characters at this point, - // the boundary will be decreased for every non-ASCII character we encounter - // Also, we need 5 chars reserve for the unrolled ansi decoding loop and for decoding of surrogates - // If there aren't enough bytes for the output, then pStop will be <= pSrc and will bypass the loop. - WCHAR *pStop = pSrc + availableChars - 5; - - while (pSrc < pStop) { - ch = *pSrc; - pSrc++; - - if (ch > 0x7F) { - goto LongCode; - } - *pTarget = (BYTE)ch; - pTarget++; - - // get pSrc aligned - if (((size_t)pSrc & 0x2) != 0) { - ch = *pSrc; - pSrc++; - if (ch > 0x7F) { - goto LongCode; - } - *pTarget = (BYTE)ch; - pTarget++; - } - - // Run 4 characters at a time! - while (pSrc < pStop) { - ch = *(int*)pSrc; - int chc = *(int*)(pSrc + 2); - if (((ch | chc) & (int)0xFF80FF80) != 0) { - goto LongCodeWithMask; - } - - // Unfortunately, this is endianess sensitive -#if BIGENDIAN - *pTarget = (BYTE)(ch >> 16); - *(pTarget + 1) = (BYTE)ch; - pSrc += 4; - *(pTarget + 2) = (BYTE)(chc >> 16); - *(pTarget + 3) = (BYTE)chc; - pTarget += 4; -#else // BIGENDIAN - *pTarget = (BYTE)ch; - *(pTarget + 1) = (BYTE)(ch >> 16); - pSrc += 4; - *(pTarget + 2) = (BYTE)chc; - *(pTarget + 3) = (BYTE)(chc >> 16); - pTarget += 4; -#endif // BIGENDIAN - } - continue; - - LongCodeWithMask: -#if BIGENDIAN - // be careful about the sign extension - ch = (int)(((uint)ch) >> 16); -#else // BIGENDIAN - ch = (WCHAR)ch; -#endif // BIGENDIAN - pSrc++; - - if (ch > 0x7F) { - goto LongCode; - } - *pTarget = (BYTE)ch; - pTarget++; - continue; - - LongCode: - // use separate helper variables for slow and fast loop so that the jit optimizations - // won't get confused about the variable lifetimes - int chd; - if (ch <= 0x7FF) { - // 2 BYTE encoding - chd = 0xC0 | (ch >> 6); - } - else { - if (!InRange(ch, CharUnicodeInfo::HIGH_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) { - // 3 BYTE encoding - chd = 0xE0 | (ch >> 12); - } - else - { - // 4 BYTE encoding - high surrogate + low surrogate - if (ch > CharUnicodeInfo::HIGH_SURROGATE_END) { - // low without high -> bad, try again in slow loop - pSrc -= 1; - break; - } - - chd = *pSrc; - pSrc++; - - // if (!IsLowSurrogate(chd)) { - if (!InRange(chd, CharUnicodeInfo::LOW_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) { - // high not followed by low -> bad, try again in slow loop - pSrc -= 2; - break; - } - - ch = chd + (ch << 10) + - (0x10000 - - CharUnicodeInfo::LOW_SURROGATE_START - - (CharUnicodeInfo::HIGH_SURROGATE_START << 10)); - - *pTarget = (BYTE)(0xF0 | (ch >> 18)); - // pStop - this BYTE is compensated by the second surrogate character - // 2 input chars require 4 output bytes. 2 have been anticipated already - // and 2 more will be accounted for by the 2 pStop-- calls below. - pTarget++; - - chd = 0x80 | ((ch >> 12) & 0x3F); - } - *pTarget = (BYTE)chd; - pStop--; // 3 BYTE sequence for 1 char, so need pStop-- and the one below too. - pTarget++; - - chd = 0x80 | ((ch >> 6) & 0x3F); - } - *pTarget = (BYTE)chd; - pStop--; // 2 BYTE sequence for 1 char so need pStop--. - pTarget++; - - *pTarget = (BYTE)(0x80 | (ch & 0x3F)); - // pStop - this BYTE is already included - pTarget++; - } - - Contract::Assert(pTarget <= pAllocatedBufferEnd, "[UTF8Encoding.GetBytes]pTarget <= pAllocatedBufferEnd"); - -#endif // FASTLOOP - - // no pending char at this point - ch = 0; - } - - InternalDelete(fallbackBuffer); - - return (int)(pTarget - bytes); - } - - int GetByteCount(WCHAR *chars, int count) - { - // For fallback we may need a fallback buffer. - // We wait to initialize it though in case we don't have any broken input unicode - EncoderFallbackBuffer* fallbackBuffer = nullptr; - WCHAR *pSrc = chars; - WCHAR *pEnd = pSrc + count; - - // Start by assuming we have as many as count - int byteCount = count; - - int ch = 0; - - while (true) { - // SLOWLOOP: does all range checks, handles all special cases, but it is slow - if (pSrc >= pEnd) { - - if (ch == 0) { - // Unroll any fallback that happens at the end - ch = fallbackBuffer != nullptr ? fallbackBuffer->InternalGetNextChar() : 0; - if (ch > 0) { - byteCount++; - goto ProcessChar; - } - } - else { - // Case of surrogates in the fallback. - if (fallbackBuffer != nullptr && fallbackBuffer->bFallingBack) { - Contract::Assert(ch >= 0xD800 && ch <= 0xDBFF, - "[UTF8Encoding.GetBytes]expected high surrogate");// , not 0x" + ((int)ch).ToString("X4", CultureInfo.InvariantCulture)); - - ch = fallbackBuffer->InternalGetNextChar(); - byteCount++; - - if (InRange(ch, CharUnicodeInfo::LOW_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) { - ch = 0xfffd; - byteCount++; - goto EncodeChar; - } - else if (ch > 0){ - goto ProcessChar; - } - else { - byteCount--; // ignore last one. - break; - } - } - } - - if (ch <= 0) { - break; - } - - // attempt to encode the partial surrogate (will fallback or ignore it), it'll also subtract 1. - byteCount++; - goto EncodeChar; - } - - if (ch > 0) { - Contract::Assert(ch >= 0xD800 && ch <= 0xDBFF, - "[UTF8Encoding.GetBytes]expected high surrogate"); // , not 0x" + ((int)ch).ToString("X4", CultureInfo.InvariantCulture)); - - // use separate helper variables for local contexts so that the jit optimizations - // won't get confused about the variable lifetimes - int cha = *pSrc; - - // count the pending surrogate - byteCount++; - - // In previous byte, we encountered a high surrogate, so we are expecting a low surrogate here. - // if (IsLowSurrogate(cha)) { - if (InRange(cha, CharUnicodeInfo::LOW_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) { - // Don't need a real # because we're just counting, anything > 0x7ff ('cept surrogate) will do. - ch = 0xfffd; - // ch = cha + (ch << 10) + - // (0x10000 - // - CharUnicodeInfo::LOW_SURROGATE_START - // - (CharUnicodeInfo::HIGH_SURROGATE_START << 10) ); - - // Use this next char - pSrc++; - } - // else ch is still high surrogate and encoding will fail (so don't add count) - - // attempt to encode the surrogate or partial surrogate - goto EncodeChar; - } - - // If we've used a fallback, then we have to check for it - if (fallbackBuffer != nullptr) - { - ch = fallbackBuffer->InternalGetNextChar(); - if (ch > 0) - { - // We have an extra byte we weren't expecting. - byteCount++; - goto ProcessChar; - } - } - - // read next char. The JIT optimization seems to be getting confused when - // compiling "ch = *pSrc++;", so rather use "ch = *pSrc; pSrc++;" instead - ch = *pSrc; - pSrc++; - - ProcessChar: - if (InRange(ch, CharUnicodeInfo::HIGH_SURROGATE_START, CharUnicodeInfo::HIGH_SURROGATE_END)) { - // we will count this surrogate next time around - byteCount--; - continue; - } - // either good char or partial surrogate - - EncodeChar: - // throw exception on partial surrogate if necessary - if (InRange(ch, CharUnicodeInfo::HIGH_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) - { - // Lone surrogates aren't allowed - // Have to make a fallback buffer if we don't have one - if (fallbackBuffer == nullptr) - { - // wait on fallbacks if we can - // For fallback we may need a fallback buffer - fallbackBuffer = encoderFallback->CreateFallbackBuffer(); - - // Set our internal fallback interesting things. - fallbackBuffer->InternalInitialize(chars, chars + count, false); - } - - // Do our fallback. Actually we already know its a mixed up surrogate, - // so the ref pSrc isn't gonna do anything. - fallbackBuffer->InternalFallback((WCHAR)ch, &pSrc); - - // Ignore it if we don't throw (we had preallocated this ch) - byteCount--; - ch = 0; - continue; - } - - // Count them - if (ch > 0x7F) { - if (ch > 0x7FF) { - // the extra surrogate byte was compensated by the second surrogate character - // (2 surrogates make 4 bytes. We've already counted 2 bytes, 1 per char) - byteCount++; - } - byteCount++; - } - -#if WIN64 - // check for overflow - if (byteCount < 0) { - break; - } -#endif - -#ifdef FASTLOOP - // If still have fallback don't do fast loop - if (fallbackBuffer != nullptr && (ch = fallbackBuffer->InternalGetNextChar()) != 0) - { - // We're reserving 1 byte for each char by default - byteCount++; - goto ProcessChar; - } - - int availableChars = PtrDiff(pEnd, pSrc); - - // don't fall into the fast decoding loop if we don't have enough characters - if (availableChars <= 13) { - // try to get over the remainder of the ascii characters fast though - WCHAR* pLocalEnd = pEnd; // hint to get pLocalEnd enregistered - while (pSrc < pLocalEnd) { - ch = *pSrc; - pSrc++; - if (ch > 0x7F) - goto ProcessChar; - } - - // we are done - break; - } - -#if WIN64 - // make sure that we won't get a silent overflow inside the fast loop - // (Fall out to slow loop if we have this many characters) - availableChars &= 0x0FFFFFFF; -#endif - - // To compute the upper bound, assume that all characters are ASCII characters at this point, - // the boundary will be decreased for every non-ASCII character we encounter - // Also, we need 3 + 4 chars reserve for the unrolled ansi decoding loop and for decoding of surrogates - WCHAR *pStop = pSrc + availableChars - (3 + 4); - - while (pSrc < pStop) { - ch = *pSrc; - pSrc++; - - if (ch > 0x7F) // Not ASCII - { - if (ch > 0x7FF) // Not 2 Byte - { - if ((ch & 0xF800) == 0xD800) // See if its a Surrogate - goto LongCode; - byteCount++; - } - byteCount++; - } - - // get pSrc aligned - if (((size_t)pSrc & 0x2) != 0) { - ch = *pSrc; - pSrc++; - if (ch > 0x7F) // Not ASCII - { - if (ch > 0x7FF) // Not 2 Byte - { - if ((ch & 0xF800) == 0xD800) // See if its a Surrogate - goto LongCode; - byteCount++; - } - byteCount++; - } - } - - // Run 2 * 4 characters at a time! - while (pSrc < pStop) { - ch = *(int*)pSrc; - int chc = *(int*)(pSrc + 2); - if (((ch | chc) & (int)0xFF80FF80) != 0) // See if not ASCII - { - if (((ch | chc) & (int)0xF800F800) != 0) // See if not 2 Byte - { - goto LongCodeWithMask; - } - - - if ((ch & (int)0xFF800000) != 0) // Actually 0x07800780 is all we care about (4 bits) - byteCount++; - if ((ch & (int)0xFF80) != 0) - byteCount++; - if ((chc & (int)0xFF800000) != 0) - byteCount++; - if ((chc & (int)0xFF80) != 0) - byteCount++; - } - pSrc += 4; - - ch = *(int*)pSrc; - chc = *(int*)(pSrc + 2); - if (((ch | chc) & (int)0xFF80FF80) != 0) // See if not ASCII - { - if (((ch | chc) & (int)0xF800F800) != 0) // See if not 2 Byte - { - goto LongCodeWithMask; - } - - if ((ch & (int)0xFF800000) != 0) - byteCount++; - if ((ch & (int)0xFF80) != 0) - byteCount++; - if ((chc & (int)0xFF800000) != 0) - byteCount++; - if ((chc & (int)0xFF80) != 0) - byteCount++; - } - pSrc += 4; - } - break; - - LongCodeWithMask: -#if BIGENDIAN - // be careful about the sign extension - ch = (int)(((uint)ch) >> 16); -#else // BIGENDIAN - ch = (WCHAR)ch; -#endif // BIGENDIAN - pSrc++; - - if (ch <= 0x7F) { - continue; - } - - LongCode: - // use separate helper variables for slow and fast loop so that the jit optimizations - // won't get confused about the variable lifetimes - if (ch > 0x7FF) { - if (InRange(ch, CharUnicodeInfo::HIGH_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) { - // 4 byte encoding - high surrogate + low surrogate - - int chd = *pSrc; - if ( - ch > CharUnicodeInfo::HIGH_SURROGATE_END || - !InRange(chd, CharUnicodeInfo::LOW_SURROGATE_START, CharUnicodeInfo::LOW_SURROGATE_END)) - { - // Back up and drop out to slow loop to figure out error - pSrc--; - break; - } - pSrc++; - - // byteCount - this byte is compensated by the second surrogate character - } - byteCount++; - } - byteCount++; - - // byteCount - the last byte is already included - } -#endif // FASTLOOP - - // no pending char at this point - ch = 0; - } - -#if WIN64 - // check for overflow - if (byteCount < 0) { - throw ArgumentException("Conversion buffer overflow."); - } -#endif - - Contract::Assert(fallbackBuffer == nullptr || fallbackBuffer->GetRemaining() == 0, - "[UTF8Encoding.GetByteCount]Expected Empty fallback buffer"); - - InternalDelete(fallbackBuffer); - - return byteCount; - } - -}; - - -//////////////////////////////////////////////////////////////////////////// -// -// UTF8ToUnicode -// -// Maps a UTF-8 character string to its wide character string counterpart. -// -//////////////////////////////////////////////////////////////////////////// - -int UTF8ToUnicode( - LPCSTR lpSrcStr, - int cchSrc, - LPWSTR lpDestStr, - int cchDest, - DWORD dwFlags - ) -{ - int ret; - UTF8Encoding enc(dwFlags & MB_ERR_INVALID_CHARS); - try { - ret = enc.GetCharCount((BYTE*)lpSrcStr, cchSrc); - if (cchDest){ - if (ret > cchDest){ - SetLastError(ERROR_INSUFFICIENT_BUFFER); - ret = 0; - } - enc.GetChars((BYTE*)lpSrcStr, cchSrc, (WCHAR*)lpDestStr, ret); - } - } - catch (const InsufficientBufferException& e){ - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return 0; - } - catch (const DecoderFallbackException& e){ - SetLastError(ERROR_NO_UNICODE_TRANSLATION); - return 0; - } - catch (const ArgumentException& e){ - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - return ret; -} - -//////////////////////////////////////////////////////////////////////////// -// -// UnicodeToUTF8 -// -// Maps a Unicode character string to its UTF-8 string counterpart. -// -//////////////////////////////////////////////////////////////////////////// - -int UnicodeToUTF8( - LPCWSTR lpSrcStr, - int cchSrc, - LPSTR lpDestStr, - int cchDest) -{ - int ret; - UTF8Encoding enc(false); - try{ - ret = enc.GetByteCount((WCHAR*)lpSrcStr, cchSrc); - if (cchDest){ - if (ret > cchDest){ - SetLastError(ERROR_INSUFFICIENT_BUFFER); - ret = 0; - } - enc.GetBytes((WCHAR*)lpSrcStr, cchSrc, (BYTE*)lpDestStr, ret); - } - } - catch (const InsufficientBufferException& e){ - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return 0; - } - catch (const EncoderFallbackException& e){ - SetLastError(ERROR_NO_UNICODE_TRANSLATION); - return 0; - } - catch (const ArgumentException& e){ - SetLastError(ERROR_INVALID_PARAMETER); - return 0; - } - return ret; -} diff --git a/src/shared/pal/src/map/map.cpp b/src/shared/pal/src/map/map.cpp index e72e64a377..f84d2725a4 100644 --- a/src/shared/pal/src/map/map.cpp +++ b/src/shared/pal/src/map/map.cpp @@ -35,6 +35,7 @@ Module Name: #include #include #include +#include #include #include "rt/ntimage.h" @@ -472,7 +473,7 @@ CorUnix::InternalCreateFileMapping( palError = ERROR_INVALID_PARAMETER; goto ExitInternalCreateFileMapping; } - + maximumSize = ((off_t)dwMaximumSizeHigh << 32) | (off_t)dwMaximumSizeLow; palError = g_pObjectManager->AllocateObject( @@ -786,50 +787,6 @@ CorUnix::InternalCreateFileMapping( return palError; } -/*++ -Function: - OpenFileMappingW - -See MSDN doc. ---*/ -HANDLE -PALAPI -OpenFileMappingW( - IN DWORD dwDesiredAccess, - IN BOOL bInheritHandle, - IN LPCWSTR lpName) -{ - HANDLE hFileMapping = NULL; - PAL_ERROR palError = NO_ERROR; - CPalThread *pThread = NULL; - - PERF_ENTRY(OpenFileMappingW); - ENTRY("OpenFileMappingW(dwDesiredAccess=%#x, bInheritHandle=%d, lpName=%p (%S)\n", - dwDesiredAccess, bInheritHandle, lpName?lpName:W16_NULLSTRING, lpName?lpName:W16_NULLSTRING); - - pThread = InternalGetCurrentThread(); - - /* validate parameters */ - if (lpName == nullptr) - { - ERROR("name is NULL\n"); - palError = ERROR_INVALID_PARAMETER; - } - else - { - ASSERT("lpName: Cross-process named objects are not supported in PAL"); - palError = ERROR_NOT_SUPPORTED; - } - - if (NO_ERROR != palError) - { - pThread->SetLastError(palError); - } - LOGEXIT("OpenFileMappingW returning %p.\n", hFileMapping); - PERF_EXIT(OpenFileMappingW); - return hFileMapping; -} - /*++ Function: MapViewOfFile @@ -1217,7 +1174,7 @@ CorUnix::InternalMapViewOfFile( // the global list. // - PMAPPED_VIEW_LIST pNewView = (PMAPPED_VIEW_LIST)InternalMalloc(sizeof(*pNewView)); + PMAPPED_VIEW_LIST pNewView = (PMAPPED_VIEW_LIST)malloc(sizeof(*pNewView)); if (NULL != pNewView) { pNewView->lpAddress = pvBaseAddress; @@ -1645,11 +1602,11 @@ static PAL_ERROR MAPGrowLocalFile( INT UnixFD, off_t NewSize ) /* ftruncate is a standard function, but the behavior of enlarging files is non-standard. So I will try to enlarge a file, and if that fails try the - less efficent way.*/ + less efficient way.*/ TruncateRetVal = ftruncate( UnixFD, NewSize ); fstat( UnixFD, &FileInfo ); - if ( TruncateRetVal != 0 || FileInfo.st_size != (int) NewSize ) + if ( TruncateRetVal != 0 || FileInfo.st_size != NewSize ) { INT OrigSize; CONST UINT BUFFER_SIZE = 128; @@ -1657,7 +1614,7 @@ static PAL_ERROR MAPGrowLocalFile( INT UnixFD, off_t NewSize ) UINT x = 0; UINT CurrentPosition = 0; - TRACE( "Trying the less efficent way.\n" ); + TRACE( "Trying the less efficient way.\n" ); CurrentPosition = lseek( UnixFD, 0, SEEK_CUR ); OrigSize = lseek( UnixFD, 0, SEEK_END ); @@ -1675,23 +1632,31 @@ static PAL_ERROR MAPGrowLocalFile( INT UnixFD, off_t NewSize ) } memset( buf, 0, BUFFER_SIZE ); - - for ( x = 0; x < NewSize - OrigSize - BUFFER_SIZE; x += BUFFER_SIZE ) + if (NewSize - OrigSize - BUFFER_SIZE >= 0 && BUFFER_SIZE > 0) { - if ( write( UnixFD, (LPVOID)buf, BUFFER_SIZE ) == -1 ) + for ( x = 0; x < NewSize - OrigSize - BUFFER_SIZE; x += BUFFER_SIZE ) { - ERROR( "Unable to grow the file. Reason=%s\n", strerror( errno ) ); - if((errno == ENOSPC) || (errno == EDQUOT)) + if ( write( UnixFD, (LPVOID)buf, BUFFER_SIZE ) == -1 ) { - palError = ERROR_DISK_FULL; - } - else - { - palError = ERROR_INTERNAL_ERROR; + ERROR( "Unable to grow the file. Reason=%s\n", strerror( errno ) ); + if((errno == ENOSPC) || (errno == EDQUOT)) + { + palError = ERROR_DISK_FULL; + } + else + { + palError = ERROR_INTERNAL_ERROR; + } + goto done; } - goto done; } } + else + { + //This will be an infinite loop because it did not pass the check. + palError = ERROR_INTERNAL_ERROR; + goto done; + } /* Catch any left overs. */ if ( x != NewSize ) { @@ -1921,7 +1886,7 @@ static PMAPPED_VIEW_LIST FindSharedMappingReplacement( /* The new desired mapping is fully contained in the one just found: we can reuse this one */ - pNewView = (PMAPPED_VIEW_LIST)InternalMalloc(sizeof(MAPPED_VIEW_LIST)); + pNewView = (PMAPPED_VIEW_LIST)malloc(sizeof(MAPPED_VIEW_LIST)); if (pNewView) { memcpy(pNewView, pView, sizeof(*pNewView)); @@ -1956,7 +1921,7 @@ static NativeMapHolder * NewNativeMapHolder(CPalThread *pThread, LPVOID address, } pThisMapHolder = - (NativeMapHolder *)InternalMalloc(sizeof(NativeMapHolder)); + (NativeMapHolder *)malloc(sizeof(NativeMapHolder)); if (pThisMapHolder) { diff --git a/src/shared/pal/src/map/virtual.cpp b/src/shared/pal/src/map/virtual.cpp index b030f640d0..4ac6e405ed 100644 --- a/src/shared/pal/src/map/virtual.cpp +++ b/src/shared/pal/src/map/virtual.cpp @@ -25,12 +25,15 @@ SET_DEFAULT_DEBUG_CHANNEL(VIRTUAL); // some headers have code with asserts, so d #include "pal/cs.hpp" #include "pal/malloc.hpp" #include "pal/file.hpp" +//#include "pal/seh.hpp" #include "pal/virtual.h" #include "pal/map.h" #include "pal/init.h" #include "pal/utils.h" #include "common.h" +#include +#include #include #include #include @@ -95,7 +98,6 @@ namespace VirtualMemoryLogging Commit = 0x30, Decommit = 0x40, Release = 0x50, - Reset = 0x60, ReserveFromExecutableMemoryAllocatorWithinRange = 0x70 }; @@ -201,8 +203,6 @@ void VIRTUALCleanup() { WARN( "The memory at %d was not freed through a call to VirtualFree.\n", pEntry->startBoundary ); - free(pEntry->pAllocState); - free(pEntry->pProtectionState ); pTempEntry = pEntry; pEntry = pEntry->pNext; free(pTempEntry ); @@ -235,235 +235,6 @@ static BOOL VIRTUALContainsInvalidProtectionFlags( IN DWORD flProtect ) } -/**** - * - * VIRTUALIsPageCommitted - * - * SIZE_T nBitToRetrieve - Which page to check. - * - * Returns TRUE if committed, FALSE otherwise. - * - */ -static BOOL VIRTUALIsPageCommitted( SIZE_T nBitToRetrieve, CONST PCMI pInformation ) -{ - SIZE_T nByteOffset = 0; - UINT nBitOffset = 0; - UINT byteMask = 0; - - if ( !pInformation ) - { - ERROR( "pInformation was NULL!\n" ); - return FALSE; - } - - nByteOffset = nBitToRetrieve / CHAR_BIT; - nBitOffset = nBitToRetrieve % CHAR_BIT; - - byteMask = 1 << nBitOffset; - - if ( pInformation->pAllocState[ nByteOffset ] & byteMask ) - { - return TRUE; - } - else - { - return FALSE; - } -} - -/********* - * - * VIRTUALGetAllocationType - * - * IN SIZE_T Index - The page within the range to retrieve - * the state for. - * - * IN pInformation - The virtual memory object. - * - */ -static INT VIRTUALGetAllocationType( SIZE_T Index, CONST PCMI pInformation ) -{ - if ( VIRTUALIsPageCommitted( Index, pInformation ) ) - { - return MEM_COMMIT; - } - else - { - return MEM_RESERVE; - } -} - -/**** - * - * VIRTUALSetPageBits - * - * IN UINT nStatus - Bit set / reset [0: reset, any other value: set]. - * IN SIZE_T nStartingBit - The bit to set. - * - * IN SIZE_T nNumberOfBits - The range of bits to set. - * IN BYTE* pBitArray - A pointer the array to be manipulated. - * - * Returns TRUE on success, FALSE otherwise. - * Turn on/off memory status bits. - * - */ -static BOOL VIRTUALSetPageBits ( UINT nStatus, SIZE_T nStartingBit, - SIZE_T nNumberOfBits, BYTE * pBitArray ) -{ - /* byte masks for optimized modification of partial bytes (changing less - than 8 bits in a single byte). note that bits are treated in little - endian order : value 1 is bit 0; value 128 is bit 7. in the binary - representations below, bit 0 is on the right */ - - /* start masks : for modifying bits >= n while preserving bits < n. - example : if nStartignBit%8 is 3, then bits 0, 1, 2 remain unchanged - while bits 3..7 are changed; startmasks[3] can be used for this. */ - static const BYTE startmasks[8] = { - 0xff, /* start at 0 : 1111 1111 */ - 0xfe, /* start at 1 : 1111 1110 */ - 0xfc, /* start at 2 : 1111 1100 */ - 0xf8, /* start at 3 : 1111 1000 */ - 0xf0, /* start at 4 : 1111 0000 */ - 0xe0, /* start at 5 : 1110 0000 */ - 0xc0, /* start at 6 : 1100 0000 */ - 0x80 /* start at 7 : 1000 0000 */ - }; - - /* end masks : for modifying bits <= n while preserving bits > n. - example : if the last bit to change is 5, then bits 6 & 7 stay unchanged - while bits 1..5 are changed; endmasks[5] can be used for this. */ - static const BYTE endmasks[8] = { - 0x01, /* end at 0 : 0000 0001 */ - 0x03, /* end at 1 : 0000 0011 */ - 0x07, /* end at 2 : 0000 0111 */ - 0x0f, /* end at 3 : 0000 1111 */ - 0x1f, /* end at 4 : 0001 1111 */ - 0x3f, /* end at 5 : 0011 1111 */ - 0x7f, /* end at 6 : 0111 1111 */ - 0xff /* end at 7 : 1111 1111 */ - }; - /* last example : if only the middle of a byte must be changed, both start - and end masks can be combined (bitwise AND) to obtain the correct mask. - if we want to change bits 2 to 4 : - startmasks[2] : 0xfc 1111 1100 (change 2,3,4,5,6,7) - endmasks[4]: 0x1f 0001 1111 (change 0,1,2,3,4) - bitwise AND : 0x1c 0001 1100 (change 2,3,4) - */ - - BYTE byte_mask; - SIZE_T nLastBit; - SIZE_T nFirstByte; - SIZE_T nLastByte; - SIZE_T nFullBytes; - - TRACE( "VIRTUALSetPageBits( nStatus = %d, nStartingBit = %d, " - "nNumberOfBits = %d, pBitArray = 0x%p )\n", - nStatus, nStartingBit, nNumberOfBits, pBitArray ); - - if ( 0 == nNumberOfBits ) - { - ERROR( "nNumberOfBits was 0!\n" ); - return FALSE; - } - - nLastBit = nStartingBit+nNumberOfBits-1; - nFirstByte = nStartingBit / 8; - nLastByte = nLastBit / 8; - - /* handle partial first byte (if any) */ - if(0 != (nStartingBit % 8)) - { - byte_mask = startmasks[nStartingBit % 8]; - - /* if 1st byte is the only changing byte, combine endmask to preserve - trailing bits (see 3rd example above) */ - if( nLastByte == nFirstByte) - { - byte_mask &= endmasks[nLastBit % 8]; - } - - /* byte_mask contains 1 for bits to change, 0 for bits to leave alone */ - if(0 == nStatus) - { - /* bits to change must be set to 0 : invert byte_mask (giving 0 for - bits to change), use bitwise AND */ - pBitArray[nFirstByte] &= ~byte_mask; - } - else - { - /* bits to change must be set to 1 : use bitwise OR */ - pBitArray[nFirstByte] |= byte_mask; - } - - /* stop right away if only 1 byte is being modified */ - if(nLastByte == nFirstByte) - { - return TRUE; - } - - /* we're done with the 1st byte; skip over it */ - nFirstByte++; - } - - /* number of bytes to change, excluding the last byte (handled separately)*/ - nFullBytes = nLastByte - nFirstByte; - - if(0 != nFullBytes) - { - // Turn off/on dirty bits - memset( &(pBitArray[nFirstByte]), (0 == nStatus) ? 0 : 0xFF, nFullBytes ); - } - - /* handle last (possibly partial) byte */ - byte_mask = endmasks[nLastBit % 8]; - - /* byte_mask contains 1 for bits to change, 0 for bits to leave alone */ - if(0 == nStatus) - { - /* bits to change must be set to 0 : invert byte_mask (giving 0 for - bits to change), use bitwise AND */ - pBitArray[nLastByte] &= ~byte_mask; - } - else - { - /* bits to change must be set to 1 : use bitwise OR */ - pBitArray[nLastByte] |= byte_mask; - } - - return TRUE; -} - -/**** - * - * VIRTUALSetAllocState - * - * IN UINT nAction - Which action to perform. - * IN SIZE_T nStartingBit - The bit to set. - * - * IN SIZE_T nNumberOfBits - The range of bits to set. - * IN PCMI pStateArray - A pointer the array to be manipulated. - * - * Returns TRUE on success, FALSE otherwise. - * Turn bit on to indicate committed, turn bit off to indicate reserved. - * - */ -static BOOL VIRTUALSetAllocState( UINT nAction, SIZE_T nStartingBit, - SIZE_T nNumberOfBits, CONST PCMI pInformation ) -{ - TRACE( "VIRTUALSetAllocState( nAction = %d, nStartingBit = %d, " - "nNumberOfBits = %d, pStateArray = 0x%p )\n", - nAction, nStartingBit, nNumberOfBits, pInformation ); - - if ( !pInformation ) - { - ERROR( "pInformation was invalid!\n" ); - return FALSE; - } - - return VIRTUALSetPageBits((MEM_COMMIT == nAction) ? 1 : 0, nStartingBit, - nNumberOfBits, pInformation->pAllocState); -} - /**** * * VIRTUALFindRegionInformation( ) @@ -540,99 +311,12 @@ static BOOL VIRTUALReleaseMemory( PCMI pMemoryToBeReleased ) } } - free( pMemoryToBeReleased->pAllocState ); - pMemoryToBeReleased->pAllocState = NULL; - - free( pMemoryToBeReleased->pProtectionState ); - pMemoryToBeReleased->pProtectionState = NULL; - free( pMemoryToBeReleased ); pMemoryToBeReleased = NULL; return bRetVal; } -/**** - * VIRTUALConvertWinFlags() - - * Converts win32 protection flags to - * internal VIRTUAL flags. - * - */ -static BYTE VIRTUALConvertWinFlags( IN DWORD flProtect ) -{ - BYTE MemAccessControl = 0; - - switch ( flProtect & 0xff ) - { - case PAGE_NOACCESS : - MemAccessControl = VIRTUAL_NOACCESS; - break; - case PAGE_READONLY : - MemAccessControl = VIRTUAL_READONLY; - break; - case PAGE_READWRITE : - MemAccessControl = VIRTUAL_READWRITE; - break; - case PAGE_EXECUTE : - MemAccessControl = VIRTUAL_EXECUTE; - break; - case PAGE_EXECUTE_READ : - MemAccessControl = VIRTUAL_EXECUTE_READ; - break; - case PAGE_EXECUTE_READWRITE: - MemAccessControl = VIRTUAL_EXECUTE_READWRITE; - break; - - default : - MemAccessControl = 0; - ERROR( "Incorrect or no protection flags specified.\n" ); - break; - } - return MemAccessControl; -} - -/**** - * VIRTUALConvertVirtualFlags() - - * Converts internal virtual protection - * flags to their win32 counterparts. - */ -static DWORD VIRTUALConvertVirtualFlags( IN BYTE VirtualProtect ) -{ - DWORD MemAccessControl = 0; - - if ( VirtualProtect == VIRTUAL_READONLY ) - { - MemAccessControl = PAGE_READONLY; - } - else if ( VirtualProtect == VIRTUAL_READWRITE ) - { - MemAccessControl = PAGE_READWRITE; - } - else if ( VirtualProtect == VIRTUAL_EXECUTE_READWRITE ) - { - MemAccessControl = PAGE_EXECUTE_READWRITE; - } - else if ( VirtualProtect == VIRTUAL_EXECUTE_READ ) - { - MemAccessControl = PAGE_EXECUTE_READ; - } - else if ( VirtualProtect == VIRTUAL_EXECUTE ) - { - MemAccessControl = PAGE_EXECUTE; - } - else if ( VirtualProtect == VIRTUAL_NOACCESS ) - { - MemAccessControl = PAGE_NOACCESS; - } - - else - { - MemAccessControl = 0; - ERROR( "Incorrect or no protection flags specified.\n" ); - } - return MemAccessControl; -} - /*** * Displays the linked list. * @@ -658,17 +342,6 @@ static void VIRTUALDisplayList( void ) DBGOUT( "\t startBoundary %#x \n", p->startBoundary ); DBGOUT( "\t memSize %d \n", p->memSize ); - DBGOUT( "\t pAllocState " ); - for ( index = 0; index < p->memSize / GetVirtualPageSize(); index++) - { - DBGOUT( "[%d] ", VIRTUALGetAllocationType( index, p ) ); - } - DBGOUT( "\t pProtectionState " ); - for ( index = 0; index < p->memSize / GetVirtualPageSize(); index++ ) - { - DBGOUT( "[%d] ", (UINT)p->pProtectionState[ index ] ); - } - DBGOUT( "\n" ); DBGOUT( "\t accessProtection %d \n", p->accessProtection ); DBGOUT( "\t allocationType %d \n", p->allocationType ); DBGOUT( "\t pNext %p \n", p->pNext ); @@ -728,7 +401,7 @@ static BOOL VIRTUALStoreAllocationInfo( return FALSE; } - if (!(pNewEntry = (PCMI)InternalMalloc(sizeof(*pNewEntry)))) + if (!(pNewEntry = (PCMI)malloc(sizeof(*pNewEntry)))) { ERROR( "Unable to allocate memory for the structure.\n"); return FALSE; @@ -739,39 +412,6 @@ static BOOL VIRTUALStoreAllocationInfo( pNewEntry->allocationType = flAllocationType; pNewEntry->accessProtection = flProtection; - nBufferSize = memSize / GetVirtualPageSize() / CHAR_BIT; - if ((memSize / GetVirtualPageSize()) % CHAR_BIT != 0) - { - nBufferSize++; - } - - pNewEntry->pAllocState = (BYTE*)InternalMalloc(nBufferSize); - pNewEntry->pProtectionState = (BYTE*)InternalMalloc((memSize / GetVirtualPageSize())); - - if (pNewEntry->pAllocState && pNewEntry->pProtectionState) - { - /* Set the intial allocation state, and initial allocation protection. */ - VIRTUALSetAllocState(MEM_RESERVE, 0, nBufferSize * CHAR_BIT, pNewEntry); - memset(pNewEntry->pProtectionState, - VIRTUALConvertWinFlags(flProtection), - memSize / GetVirtualPageSize()); - } - else - { - ERROR( "Unable to allocate memory for the structure.\n"); - - if (pNewEntry->pProtectionState) free(pNewEntry->pProtectionState); - pNewEntry->pProtectionState = nullptr; - - if (pNewEntry->pAllocState) free(pNewEntry->pAllocState); - pNewEntry->pAllocState = nullptr; - - free(pNewEntry); - pNewEntry = nullptr; - - return FALSE; - } - pMemInfo = pVirtualMemory; if (pMemInfo && pMemInfo->startBoundary < startBoundary) @@ -815,61 +455,6 @@ static BOOL VIRTUALStoreAllocationInfo( return TRUE; } -/****** - * - * VIRTUALResetMemory() - Helper function that resets the memory - * - * - */ -static LPVOID VIRTUALResetMemory( - IN CPalThread *pthrCurrent, /* Currently executing thread */ - IN LPVOID lpAddress, /* Region to reserve or commit */ - IN SIZE_T dwSize) /* Size of Region */ -{ - LPVOID pRetVal = NULL; - UINT_PTR StartBoundary; - SIZE_T MemSize; - - TRACE( "Resetting the memory now..\n"); - - StartBoundary = (UINT_PTR) ALIGN_DOWN(lpAddress, GetVirtualPageSize()); - MemSize = ALIGN_UP((UINT_PTR)lpAddress + dwSize, GetVirtualPageSize()) - StartBoundary; - - int st; -#if HAVE_MADV_FREE - // Try to use MADV_FREE if supported. It tells the kernel that the application doesn't - // need the pages in the range. Freeing the pages can be delayed until a memory pressure - // occurs. - st = madvise((LPVOID)StartBoundary, MemSize, MADV_FREE); - if (st != 0) -#endif - { - // In case the MADV_FREE is not supported, use MADV_DONTNEED - st = posix_madvise((LPVOID)StartBoundary, MemSize, POSIX_MADV_DONTNEED); - } - - if (st == 0) - { - pRetVal = lpAddress; - -#ifdef MADV_DONTDUMP - // Do not include reset memory in coredump. - madvise((LPVOID)StartBoundary, MemSize, MADV_DONTDUMP); -#endif - } - - LogVaOperation( - VirtualMemoryLogging::VirtualOperation::Reset, - lpAddress, - dwSize, - 0, - 0, - pRetVal, - pRetVal != NULL); - - return pRetVal; -} - /****** * * VIRTUALReserveMemory() - Helper function that actually reserves the memory. @@ -883,7 +468,8 @@ static LPVOID VIRTUALReserveMemory( IN LPVOID lpAddress, /* Region to reserve or commit */ IN SIZE_T dwSize, /* Size of Region */ IN DWORD flAllocationType, /* Type of allocation */ - IN DWORD flProtect) /* Type of access protection */ + IN DWORD flProtect, /* Type of access protection */ + OUT BOOL *newMemory = NULL) /* Set if new virtual memory is allocated */ { LPVOID pRetVal = NULL; UINT_PTR StartBoundary; @@ -891,6 +477,11 @@ static LPVOID VIRTUALReserveMemory( TRACE( "Reserving the memory now..\n"); + if (newMemory != NULL) + { + *newMemory = false; + } + // First, figure out where we're trying to reserve the memory and // how much we need. On most systems, requests to mmap must be // page-aligned and at multiples of the page size. Unlike on Windows, on @@ -924,6 +515,11 @@ static LPVOID VIRTUALReserveMemory( flAllocationType |= MEM_RESERVE_EXECUTABLE; } pRetVal = ReserveVirtualMemory(pthrCurrent, (LPVOID)StartBoundary, MemSize, flAllocationType); + + if (newMemory != NULL && pRetVal != NULL) + { + *newMemory = true; + } } if (pRetVal != NULL) @@ -1033,8 +629,11 @@ static LPVOID ReserveVirtualMemory( #endif // MMAP_ANON_IGNORES_PROTECTION #ifdef MADV_DONTDUMP - // Do not include reserved memory in coredump. - madvise(pRetVal, MemSize, MADV_DONTDUMP); + // Do not include reserved uncommitted memory in coredump. + if (!(fAllocationType & MEM_COMMIT)) + { + madvise(pRetVal, MemSize, MADV_DONTDUMP); + } #endif return pRetVal; @@ -1061,15 +660,8 @@ VIRTUALCommitMemory( PCMI pInformation = 0; LPVOID pRetVal = NULL; BOOL IsLocallyReserved = FALSE; - SIZE_T totalPages; - INT allocationType, curAllocationType; - INT protectionState, curProtectionState; - SIZE_T initialRunStart; - SIZE_T runStart; - SIZE_T runLength; - SIZE_T index; + BOOL IsNewMemory = FALSE; INT nProtect; - INT vProtect; if ( lpAddress ) { @@ -1091,7 +683,7 @@ VIRTUALCommitMemory( */ LPVOID pReservedMemory = VIRTUALReserveMemory( pthrCurrent, lpAddress, dwSize, - flAllocationType, flProtect ); + flAllocationType, flProtect, &IsNewMemory ); TRACE( "Reserve and commit the memory!\n " ); @@ -1123,104 +715,24 @@ VIRTUALCommitMemory( TRACE( "Committing the memory now..\n"); - // Pages that aren't already committed need to be committed. Pages that - // are committed don't need to be committed, but they might need to have - // their permissions changed. - // To get this right, we find runs of pages with similar states and - // permissions. If a run is not committed, we commit it and then set - // its permissions. If a run is committed but has different permissions - // from what we're trying to set, we set its permissions. Finally, - // if a run is already committed and has the right permissions, - // we don't need to do anything to it. - - totalPages = MemSize / GetVirtualPageSize(); - runStart = (StartBoundary - pInformation->startBoundary) / - GetVirtualPageSize(); // Page index - initialRunStart = runStart; - allocationType = VIRTUALGetAllocationType(runStart, pInformation); - protectionState = pInformation->pProtectionState[runStart]; - curAllocationType = allocationType; - curProtectionState = protectionState; - runLength = 1; nProtect = W32toUnixAccessControl(flProtect); - vProtect = VIRTUALConvertWinFlags(flProtect); - if (totalPages > pInformation->memSize / GetVirtualPageSize() - runStart) + // Commit the pages + if (mprotect((void *) StartBoundary, MemSize, nProtect) != 0) { - ERROR("Trying to commit beyond the end of the region!\n"); + ERROR("mprotect() failed! Error(%d)=%s\n", errno, strerror(errno)); goto error; } - while(runStart < initialRunStart + totalPages) - { - // Find the next run of pages - for(index = runStart + 1; index < initialRunStart + totalPages; - index++) - { - curAllocationType = VIRTUALGetAllocationType(index, pInformation); - curProtectionState = pInformation->pProtectionState[index]; - if (curAllocationType != allocationType || - curProtectionState != protectionState) - { - break; - } - runLength++; - } - - StartBoundary = pInformation->startBoundary + runStart * GetVirtualPageSize(); - pRetVal = (void *)StartBoundary; - MemSize = runLength * GetVirtualPageSize(); - - if (allocationType != MEM_COMMIT) - { - // Commit the pages - if (mprotect((void *) StartBoundary, MemSize, PROT_WRITE | PROT_READ) != 0) - { - ERROR("mprotect() failed! Error(%d)=%s\n", errno, strerror(errno)); - goto error; - } - #ifdef MADV_DODUMP - // Include committed memory in coredump. - madvise((void *) StartBoundary, MemSize, MADV_DODUMP); -#endif - - VIRTUALSetAllocState(MEM_COMMIT, runStart, runLength, pInformation); - - if (nProtect == (PROT_WRITE | PROT_READ)) - { - // Handle this case specially so we don't bother - // mprotect'ing the region. - memset(pInformation->pProtectionState + runStart, - vProtect, runLength); - } - - protectionState = VIRTUAL_READWRITE; - } - - if (protectionState != vProtect) - { - // Change permissions. - if (mprotect((void *) StartBoundary, MemSize, nProtect) != -1) - { - memset(pInformation->pProtectionState + runStart, - vProtect, runLength); - } - else - { - ERROR("mprotect() failed! Error(%d)=%s\n", - errno, strerror(errno)); - goto error; - } - } - - runStart = index; - runLength = 1; - allocationType = curAllocationType; - protectionState = curProtectionState; + // Include committed memory in coredump. Any newly allocated memory included by default. + if (!IsNewMemory) + { + madvise((void *) StartBoundary, MemSize, MADV_DODUMP); } +#endif - pRetVal = (void *) (pInformation->startBoundary + initialRunStart * GetVirtualPageSize()); + pRetVal = (void *) StartBoundary; goto done; error: @@ -1262,21 +774,24 @@ VIRTUALCommitMemory( lpBeginAddress - Inclusive beginning of range lpEndAddress - Exclusive end of range dwSize - Number of bytes to allocate + fStoreAllocationInfo - TRUE to indicate that the allocation should be registered in the PAL allocation list --*/ LPVOID PALAPI PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange( IN LPCVOID lpBeginAddress, IN LPCVOID lpEndAddress, - IN SIZE_T dwSize) + IN SIZE_T dwSize, + IN BOOL fStoreAllocationInfo) { #ifdef HOST_64BIT PERF_ENTRY(PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange); ENTRY( - "PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(lpBeginAddress = %p, lpEndAddress = %p, dwSize = %Iu)\n", + "PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange(lpBeginAddress = %p, lpEndAddress = %p, dwSize = %zu, fStoreAllocationInfo = %d)\n", lpBeginAddress, lpEndAddress, - dwSize); + dwSize, + fStoreAllocationInfo); _ASSERTE(lpBeginAddress <= lpEndAddress); @@ -1291,7 +806,7 @@ PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange( if (address != nullptr) { _ASSERTE(IS_ALIGNED(address, GetVirtualPageSize())); - if (!VIRTUALStoreAllocationInfo((UINT_PTR)address, reservationSize, MEM_RESERVE | MEM_RESERVE_EXECUTABLE, PAGE_NOACCESS)) + if (fStoreAllocationInfo && !VIRTUALStoreAllocationInfo((UINT_PTR)address, reservationSize, MEM_RESERVE | MEM_RESERVE_EXECUTABLE, PAGE_NOACCESS)) { ASSERT("Unable to store the structure in the list.\n"); munmap(address, reservationSize); @@ -1318,6 +833,27 @@ PAL_VirtualReserveFromExecutableMemoryAllocatorWithinRange( #endif // HOST_64BIT } +/*++ +Function: + PAL_GetExecutableMemoryAllocatorPreferredRange + + This function gets the preferred range used by the executable memory allocator. + This is the range that the memory allocator will prefer to allocate memory in, + including (if nearby) the libcoreclr memory range. + + lpBeginAddress - Inclusive beginning of range + lpEndAddress - Exclusive end of range + dwSize - Number of bytes to allocate +--*/ +void +PALAPI +PAL_GetExecutableMemoryAllocatorPreferredRange( + OUT LPVOID *start, + OUT LPVOID *end) +{ + g_executableMemoryAllocator.GetPreferredRange(start, end); +} + /*++ Function: VirtualAlloc @@ -1354,7 +890,7 @@ VirtualAlloc( } /* Test for un-supported flags. */ - if ( ( flAllocationType & ~( MEM_COMMIT | MEM_RESERVE | MEM_RESET | MEM_TOP_DOWN | MEM_RESERVE_EXECUTABLE | MEM_LARGE_PAGES ) ) != 0 ) + if ( ( flAllocationType & ~( MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN | MEM_RESERVE_EXECUTABLE | MEM_LARGE_PAGES ) ) != 0 ) { ASSERT( "flAllocationType can be one, or any combination of MEM_COMMIT, \ MEM_RESERVE, MEM_TOP_DOWN, MEM_RESERVE_EXECUTABLE, or MEM_LARGE_PAGES.\n" ); @@ -1383,26 +919,6 @@ VirtualAlloc( NULL, TRUE); - if ( flAllocationType & MEM_RESET ) - { - if ( flAllocationType != MEM_RESET ) - { - ASSERT( "MEM_RESET cannot be used with any other allocation flags in flAllocationType.\n" ); - pthrCurrent->SetLastError( ERROR_INVALID_PARAMETER ); - goto done; - } - - InternalEnterCriticalSection(pthrCurrent, &virtual_critsec); - pRetVal = VIRTUALResetMemory( pthrCurrent, lpAddress, dwSize ); - InternalLeaveCriticalSection(pthrCurrent, &virtual_critsec); - - if ( !pRetVal ) - { - /* Error messages are already displayed, just leave. */ - goto done; - } - } - if ( flAllocationType & MEM_RESERVE ) { InternalEnterCriticalSection(pthrCurrent, &virtual_critsec); @@ -1546,17 +1062,6 @@ VirtualFree( // Do not include freed memory in coredump. madvise((LPVOID) StartBoundary, MemSize, MADV_DONTDUMP); #endif - - SIZE_T index = 0; - SIZE_T nNumOfPagesToChange = 0; - - /* We can now commit this memory by calling VirtualAlloc().*/ - index = (StartBoundary - pUnCommittedMem->startBoundary) / GetVirtualPageSize(); - - nNumOfPagesToChange = MemSize / GetVirtualPageSize(); - VIRTUALSetAllocState( MEM_RESERVE, index, - nNumOfPagesToChange, pUnCommittedMem ); - goto VirtualFreeExit; } else @@ -1682,27 +1187,6 @@ VirtualProtect( } pEntry = VIRTUALFindRegionInformation( StartBoundary ); - if ( NULL != pEntry ) - { - /* See if the pages are committed. */ - Index = OffSet = StartBoundary - pEntry->startBoundary == 0 ? - 0 : ( StartBoundary - pEntry->startBoundary ) / GetVirtualPageSize(); - NumberOfPagesToChange = MemSize / GetVirtualPageSize(); - - TRACE( "Number of pages to check %d, starting page %d \n", NumberOfPagesToChange, Index ); - - for ( ; Index < NumberOfPagesToChange; Index++ ) - { - if ( !VIRTUALIsPageCommitted( Index, pEntry ) ) - { - ERROR( "You can only change the protection attributes" - " on committed memory.\n" ) - SetLastError( ERROR_INVALID_ADDRESS ); - goto ExitVirtualProtect; - } - } - } - if ( 0 == mprotect( (LPVOID)StartBoundary, MemSize, W32toUnixAccessControl( flNewProtect ) ) ) { @@ -1714,19 +1198,7 @@ VirtualProtect( * if there were several regions with each with different flags only the * first region's protection flag will be returned. */ - if ( pEntry ) - { - *lpflOldProtect = - VIRTUALConvertVirtualFlags( pEntry->pProtectionState[ OffSet ] ); - - memset( pEntry->pProtectionState + OffSet, - VIRTUALConvertWinFlags( flNewProtect ), - NumberOfPagesToChange ); - } - else - { - *lpflOldProtect = PAGE_EXECUTE_READWRITE; - } + *lpflOldProtect = PAGE_EXECUTE_READWRITE; #ifdef MADV_DONTDUMP // Include or exclude memory from coredump based on the protection. @@ -1759,6 +1231,28 @@ VirtualProtect( return bRetVal; } +#if defined(HOST_OSX) && defined(HOST_ARM64) +PALAPI VOID PAL_JitWriteProtect(bool writeEnable) +{ + thread_local int enabledCount = 0; + if (writeEnable) + { + if (enabledCount++ == 0) + { + pthread_jit_write_protect_np(0); + } + } + else + { + if (--enabledCount == 0) + { + pthread_jit_write_protect_np(1); + } + _ASSERTE(enabledCount >= 0); + } +} +#endif // HOST_OSX && HOST_ARM64 + #if HAVE_VM_ALLOCATE //--------------------------------------------------------------------------------------- // @@ -1989,37 +1483,15 @@ VirtualQuery( } else { - /* Starting page. */ - SIZE_T Index = ( StartBoundary - pEntry->startBoundary ) / GetVirtualPageSize(); - - /* Attributes to check for. */ - BYTE AccessProtection = pEntry->pProtectionState[ Index ]; - INT AllocationType = VIRTUALGetAllocationType( Index, pEntry ); - SIZE_T RegionSize = 0; - - TRACE( "Index = %d, Number of Pages = %d. \n", - Index, pEntry->memSize / GetVirtualPageSize() ); - - while ( Index < pEntry->memSize / GetVirtualPageSize() && - VIRTUALGetAllocationType( Index, pEntry ) == AllocationType && - pEntry->pProtectionState[ Index ] == AccessProtection ) - { - RegionSize += GetVirtualPageSize(); - Index++; - } - - TRACE( "RegionSize = %d.\n", RegionSize ); - /* Fill the structure.*/ lpBuffer->AllocationProtect = pEntry->accessProtection; lpBuffer->BaseAddress = (LPVOID)StartBoundary; - lpBuffer->Protect = AllocationType == MEM_COMMIT ? - VIRTUALConvertVirtualFlags( AccessProtection ) : 0; - - lpBuffer->RegionSize = RegionSize; - lpBuffer->State = - ( AllocationType == MEM_COMMIT ? MEM_COMMIT : MEM_RESERVE ); + lpBuffer->Protect = pEntry->allocationType == MEM_COMMIT ? + pEntry->accessProtection : 0; + lpBuffer->RegionSize = pEntry->memSize; + lpBuffer->State = pEntry->allocationType == MEM_COMMIT ? + MEM_COMMIT : MEM_RESERVE; WARN( "Ignoring lpBuffer->Type. \n" ); } @@ -2042,7 +1514,7 @@ size_t GetVirtualPageSize() Function : ReserveMemoryFromExecutableAllocator - This function is used to reserve a region of virual memory (not commited) + This function is used to reserve a region of virual memory (not committed) that is located close to the coreclr library. The memory comes from the virtual address range that is managed by ExecutableMemoryAllocator. --*/ @@ -2089,11 +1561,41 @@ void ExecutableMemoryAllocator::Initialize() void ExecutableMemoryAllocator::TryReserveInitialMemory() { CPalThread* pthrCurrent = InternalGetCurrentThread(); - int32_t sizeOfAllocation = MaxExecutableMemorySizeNearCoreClr; int32_t preferredStartAddressIncrement; UINT_PTR preferredStartAddress; UINT_PTR coreclrLoadAddress; - const int32_t MemoryProbingIncrement = 128 * 1024 * 1024; + + int32_t sizeOfAllocation = MaxExecutableMemorySizeNearCoreClr; + int32_t initialReserveLimit = -1; + rlimit addressSpaceLimit; + if ((getrlimit(RLIMIT_AS, &addressSpaceLimit) == 0) && (addressSpaceLimit.rlim_cur != RLIM_INFINITY)) + { + // By default reserve max 20% of the available virtual address space + rlim_t initialExecMemoryPerc = 20; + CLRConfigNoCache defInitialExecMemoryPerc = CLRConfigNoCache::Get("InitialExecMemoryPercent", /*noprefix*/ false, &getenv); + if (defInitialExecMemoryPerc.IsSet()) + { + DWORD perc; + if (defInitialExecMemoryPerc.TryAsInteger(16, perc)) + { + initialExecMemoryPerc = perc; + } + } + + initialReserveLimit = addressSpaceLimit.rlim_cur * initialExecMemoryPerc / 100; + if (initialReserveLimit < sizeOfAllocation) + { + sizeOfAllocation = initialReserveLimit; + } + } +#if defined(TARGET_ARM) || defined(TARGET_ARM64) + // Smaller steps on ARM because we try hard finding a spare memory in a 128Mb + // distance from coreclr so e.g. all calls from corelib to coreclr could use relocs + const int32_t AddressProbingIncrement = 8 * 1024 * 1024; +#else + const int32_t AddressProbingIncrement = 128 * 1024 * 1024; +#endif + const int32_t SizeProbingDecrement = 128 * 1024 * 1024; // Try to find and reserve an available region of virtual memory that is located // within 2GB range (defined by the MaxExecutableMemorySizeNearCoreClr constant) from the @@ -2114,12 +1616,18 @@ void ExecutableMemoryAllocator::TryReserveInitialMemory() { // Try to allocate above the location of libcoreclr preferredStartAddress = coreclrLoadAddress + CoreClrLibrarySize; - preferredStartAddressIncrement = MemoryProbingIncrement; + preferredStartAddressIncrement = AddressProbingIncrement; } else { // Try to allocate below the location of libcoreclr - preferredStartAddress = coreclrLoadAddress - MaxExecutableMemorySizeNearCoreClr; +#if defined(TARGET_ARM) || defined(TARGET_ARM64) + // For arm for the "high address" case it only makes sense to try to reserve 128Mb + // and if it doesn't work - we'll reserve a full-sized region in a random location + sizeOfAllocation = SizeProbingDecrement; +#endif + + preferredStartAddress = coreclrLoadAddress - sizeOfAllocation; preferredStartAddressIncrement = 0; } @@ -2133,10 +1641,10 @@ void ExecutableMemoryAllocator::TryReserveInitialMemory() } // Try to allocate a smaller region - sizeOfAllocation -= MemoryProbingIncrement; + sizeOfAllocation -= SizeProbingDecrement; preferredStartAddress += preferredStartAddressIncrement; - } while (sizeOfAllocation >= MemoryProbingIncrement); + } while (sizeOfAllocation >= SizeProbingDecrement); if (m_startAddress == nullptr) { @@ -2155,7 +1663,7 @@ void ExecutableMemoryAllocator::TryReserveInitialMemory() // does not exceed approximately 2 GB. // - The code heap allocator for the JIT can allocate from this address space. Beyond this reservation, one can use // the DOTNET_CodeHeapReserveForJumpStubs environment variable to reserve space for jump stubs. - sizeOfAllocation = MaxExecutableMemorySize; + sizeOfAllocation = (initialReserveLimit != -1) ? initialReserveLimit : MaxExecutableMemorySize; m_startAddress = ReserveVirtualMemory(pthrCurrent, nullptr, sizeOfAllocation, MEM_RESERVE_EXECUTABLE); if (m_startAddress == nullptr) { diff --git a/src/shared/pal/src/misc/dbgmsg.cpp b/src/shared/pal/src/misc/dbgmsg.cpp index a5f98a0b0d..38f101d147 100644 --- a/src/shared/pal/src/misc/dbgmsg.cpp +++ b/src/shared/pal/src/misc/dbgmsg.cpp @@ -670,10 +670,10 @@ int DBG_change_entrylevel(int new_level) { return 0; } - old_level = PtrToInt(pthread_getspecific(entry_level_key)); + old_level = (int)(intptr_t)pthread_getspecific(entry_level_key); if(-1 != new_level) { - if ((ret = pthread_setspecific(entry_level_key,(LPVOID)(IntToPtr(new_level)))) != 0) + if ((ret = pthread_setspecific(entry_level_key,(LPVOID)(intptr_t)new_level)) != 0) { fprintf(stderr, "ERROR : pthread_setspecific() failed " "error:%d (%s)\n", ret, strerror(ret)); diff --git a/src/shared/pal/src/misc/environ.cpp b/src/shared/pal/src/misc/environ.cpp index a31d6b1777..4980d213fa 100644 --- a/src/shared/pal/src/misc/environ.cpp +++ b/src/shared/pal/src/misc/environ.cpp @@ -183,7 +183,7 @@ GetEnvironmentVariableW( goto done; } - inBuff = (CHAR *)PAL_malloc(inBuffSize); + inBuff = (CHAR *)malloc(inBuffSize); if (inBuff == nullptr) { ERROR("malloc failed\n"); @@ -193,7 +193,7 @@ GetEnvironmentVariableW( if (nSize) { - outBuff = (CHAR *)PAL_malloc(nSize*2); + outBuff = (CHAR *)malloc(nSize*2); if (outBuff == nullptr) { ERROR("malloc failed\n"); @@ -243,8 +243,8 @@ GetEnvironmentVariableW( } done: - PAL_free(outBuff); - PAL_free(inBuff); + free(outBuff); + free(inBuff); LOGEXIT("GetEnvironmentVariableW returns DWORD 0x%x\n", size); PERF_EXIT(GetEnvironmentVariableW); @@ -310,7 +310,7 @@ SetEnvironmentVariableW( goto done; } - name = (PCHAR)PAL_malloc(sizeof(CHAR)* nameSize); + name = (PCHAR)malloc(sizeof(CHAR)* nameSize); if (name == nullptr) { ERROR("malloc failed\n"); @@ -336,7 +336,7 @@ SetEnvironmentVariableW( goto done; } - value = (PCHAR)PAL_malloc(sizeof(CHAR)*valueSize); + value = (PCHAR)malloc(sizeof(CHAR)*valueSize); if (value == nullptr) { @@ -356,8 +356,8 @@ SetEnvironmentVariableW( bRet = SetEnvironmentVariableA(name, value); done: - PAL_free(value); - PAL_free(name); + free(value); + free(name); LOGEXIT("SetEnvironmentVariableW returning BOOL %d\n", bRet); PERF_EXIT(SetEnvironmentVariableW); @@ -414,7 +414,7 @@ GetEnvironmentStringsW( envNum += len; } - wenviron = (WCHAR *)PAL_malloc(sizeof(WCHAR)* (envNum + 1)); + wenviron = (WCHAR *)malloc(sizeof(WCHAR)* (envNum + 1)); if (wenviron == nullptr) { ERROR("malloc failed\n"); @@ -476,7 +476,7 @@ FreeEnvironmentStringsW( if (lpValue != nullptr) { - PAL_free(lpValue); + free(lpValue); } LOGEXIT("FreeEnvironmentStringW returning BOOL TRUE\n"); @@ -559,7 +559,7 @@ SetEnvironmentVariableA( { // All the conditions are met. Set the variable. int iLen = strlen(lpName) + strlen(lpValue) + 2; - LPSTR string = (LPSTR) PAL_malloc(iLen); + LPSTR string = (LPSTR) malloc(iLen); if (string == nullptr) { bRet = FALSE; @@ -571,7 +571,7 @@ SetEnvironmentVariableA( sprintf_s(string, iLen, "%s=%s", lpName, lpValue); nResult = EnvironPutenv(string, FALSE) ? 0 : -1; - PAL_free(string); + free(string); string = nullptr; // If EnvironPutenv returns FALSE, it almost certainly failed to allocate memory. diff --git a/src/shared/pal/src/misc/error.cpp b/src/shared/pal/src/misc/error.cpp index 3abe03127c..6b67bf717d 100644 --- a/src/shared/pal/src/misc/error.cpp +++ b/src/shared/pal/src/misc/error.cpp @@ -26,45 +26,6 @@ using namespace CorUnix; SET_DEFAULT_DEBUG_CHANNEL(MISC); -/*++ -Function: - SetErrorMode - -The SetErrorMode function controls whether the system will handle the -specified types of serious errors, or whether the process will handle -them. - -Parameters - -uMode - [in] Specifies the process error mode. This parameter can be one or more of the following values. - - Value Action - 0 Use the system default, which is to display all error dialog boxes. - SEM_FAILCRITICALERRORS The system does not display the critical-error-handler message box. Instead, - the system sends the error to the calling process. - SEM_NOOPENFILEERRORBOX The system does not display a message box when it fails to find a file. Instead, - the error is returned to the calling process. - -Return Values - -The return value is the previous state of the error-mode bit flags. - ---*/ -UINT -PALAPI -SetErrorMode( - IN UINT uMode) -{ - PERF_ENTRY(SetErrorMode); - ENTRY("SetErrorMode (uMode=%#x)\n", uMode); - - LOGEXIT("SetErrorMode returns UINT 0\n"); - PERF_EXIT(SetErrorMode); - return 0; -} - - /*++ Function: GetLastError diff --git a/src/shared/pal/src/misc/errorstrings.cpp b/src/shared/pal/src/misc/errorstrings.cpp index 7963931b86..fbf9a3f4c1 100644 --- a/src/shared/pal/src/misc/errorstrings.cpp +++ b/src/shared/pal/src/misc/errorstrings.cpp @@ -163,7 +163,7 @@ LPCWSTR GetPalErrorString(DWORD code) ErrorString *stringEntry = (ErrorString *)bsearch( &searchEntry, palErrorStrings, - ARRAY_SIZE(palErrorStrings), + sizeof(palErrorStrings) / sizeof(palErrorStrings[0]), sizeof(ErrorString), CompareErrorStrings); diff --git a/src/shared/pal/src/misc/fmtmessage.cpp b/src/shared/pal/src/misc/fmtmessage.cpp index e9d87d19c4..0598914b06 100644 --- a/src/shared/pal/src/misc/fmtmessage.cpp +++ b/src/shared/pal/src/misc/fmtmessage.cpp @@ -25,8 +25,6 @@ Revision History: #include "pal/module.h" #include "pal/misc.h" -#include "pal/printfcpp.hpp" - #include "errorstrings.h" #include @@ -63,7 +61,7 @@ static LPWSTR FMTMSG_GetMessageString( DWORD dwErrCode ) allocChars = MAX_ERROR_STRING_LENGTH + 1; } - LPWSTR lpRetVal = (LPWSTR)PAL_malloc(allocChars * sizeof(WCHAR)); + LPWSTR lpRetVal = (LPWSTR)malloc(allocChars * sizeof(WCHAR)); if (lpRetVal) { @@ -73,7 +71,14 @@ static LPWSTR FMTMSG_GetMessageString( DWORD dwErrCode ) } else { - swprintf_s(lpRetVal, MAX_ERROR_STRING_LENGTH, W("Error %u"), dwErrCode); + char errorString[sizeof("Error 4294967295")]; + int cnt = sprintf_s(errorString, sizeof(errorString), "Error %u", dwErrCode); + cnt++; // +1 for null terminator + + // Widening characters is okay here because they are the + // same in both char and WCHAR. + for (int i = 0; i < cnt; ++i) + lpRetVal[i] = (WCHAR)errorString[i]; } } else @@ -91,7 +96,7 @@ Function : FMTMSG__watoi Converts a wide string repersentation of an integer number - into a interger number. + into a integer number. Returns a integer number, or 0 on failure. 0 is not a valid number for FormatMessage inserts. @@ -135,7 +140,7 @@ static INT FMTMSG__watoi( LPWSTR str ) UINT NumOfBytes = 0; \ nSize *= 2; \ NumOfBytes = nSize * sizeof( WCHAR ); \ - lpTemp = static_cast( PAL_malloc( NumOfBytes ) ); \ + lpTemp = static_cast( malloc( NumOfBytes ) ); \ TRACE( "Growing the buffer.\n" );\ \ if ( !lpTemp ) \ @@ -173,102 +178,6 @@ of _ADD_TO_STRING, as we will resize the buffer if necessary. */ _ADD_TO_STRING( c );\ } - -/*++ -Function : - - FMTMSG_ProcessPrintf - - Processes the printf formatters based on the format. - - Returns the LPWSTR string, or NULL on failure. -*/ - -static LPWSTR FMTMSG_ProcessPrintf( WCHAR c , - LPWSTR lpPrintfString, - LPWSTR lpInsertString) -{ - LPWSTR lpBuffer = NULL; - LPWSTR lpBuffer2 = NULL; - LPWSTR lpFormat = NULL; -#if _DEBUG - // small size for _DEBUG to exercise buffer reallocation logic - int tmpSize = 4; -#else - int tmpSize = 64; -#endif - UINT nFormatLength = 0; - int nBufferLength = 0; - - TRACE( "FMTMSG_ProcessPrintf( %C, %S, %p )\n", c, - lpPrintfString, lpInsertString ); - - switch ( c ) - { - case 'e' : - /* Fall through */ - case 'E' : - /* Fall through */ - case 'f' : - /* Fall through */ - case 'g' : - /* Fall through */ - case 'G' : - ERROR( "%%%c is not supported by FormatMessage.\n", c ); - SetLastError( ERROR_INVALID_PARAMETER ); - return NULL; - } - - nFormatLength = PAL_wcslen( lpPrintfString ) + 2; /* Need to count % AND NULL */ - lpFormat = (LPWSTR)PAL_malloc( nFormatLength * sizeof( WCHAR ) ); - if ( !lpFormat ) - { - ERROR( "Unable to allocate memory.\n" ); - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); - return NULL; - } - /* Create the format string. */ - memset( lpFormat, 0, nFormatLength * sizeof(WCHAR) ); - *lpFormat = '%'; - - PAL_wcscat( lpFormat, lpPrintfString ); - - lpBuffer = (LPWSTR) PAL_malloc(tmpSize*sizeof(WCHAR)); - - /* try until the buffer is big enough */ - while (TRUE) - { - if (!lpBuffer) - { - ERROR("Unable to allocate memory\n"); - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); - PAL_free(lpFormat); - return NULL; - } - nBufferLength = _snwprintf_s( lpBuffer, tmpSize, tmpSize, - lpFormat, lpInsertString); - - if ((nBufferLength >= 0) && (nBufferLength != tmpSize)) - { - break; /* succeeded */ - } - else - { - tmpSize *= 2; - lpBuffer2 = static_cast( - PAL_realloc(lpBuffer, tmpSize*sizeof(WCHAR))); - if (lpBuffer2 == NULL) - PAL_free(lpBuffer); - lpBuffer = lpBuffer2; - } - } - - PAL_free( lpFormat ); - lpFormat = NULL; - - return lpBuffer; -} - /*++ Function: FormatMessageW @@ -333,7 +242,7 @@ FormatMessageW( if ( !( dwFlags & FORMAT_MESSAGE_FROM_STRING ) && ( dwLanguageId != 0) ) { - ERROR( "Invalid language indentifier.\n" ); + ERROR( "Invalid language identifier.\n" ); SetLastError( ERROR_RESOURCE_LANG_NOT_FOUND ); goto exit; } @@ -400,7 +309,7 @@ FormatMessageW( } if ( !lpWorkingString ) { - ERROR( "Invalid error indentifier.\n" ); + ERROR( "Invalid error identifier.\n" ); SetLastError( ERROR_INVALID_ADDRESS ); } goto exit; @@ -418,7 +327,7 @@ FormatMessageW( } lpWorkingString = static_cast( - PAL_malloc( nSize * sizeof( WCHAR ) ) ); + malloc( nSize * sizeof( WCHAR ) ) ); if ( !lpWorkingString ) { ERROR( "Unable to allocate memory for the working string.\n" ); @@ -456,7 +365,7 @@ FormatMessageW( lpSourceString++; if ( iswdigit( *lpSourceString ) ) { - ERROR( "Invalid insert indentifier.\n" ); + ERROR( "Invalid insert identifier.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; @@ -466,7 +375,7 @@ FormatMessageW( Index = FMTMSG__watoi( Number ); if ( Index == 0 ) { - ERROR( "Invalid insert indentifier.\n" ); + ERROR( "Invalid insert identifier.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; @@ -474,113 +383,33 @@ FormatMessageW( } if ( *lpSourceString == '!' ) { - LPWSTR lpInsertString = NULL; - LPWSTR lpPrintfString = NULL; - LPWSTR lpStartOfFormattedString = NULL; - UINT nPrintfLength = 0; - LPWSTR lpFormattedString = NULL; - UINT nFormattedLength = 0; - - if ( !bIsVaList ) - { - lpInsertString = ((LPWSTR*)Arguments)[ Index - 1 ]; - } - else - { - va_list TheArgs; - - va_copy(TheArgs, *Arguments); - UINT i = 0; - for ( ; i < Index; i++ ) - { - lpInsertString = va_arg( TheArgs, LPWSTR ); - } - } - - /* Calculate the length, and extract the printf string.*/ - lpSourceString++; - { - LPWSTR p = PAL_wcschr( lpSourceString, '!' ); - - if ( NULL == p ) - { - nPrintfLength = 0; - } - else - { - nPrintfLength = p - lpSourceString; - } - } - - lpPrintfString = - (LPWSTR)PAL_malloc( ( nPrintfLength + 1 ) * sizeof( WCHAR ) ); - - if ( !lpPrintfString ) - { - ERROR( "Unable to allocate memory.\n" ); - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); - lpWorkingString = NULL; - nCount = 0; - goto exit; - } - - PAL_wcsncpy( lpPrintfString, lpSourceString, nPrintfLength ); - *( lpPrintfString + nPrintfLength ) = '\0'; - - lpStartOfFormattedString = lpFormattedString = - FMTMSG_ProcessPrintf( *lpPrintfString, - lpPrintfString, - lpInsertString); - - if ( !lpFormattedString ) - { - ERROR( "Unable to process the format string.\n" ); - /* Function will set the error code. */ - PAL_free( lpPrintfString ); - lpWorkingString = NULL; - goto exit; - } - - - nFormattedLength = PAL_wcslen( lpFormattedString ); - - /* Append the processed printf string into the working string */ - while ( *lpFormattedString ) - { - _CHECKED_ADD_TO_STRING( *lpFormattedString ); - lpFormattedString++; - } + ERROR( "Embedded printf formatting ('!!') is unsupported\n" ); + SetLastError( ERROR_INVALID_PARAMETER ); + lpWorkingString = NULL; + nCount = 0; + goto exit; + } - lpSourceString += nPrintfLength + 1; - PAL_free( lpPrintfString ); - PAL_free( lpStartOfFormattedString ); - lpPrintfString = lpFormattedString = NULL; + LPWSTR lpInsert = NULL; + if ( !bIsVaList ) + { + lpInsert = ((LPWSTR*)Arguments)[Index - 1]; } else { - /* The printf format string defaults to 's'.*/ - LPWSTR lpInsert = NULL; - - if ( !bIsVaList ) - { - lpInsert = ((LPWSTR*)Arguments)[Index - 1]; - } - else + va_list TheArgs; + va_copy(TheArgs, *Arguments); + UINT i = 0; + for ( ; i < Index; i++ ) { - va_list TheArgs; - va_copy(TheArgs, *Arguments); - UINT i = 0; - for ( ; i < Index; i++ ) - { - lpInsert = va_arg( TheArgs, LPWSTR ); - } + lpInsert = va_arg( TheArgs, LPWSTR ); } + } - while ( *lpInsert ) - { - _CHECKED_ADD_TO_STRING( *lpInsert ); - lpInsert++; - } + while ( *lpInsert ) + { + _CHECKED_ADD_TO_STRING( *lpInsert ); + lpInsert++; } } /* Format specifiers. */ diff --git a/src/shared/pal/src/misc/miscpalapi.cpp b/src/shared/pal/src/misc/miscpalapi.cpp index b8723e5c38..f0d32f0388 100644 --- a/src/shared/pal/src/misc/miscpalapi.cpp +++ b/src/shared/pal/src/misc/miscpalapi.cpp @@ -29,6 +29,7 @@ Revision History: #include #include +#include #include #include #include @@ -43,192 +44,6 @@ SET_DEFAULT_DEBUG_CHANNEL(MISC); static const char URANDOM_DEVICE_NAME[]="/dev/urandom"; -/*++ - -Function : - - PAL_GetPALDirectoryW - - Returns the fully qualified path name - where the PALL DLL was loaded from. - - On failure it returns FALSE and sets the - proper LastError code. - ---*/ -BOOL -PAL_GetPALDirectoryW( - PathWCharString& lpDirectoryName) -{ - LPCWSTR lpFullPathAndName = NULL; - LPCWSTR lpEndPoint = NULL; - BOOL bRet = FALSE; - - PERF_ENTRY(PAL_GetPALDirectoryW); - - MODSTRUCT *module = LOADGetPalLibrary(); - if (!module) - { - SetLastError(ERROR_INTERNAL_ERROR); - goto EXIT; - } - lpFullPathAndName = module->lib_name; - if (lpFullPathAndName == NULL) - { - SetLastError(ERROR_INTERNAL_ERROR); - goto EXIT; - } - lpEndPoint = PAL_wcsrchr( lpFullPathAndName, '/' ); - if ( lpEndPoint ) - { - /* The path that we return is required to have - the trailing slash on the end.*/ - lpEndPoint++; - - - if(!lpDirectoryName.Set(lpFullPathAndName,lpEndPoint - lpFullPathAndName)) - { - ASSERT( "The buffer was not large enough.\n" ); - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - goto EXIT; - } - - bRet = TRUE; - } - else - { - ASSERT( "Unable to determine the path.\n" ); - /* Error path, should not be executed. */ - SetLastError( ERROR_INTERNAL_ERROR ); - } - -EXIT: - PERF_EXIT(PAL_GetPALDirectoryW); - return bRet; -} - -BOOL -PAL_GetPALDirectoryA( - PathCharString& lpDirectoryName) -{ - BOOL bRet; - PathWCharString directory; - - PERF_ENTRY(PAL_GetPALDirectoryA); - - bRet = PAL_GetPALDirectoryW(directory); - - if (bRet) - { - - int length = WideCharToMultiByte(CP_ACP, 0, directory.GetString(), -1, NULL, 0, NULL, 0); - LPSTR DirectoryName = lpDirectoryName.OpenStringBuffer(length); - if (NULL == DirectoryName) - { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - bRet = FALSE; - } - - length = WideCharToMultiByte(CP_ACP, 0, directory.GetString(), -1, DirectoryName, length, NULL, 0); - - if (0 == length) - { - bRet = FALSE; - length++; - } - - lpDirectoryName.CloseBuffer(length - 1); - } - - PERF_EXIT(PAL_GetPALDirectoryA); - return bRet; -} - -/*++ - -Function : - - PAL_GetPALDirectoryW - - Returns the fully qualified path name - where the PALL DLL was loaded from. - - On failure it returns FALSE and sets the - proper LastError code. - -See rotor_pal.doc for more details. - ---*/ -PALIMPORT -BOOL -PALAPI -PAL_GetPALDirectoryW( - OUT LPWSTR lpDirectoryName, - IN OUT UINT* cchDirectoryName) -{ - PathWCharString directory; - BOOL bRet; - PERF_ENTRY(PAL_GetPALDirectoryW); - ENTRY( "PAL_GetPALDirectoryW( %p, %d )\n", lpDirectoryName, *cchDirectoryName ); - - bRet = PAL_GetPALDirectoryW(directory); - - if (bRet) { - - if (directory.GetCount() > *cchDirectoryName) - { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - bRet = FALSE; - } - else - { - PAL_wcscpy(lpDirectoryName, directory.GetString()); - } - - *cchDirectoryName = directory.GetCount(); - } - - LOGEXIT( "PAL_GetPALDirectoryW returns BOOL %d.\n", bRet); - PERF_EXIT(PAL_GetPALDirectoryW); - return bRet; - -} - -PALIMPORT -BOOL -PALAPI -PAL_GetPALDirectoryA( - OUT LPSTR lpDirectoryName, - IN OUT UINT* cchDirectoryName) -{ - BOOL bRet; - PathCharString directory; - - PERF_ENTRY(PAL_GetPALDirectoryA); - ENTRY( "PAL_GetPALDirectoryA( %p, %d )\n", lpDirectoryName, *cchDirectoryName ); - - bRet = PAL_GetPALDirectoryA(directory); - - if (bRet) - { - if (directory.GetCount() > *cchDirectoryName) - { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - bRet = FALSE; - } - else if (strcpy_s(lpDirectoryName, *cchDirectoryName, directory.GetString()) != SAFECRT_SUCCESS) - { - bRet = FALSE; - } - - *cchDirectoryName = directory.GetCount(); - } - - LOGEXIT( "PAL_GetPALDirectoryA returns BOOL %d.\n", bRet); - PERF_EXIT(PAL_GetPALDirectoryA); - return bRet; -} - VOID PALAPI PAL_Random( diff --git a/src/shared/pal/src/misc/strutil.cpp b/src/shared/pal/src/misc/strutil.cpp index ed29831232..e665e22b65 100644 --- a/src/shared/pal/src/misc/strutil.cpp +++ b/src/shared/pal/src/misc/strutil.cpp @@ -53,7 +53,7 @@ CPalString::CopyString( _ASSERTE(psSource->GetMaxLength() > psSource->GetStringLength()); WCHAR *pwsz = reinterpret_cast( - InternalMalloc(psSource->GetMaxLength() * sizeof(WCHAR)) + malloc(psSource->GetMaxLength() * sizeof(WCHAR)) ); if (NULL != pwsz) diff --git a/src/shared/pal/src/misc/sysinfo.cpp b/src/shared/pal/src/misc/sysinfo.cpp index 4e08089d96..d20fa7b2aa 100644 --- a/src/shared/pal/src/misc/sysinfo.cpp +++ b/src/shared/pal/src/misc/sysinfo.cpp @@ -40,20 +40,12 @@ Revision History: #include #endif -#if HAVE_SYSINFO -#include -#endif - #include #if HAVE_SYS_VMPARAM_H #include #endif // HAVE_SYS_VMPARAM_H -#if HAVE_XSWDEV -#include -#endif // HAVE_XSWDEV - #if HAVE_MACH_VM_TYPES_H #include #endif // HAVE_MACH_VM_TYPES_H @@ -92,10 +84,6 @@ Revision History: #include -#if HAVE_SWAPCTL -#include -#endif - SET_DEFAULT_DEBUG_CHANNEL(MISC); #ifndef __APPLE__ @@ -249,391 +237,3 @@ GetSystemInfo( LOGEXIT("GetSystemInfo returns VOID\n"); PERF_EXIT(GetSystemInfo); } - -// Get memory size multiplier based on the passed in units (k = kilo, m = mega, g = giga) -static uint64_t GetMemorySizeMultiplier(char units) -{ - switch(units) - { - case 'g': - case 'G': return 1024 * 1024 * 1024; - case 'm': - case 'M': return 1024 * 1024; - case 'k': - case 'K': return 1024; - } - - // No units multiplier - return 1; -} - -#ifndef __APPLE__ -// Try to read the MemAvailable entry from /proc/meminfo. -// Return true if the /proc/meminfo existed, the entry was present and we were able to parse it. -static bool ReadMemAvailable(uint64_t* memAvailable) -{ - bool foundMemAvailable = false; - FILE* memInfoFile = fopen("/proc/meminfo", "r"); - if (memInfoFile != NULL) - { - char *line = nullptr; - size_t lineLen = 0; - - while (getline(&line, &lineLen, memInfoFile) != -1) - { - char units = '\0'; - uint64_t available; - int fieldsParsed = sscanf(line, "MemAvailable: %" SCNu64 " %cB", &available, &units); - - if (fieldsParsed >= 1) - { - uint64_t multiplier = GetMemorySizeMultiplier(units); - *memAvailable = available * multiplier; - foundMemAvailable = true; - break; - } - } - - free(line); - fclose(memInfoFile); - } - - return foundMemAvailable; -} -#endif // __APPLE__ - -/*++ -Function: - GlobalMemoryStatusEx - -GlobalMemoryStatusEx - -Retrieves information about the system's current usage of both physical and virtual memory. - -Return Values - -This function returns a BOOL to indicate its success status. - ---*/ -BOOL -PALAPI -GlobalMemoryStatusEx( - IN OUT LPMEMORYSTATUSEX lpBuffer) -{ - - PERF_ENTRY(GlobalMemoryStatusEx); - ENTRY("GlobalMemoryStatusEx (lpBuffer=%p)\n", lpBuffer); - - lpBuffer->dwMemoryLoad = 0; - lpBuffer->ullTotalPhys = 0; - lpBuffer->ullAvailPhys = 0; - lpBuffer->ullTotalPageFile = 0; - lpBuffer->ullAvailPageFile = 0; - lpBuffer->ullTotalVirtual = 0; - lpBuffer->ullAvailVirtual = 0; - lpBuffer->ullAvailExtendedVirtual = 0; - - BOOL fRetVal = FALSE; - int rc; - - // Get the physical memory size -#if HAVE_SYSCONF && HAVE__SC_PHYS_PAGES - int64_t physical_memory; - - // Get the Physical memory size - physical_memory = sysconf( _SC_PHYS_PAGES ) * sysconf( _SC_PAGE_SIZE ); - lpBuffer->ullTotalPhys = (DWORDLONG)physical_memory; - fRetVal = TRUE; -#elif HAVE_SYSCTL - int64_t physical_memory; - size_t length; - // Get the Physical memory size - int mib[] = { CTL_HW, HW_MEMSIZE }; - length = sizeof(INT64); - rc = sysctl(mib, 2, &physical_memory, &length, NULL, 0); - if (rc != 0) - { - ASSERT("sysctl failed for HW_MEMSIZE (%d)\n", errno); - } - else - { - lpBuffer->ullTotalPhys = (DWORDLONG)physical_memory; - fRetVal = TRUE; - } - -#endif // HAVE_SYSCTL - - // Get swap file size, consider the ability to get the values optional - // (don't return FALSE from the GlobalMemoryStatusEx) -#if HAVE_XSW_USAGE - // This is available on OSX - struct xsw_usage xsu; - int mib[] = { CTL_HW, VM_SWAPUSAGE }; - size_t length = sizeof(xsu); - rc = sysctl(mib, 2, &xsu, &length, NULL, 0); - if (rc == 0) - { - lpBuffer->ullTotalPageFile = xsu.xsu_total; - lpBuffer->ullAvailPageFile = xsu.xsu_avail; - } -#elif HAVE_XSWDEV - // E.g. FreeBSD - struct xswdev xsw; - int mib[3]; - size_t length = 2; - rc = sysctlnametomib("vm.swap_info", mib, &length); - if (rc == 0) - { - int pagesize = getpagesize(); - // Aggregate the information for all swap files on the system - for (mib[2] = 0; ; mib[2]++) - { - length = sizeof(xsw); - rc = sysctl(mib, 3, &xsw, &length, NULL, 0); - if ((rc < 0) || (xsw.xsw_version != XSWDEV_VERSION)) - { - // All the swap files were processed or coreclr was built against - // a version of headers not compatible with the current XSWDEV_VERSION. - break; - } - - DWORDLONG avail = xsw.xsw_nblks - xsw.xsw_used; - lpBuffer->ullTotalPageFile += (DWORDLONG)xsw.xsw_nblks * pagesize; - lpBuffer->ullAvailPageFile += (DWORDLONG)avail * pagesize; - } - } -#elif HAVE_SWAPCTL - struct anoninfo ai; - if (swapctl(SC_AINFO, &ai) != -1) - { - int pagesize = getpagesize(); - lpBuffer->ullTotalPageFile = ai.ani_max * pagesize; - lpBuffer->ullAvailPageFile = ai.ani_free * pagesize; - } -#elif HAVE_SYSINFO - // Linux - struct sysinfo info; - rc = sysinfo(&info); - if (rc == 0) - { - lpBuffer->ullTotalPageFile = info.totalswap; - lpBuffer->ullAvailPageFile = info.freeswap; -#if HAVE_SYSINFO_WITH_MEM_UNIT - // A newer version of the sysinfo structure represents all the sizes - // in mem_unit instead of bytes - lpBuffer->ullTotalPageFile *= info.mem_unit; - lpBuffer->ullAvailPageFile *= info.mem_unit; -#endif // HAVE_SYSINFO_WITH_MEM_UNIT - } -#endif // HAVE_SYSINFO - - // Get the physical memory in use - from it, we can get the physical memory available. - // We do this only when we have the total physical memory available. - if (lpBuffer->ullTotalPhys > 0) - { -#ifndef __APPLE__ - static volatile bool tryReadMemInfo = true; - - if (tryReadMemInfo) - { - // Ensure that we don't try to read the /proc/meminfo in successive calls to the GlobalMemoryStatusEx - // if we have failed to access the file or the file didn't contain the MemAvailable value. - tryReadMemInfo = ReadMemAvailable(&lpBuffer->ullAvailPhys); - } - - if (!tryReadMemInfo) - { - // The /proc/meminfo doesn't exist or it doesn't contain the MemAvailable row or the format of the row is invalid - // Fall back to getting the available pages using sysconf. - lpBuffer->ullAvailPhys = sysconf(SYSCONF_PAGES) * sysconf(_SC_PAGE_SIZE); - } - - INT64 used_memory = lpBuffer->ullTotalPhys - lpBuffer->ullAvailPhys; - lpBuffer->dwMemoryLoad = (DWORD)((used_memory * 100) / lpBuffer->ullTotalPhys); -#else - vm_size_t page_size; - mach_port_t mach_port; - mach_msg_type_number_t count; - vm_statistics_data_t vm_stats; - mach_port = mach_host_self(); - count = sizeof(vm_stats) / sizeof(natural_t); - if (KERN_SUCCESS == host_page_size(mach_port, &page_size)) - { - if (KERN_SUCCESS == host_statistics(mach_port, HOST_VM_INFO, (host_info_t)&vm_stats, &count)) - { - lpBuffer->ullAvailPhys = (int64_t)vm_stats.free_count * (int64_t)page_size; - INT64 used_memory = ((INT64)vm_stats.active_count + (INT64)vm_stats.inactive_count + (INT64)vm_stats.wire_count) * (INT64)page_size; - lpBuffer->dwMemoryLoad = (DWORD)((used_memory * 100) / lpBuffer->ullTotalPhys); - } - } - mach_port_deallocate(mach_task_self(), mach_port); -#endif // __APPLE__ - } - -#ifndef TARGET_RISCV64 - // There is no API to get the total virtual address space size on - // Unix, so we use a constant value representing 128TB, which is - // the approximate size of total user virtual address space on - // the currently supported Unix systems. - static const UINT64 VMSize = (1ull << 47); -#else // TARGET_RISCV64 - // For RISC-V Linux Kernel SV39 virtual memory limit is 256gb. - static const UINT64 VMSize = (1ull << 38); -#endif // TARGET_RISCV64 - lpBuffer->ullTotalVirtual = VMSize; - lpBuffer->ullAvailVirtual = lpBuffer->ullAvailPhys; - - LOGEXIT("GlobalMemoryStatusEx returns %d\n", fRetVal); - PERF_EXIT(GlobalMemoryStatusEx); - - return fRetVal; -} - -PALIMPORT -DWORD -PALAPI -GetCurrentProcessorNumber() -{ -#if HAVE_SCHED_GETCPU - return sched_getcpu(); -#else //HAVE_SCHED_GETCPU - return -1; -#endif //HAVE_SCHED_GETCPU -} - -BOOL -PALAPI -PAL_HasGetCurrentProcessorNumber() -{ - return HAVE_SCHED_GETCPU; -} - -bool -ReadMemoryValueFromFile(const char* filename, uint64_t* val) -{ - bool result = false; - char *line = nullptr; - size_t lineLen = 0; - char* endptr = nullptr; - uint64_t num = 0, multiplier; - - if (val == nullptr) - return false; - - FILE* file = fopen(filename, "r"); - if (file == nullptr) - goto done; - - if (getline(&line, &lineLen, file) == -1) - goto done; - - errno = 0; - num = strtoull(line, &endptr, 0); - if (errno != 0) - goto done; - - multiplier = GetMemorySizeMultiplier(*endptr); - *val = num * multiplier; - result = true; - if (*val/multiplier != num) - result = false; -done: - if (file) - fclose(file); - free(line); - return result; -} - -size_t -PALAPI -PAL_GetLogicalProcessorCacheSizeFromOS() -{ - size_t cacheSize = 0; - -#ifdef _SC_LEVEL1_DCACHE_SIZE - cacheSize = std::max(cacheSize, (size_t)sysconf(_SC_LEVEL1_DCACHE_SIZE)); -#endif -#ifdef _SC_LEVEL2_CACHE_SIZE - cacheSize = std::max(cacheSize, (size_t)sysconf(_SC_LEVEL2_CACHE_SIZE)); -#endif -#ifdef _SC_LEVEL3_CACHE_SIZE - cacheSize = std::max(cacheSize, (size_t)sysconf(_SC_LEVEL3_CACHE_SIZE)); -#endif -#ifdef _SC_LEVEL4_CACHE_SIZE - cacheSize = std::max(cacheSize, (size_t)sysconf(_SC_LEVEL4_CACHE_SIZE)); -#endif - -#if defined(TARGET_LINUX) && !defined(HOST_ARM) && !defined(HOST_X86) - if (cacheSize == 0) - { - // - // Fallback to retrieve cachesize via /sys/.. if sysconf was not available - // for the platform. Currently musl and arm64 should be only cases to use - // this method to determine cache size. - // - size_t size; - - if(ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index0/size", &size)) - cacheSize = std::max(cacheSize, size); - if(ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index1/size", &size)) - cacheSize = std::max(cacheSize, size); - if(ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index2/size", &size)) - cacheSize = std::max(cacheSize, size); - if(ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index3/size", &size)) - cacheSize = std::max(cacheSize, size); - if(ReadMemoryValueFromFile("/sys/devices/system/cpu/cpu0/cache/index4/size", &size)) - cacheSize = std::max(cacheSize, size); - } -#endif - -#if defined(HOST_ARM64) && !defined(TARGET_OSX) - if (cacheSize == 0) - { - // It is currently expected to be missing cache size info - // - // _SC_LEVEL*_*CACHE_SIZE is not yet present. Work is in progress to enable this for arm64 - // - // /sys/devices/system/cpu/cpu*/cache/index*/ is also not yet present in most systems. - // Arm64 patch is in Linux kernel tip. - // - // midr_el1 is available in "/sys/devices/system/cpu/cpu0/regs/identification/midr_el1", - // but without an exhaustive list of ARM64 processors any decode of midr_el1 - // Would likely be incomplete - - // Published information on ARM64 architectures is limited. - // If we use recent high core count chips as a guide for state of the art, we find - // total L3 cache to be 1-2MB/core. As always, there are exceptions. - - // Estimate cache size based on CPU count - // Assume lower core count are lighter weight parts which are likely to have smaller caches - // Assume L3$/CPU grows linearly from 256K to 1.5M/CPU as logicalCPUs grows from 2 to 12 CPUs - DWORD logicalCPUs = PAL_GetLogicalCpuCountFromOS(); - - cacheSize = logicalCPUs*std::min(1536, std::max(256, (int)logicalCPUs*128))*1024; - } -#endif - -#if HAVE_SYSCTLBYNAME - if (cacheSize == 0) - { - int64_t cacheSizeFromSysctl = 0; - size_t sz = sizeof(cacheSizeFromSysctl); - const bool success = false - // macOS-arm64: Since macOS 12.0, Apple added ".perflevelX." to determinate cache sizes for efficiency - // and performance cores separetely. "perflevel0" stands for "performance" - || sysctlbyname("hw.perflevel0.l2cachesize", &cacheSizeFromSysctl, &sz, nullptr, 0) == 0 - // macOS-arm64: these report cache sizes for efficiency cores only: - || sysctlbyname("hw.l3cachesize", &cacheSizeFromSysctl, &sz, nullptr, 0) == 0 - || sysctlbyname("hw.l2cachesize", &cacheSizeFromSysctl, &sz, nullptr, 0) == 0 - || sysctlbyname("hw.l1dcachesize", &cacheSizeFromSysctl, &sz, nullptr, 0) == 0; - - if (success) - { - _ASSERTE(cacheSizeFromSysctl > 0); - cacheSize = (size_t) cacheSizeFromSysctl; - } - } -#endif - - return cacheSize; -} diff --git a/src/shared/pal/src/misc/time.cpp b/src/shared/pal/src/misc/time.cpp index 2fddd2ff77..3e54cfedb8 100644 --- a/src/shared/pal/src/misc/time.cpp +++ b/src/shared/pal/src/misc/time.cpp @@ -82,13 +82,13 @@ GetSystemTime( goto EXIT; } - lpSystemTime->wYear = 1900 + utPtr->tm_year; - lpSystemTime->wMonth = utPtr->tm_mon + 1; - lpSystemTime->wDayOfWeek = utPtr->tm_wday; - lpSystemTime->wDay = utPtr->tm_mday; - lpSystemTime->wHour = utPtr->tm_hour; - lpSystemTime->wMinute = utPtr->tm_min; - lpSystemTime->wSecond = utPtr->tm_sec; + lpSystemTime->wYear = (WORD)(1900 + utPtr->tm_year); + lpSystemTime->wMonth = (WORD)(utPtr->tm_mon + 1); + lpSystemTime->wDayOfWeek = (WORD)utPtr->tm_wday; + lpSystemTime->wDay = (WORD)utPtr->tm_mday; + lpSystemTime->wHour = (WORD)utPtr->tm_hour; + lpSystemTime->wMinute = (WORD)utPtr->tm_min; + lpSystemTime->wSecond = (WORD)utPtr->tm_sec; if(-1 == timeofday_retval) { @@ -101,7 +101,7 @@ GetSystemTime( int old_seconds; int new_seconds; - lpSystemTime->wMilliseconds = timeval.tv_usec/tccMillieSecondsToMicroSeconds; + lpSystemTime->wMilliseconds = (WORD)(timeval.tv_usec/tccMillieSecondsToMicroSeconds); old_seconds = utPtr->tm_sec; new_seconds = timeval.tv_sec%60; diff --git a/src/shared/pal/src/misc/utils.cpp b/src/shared/pal/src/misc/utils.cpp index f279ef3d58..261be25bca 100644 --- a/src/shared/pal/src/misc/utils.cpp +++ b/src/shared/pal/src/misc/utils.cpp @@ -190,7 +190,7 @@ LPSTR UTIL_WCToMB_Alloc(LPCWSTR lpWideCharStr, int cchWideChar) } /* allocate required buffer */ - lpMultiByteStr = (LPSTR)PAL_malloc(length); + lpMultiByteStr = (LPSTR)malloc(length); if(NULL == lpMultiByteStr) { ERROR("malloc() failed! errno is %d (%s)\n", errno,strerror(errno)); @@ -204,7 +204,7 @@ LPSTR UTIL_WCToMB_Alloc(LPCWSTR lpWideCharStr, int cchWideChar) if(0 == length) { ASSERT("WCToMB error; GetLastError returns %#x\n", GetLastError()); - PAL_free(lpMultiByteStr); + free(lpMultiByteStr); return NULL; } return lpMultiByteStr; @@ -250,7 +250,7 @@ LPWSTR UTIL_MBToWC_Alloc(LPCSTR lpMultiByteStr, int cbMultiByte) return NULL; } - lpWideCharStr = (LPWSTR)PAL_malloc(fullsize); + lpWideCharStr = (LPWSTR)malloc(fullsize); if(NULL == lpWideCharStr) { ERROR("malloc() failed! errno is %d (%s)\n", errno,strerror(errno)); @@ -264,7 +264,7 @@ LPWSTR UTIL_MBToWC_Alloc(LPCSTR lpMultiByteStr, int cbMultiByte) if(0 >= length) { ASSERT("MCToMB error; GetLastError returns %#x\n", GetLastError()); - PAL_free(lpWideCharStr); + free(lpWideCharStr); return NULL; } return lpWideCharStr; @@ -366,3 +366,61 @@ BOOL IsRunningOnMojaveHardenedRuntime() } #endif // __APPLE__ + +const char *GetFriendlyErrorCodeString(int errorCode) +{ +#if HAVE_STRERRORNAME_NP + const char *error = strerrorname_np(errorCode); + if (error != nullptr) + { + return error; + } +#else // !HAVE_STRERRORNAME_NP + switch (errorCode) + { + case EACCES: return "EACCES"; + #if EAGAIN == EWOULDBLOCK + case EAGAIN: return "EAGAIN/EWOULDBLOCK"; + #else + case EAGAIN: return "EAGAIN"; + case EWOULDBLOCK: return "EWOULDBLOCK"; + #endif + case EBADF: return "EBADF"; + case EBUSY: return "EBUSY"; + case EDQUOT: return "EDQUOT"; + case EEXIST: return "EEXIST"; + case EFAULT: return "EFAULT"; + case EFBIG: return "EFBIG"; + case EINVAL: return "EINVAL"; + case EINTR: return "EINTR"; + case EIO: return "EIO"; + case EISDIR: return "EISDIR"; + case ELOOP: return "ELOOP"; + case EMFILE: return "EMFILE"; + case EMLINK: return "EMLINK"; + case ENAMETOOLONG: return "ENAMETOOLONG"; + case ENFILE: return "ENFILE"; + case ENODEV: return "ENODEV"; + case ENOENT: return "ENOENT"; + case ENOLCK: return "ENOLCK"; + case ENOMEM: return "ENOMEM"; + case ENOSPC: return "ENOSPC"; + #if ENOTSUP == EOPNOTSUPP + case ENOTSUP: return "ENOTSUP/EOPNOTSUPP"; + #else + case ENOTSUP: return "ENOTSUP"; + case EOPNOTSUPP: return "EOPNOTSUPP"; + #endif + case ENOTDIR: return "ENOTDIR"; + case ENOTEMPTY: return "ENOTEMPTY"; + case ENXIO: return "ENXIO"; + case EOVERFLOW: return "EOVERFLOW"; + case EPERM: return "EPERM"; + case EROFS: return "EROFS"; + case ETXTBSY: return "ETXTBSY"; + case EXDEV: return "EXDEV"; + } +#endif // HAVE_STRERRORNAME_NP + + return strerror(errorCode); +} diff --git a/src/shared/pal/src/objmgr/palobjbase.cpp b/src/shared/pal/src/objmgr/palobjbase.cpp index d81c04ebfd..c39b5df7e2 100644 --- a/src/shared/pal/src/objmgr/palobjbase.cpp +++ b/src/shared/pal/src/objmgr/palobjbase.cpp @@ -58,7 +58,7 @@ CPalObjectBase::Initialize( if (0 != m_pot->GetImmutableDataSize()) { - m_pvImmutableData = InternalMalloc(m_pot->GetImmutableDataSize()); + m_pvImmutableData = malloc(m_pot->GetImmutableDataSize()); if (NULL != m_pvImmutableData) { ZeroMemory(m_pvImmutableData, m_pot->GetImmutableDataSize()); @@ -67,7 +67,7 @@ CPalObjectBase::Initialize( { ERROR("Unable to allocate immutable data\n"); palError = ERROR_OUTOFMEMORY; - goto IntializeExit; + goto InitializeExit; } } @@ -77,10 +77,10 @@ CPalObjectBase::Initialize( if (NO_ERROR != palError) { ERROR("Unable to initialize local data lock!\n"); - goto IntializeExit; + goto InitializeExit; } - m_pvLocalData = InternalMalloc(m_pot->GetProcessLocalDataSize()); + m_pvLocalData = malloc(m_pot->GetProcessLocalDataSize()); if (NULL != m_pvLocalData) { ZeroMemory(m_pvLocalData, m_pot->GetProcessLocalDataSize()); @@ -89,7 +89,7 @@ CPalObjectBase::Initialize( { ERROR("Unable to allocate local data\n"); palError = ERROR_OUTOFMEMORY; - goto IntializeExit; + goto InitializeExit; } } @@ -98,7 +98,7 @@ CPalObjectBase::Initialize( palError = m_oa.sObjectName.CopyString(&poa->sObjectName); } -IntializeExit: +InitializeExit: LOGEXIT("CPalObjectBase::Initialize returns %d\n", palError); diff --git a/src/shared/pal/src/objmgr/shmobject.cpp b/src/shared/pal/src/objmgr/shmobject.cpp index 35cfc76f33..282dd113da 100644 --- a/src/shared/pal/src/objmgr/shmobject.cpp +++ b/src/shared/pal/src/objmgr/shmobject.cpp @@ -119,7 +119,7 @@ CSharedMemoryObject::Initialize( // Allocate local memory to hold the shared data // - m_pvSharedData = InternalMalloc(m_pot->GetSharedDataSize()); + m_pvSharedData = malloc(m_pot->GetSharedDataSize()); if (NULL == m_pvSharedData) { ERROR("Failure allocating m_pvSharedData (local copy)\n"); @@ -134,7 +134,7 @@ CSharedMemoryObject::Initialize( InitializeExit: - LOGEXIT("CSharedMemoryObject::Initalize returns %d\n", palError); + LOGEXIT("CSharedMemoryObject::Initialize returns %d\n", palError); return palError; } @@ -281,7 +281,7 @@ CSharedMemoryObject::InitializeFromExistingSharedData( InitializeFromExistingSharedDataExit: - LOGEXIT("CSharedMemoryObject::InitalizeFromExistingSharedData returns %d\n", palError); + LOGEXIT("CSharedMemoryObject::InitializeFromExistingSharedData returns %d\n", palError); return palError; } @@ -756,21 +756,6 @@ CSharedMemoryObject::~CSharedMemoryObject() LOGEXIT("CSharedMemoryObject::~CSharedMemoryObject\n"); } -// -// C++ standard, 18.1.5 - offsetof requires a POD (plain old data) struct or -// union. Since offsetof is a macro, gcc doesn't actually check for improper -// use of offsetof, it keys off of the -> from NULL (which is also invalid for -// non-POD types by 18.1.5) -// -// As we have numerous examples of this behavior in our codebase, -// making an offsetof which doesn't use 0. -// -// PAL_safe_offsetof is a version of offsetof that protects against an -// overridden operator& -// - -#define PAL_safe_offsetof(s,m) ((size_t)((ptrdiff_t)&(char&)(((s *)64)->m))-64) - /*++ Function: CSharedMemoryObject::GetObjectFromListLink @@ -798,7 +783,7 @@ CSharedMemoryObject::GetObjectFromListLink(PLIST_ENTRY ple) // pshmo = reinterpret_cast( - reinterpret_cast(ple) - PAL_safe_offsetof(CSharedMemoryObject, m_le) + reinterpret_cast(ple) - offsetof(CSharedMemoryObject, m_le) ); _ASSERTE(ple == &pshmo->m_le); diff --git a/src/shared/pal/src/safecrt/cruntime.h b/src/shared/pal/src/safecrt/cruntime.h index 87dc02c5af..50b1e8abf6 100644 --- a/src/shared/pal/src/safecrt/cruntime.h +++ b/src/shared/pal/src/safecrt/cruntime.h @@ -35,14 +35,14 @@ #endif /* defined (_SYSCRT) && defined (HOST_64BIT) */ #if !defined (UNALIGNED) -#if defined (_M_AMD64) +#if defined (TARGET_AMD64) #define UNALIGNED __unaligned -#else /* defined (_M_AMD64) */ +#else /* defined (TARGET_AMD64) */ #define UNALIGNED -#endif /* defined (_M_AMD64) */ +#endif /* defined (TARGET_AMD64) */ #endif /* !defined (UNALIGNED) */ -#ifdef _M_IX86 +#ifdef TARGET_X86 /* * 386/486 */ @@ -56,7 +56,7 @@ #define REG8 #define REG9 -#elif defined (_M_AMD64) +#elif defined (TARGET_AMD64) /* * AMD64 */ @@ -70,7 +70,7 @@ #define REG8 register #define REG9 register -#else /* defined (_M_AMD64) */ +#else /* defined (TARGET_AMD64) */ #pragma message ("Machine register set not defined") @@ -88,7 +88,7 @@ #define REG8 #define REG9 -#endif /* defined (_M_AMD64) */ +#endif /* defined (TARGET_AMD64) */ /* * Are the macro definitions below still needed in this file? diff --git a/src/shared/pal/src/safecrt/input.inl b/src/shared/pal/src/safecrt/input.inl index dd3870c26b..1ee887c2ad 100644 --- a/src/shared/pal/src/safecrt/input.inl +++ b/src/shared/pal/src/safecrt/input.inl @@ -28,8 +28,6 @@ #define _INTEGRAL_MAX_BITS 64 #endif /* _INTEGRAL_MAX_BITS */ -// typedef __int64_t __int64; - #ifndef FALSE #define FALSE 0 #endif @@ -40,18 +38,15 @@ #define UNALIGNED -#define _BEGIN_SECURE_CRT_DEPRECATION_DISABLE -#define _END_SECURE_CRT_DEPRECATION_DISABLE - #define _CVTBUFSIZE (309+40) /* # of digits in max. dp value + slop */ #define _MBTOWC(x,y,z) _minimal_chartowchar( x, y ) #define _istspace(x) isspace((unsigned char)x) -#define _malloc_crt PAL_malloc -#define _realloc_crt PAL_realloc -#define _free_crt PAL_free +#define _malloc_crt malloc +#define _realloc_crt realloc +#define _free_crt free #define _FASSIGN(flag, argument, number, dec_point, locale) _safecrt_fassign((flag), (argument), (number)) #define _WFASSIGN(flag, argument, number, dec_point, locale) _safecrt_wfassign((flag), (argument), (number)) @@ -220,10 +215,10 @@ static int __check_float_string(size_t nFloatStrUsed, #endif /* _UNICODE */ { _TCHAR floatstring[_CVTBUFSIZE + 1]; - _TCHAR *pFloatStr = floatstring; - size_t nFloatStrUsed = 0; - size_t nFloatStrSz = ARRAY_SIZE(floatstring); - int malloc_FloatStrFlag = 0; + _TCHAR *pFloatStr=floatstring; + size_t nFloatStrUsed=0; + size_t nFloatStrSz=sizeof(floatstring)/sizeof(floatstring[0]); + int malloc_FloatStrFlag=0; unsigned long number; /* temp hold-value */ #if ALLOC_TABLE @@ -354,6 +349,7 @@ static int __check_float_string(size_t nFloatStrUsed, break; #if _INTEGRAL_MAX_BITS >= 64 + case _T('z'): case _T('I'): if ( (*(format + 1) == _T('6')) && (*(format + 2) == _T('4')) ) @@ -375,14 +371,14 @@ static int __check_float_string(size_t nFloatStrUsed, (*(format + 1) == _T('x')) || (*(format + 1) == _T('X')) ) { - if (sizeof(void*) == sizeof(__int64)) + if (sizeof(void*) == sizeof(int64_t)) { ++integer64; num64 = 0; } break; } - if (sizeof(void*) == sizeof(__int64)) + if (sizeof(void*) == sizeof(int64_t)) { ++integer64; num64 = 0; @@ -668,7 +664,7 @@ scanit: } else #else /* _UNICODE */ if (fl_wchar_arg) { - *(char16_t UNALIGNED *)pointer = ch; + *(char16_t UNALIGNED *)pointer = (char16_t)ch; pointer = (char16_t *)pointer + 1; #ifdef _SECURE_SCANF --array_width; @@ -695,16 +691,12 @@ scanit: /* convert wide to multibyte */ if (array_width >= ((size_t)MB_CUR_MAX)) { -_BEGIN_SECURE_CRT_DEPRECATION_DISABLE temp = wctomb((char *)pointer, ch); -_END_SECURE_CRT_DEPRECATION_DISABLE } else { char tmpbuf[MB_LEN_MAX]; -_BEGIN_SECURE_CRT_DEPRECATION_DISABLE temp = wctomb(tmpbuf, ch); -_END_SECURE_CRT_DEPRECATION_DISABLE if (temp > 0 && ((size_t)temp) > array_width) { /* We have exhausted the user's buffer */ @@ -780,7 +772,7 @@ _END_SECURE_CRT_DEPRECATION_DISABLE } else { - // supress set, do nothing + // suppress set, do nothing } } else @@ -874,7 +866,7 @@ getnum: if (_ISXDIGIT(ch)) { num64 <<= 4; - ch = _hextodec(ch); + ch = _hextodec((_TCHAR)ch); } else ++done_flag; @@ -907,7 +899,7 @@ getnum: } /* end of WHILE loop */ if (negative) - num64 = (uint64_t )(-(__int64)num64); + num64 = (uint64_t )(-(int64_t)num64); } else { #endif /* _INTEGRAL_MAX_BITS >= 64 */ @@ -917,7 +909,7 @@ getnum: if (_ISXDIGIT(ch)) { number = (number << 4); - ch = _hextodec(ch); + ch = _hextodec((_TCHAR)ch); } else ++done_flag; @@ -964,7 +956,7 @@ getnum: assign_num: #if _INTEGRAL_MAX_BITS >= 64 if ( integer64 ) - *(__int64 UNALIGNED *)pointer = ( uint64_t )num64; + *(int64_t UNALIGNED *)pointer = ( uint64_t )num64; else #endif /* _INTEGRAL_MAX_BITS >= 64 */ if (longone) @@ -1269,7 +1261,7 @@ static int __cdecl _inc(miniFILE* fileptr) static void __cdecl _un_inc(int chr, miniFILE* fileptr) { if (_TEOF != chr) { - _ungettc_nolock(chr,fileptr); + _ungettc_nolock((char)chr,fileptr); } } diff --git a/src/shared/pal/src/safecrt/internal.h b/src/shared/pal/src/safecrt/internal.h deleted file mode 100644 index 02f8f80091..0000000000 --- a/src/shared/pal/src/safecrt/internal.h +++ /dev/null @@ -1,1083 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*** -*internal.h - contains declarations of internal routines and variables -* - -* -*Purpose: -* Declares routines and variables used internally by the C run-time. -* -* [Internal] -* -****/ - -#if _MSC_VER > 1000 -#pragma once -#endif /* _MSC_VER > 1000 */ - -#ifndef _INC_INTERNAL -#define _INC_INTERNAL - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -/* - * Conditionally include windows.h to pick up the definition of - * CRITICAL_SECTION. - */ -#include - -#ifdef _MSC_VER -#pragma pack(push,_CRT_PACKING) -#endif /* _MSC_VER */ - -/* Define function types used in several startup sources */ - -typedef void (__cdecl *_PVFV)(void); -typedef int (__cdecl *_PIFV)(void); -typedef void (__cdecl *_PVFI)(int); - -#if _MSC_VER >= 1400 && defined(_M_CEE) -typedef const void* (__clrcall *_PVFVM)(void); -typedef int (__clrcall *_PIFVM)(void); -typedef void (__clrcall *_CPVFV)(void); -#endif /* _MSC_VER >= 1400 && defined(_M_CEE) */ - -#if defined (_M_CEE_PURE) || (defined (_DLL) && defined (_M_IX86)) -/* Retained for compatibility with VC++ 5.0 and earlier versions */ -_CRTIMP int * __cdecl __p__commode(void); -#endif /* defined (_M_CEE_PURE) || (defined (_DLL) && defined (_M_IX86)) */ -#if defined (SPECIAL_CRTEXE) && defined (_DLL) - extern int _commode; -#else /* defined (SPECIAL_CRTEXE) && defined (_DLL) */ -#ifndef _M_CEE_PURE -_CRTIMP extern int _commode; -#else /* _M_CEE_PURE */ -#define _commode (*__p___commode()) -#endif /* _M_CEE_PURE */ -#endif /* defined (SPECIAL_CRTEXE) && defined (_DLL) */ - -#define __IOINFO_TM_ANSI 0 /* Regular Text */ -#define __IOINFO_TM_UTF8 1 /* UTF8 Encoded */ -#define __IOINFO_TM_UTF16LE 2 /* UTF16 Little Endian Encoded */ - -/* - * Control structure for lowio file handles - */ -typedef struct { - intptr_t osfhnd; /* underlying OS file HANDLE */ - char osfile; /* attributes of file (e.g., open in text mode?) */ - char pipech; /* one char buffer for handles opened on pipes */ - int lockinitflag; - CRITICAL_SECTION lock; -#ifndef _SAFECRT_IMPL - /* Not used in the safecrt downlevel. We do not define them, so we cannot use them accidentally */ - char textmode : 7; /* __IOINFO_TM_ANSI or __IOINFO_TM_UTF8 or __IOINFO_TM_UTF16LE */ - char unicode : 1; /* Was the file opened as unicode? */ - char pipech2[2]; /* 2 more peak ahead chars for UNICODE mode */ -#endif /* _SAFECRT_IMPL */ - } ioinfo; - -/* - * Definition of IOINFO_L2E, the log base 2 of the number of elements in each - * array of ioinfo structs. - */ -#define IOINFO_L2E 5 - -/* - * Definition of IOINFO_ARRAY_ELTS, the number of elements in ioinfo array - */ -#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) - -/* - * Definition of IOINFO_ARRAYS, maximum number of supported ioinfo arrays. - */ -#define IOINFO_ARRAYS 64 - -#define _NHANDLE_ (IOINFO_ARRAYS * IOINFO_ARRAY_ELTS) - -#define _TZ_STRINGS_SIZE 64 - -/* - * Access macros for getting at an ioinfo struct and its fields from a - * file handle - */ -#define _pioinfo(i) ( __pioinfo[(i) >> IOINFO_L2E] + ((i) & (IOINFO_ARRAY_ELTS - \ - 1)) ) -#define _osfhnd(i) ( _pioinfo(i)->osfhnd ) - -#define _osfile(i) ( _pioinfo(i)->osfile ) - -#define _pipech(i) ( _pioinfo(i)->pipech ) - -#define _pipech2(i) ( _pioinfo(i)->pipech2 ) - -#define _textmode(i) ( _pioinfo(i)->textmode ) - -#define _tm_unicode(i) ( _pioinfo(i)->unicode ) - -/* - * Safer versions of the above macros. Currently, only _osfile_safe is - * used. - */ -#define _pioinfo_safe(i) ( (((i) != -1) && ((i) != -2)) ? _pioinfo(i) : &__badioinfo ) - -#define _osfhnd_safe(i) ( _pioinfo_safe(i)->osfhnd ) - -#define _osfile_safe(i) ( _pioinfo_safe(i)->osfile ) - -#define _pipech_safe(i) ( _pioinfo_safe(i)->pipech ) - -#define _pipech2_safe(i) ( _pioinfo_safe(i)->pipech2 ) - -#ifdef _SAFECRT_IMPL -/* safecrt does not have support for textmode, so we always return __IOINFO_TM_ANSI */ -#define _textmode_safe(i) __IOINFO_TM_ANSI -#define _tm_unicode_safe(i) 0 -#else /* _SAFECRT_IMPL */ -#define _textmode_safe(i) ( _pioinfo_safe(i)->textmode ) -#define _tm_unicode_safe(i) ( _pioinfo_safe(i)->unicode ) -#endif /* _SAFECRT_IMPL */ - -#ifndef _M_CEE_PURE -#ifdef _SAFECRT_IMPL -/* We need to get this from the downlevel DLL, even when we build safecrt.lib */ -extern __declspec(dllimport) ioinfo __badioinfo; -extern __declspec(dllimport) ioinfo * __pioinfo[]; -#else /* _SAFECRT_IMPL */ -/* - * Special, static ioinfo structure used only for more graceful handling - * of a C file handle value of -1 (results from common errors at the stdio - * level). - */ -extern _CRTIMP ioinfo __badioinfo; - -/* - * Array of arrays of control structures for lowio files. - */ -extern _CRTIMP ioinfo * __pioinfo[]; -#endif /* _SAFECRT_IMPL */ -#endif /* _M_CEE_PURE */ - -/* - * Current number of allocated ioinfo structures (_NHANDLE_ is the upper - * limit). - */ -extern int _nhandle; - -int __cdecl _alloc_osfhnd(void); -int __cdecl _free_osfhnd(int); -int __cdecl _set_osfhnd(int, intptr_t); - -/* - fileno for stdout, stdin & stderr when there is no console -*/ -#define _NO_CONSOLE_FILENO (intptr_t)-2 - - -extern const char __dnames[]; -extern const char __mnames[]; - -extern int _days[]; -extern int _lpdays[]; - -extern __time32_t __cdecl __loctotime32_t(int, int, int, int, int, int, int); -extern __time64_t __cdecl __loctotime64_t(int, int, int, int, int, int, int); - -extern void __cdecl __tzset(void); - -extern int __cdecl _validdrive(unsigned); - -/* - * If we are only interested in years between 1901 and 2099, we could use this: - * - * #define IS_LEAP_YEAR(y) (y % 4 == 0) - */ - -#define IS_LEAP_YEAR(y) (((y) % 4 == 0 && (y) % 100 != 0) || (y) % 400 == 0) - -/* - * This variable is in the C start-up; the length must be kept synchronized - * It is used by the *cenvarg.c modules - */ - -extern char _acfinfo[]; /* "_C_FILE_INFO=" */ - -#define CFI_LENGTH 12 /* "_C_FILE_INFO" is 12 bytes long */ - - -/* - * stdio internals - */ -#ifndef _FILE_DEFINED -struct _iobuf { - char *_ptr; - int _cnt; - char *_base; - int _flag; - int _file; - int _charbuf; - int _bufsiz; - char *_tmpfname; - }; -typedef struct _iobuf FILE; -#define _FILE_DEFINED -#endif /* _FILE_DEFINED */ - -#if !defined (_FILEX_DEFINED) && defined (_WINDOWS_) - -/* - * Variation of FILE type used for the dynamically allocated portion of - * __piob[]. For single thread, _FILEX is the same as FILE. For multithread - * models, _FILEX has two fields: the FILE struct and the CRITICAL_SECTION - * struct used to serialize access to the FILE. - */ - -typedef struct { - FILE f; - CRITICAL_SECTION lock; - } _FILEX; - - -#define _FILEX_DEFINED -#endif /* !defined (_FILEX_DEFINED) && defined (_WINDOWS_) */ - -/* - * Number of entries supported in the array pointed to by __piob[]. That is, - * the number of stdio-level files which may be open simultaneously. This - * is normally set to _NSTREAM_ by the stdio initialization code. - */ -extern int _nstream; - -/* - * Pointer to the array of pointers to FILE/_FILEX structures that are used - * to manage stdio-level files. - */ -extern void **__piob; - -FILE * __cdecl _getstream(void); -FILE * __cdecl _openfile(_In_z_ const char * _Filename, _In_z_ const char * _Mode, _In_ int _ShFlag, _Out_ FILE * _File); -FILE * __cdecl _wopenfile(_In_z_ const char16_t * _Filename, _In_z_ const char16_t * _Mode, _In_ int _ShFlag, _Out_ FILE * _File); -void __cdecl _getbuf(_Out_ FILE * _File); -int __cdecl _filwbuf (__inout FILE * _File); -int __cdecl _flswbuf(_In_ int _Ch, __inout FILE * _File); -void __cdecl _freebuf(__inout FILE * _File); -int __cdecl _stbuf(__inout FILE * _File); -void __cdecl _ftbuf(int _Flag, __inout FILE * _File); - -#ifdef _SAFECRT_IMPL - -int __cdecl _output(__inout FILE * _File, _In_z_ __format_string const char *_Format, va_list _ArgList); -int __cdecl _woutput(__inout FILE * _File, _In_z_ __format_string const char16_t *_Format, va_list _ArgList); -int __cdecl _output_s(__inout FILE * _File, _In_z_ __format_string const char *_Format, va_list _ArgList); -int __cdecl _output_p(__inout FILE * _File, _In_z_ __format_string const char *_Format, va_list _ArgList); -int __cdecl _woutput_s(__inout FILE * _File, _In_z_ __format_string const char16_t *_Format, va_list _ArgList); -int __cdecl _woutput_p(__inout FILE * _File, _In_z_ __format_string const char16_t *_Format, va_list _ArgList); -typedef int (*OUTPUTFN)(FILE *, const char *, va_list); -typedef int (*WOUTPUTFN)(FILE *, const char16_t *, va_list); - -#else /* _SAFECRT_IMPL */ - -int __cdecl _output_l(__inout FILE * _File, _In_z_ __format_string const char *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList); -int __cdecl _woutput_l(__inout FILE * _File, _In_z_ __format_string const char16_t *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList); -int __cdecl _output_s_l(__inout FILE * _File, _In_z_ __format_string const char *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList); -int __cdecl _output_p_l(__inout FILE * _File, _In_z_ __format_string const char *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList); -int __cdecl _woutput_s_l(__inout FILE * _File, _In_z_ __format_string const char16_t *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList); -int __cdecl _woutput_p_l(__inout FILE * _File, _In_z_ __format_string const char16_t *_Format, _In_opt_ _locale_t _Locale, va_list _ArgList); -typedef int (*OUTPUTFN)(__inout FILE * _File, const char *, _locale_t, va_list); -typedef int (*WOUTPUTFN)(__inout FILE * _File, const char16_t *, _locale_t, va_list); - -#endif /* _SAFECRT_IMPL */ - -#ifdef _SAFECRT_IMPL - -int __cdecl _input(_In_ FILE * _File, _In_z_ __format_string const unsigned char * _Format, va_list _ArgList); -int __cdecl _winput(_In_ FILE * _File, _In_z_ __format_string const char16_t * _Format, va_list _ArgList); -int __cdecl _input_s(_In_ FILE * _File, _In_z_ __format_string const unsigned char * _Format, va_list _ArgList); -int __cdecl _winput_s(_In_ FILE * _File, _In_z_ __format_string const char16_t * _Format, va_list _ArgList); -typedef int (*INPUTFN)(FILE *, const unsigned char *, va_list); -typedef int (*WINPUTFN)(FILE *, const char16_t *, va_list); - -#else /* _SAFECRT_IMPL */ - -int __cdecl _input_l(__inout FILE * _File, _In_z_ __format_string const unsigned char *, _In_opt_ _locale_t _Locale, va_list _ArgList); -int __cdecl _winput_l(__inout FILE * _File, _In_z_ __format_string const char16_t *, _In_opt_ _locale_t _Locale, va_list _ArgList); -int __cdecl _input_s_l(__inout FILE * _File, _In_z_ __format_string const unsigned char *, _In_opt_ _locale_t _Locale, va_list _ArgList); -int __cdecl _winput_s_l(__inout FILE * _File, _In_z_ __format_string const char16_t *, _In_opt_ _locale_t _Locale, va_list _ArgList); -typedef int (*INPUTFN)(FILE *, const unsigned char *, _locale_t, va_list); -typedef int (*WINPUTFN)(FILE *, const char16_t *, _locale_t, va_list); - -#ifdef _UNICODE -#define TINPUTFN WINPUTFN -#else /* _UNICODE */ -#define TINPUTFN INPUTFN -#endif /* _UNICODE */ - -#endif /* _SAFECRT_IMPL */ - -int __cdecl _flush(__inout FILE * _File); -void __cdecl _endstdio(void); - -errno_t __cdecl _sopen_helper(_In_z_ const char * _Filename, - _In_ int _OFlag, _In_ int _ShFlag, _In_ int _PMode, - _Out_ int * _PFileHandle, int _BSecure); -errno_t __cdecl _wsopen_helper(_In_z_ const char16_t * _Filename, - _In_ int _OFlag, _In_ int _ShFlag, _In_ int _PMode, - _Out_ int * _PFileHandle, int _BSecure); - -#ifndef CRTDLL -extern int _cflush; -#endif /* CRTDLL */ - -extern unsigned int _tempoff; - -extern unsigned int _old_pfxlen; - -extern int _umaskval; /* the umask value */ - -extern char _pipech[]; /* pipe lookahead */ - -extern char _exitflag; /* callable termination flag */ - -extern int _C_Termination_Done; /* termination done flag */ - -char * __cdecl _getpath(_In_z_ const char * _Src, _Out_writes_z_(_SizeInChars) char * _Dst, _In_ size_t _SizeInChars); -char16_t * __cdecl _wgetpath(_In_z_ const char16_t * _Src, _Out_writes_z_(_SizeInWords) char16_t * _Dst, _In_ size_t _SizeInWords); - -extern int _dowildcard; /* flag to enable argv[] wildcard expansion */ - -#ifndef _PNH_DEFINED -typedef int (__cdecl * _PNH)( size_t ); -#define _PNH_DEFINED -#endif /* _PNH_DEFINED */ - -#if _MSC_VER >= 1400 && defined(_M_CEE) -#ifndef __MPNH_DEFINED -typedef int (__clrcall * __MPNH)( size_t ); -#define __MPNH_DEFINED -#endif /* __MPNH_DEFINED */ -#endif /* _MSC_VER >= 1400 && defined(_M_CEE) */ - - -/* calls the currently installed new handler */ -int __cdecl _callnewh(_In_ size_t _Size); - -extern int _newmode; /* malloc new() handler mode */ - -/* pointer to initial environment block that is passed to [w]main */ -#ifndef _M_CEE_PURE -extern _CRTIMP char16_t **__winitenv; -extern _CRTIMP char **__initenv; -#endif /* _M_CEE_PURE */ - -/* _calloca helper */ -#define _calloca(count, size) ((count<=0 || size<=0 || ((((size_t)_HEAP_MAXREQ) / ((size_t)count)) < ((size_t)size)))? NULL : _malloca(count * size)) - -/* startup set values */ -extern char *_aenvptr; /* environment ptr */ -extern char16_t *_wenvptr; /* wide environment ptr */ - -/* command line */ - -#if defined (_DLL) -_CRTIMP char ** __cdecl __p__acmdln(void); -_CRTIMP char16_t ** __cdecl __p__wcmdln(void); -#endif /* defined (_DLL) */ -#ifndef _M_CEE_PURE -_CRTIMP extern char *_acmdln; -_CRTIMP extern char16_t *_wcmdln; -#else /* _M_CEE_PURE */ -#define _acmdln (*__p__acmdln()) -#define _wcmdln (*__p__wcmdln()) -#endif /* _M_CEE_PURE */ - -/* - * prototypes for internal startup functions - */ -int __cdecl _cwild(void); /* wild.c */ -int __cdecl _wcwild(void); /* wwild.c */ -int __cdecl _mtinit(void); /* tidtable.c */ -void __cdecl _mtterm(void); /* tidtable.c */ -int __cdecl _mtinitlocks(void); /* mlock.c */ -void __cdecl _mtdeletelocks(void); /* mlock.c */ -int __cdecl _mtinitlocknum(int); /* mlock.c */ - -/* Wrapper for InitializeCriticalSection API, with default spin count */ -int __cdecl __crtInitCritSecAndSpinCount(PCRITICAL_SECTION, DWORD); -#define _CRT_SPINCOUNT 4000 - -/* - * C source build only!!!! - * - * more prototypes for internal startup functions - */ -void __cdecl _amsg_exit(int); /* crt0.c */ -void __cdecl __crtExitProcess(int); /* crt0dat.c */ -void __cdecl __crtCorExitProcess(int); /* crt0dat.c */ -void __cdecl __crtdll_callstaticterminators(void); /* crt0dat.c */ - -/* -_cinit now allows the caller to suppress floating point precision init -This allows the DLLs that use the CRT to not initialise FP precision, -allowing the EXE's setting to persist even when a DLL is loaded -*/ -int __cdecl _cinit(int /* initFloatingPrecision */); /* crt0dat.c */ -void __cdecl __doinits(void); /* astart.asm */ -void __cdecl __doterms(void); /* astart.asm */ -void __cdecl __dopreterms(void); /* astart.asm */ -void __cdecl _FF_MSGBANNER(void); -void __cdecl _fpmath(int /*initPrecision*/); -void __cdecl _fpclear(void); -void __cdecl _fptrap(void); /* crt0fp.c */ -int __cdecl _heap_init(int); -void __cdecl _heap_term(void); -void __cdecl _heap_abort(void); -void __cdecl __initconin(void); /* initcon.c */ -void __cdecl __initconout(void); /* initcon.c */ -int __cdecl _ioinit(void); /* crt0.c, crtlib.c */ -void __cdecl _ioterm(void); /* crt0.c, crtlib.c */ -char * __cdecl _GET_RTERRMSG(int); -void __cdecl _NMSG_WRITE(int); -int __CRTDECL _setargv(void); /* setargv.c, stdargv.c */ -int __CRTDECL __setargv(void); /* stdargv.c */ -int __CRTDECL _wsetargv(void); /* wsetargv.c, wstdargv.c */ -int __CRTDECL __wsetargv(void); /* wstdargv.c */ -int __cdecl _setenvp(void); /* stdenvp.c */ -int __cdecl _wsetenvp(void); /* wstdenvp.c */ -void __cdecl __setmbctable(unsigned int); /* mbctype.c */ - -#ifdef MRTDLL -_MRTIMP int __cdecl _onexit_process(_CPVFV); -_MRTIMP int __cdecl _onexit_app_domain(_CPVFV); -#endif /* MRTDLL */ - -#ifndef _MANAGED_MAIN -int __CRTDECL main(_In_ int _Argc, _In_reads_z_(_Argc) char ** _Argv, _In_z_ char ** _Env); -int __CRTDECL wmain(_In_ int _Argc, _In_reads_z_(_Argc) char16_t ** _Argv, _In_z_ char16_t ** _Env); -#endif /* _MANAGED_MAIN */ - -/* helper functions for wide/multibyte environment conversion */ -int __cdecl __mbtow_environ (void); -int __cdecl __wtomb_environ (void); - -/* These two functions take a char ** for the environment option - At some point during their execution, they take ownership of the - memory block passed in using option. At this point, they - NULL out the incoming char * / char16_t * to ensure there is no - double-free -*/ -int __cdecl __crtsetenv(_Outptr_opt_ char ** _POption, _In_ const int _Primary); -int __cdecl __crtwsetenv(_Outptr_opt_ char16_t ** _POption, _In_ const int _Primary); - -#ifndef _M_CEE_PURE -_CRTIMP extern void (__cdecl * _aexit_rtn)(int); -#endif /* _M_CEE_PURE */ - -#if defined (_DLL) || defined (CRTDLL) - -#ifndef _STARTUP_INFO_DEFINED -typedef struct -{ - int newmode; -} _startupinfo; -#define _STARTUP_INFO_DEFINED -#endif /* _STARTUP_INFO_DEFINED */ - -_CRTIMP int __cdecl __getmainargs(_Out_ int * _Argc, _Outptr_result_buffer_(*_Argc) char *** _Argv, - _Outptr_opt_ char *** _Env, _In_ int _DoWildCard, - _In_ _startupinfo * _StartInfo); - -_CRTIMP int __cdecl __wgetmainargs(_Out_ int * _Argc, _Outptr_result_buffer_(*_Argc)char16_t *** _Argv, - _Outptr_opt_ char16_t *** _Env, _In_ int _DoWildCard, - _In_ _startupinfo * _StartInfo); - -#endif /* defined (_DLL) || defined (CRTDLL) */ - -/* - * Prototype, variables and constants which determine how error messages are - * written out. - */ -#define _UNKNOWN_APP 0 -#define _CONSOLE_APP 1 -#define _GUI_APP 2 - -extern int __app_type; - -#if !defined (_M_CEE_PURE) - -extern Volatile __native_startup_lock; - -#define __NO_REASON UINT_MAX -extern Volatile __native_dllmain_reason; -extern Volatile __native_vcclrit_reason; - -#if defined (__cplusplus) - -#pragma warning(push) -#pragma warning(disable: 4483) -#if _MSC_FULL_VER >= 140050415 -#define _NATIVE_STARTUP_NAMESPACE __identifier("") -#else /* _MSC_FULL_VER >= 140050415 */ -#define _NATIVE_STARTUP_NAMESPACE __CrtImplementationDetails -#endif /* _MSC_FULL_VER >= 140050415 */ - -namespace _NATIVE_STARTUP_NAMESPACE -{ - class NativeDll - { - private: - static const unsigned int ProcessDetach = 0; - static const unsigned int ProcessAttach = 1; - static const unsigned int ThreadAttach = 2; - static const unsigned int ThreadDetach = 3; - static const unsigned int ProcessVerifier = 4; - - public: - - inline static bool IsInDllMain() - { - return (__native_dllmain_reason != __NO_REASON); - } - - inline static bool IsInProcessAttach() - { - return (__native_dllmain_reason == ProcessAttach); - } - - inline static bool IsInProcessDetach() - { - return (__native_dllmain_reason == ProcessDetach); - } - - inline static bool IsInVcclrit() - { - return (__native_vcclrit_reason != __NO_REASON); - } - - inline static bool IsSafeForManagedCode() - { - if (!IsInDllMain()) - { - return true; - } - - if (IsInVcclrit()) - { - return true; - } - - return !IsInProcessAttach() && !IsInProcessDetach(); - } - }; -} -#pragma warning(pop) - -#endif /* defined (__cplusplus) */ - -#endif /* !defined (_M_CEE_PURE) */ - -extern int __error_mode; - -_CRTIMP void __cdecl __set_app_type(int); -#if defined (CRTDLL) && !defined (_SYSCRT) -/* - * All these function pointer are used for creating global state of CRT - * functions. Either all of them will be set or all of them will be NULL - */ -typedef void (__cdecl *_set_app_type_function)(int); -typedef int (__cdecl *_get_app_type_function)(); -extern _set_app_type_function __set_app_type_server; -extern _get_app_type_function __get_app_type_server; -#endif /* defined (CRTDLL) && !defined (_SYSCRT) */ - -/* - * C source build only!!!! - * - * map Win32 errors into Xenix errno values -- for modules written in C - */ -_CRTIMP void __cdecl _dosmaperr(unsigned long); -extern int __cdecl _get_errno_from_oserr(unsigned long); - -/* - * internal routines used by the exec/spawn functions - */ - -extern intptr_t __cdecl _dospawn(_In_ int _Mode, _In_opt_z_ const char * _Name, __inout_z char * _Cmd, _In_opt_z_ char * _Env); -extern intptr_t __cdecl _wdospawn(_In_ int _Mode, _In_opt_z_ const char16_t * _Name, __inout_z char16_t * _Cmd, _In_opt_z_ char16_t * _Env); -extern int __cdecl _cenvarg(_In_z_ const char * const * _Argv, _In_opt_z_ const char * const * _Env, - _Outptr_opt_ char ** _ArgBlk, _Outptr_opt_ char ** _EnvBlk, _In_z_ const char *_Name); -extern int __cdecl _wcenvarg(_In_z_ const char16_t * const * _Argv, _In_opt_z_ const char16_t * const * _Env, - _Outptr_opt_ char16_t ** _ArgBlk, _Outptr_opt_ char16_t ** _EnvBlk, _In_z_ const char16_t * _Name); -#ifndef _M_IX86 -extern char ** _capture_argv(_In_ va_list *, _In_z_ const char * _FirstArg, _Out_writes_z_(_MaxCount) char ** _Static_argv, _In_ size_t _MaxCount); -extern char16_t ** _wcapture_argv(_In_ va_list *, _In_z_ const char16_t * _FirstArg, _Out_writes_z_(_MaxCount) char16_t ** _Static_argv, _In_ size_t _MaxCount); -#endif /* _M_IX86 */ - -/* - * internal routine used by the abort - */ - -extern _PHNDLR __cdecl __get_sigabrt(void); - -/* - * Type from ntdef.h - */ - -typedef LONG NTSTATUS; - -/* - * Exception code used in _invalid_parameter - */ - -#ifndef STATUS_INVALID_PARAMETER -#define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000DL) -#endif /* STATUS_INVALID_PARAMETER */ - -/* - * Exception code used for abort and _CALL_REPORTFAULT - */ - -#ifndef STATUS_FATAL_APP_EXIT -#define STATUS_FATAL_APP_EXIT ((NTSTATUS)0x40000015L) -#endif /* STATUS_FATAL_APP_EXIT */ - -/* - * Validate functions - */ -#include /* _ASSERTE */ -#include - -#define __STR2WSTR(str) L##str - -#define _STR2WSTR(str) __STR2WSTR(str) - -#define __FILEW__ _STR2WSTR(__FILE__) -#define __FUNCTIONW__ _STR2WSTR(__FUNCTION__) - -/* We completely fill the buffer only in debug (see _SECURECRT__FILL_STRING - * and _SECURECRT__FILL_BYTE macros). - */ -#if !defined (_SECURECRT_FILL_BUFFER) -#ifdef _DEBUG -#define _SECURECRT_FILL_BUFFER 1 -#else /* _DEBUG */ -#define _SECURECRT_FILL_BUFFER 0 -#endif /* _DEBUG */ -#endif /* !defined (_SECURECRT_FILL_BUFFER) */ - -#ifndef _SAFECRT_IMPL -/* _invalid_parameter is already defined in safecrt.h and safecrt.lib */ -#if !defined (_NATIVE_char16_t_DEFINED) && defined (_M_CEE_PURE) -extern "C++" -#endif /* !defined (_NATIVE_char16_t_DEFINED) && defined (_M_CEE_PURE) */ -_CRTIMP -#endif /* _SAFECRT_IMPL */ -void __cdecl _invalid_parameter(_In_opt_z_ const char16_t *, _In_opt_z_ const char16_t *, _In_opt_z_ const char16_t *, unsigned int, uintptr_t); - -#if !defined (_NATIVE_char16_t_DEFINED) && defined (_M_CEE_PURE) -extern "C++" -#endif /* !defined (_NATIVE_char16_t_DEFINED) && defined (_M_CEE_PURE) */ -_CRTIMP -void __cdecl _invoke_watson(_In_opt_z_ const char16_t *, _In_opt_z_ const char16_t *, _In_opt_z_ const char16_t *, unsigned int, uintptr_t); - -#ifndef _DEBUG -#if !defined (_NATIVE_char16_t_DEFINED) && defined (_M_CEE_PURE) -extern "C++" -#endif /* !defined (_NATIVE_char16_t_DEFINED) && defined (_M_CEE_PURE) */ -_CRTIMP -void __cdecl _invalid_parameter_noinfo(void); -#endif /* _DEBUG */ - -/* Invoke Watson if _ExpressionError is not 0; otherwise simply return _EspressionError */ -__forceinline -void _invoke_watson_if_error( - errno_t _ExpressionError, - const char16_t *_Expression, - const char16_t *_Function, - const char16_t *_File, - unsigned int _Line, - uintptr_t _Reserved - ) -{ - if (_ExpressionError == 0) - { - return; - } - _invoke_watson(_Expression, _Function, _File, _Line, _Reserved); -} - -/* Invoke Watson if _ExpressionError is not 0 and equal to _ErrorValue1 or _ErrorValue2; otherwise simply return _EspressionError */ -__forceinline -errno_t _invoke_watson_if_oneof( - errno_t _ExpressionError, - errno_t _ErrorValue1, - errno_t _ErrorValue2, - const char16_t *_Expression, - const char16_t *_Function, - const char16_t *_File, - unsigned int _Line, - uintptr_t _Reserved - ) -{ - if (_ExpressionError == 0 || (_ExpressionError != _ErrorValue1 && _ExpressionError != _ErrorValue2)) - { - return _ExpressionError; - } - _invoke_watson(_Expression, _Function, _File, _Line, _Reserved); - return _ExpressionError; -} - -/* - * Assert in debug builds. - * set errno and return - * - */ -#ifdef _DEBUG -#define _CALL_INVALID_PARAMETER_FUNC(funcname, expr) funcname(expr, __FUNCTIONW__, __FILEW__, __LINE__, 0) -#define _INVOKE_WATSON_IF_ERROR(expr) _invoke_watson_if_error((expr), __STR2WSTR(#expr), __FUNCTIONW__, __FILEW__, __LINE__, 0) -#define _INVOKE_WATSON_IF_ONEOF(expr, errvalue1, errvalue2) _invoke_watson_if_oneof(expr, (errvalue1), (errvalue2), __STR2WSTR(#expr), __FUNCTIONW__, __FILEW__, __LINE__, 0) -#else /* _DEBUG */ -#define _CALL_INVALID_PARAMETER_FUNC(funcname, expr) funcname(NULL, NULL, NULL, 0, 0) -#define _INVOKE_WATSON_IF_ERROR(expr) _invoke_watson_if_error(expr, NULL, NULL, NULL, 0, 0) -#define _INVOKE_WATSON_IF_ONEOF(expr, errvalue1, errvalue2) _invoke_watson_if_oneof((expr), (errvalue1), (errvalue2), NULL, NULL, NULL, 0, 0) -#endif /* _DEBUG */ - -#define _INVALID_PARAMETER(expr) _CALL_INVALID_PARAMETER_FUNC(_invalid_parameter, expr) - -#define _VALIDATE_RETURN_VOID( expr, errorcode ) \ - { \ - int _Expr_val=!!(expr); \ - _ASSERT_EXPR( ( _Expr_val ), _CRT_WIDE(#expr) ); \ - if ( !( _Expr_val ) ) \ - { \ - errno = errorcode; \ - _INVALID_PARAMETER(_CRT_WIDE(#expr)); \ - return; \ - } \ - } - -/* - * Assert in debug builds. - * set errno and return value - */ - -#ifndef _VALIDATE_RETURN -#define _VALIDATE_RETURN( expr, errorcode, retexpr ) \ - { \ - int _Expr_val=!!(expr); \ - _ASSERT_EXPR( ( _Expr_val ), _CRT_WIDE(#expr) ); \ - if ( !( _Expr_val ) ) \ - { \ - errno = errorcode; \ - _INVALID_PARAMETER(_CRT_WIDE(#expr) ); \ - return ( retexpr ); \ - } \ - } -#endif /* _VALIDATE_RETURN */ - -#ifndef _VALIDATE_RETURN_NOEXC -#define _VALIDATE_RETURN_NOEXC( expr, errorcode, retexpr ) \ - { \ - if ( !(expr) ) \ - { \ - errno = errorcode; \ - return ( retexpr ); \ - } \ - } -#endif /* _VALIDATE_RETURN_NOEXC */ - -/* - * Assert in debug builds. - * set errno and set retval for later usage - */ - -#define _VALIDATE_SETRET( expr, errorcode, retval, retexpr ) \ - { \ - int _Expr_val=!!(expr); \ - _ASSERT_EXPR( ( _Expr_val ), _CRT_WIDE(#expr) ); \ - if ( !( _Expr_val ) ) \ - { \ - errno = errorcode; \ - _INVALID_PARAMETER(_CRT_WIDE(#expr)); \ - retval=( retexpr ); \ - } \ - } - -#define _CHECK_FH_RETURN( handle, errorcode, retexpr ) \ - { \ - if(handle == _NO_CONSOLE_FILENO) \ - { \ - errno = errorcode; \ - return ( retexpr ); \ - } \ - } - -/* - We use _VALIDATE_STREAM_ANSI_RETURN to ensure that ANSI file operations( - fprintf etc) aren't called on files opened as UNICODE. We do this check - only if it's an actual FILE pointer & not a string -*/ - -#define _VALIDATE_STREAM_ANSI_RETURN( stream, errorcode, retexpr ) \ - { \ - FILE *_Stream=stream; \ - _VALIDATE_RETURN(( (_Stream->_flag & _IOSTRG) || \ - ( (_textmode_safe(_fileno(_Stream)) == __IOINFO_TM_ANSI) && \ - !_tm_unicode_safe(_fileno(_Stream)))), \ - errorcode, retexpr) \ - } - -/* - We use _VALIDATE_STREAM_ANSI_SETRET to ensure that ANSI file operations( - fprintf etc) aren't called on files opened as UNICODE. We do this check - only if it's an actual FILE pointer & not a string. It doesn't actually return - immediately -*/ - -#define _VALIDATE_STREAM_ANSI_SETRET( stream, errorcode, retval, retexpr) \ - { \ - FILE *_Stream=stream; \ - _VALIDATE_SETRET(( (_Stream->_flag & _IOSTRG) || \ - ( (_textmode_safe(_fileno(_Stream)) == __IOINFO_TM_ANSI) && \ - !_tm_unicode_safe(_fileno(_Stream)))), \ - errorcode, retval, retexpr) \ - } - -/* - * Assert in debug builds. - * Return value (do not set errno) - */ - -#define _VALIDATE_RETURN_NOERRNO( expr, retexpr ) \ - { \ - int _Expr_val=!!(expr); \ - _ASSERT_EXPR( ( _Expr_val ), _CRT_WIDE(#expr) ); \ - if ( !( _Expr_val ) ) \ - { \ - _INVALID_PARAMETER(_CRT_WIDE(#expr)); \ - return ( retexpr ); \ - } \ - } - -/* - * Assert in debug builds. - * set errno and return errorcode - */ - -#define _VALIDATE_RETURN_ERRCODE( expr, errorcode ) \ - { \ - int _Expr_val=!!(expr); \ - _ASSERT_EXPR( ( _Expr_val ), _CRT_WIDE(#expr) ); \ - if ( !( _Expr_val ) ) \ - { \ - errno = errorcode; \ - _INVALID_PARAMETER(_CRT_WIDE(#expr)); \ - return ( errorcode ); \ - } \ - } - -#define _VALIDATE_RETURN_ERRCODE_NOEXC( expr, errorcode ) \ - { \ - if (!(expr)) \ - { \ - errno = errorcode; \ - return ( errorcode ); \ - } \ - } - -#define _VALIDATE_CLEAR_OSSERR_RETURN( expr, errorcode, retexpr ) \ - { \ - int _Expr_val=!!(expr); \ - _ASSERT_EXPR( ( _Expr_val ), _CRT_WIDE(#expr) ); \ - if ( !( _Expr_val ) ) \ - { \ - _doserrno = 0L; \ - errno = errorcode; \ - _INVALID_PARAMETER(_CRT_WIDE(#expr) ); \ - return ( retexpr ); \ - } \ - } - -#define _CHECK_FH_CLEAR_OSSERR_RETURN( handle, errorcode, retexpr ) \ - { \ - if(handle == _NO_CONSOLE_FILENO) \ - { \ - _doserrno = 0L; \ - errno = errorcode; \ - return ( retexpr ); \ - } \ - } - -#define _VALIDATE_CLEAR_OSSERR_RETURN_ERRCODE( expr, errorcode ) \ - { \ - int _Expr_val=!!(expr); \ - _ASSERT_EXPR( ( _Expr_val ), _CRT_WIDE(#expr) ); \ - if ( !( _Expr_val ) ) \ - { \ - _doserrno = 0L; \ - errno = errorcode; \ - _INVALID_PARAMETER(_CRT_WIDE(#expr)); \ - return ( errorcode ); \ - } \ - } - -#define _CHECK_FH_CLEAR_OSSERR_RETURN_ERRCODE( handle, retexpr ) \ - { \ - if(handle == _NO_CONSOLE_FILENO) \ - { \ - _doserrno = 0L; \ - return ( retexpr ); \ - } \ - } - -#ifdef _DEBUG -extern size_t __crtDebugFillThreshold; -#endif /* _DEBUG */ - -#if !defined (_SECURECRT_FILL_BUFFER_THRESHOLD) -#ifdef _DEBUG -#define _SECURECRT_FILL_BUFFER_THRESHOLD __crtDebugFillThreshold -#else /* _DEBUG */ -#define _SECURECRT_FILL_BUFFER_THRESHOLD ((size_t)0) -#endif /* _DEBUG */ -#endif /* !defined (_SECURECRT_FILL_BUFFER_THRESHOLD) */ - -#if _SECURECRT_FILL_BUFFER -#define _SECURECRT__FILL_STRING(_String, _Size, _Offset) \ - if ((_Size) != ((size_t)-1) && (_Size) != INT_MAX && \ - ((size_t)(_Offset)) < (_Size)) \ - { \ - memset((_String) + (_Offset), \ - _SECURECRT_FILL_BUFFER_PATTERN, \ - (_SECURECRT_FILL_BUFFER_THRESHOLD < ((size_t)((_Size) - (_Offset))) ? \ - _SECURECRT_FILL_BUFFER_THRESHOLD : \ - ((_Size) - (_Offset))) * sizeof(*(_String))); \ - } -#else /* _SECURECRT_FILL_BUFFER */ -#define _SECURECRT__FILL_STRING(_String, _Size, _Offset) -#endif /* _SECURECRT_FILL_BUFFER */ - -#if _SECURECRT_FILL_BUFFER -#define _SECURECRT__FILL_BYTE(_Position) \ - if (_SECURECRT_FILL_BUFFER_THRESHOLD > 0) \ - { \ - (_Position) = _SECURECRT_FILL_BUFFER_PATTERN; \ - } -#else /* _SECURECRT_FILL_BUFFER */ -#define _SECURECRT__FILL_BYTE(_Position) -#endif /* _SECURECRT_FILL_BUFFER */ - -#ifdef __cplusplus -#define _REDIRECT_TO_L_VERSION_FUNC_PROLOGUE extern "C" -#else /* __cplusplus */ -#define _REDIRECT_TO_L_VERSION_FUNC_PROLOGUE -#endif /* __cplusplus */ - -/* helper macros to redirect an mbs function to the corresponding _l version */ -#define _REDIRECT_TO_L_VERSION_1(_ReturnType, _FunctionName, _Type1) \ - _REDIRECT_TO_L_VERSION_FUNC_PROLOGUE \ - _ReturnType __cdecl _FunctionName(_Type1 _Arg1) \ - { \ - return _FunctionName##_l(_Arg1, NULL); \ - } - -#define _REDIRECT_TO_L_VERSION_2(_ReturnType, _FunctionName, _Type1, _Type2) \ - _REDIRECT_TO_L_VERSION_FUNC_PROLOGUE \ - _ReturnType __cdecl _FunctionName(_Type1 _Arg1, _Type2 _Arg2) \ - { \ - return _FunctionName##_l(_Arg1, _Arg2, NULL); \ - } - -#define _REDIRECT_TO_L_VERSION_3(_ReturnType, _FunctionName, _Type1, _Type2, _Type3) \ - _REDIRECT_TO_L_VERSION_FUNC_PROLOGUE \ - _ReturnType __cdecl _FunctionName(_Type1 _Arg1, _Type2 _Arg2, _Type3 _Arg3) \ - { \ - return _FunctionName##_l(_Arg1, _Arg2, _Arg3, NULL); \ - } - -#define _REDIRECT_TO_L_VERSION_4(_ReturnType, _FunctionName, _Type1, _Type2, _Type3, _Type4) \ - _REDIRECT_TO_L_VERSION_FUNC_PROLOGUE \ - _ReturnType __cdecl _FunctionName(_Type1 _Arg1, _Type2 _Arg2, _Type3 _Arg3, _Type4 _Arg4) \ - { \ - return _FunctionName##_l(_Arg1, _Arg2, _Arg3, _Arg4, NULL); \ - } - -#define _REDIRECT_TO_L_VERSION_5(_ReturnType, _FunctionName, _Type1, _Type2, _Type3, _Type4, _Type5) \ - _REDIRECT_TO_L_VERSION_FUNC_PROLOGUE \ - _ReturnType __cdecl _FunctionName(_Type1 _Arg1, _Type2 _Arg2, _Type3 _Arg3, _Type4 _Arg4, _Type5 _Arg5) \ - { \ - return _FunctionName##_l(_Arg1, _Arg2, _Arg3, _Arg4, _Arg5, NULL); \ - } - -#define _REDIRECT_TO_L_VERSION_6(_ReturnType, _FunctionName, _Type1, _Type2, _Type3, _Type4, _Type5, _Type6) \ - _REDIRECT_TO_L_VERSION_FUNC_PROLOGUE \ - _ReturnType __cdecl _FunctionName(_Type1 _Arg1, _Type2 _Arg2, _Type3 _Arg3, _Type4 _Arg4, _Type5 _Arg5, _Type6 _Arg6) \ - { \ - return _FunctionName##_l(_Arg1, _Arg2, _Arg3, _Arg4, _Arg5, _Arg6, NULL); \ - } - -/* internal helper functions for encoding and decoding pointers */ -void __cdecl _init_pointers(); -_CRTIMP void * __cdecl _encode_pointer(void *); -_CRTIMP void * __cdecl _encoded_null(); -_CRTIMP void * __cdecl _decode_pointer(void *); - -/* internal helper function for communicating with the debugger */ -BOOL DebuggerKnownHandle(); - -/* Macros to simplify the use of Secure CRT in the CRT itself. - * We should use [_BEGIN/_END]_SECURE_CRT_DEPRECATION_DISABLE sparingly. - */ -#define _BEGIN_SECURE_CRT_DEPRECATION_DISABLE \ - __pragma(warning(push)) \ - __pragma(warning(disable:4996)) - -#define _END_SECURE_CRT_DEPRECATION_DISABLE \ - __pragma(warning(pop)) - -#define _ERRCHECK(e) \ - _INVOKE_WATSON_IF_ERROR(e) - -#define _ERRCHECK_EINVAL(e) \ - _INVOKE_WATSON_IF_ONEOF(e, EINVAL, EINVAL) - -#define _ERRCHECK_EINVAL_ERANGE(e) \ - _INVOKE_WATSON_IF_ONEOF(e, EINVAL, ERANGE) - -#define _ERRCHECK_SPRINTF(_PrintfCall) \ - { \ - errno_t _SaveErrno = errno; \ - errno = 0; \ - if ( ( _PrintfCall ) < 0) \ - { \ - _ERRCHECK_EINVAL_ERANGE(errno); \ - } \ - errno = _SaveErrno; \ - } - -/* internal helper function to access environment variable in read-only mode */ -const char16_t * __cdecl _wgetenv_helper_nolock(const char16_t *); -const char * __cdecl _getenv_helper_nolock(const char *); - -/* internal helper routines used to query a PE image header. */ -BOOL __cdecl _ValidateImageBase(PBYTE pImageBase); -PIMAGE_SECTION_HEADER __cdecl _FindPESection(PBYTE pImageBase, DWORD_PTR rva); -BOOL __cdecl _IsNonwritableInCurrentImage(PBYTE pTarget); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#ifdef _MSC_VER -#pragma pack(pop) -#endif /* _MSC_VER */ - -#endif /* _INC_INTERNAL */ diff --git a/src/shared/pal/src/safecrt/internal_securecrt.h b/src/shared/pal/src/safecrt/internal_securecrt.h index 741989897a..f5117457c5 100644 --- a/src/shared/pal/src/safecrt/internal_securecrt.h +++ b/src/shared/pal/src/safecrt/internal_securecrt.h @@ -37,7 +37,7 @@ #define _Out_writes_opt_z_(size) /* - * The original SafeCRT implemention allows runtime control over buffer checking. + * The original SafeCRT implementation allows runtime control over buffer checking. * For now we'll key this off the debug flag. */ #ifdef _DEBUG diff --git a/src/shared/pal/src/safecrt/mbusafecrt.cpp b/src/shared/pal/src/safecrt/mbusafecrt.cpp index 1f56c45a23..e2f3d04033 100644 --- a/src/shared/pal/src/safecrt/mbusafecrt.cpp +++ b/src/shared/pal/src/safecrt/mbusafecrt.cpp @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. /*** -* mbusafecrt.c - implementaion of support functions and data for MBUSafeCRT +* mbusafecrt.c - implementation of support functions and data for MBUSafeCRT * * diff --git a/src/shared/pal/src/safecrt/memcpy_s.cpp b/src/shared/pal/src/safecrt/memcpy_s.cpp index b4b83da74c..cef208affb 100644 --- a/src/shared/pal/src/safecrt/memcpy_s.cpp +++ b/src/shared/pal/src/safecrt/memcpy_s.cpp @@ -53,7 +53,7 @@ DLLEXPORT errno_t __cdecl memcpy_s( size_t sizeInBytes, const void * src, size_t count -) THROW_DECL +) { if (count == 0) { diff --git a/src/shared/pal/src/safecrt/output.inl b/src/shared/pal/src/safecrt/output.inl index 9aab6e8f16..f351a8ae89 100644 --- a/src/shared/pal/src/safecrt/output.inl +++ b/src/shared/pal/src/safecrt/output.inl @@ -22,16 +22,10 @@ * *******************************************************************************/ - -//typedef __int64_t __int64; - - #define FORMAT_VALIDATIONS typedef double _CRT_DOUBLE; -//typedef int* intptr_t; - /* Buffer size required to be passed to _gcvt, fcvt and other fp conversion routines */ @@ -440,7 +434,7 @@ LOCAL(void) write_string(const _TCHAR *string, int len, miniFILE *f, int *numwri #define get_int_arg(list) va_arg(*list, int) #define get_long_arg(list) va_arg(*list, long) #define get_long_long_arg(list) va_arg(*list, long long) -#define get_int64_arg(list) va_arg(*list, __int64) +#define get_int64_arg(list) va_arg(*list, int64_t) #define get_crtdouble_arg(list) va_arg(*list, _CRT_DOUBLE) #define get_ptr_arg(list) va_arg(*list, void *) @@ -1150,7 +1144,7 @@ int __cdecl _output ( #if _INTEGRAL_MAX_BITS >= 64 uint64_t number; /* number to convert */ int digit; /* ascii value of digit */ - __int64 l; /* temp long value */ + int64_t l; /* temp long value */ #else /* _INTEGRAL_MAX_BITS >= 64 */ unsigned long number; /* number to convert */ int digit; /* ascii value of digit */ diff --git a/src/shared/pal/src/safecrt/safecrt_output_l.cpp b/src/shared/pal/src/safecrt/safecrt_output_l.cpp index a59bfaaf54..010d5d6da4 100644 --- a/src/shared/pal/src/safecrt/safecrt_output_l.cpp +++ b/src/shared/pal/src/safecrt/safecrt_output_l.cpp @@ -366,7 +366,7 @@ LOCAL(void) write_string(const _TCHAR *string, int len, miniFILE *f, int *numwri #define get_int_arg(list) va_arg(*list, int) #define get_long_arg(list) va_arg(*list, long) #define get_long_long_arg(list) va_arg(*list, long long) -#define get_int64_arg(list) va_arg(*list, __int64) +#define get_int64_arg(list) va_arg(*list, int64_t) #define get_crtdouble_arg(list) va_arg(*list, _CRT_DOUBLE) #define get_ptr_arg(list) va_arg(*list, void *) @@ -1057,7 +1057,7 @@ int __cdecl _output ( // unsigned __int64 number; /* number to convert */ uint64_t number; /* number to convert */ int digit; /* ascii value of digit */ - __int64 l; /* temp long value */ + int64_t l; /* temp long value */ #else /* _INTEGRAL_MAX_BITS >= 64 */ unsigned long number; /* number to convert */ int digit; /* ascii value of digit */ diff --git a/src/shared/pal/src/safecrt/strlen_s.cpp b/src/shared/pal/src/safecrt/strlen_s.cpp deleted file mode 100644 index 0c35d3625d..0000000000 --- a/src/shared/pal/src/safecrt/strlen_s.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*** -*strlen_s.c - contains strnlen() routine -* - -* -*Purpose: -* strnlen returns the length of a null-terminated string, -* not including the null byte itself, up to the specified max size -* -*******************************************************************************/ - - -#include -#include -#include -#include "internal_securecrt.h" - -#include "mbusafecrt_internal.h" - -/*** -*strnlen - return the length of a null-terminated string -* -*Purpose: -* Finds the length in bytes of the given string, not including -* the final null character. Only the first maxsize characters -* are inspected: if the null character is not found, maxsize is -* returned. -* -*Entry: -* const char * str - string whose length is to be computed -* size_t maxsize -* -*Exit: -* Length of the string "str", exclusive of the final null byte, or -* maxsize if the null character is not found. -* -*Exceptions: -* -*******************************************************************************/ - -size_t __cdecl PAL_strnlen(const char *str, size_t maxsize) -{ - size_t n; - - /* Note that we do not check if str == NULL, because we do not - * return errno_t... - */ - - for (n = 0; n < maxsize && *str; n++, str++) - ; - - return n; -} - diff --git a/src/shared/pal/src/safecrt/strtok_s.cpp b/src/shared/pal/src/safecrt/strtok_s.cpp deleted file mode 100644 index c183ad5ab3..0000000000 --- a/src/shared/pal/src/safecrt/strtok_s.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*** -*strtok_s.c - tokenize a string with given delimiters -* - -* -*Purpose: -* defines strtok_s() - breaks string into series of token -* via repeated calls. -* -*******************************************************************************/ - -#include -#include -#include -#include "internal_securecrt.h" - -#include "mbusafecrt_internal.h" - -#define _FUNC_PROLOGUE -#define _FUNC_NAME strtok_s -#define _CHAR char - -#include "tcstok_s.inl" diff --git a/src/shared/pal/src/safecrt/tcstok_s.inl b/src/shared/pal/src/safecrt/tcstok_s.inl deleted file mode 100644 index f3ed934c19..0000000000 --- a/src/shared/pal/src/safecrt/tcstok_s.inl +++ /dev/null @@ -1,70 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*** -*tcstok_s.inl - general implementation of _tcstok_s -* - -* -*Purpose: -* This file contains the general algorithm for strtok_s and its variants. -* -****/ - -_FUNC_PROLOGUE -_CHAR * __cdecl _FUNC_NAME(_CHAR *_String, const _CHAR *_Control, _CHAR **_Context) -{ - _CHAR *token; - const _CHAR *ctl; - - /* validation section */ - _VALIDATE_POINTER_ERROR_RETURN(_Context, EINVAL, NULL); - _VALIDATE_POINTER_ERROR_RETURN(_Control, EINVAL, NULL); - _VALIDATE_CONDITION_ERROR_RETURN(_String != NULL || *_Context != NULL, EINVAL, NULL); - - /* If string==NULL, continue with previous string */ - if (!_String) - { - _String = *_Context; - } - - /* Find beginning of token (skip over leading delimiters). Note that - * there is no token iff this loop sets string to point to the terminal null. */ - for ( ; *_String != 0 ; _String++) - { - for (ctl = _Control; *ctl != 0 && *ctl != *_String; ctl++) - ; - if (*ctl == 0) - { - break; - } - } - - token = _String; - - /* Find the end of the token. If it is not the end of the string, - * put a null there. */ - for ( ; *_String != 0 ; _String++) - { - for (ctl = _Control; *ctl != 0 && *ctl != *_String; ctl++) - ; - if (*ctl != 0) - { - *_String++ = 0; - break; - } - } - - /* Update the context */ - *_Context = _String; - - /* Determine if a token has been found. */ - if (token == _String) - { - return NULL; - } - else - { - return token; - } -} diff --git a/src/shared/pal/src/safecrt/tmakepath_s.inl b/src/shared/pal/src/safecrt/tmakepath_s.inl index 53517412f7..aabf7ee266 100644 --- a/src/shared/pal/src/safecrt/tmakepath_s.inl +++ b/src/shared/pal/src/safecrt/tmakepath_s.inl @@ -48,13 +48,13 @@ errno_t __cdecl _FUNC_NAME(_Out_writes_z_(_SIZE) _CHAR *_DEST, _In_opt_ size_t _ } while (*p != 0); p--; - if (*p != _T('/') && *p != _T('\\')) + if (*p != '/') { if(++written >= _SIZE) { goto error_return; } - *d++ = _T('\\'); + *d++ = '/'; } } diff --git a/src/shared/pal/src/safecrt/tsplitpath_s.inl b/src/shared/pal/src/safecrt/tsplitpath_s.inl index 0884b2fb3f..c3d8b41403 100644 --- a/src/shared/pal/src/safecrt/tsplitpath_s.inl +++ b/src/shared/pal/src/safecrt/tsplitpath_s.inl @@ -102,7 +102,7 @@ errno_t __cdecl _FUNC_NAME( tmp = _Path; for (; *tmp != 0; ++tmp) { - if (*tmp == _T('/') || *tmp == _T('\\')) + if (*tmp == '/') { /* point to one beyond for later copy */ last_slash = tmp + 1; @@ -125,16 +125,6 @@ errno_t __cdecl _FUNC_NAME( goto error_erange; } _TCSNCPY_S(_Dir, _DirSize, _Path, length); - - // Normalize the path seperator - size_t iIndex; - for(iIndex = 0; iIndex < length; iIndex++) - { - if (_Dir[iIndex] == _T('\\')) - { - _Dir[iIndex] = _T('/'); - } - } } _Path = last_slash; } diff --git a/src/shared/pal/src/safecrt/vswprint.cpp b/src/shared/pal/src/safecrt/vswprint.cpp index 24451849b6..8aa87840ee 100644 --- a/src/shared/pal/src/safecrt/vswprint.cpp +++ b/src/shared/pal/src/safecrt/vswprint.cpp @@ -16,12 +16,11 @@ #include #include #include "internal_securecrt.h" - #include "mbusafecrt_internal.h" typedef int (*WOUTPUTFN)(miniFILE *, const char16_t *, va_list); -static int _vswprintf_helper( WOUTPUTFN outfn, char16_t *string, size_t count, const char16_t *format, va_list ap ); +static int _vswprintf_helper(WOUTPUTFN outfn, char16_t *string, size_t count, const char16_t *format, va_list ap); /*** *int vswprintf_s(string, sizeInWords, format, ap) - print formatted data to string from arg ptr diff --git a/src/shared/pal/src/safecrt/wcslwr_s.cpp b/src/shared/pal/src/safecrt/wcslwr_s.cpp new file mode 100644 index 0000000000..85936d840e --- /dev/null +++ b/src/shared/pal/src/safecrt/wcslwr_s.cpp @@ -0,0 +1,39 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/*** +*wcslwr_s.cpp - contains _wcslwr_s() routine +* +* +*Purpose: +* _wcslwr_s converts, in place, any upper case letters in input string to +* lowercase. +* +*******************************************************************************/ + +#include +#include +#include +#include +#include "internal_securecrt.h" + +#include "mbusafecrt_internal.h" + +DLLEXPORT errno_t __cdecl _wcslwr_s(char16_t *string, size_t sz) +{ + _VALIDATE_RETURN_ERRCODE(string != NULL, EINVAL); + size_t length = PAL_wcsnlen(string, sz); + if (length >= sz) + { + _RETURN_DEST_NOT_NULL_TERMINATED(string, sz); + } + + for (int i = 0; string[i] != 0; i++) + { + string[i] = (char16_t)minipal_tolower_invariant(string[i]); + } + + _FILL_STRING(string, sz, length + 1); + + return 0; +} diff --git a/src/shared/pal/src/safecrt/wcstok_s.cpp b/src/shared/pal/src/safecrt/wcstok_s.cpp deleted file mode 100644 index 83751d6565..0000000000 --- a/src/shared/pal/src/safecrt/wcstok_s.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*** -*wcstok_s.c - tokenize a wide-character string with given delimiters -* - -* -*Purpose: -* defines wcstok_s() - breaks wide-character string into series of token -* via repeated calls. -* -*******************************************************************************/ - -#include -#include -#include -#include "internal_securecrt.h" - -#include "mbusafecrt_internal.h" - -#define _FUNC_PROLOGUE -#define _FUNC_NAME wcstok_s -#define _CHAR char16_t - -#include "tcstok_s.inl" diff --git a/src/shared/pal/src/safecrt/wsplitpath_s.cpp b/src/shared/pal/src/safecrt/wsplitpath_s.cpp deleted file mode 100644 index 420d7134ac..0000000000 --- a/src/shared/pal/src/safecrt/wsplitpath_s.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*** -*wsplitpath_s.c - break down path name into components -* - -* -*Purpose: -* To provide support for accessing the individual components of an -* arbitrary path name -* -*******************************************************************************/ - -#include -#include -#include -#include "internal_securecrt.h" - -#include "mbusafecrt_internal.h" - -#define _FUNC_PROLOGUE -#define _FUNC_NAME _wsplitpath_s -#define _CHAR char16_t -#define _TCSNCPY_S wcsncpy_s -#define _T(_Character) L##_Character - -#include "tsplitpath_s.inl" diff --git a/src/shared/pal/src/safecrt/xtox_s.inl b/src/shared/pal/src/safecrt/xtox_s.inl index f2284fa4ab..28f7651bdf 100644 --- a/src/shared/pal/src/safecrt/xtox_s.inl +++ b/src/shared/pal/src/safecrt/xtox_s.inl @@ -262,7 +262,7 @@ TCHAR * __cdecl _ultox ( #ifdef _SECURE_ITOA static errno_t __fastcall x64tox_s (/* stdcall is faster and smaller... Might as well use it for the helper. */ - unsigned __int64 val, + uint64_t val, TCHAR *buf, size_t sizeInTChars, unsigned radix, @@ -271,7 +271,7 @@ static errno_t __fastcall x64tox_s #else /* _SECURE_ITOA */ static void __fastcall x64tox (/* stdcall is faster and smaller... Might as well use it for the helper. */ - unsigned __int64 val, + uint64_t val, TCHAR *buf, unsigned radix, int is_neg @@ -301,7 +301,7 @@ static void __fastcall x64tox #ifdef _SECURE_ITOA length++; #endif /* _SECURE_ITOA */ - val = (unsigned __int64)(-(__int64)val); + val = (uint64_t)(-(int64_t)val); } firstdig = p; /* save pointer to first digit */ @@ -359,7 +359,7 @@ DLLEXPORT errno_t __cdecl _i64tox_s ( int radix ) { - return x64tox_s((unsigned __int64)val, buf, sizeInTChars, radix, (radix == 10 && val < 0)); + return x64tox_s((uint64_t)val, buf, sizeInTChars, radix, (radix == 10 && val < 0)); } errno_t __cdecl _ui64tox_s ( @@ -400,7 +400,7 @@ errno_t __cdecl _ui64tox_s ( and return pointer to buffer. */ TCHAR * __cdecl _ui64tox ( - unsigned __int64 val, + uint64_t val, TCHAR *buf, int radix ) diff --git a/src/shared/pal/src/sync/cs.cpp b/src/shared/pal/src/sync/cs.cpp index 8fa0509e83..d04b2c13bb 100644 --- a/src/shared/pal/src/sync/cs.cpp +++ b/src/shared/pal/src/sync/cs.cpp @@ -213,25 +213,6 @@ void InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection) PERF_EXIT(InitializeCriticalSection); } -/*++ -Function: - InitializeCriticalSectionEx - Flags is ignored. - -See MSDN doc. ---*/ -BOOL InitializeCriticalSectionEx(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags) -{ - PERF_ENTRY(InitializeCriticalSection); - ENTRY("InitializeCriticalSectionEx(lpCriticalSection=%p, dwSpinCount=%d, Flags=%d)\n", - lpCriticalSection, dwSpinCount, Flags); - - InternalInitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount, false); - - LOGEXIT("InitializeCriticalSectionEx returns TRUE\n"); - PERF_EXIT(InitializeCriticalSection); - return true; -} - /*++ Function: InitializeCriticalSectionAndSpinCount @@ -291,28 +272,6 @@ void EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection) PERF_EXIT(EnterCriticalSection); } -/*++ -Function: - TryEnterCriticalSection - -See MSDN doc. ---*/ -BOOL TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection) -{ - PERF_ENTRY(TryEnterCriticalSection); - ENTRY("TryEnterCriticalSection(lpCriticalSection=%p)\n", lpCriticalSection); - - CPalThread * pThread = InternalGetCurrentThread(); - - bool fRet = InternalTryEnterCriticalSection(pThread, - lpCriticalSection); - - LOGEXIT("TryEnterCriticalSection returns bool %d\n", (int)fRet); - PERF_EXIT(TryEnterCriticalSection); - - return (BOOL)fRet; -} - /*++ Function: LeaveCriticalSection @@ -531,11 +490,11 @@ namespace CorUnix #ifdef _DEBUG enum CSSubSysInitState { - CSSubSysNotInitialzed, + CSSubSysNotInitialized, CSSubSysInitializing, CSSubSysInitialized }; - static Volatile csssInitState = CSSubSysNotInitialzed; + static Volatile csssInitState = CSSubSysNotInitialized; #ifdef PAL_TRACK_CRITICAL_SECTIONS_DATA static Volatile g_lPALCSInitializeCount = 0; @@ -567,8 +526,8 @@ namespace CorUnix #ifdef _DEBUG LONG lRet = InterlockedCompareExchange((LONG *)&csssInitState, (LONG)CSSubSysInitializing, - (LONG)CSSubSysNotInitialzed); - if ((LONG)CSSubSysNotInitialzed == lRet) + (LONG)CSSubSysNotInitialized); + if ((LONG)CSSubSysNotInitialized == lRet) { InitializeListHead(&g_PALCSList); @@ -982,75 +941,13 @@ namespace CorUnix return; } - /*++ - Function: - CorUnix::InternalTryEnterCriticalSection - - Tries to acquire a CS. It returns true on success, false if the CS is - locked by another thread - --*/ - bool InternalTryEnterCriticalSection( - CPalThread * pThread, - PCRITICAL_SECTION pCriticalSection) - { - PAL_CRITICAL_SECTION * pPalCriticalSection = - reinterpret_cast(pCriticalSection); - - LONG lNewVal; - SIZE_T threadId; - bool fRet = true; - - _ASSERTE(PalCsNotInitialized != pPalCriticalSection->cisInitState); - - threadId = ObtainCurrentThreadId(pThread); - - lNewVal = InterlockedCompareExchange (&pPalCriticalSection->LockCount, - (LONG)PALCS_LOCK_BIT, - (LONG)PALCS_LOCK_INIT); - if (lNewVal == PALCS_LOCK_INIT) - { - // CS successfully acquired: setting ownership data - pPalCriticalSection->OwningThread = threadId; - pPalCriticalSection->RecursionCount = 1; -#ifdef _DEBUG - if (NULL != pPalCriticalSection->DebugInfo) - { - pPalCriticalSection->DebugInfo->lAcquireCount += 1; - pPalCriticalSection->DebugInfo->lEnterCount += 1; - } -#endif // _DEBUG - - goto ITECS_exit; - } - - // check if the current thread already owns the criticalSection - if ((lNewVal & PALCS_LOCK_BIT) && - (pPalCriticalSection->OwningThread == threadId)) - { - pPalCriticalSection->RecursionCount += 1; -#ifdef _DEBUG - if (NULL != pPalCriticalSection->DebugInfo) - { - pPalCriticalSection->DebugInfo->lEnterCount += 1; - } -#endif // _DEBUG - - goto ITECS_exit; - } - - // Failed to acquire the CS - fRet = false; - - ITECS_exit: - return fRet; - } #endif // MUTEX_BASED_CSS /*++ Function: CorUnix::PALCS_FullyInitialize - Fully initializes a CS previously initialied true InitializeCriticalSection. + Fully initializes a CS which was previously initialized in InitializeCriticalSection. This method is called at the first contention on the target CS --*/ bool PALCS_FullyInitialize(PAL_CRITICAL_SECTION * pPalCriticalSection) @@ -1557,50 +1454,5 @@ namespace CorUnix _ASSERTE(0 == iRet); } - /*++ - Function: - CorUnix::InternalTryEnterCriticalSection - - Tries to acquire a CS. It returns true on success, false if the CS is - locked by another thread - --*/ -#ifdef MUTEX_BASED_CSS - bool InternalTryEnterCriticalSection( - CPalThread * pThread, - PCRITICAL_SECTION pCriticalSection) -#else // MUTEX_BASED_CSS - bool MTX_InternalTryEnterCriticalSection( - CPalThread * pThread, - PCRITICAL_SECTION pCriticalSection) -#endif // MUTEX_BASED_CSS - { - PAL_CRITICAL_SECTION * pPalCriticalSection = - reinterpret_cast(pCriticalSection); - bool fRet; - SIZE_T threadId; - - _ASSERTE(PalCsNotInitialized != pPalCriticalSection->cisInitState); - - threadId = ObtainCurrentThreadId(pThread); - - /* check if the current thread already owns the criticalSection */ - if (pPalCriticalSection->OwningThread == threadId) - { - pPalCriticalSection->RecursionCount += 1; - fRet = true; - goto ITECS_exit; - } - - fRet = (0 == pthread_mutex_trylock(&pPalCriticalSection->csndNativeData.mutex)); - - if (fRet) - { - pPalCriticalSection->OwningThread = threadId; - pPalCriticalSection->RecursionCount = 1; - } - - ITECS_exit: - return fRet; - } #endif // MUTEX_BASED_CSS || _DEBUG } diff --git a/src/shared/pal/src/synchmgr/synchcontrollers.cpp b/src/shared/pal/src/synchmgr/synchcontrollers.cpp index 22bba4aaf8..dc8c99ae7f 100644 --- a/src/shared/pal/src/synchmgr/synchcontrollers.cpp +++ b/src/shared/pal/src/synchmgr/synchcontrollers.cpp @@ -1050,6 +1050,9 @@ namespace CorUnix "OwnershipCount [%d]\n", GetOwnershipCount(), GetSignalCount()); + _ASSERT_MSG(otiMutex != m_otiObjectTypeId || m_lSignalCount <= 1, + "Mutex with invalid singal count\n"); + return; } @@ -1247,7 +1250,7 @@ namespace CorUnix palErr = CPalSynchronizationManager::WakeUpLocalThread( pthrCurrent, ptwiWaitInfo->pthrOwner, - fAbandoned ? MutexAbondoned : WaitSucceeded, + fAbandoned ? MutexAbandoned : WaitSucceeded, dwObjIdx); if (NO_ERROR != palErr) @@ -1511,7 +1514,7 @@ namespace CorUnix palErr = CPalSynchronizationManager::WakeUpLocalThread( pthrCurrent, ptwiWaitInfo->pthrOwner, - fAbandoned ? MutexAbondoned : WaitSucceeded, + fAbandoned ? MutexAbandoned : WaitSucceeded, dwObjIdx); if (NO_ERROR != palErr) @@ -1552,7 +1555,7 @@ namespace CorUnix - WaitIsSatisfied if the wait-all is fully satisfied. - WaitMayBeSatisfied if the target thread lives in a different process and therefore the wait may involve objects local to the remote process, and - as result is generally not possible to say whther or not the wait-all is + as result is generally not possible to say whether or not the wait-all is fully satisfied from the current process. Note: this method must be called while holding the synchronization locks diff --git a/src/shared/pal/src/synchmgr/synchmanager.cpp b/src/shared/pal/src/synchmgr/synchmanager.cpp index b359c2f731..d170440bf1 100644 --- a/src/shared/pal/src/synchmgr/synchmanager.cpp +++ b/src/shared/pal/src/synchmgr/synchmanager.cpp @@ -28,6 +28,7 @@ SET_DEFAULT_DEBUG_CHANNEL(SYNC); // some headers have code with asserts, so do t #include #include #include +#include #include #include #include @@ -322,7 +323,7 @@ namespace CorUnix break; } case WaitSucceeded: - case MutexAbondoned: + case MutexAbandoned: *pdwSignaledObject = dwSigObjIdx; break; default: @@ -1123,7 +1124,7 @@ namespace CorUnix if ((NULL == pSynchManager) || ((LONG)SynchMgrStatusRunning != s_lInitStatus)) { - ERROR("Trying to to create worker thread in invalid state\n"); + ERROR("Trying to create worker thread in invalid state\n"); return ERROR_INTERNAL_ERROR; } @@ -1418,7 +1419,7 @@ namespace CorUnix // resetting the data by acquiring the object ownership if (psdSynchData->IsAbandoned()) { - twrWakeUpReason = MutexAbondoned; + twrWakeUpReason = MutexAbandoned; } // Acquire ownership @@ -1909,7 +1910,7 @@ namespace CorUnix } else if (0 > iRet) { - ERROR("Unable to read %d bytes from the the process pipe " + ERROR("Unable to read %d bytes from the process pipe " "[pipe=%d ret=%d errno=%d (%s)]\n", iBytes - iBytesRead, m_iProcessPipeRead, iRet, errno, strerror(errno)); goto RBFPP_exit; @@ -2557,7 +2558,7 @@ namespace CorUnix Method: CPalSynchronizationManager::MarkWaitForDelegatedObjectSignalingInProgress - Marks all the thread waiting list nodes involved in the the current wait-all + Marks all the thread waiting list nodes involved in the current wait-all for "delegated object signaling in progress", so that this wait cannot be involved in another delegated object signaling that may happen while the current object singaling is being tranfered to the target process (while diff --git a/src/shared/pal/src/synchmgr/synchmanager.hpp b/src/shared/pal/src/synchmgr/synchmanager.hpp index 4338a61084..2a78e327fd 100644 --- a/src/shared/pal/src/synchmgr/synchmanager.hpp +++ b/src/shared/pal/src/synchmgr/synchmanager.hpp @@ -398,7 +398,7 @@ namespace CorUnix friend class CPalSynchronizationManager; // NB: For perforformance purposes this class is supposed - // to have no virtual methods, contructor and + // to have no virtual methods, constructor and // destructor public: enum ControllerType { WaitController, StateController }; @@ -489,7 +489,7 @@ namespace CorUnix class CPalSynchronizationManager : public IPalSynchronizationManager { friend class CPalSynchMgrController; - template friend T *CorUnix::InternalNew(); + template friend T *CorUnix::InternalNew(Ts... args); public: // types diff --git a/src/shared/pal/src/synchmgr/wait.cpp b/src/shared/pal/src/synchmgr/wait.cpp index e00e62f44b..8d64f05f25 100644 --- a/src/shared/pal/src/synchmgr/wait.cpp +++ b/src/shared/pal/src/synchmgr/wait.cpp @@ -305,7 +305,7 @@ DWORD CorUnix::InternalWaitForMultipleObjectsEx( case WaitSucceeded: dwRet = WAIT_OBJECT_0; // offset added later break; - case MutexAbondoned: + case MutexAbandoned: dwRet = WAIT_ABANDONED_0; // offset added later break; case WaitTimeout: diff --git a/src/shared/pal/src/thread/process.cpp b/src/shared/pal/src/thread/process.cpp index aa3d5b8907..6eee73cec2 100644 --- a/src/shared/pal/src/thread/process.cpp +++ b/src/shared/pal/src/thread/process.cpp @@ -40,6 +40,7 @@ SET_DEFAULT_DEBUG_CHANNEL(PROCESS); // some headers have code with asserts, so d #endif // HAVE_POLL #include +#include #include #include #include @@ -70,6 +71,8 @@ SET_DEFAULT_DEBUG_CHANNEL(PROCESS); // some headers have code with asserts, so d # define __NR_membarrier 389 # elif defined(__aarch64__) # define __NR_membarrier 283 +# elif defined(__loongarch64) +# define __NR_membarrier 283 # else # error Unknown architecture # endif @@ -78,13 +81,14 @@ SET_DEFAULT_DEBUG_CHANNEL(PROCESS); // some headers have code with asserts, so d #ifdef __APPLE__ #include +#include #include #include #include #include extern "C" { - #include +# include } #endif // __APPLE__ @@ -692,7 +696,7 @@ CorUnix::InternalCreateProcess( } } EnvironmentEntries++; - EnvironmentArray = (char **)InternalMalloc(EnvironmentEntries * sizeof(char *)); + EnvironmentArray = (char **)malloc(EnvironmentEntries * sizeof(char *)); EnvironmentEntries = 0; // Convert the environment block to array of strings @@ -723,7 +727,7 @@ CorUnix::InternalCreateProcess( if (NO_ERROR != palError) { - ERROR("Unable to allocate object for new proccess\n"); + ERROR("Unable to allocate object for new process\n"); goto InternalCreateProcessExit; } @@ -950,7 +954,7 @@ CorUnix::InternalCreateProcess( pobjFileErr = NULL; } - /* fill PROCESS_INFORMATION strucutre */ + /* fill PROCESS_INFORMATION structure */ lpProcessInformation->hProcess = hProcess; lpProcessInformation->hThread = hDummyThread; lpProcessInformation->dwProcessId = processId; @@ -1078,6 +1082,7 @@ See MSDN doc. --*/ VOID PALAPI +DECLSPEC_NORETURN RaiseFailFastException( IN PEXCEPTION_RECORD pExceptionRecord, IN PCONTEXT pContextRecord, @@ -1087,7 +1092,7 @@ RaiseFailFastException( ENTRY("RaiseFailFastException"); TerminateCurrentProcessNoExit(TRUE); - PROCAbort(); + for (;;) PROCAbort(); LOGEXIT("RaiseFailFastException"); PERF_EXIT(RaiseFailFastException); @@ -1837,6 +1842,7 @@ GetProcessIdDisambiguationKey(DWORD processId, UINT64 *disambiguationKey) TRACE("GetProcessIdDisambiguationKey: getline() FAILED"); SetLastError(ERROR_INVALID_HANDLE); free(line); + fclose(statFile); return FALSE; } @@ -1853,15 +1859,15 @@ GetProcessIdDisambiguationKey(DWORD processId, UINT64 *disambiguationKey) "%*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %*u %*u %*d %*d %*d %*d %*d %*d %llu \n", &starttime); + free(line); + fclose(statFile); + if (sscanfRet != 1) { _ASSERTE(!"Failed to parse stat file contents with sscanf_s."); return FALSE; } - free(line); - fclose(statFile); - *disambiguationKey = starttime; return TRUE; @@ -2368,7 +2374,7 @@ CreateProcessModules( if (!dup) { int cbModuleName = strlen(moduleName) + 1; - ProcessModules *entry = (ProcessModules *)InternalMalloc(sizeof(ProcessModules) + cbModuleName); + ProcessModules *entry = (ProcessModules *)malloc(sizeof(ProcessModules) + cbModuleName); if (entry == NULL) { DestroyProcessModules(listHead); @@ -2451,7 +2457,7 @@ CreateProcessModules( if (!dup) { int cbModuleName = strlen(moduleName) + 1; - ProcessModules *entry = (ProcessModules *)InternalMalloc(sizeof(ProcessModules) + cbModuleName); + ProcessModules *entry = (ProcessModules *)malloc(sizeof(ProcessModules) + cbModuleName); if (entry == NULL) { DestroyProcessModules(listHead); @@ -2520,9 +2526,11 @@ DestroyProcessModules(IN ProcessModules *listHead) Does not return --*/ +#if !defined(HOST_ARM) PAL_NORETURN +#endif VOID -PROCAbort() +PROCAbort(int signal, siginfo_t* siginfo) { // Abort the process after waiting for the core dump to complete abort(); @@ -3031,8 +3039,7 @@ getFileName( NULL, 0, NULL, NULL); /* if only a file name is specified, prefix it with "./" */ - if ((*lpApplicationName != '.') && (*lpApplicationName != '/') && - (*lpApplicationName != '\\')) + if ((*lpApplicationName != '.') && (*lpApplicationName != '/')) { length += 2; lpTemp = lpPathFileName.OpenStringBuffer(length); @@ -3062,9 +3069,6 @@ getFileName( lpPathFileName.CloseBuffer(length -1); - /* Replace '\' by '/' */ - FILEDosToUnixPathA(lpTemp); - return TRUE; } else @@ -3135,8 +3139,6 @@ getFileName( /* restore last character */ *lpEnd = wcEnd; - /* Replace '\' by '/' */ - FILEDosToUnixPathA(lpFileName); if (!getPath(lpFileNamePS, lpPathFileName)) { /* file is not in the path */ @@ -3206,7 +3208,7 @@ checkFileType( LPCSTR lpFileName) Parameters: IN lpCommandLine: second parameter from CreateProcessW (an unicode string) - IN lpAppPath: cannonical name of the application to launched + IN lpAppPath: canonical name of the application to launched OUT lppArgv: array of arguments to be passed to the new process Return: @@ -3254,7 +3256,7 @@ buildArgv( pThread = InternalGetCurrentThread(); /* make sure to allocate enough space, up for the worst case scenario */ int iLength = (iWlen + lpAppPath.GetCount() + 2); - lpAsciiCmdLine = (char *) InternalMalloc(iLength); + lpAsciiCmdLine = (char *) malloc(iLength); if (lpAsciiCmdLine == NULL) { @@ -3264,7 +3266,7 @@ buildArgv( pChar = lpAsciiCmdLine; - /* put the cannonical name of the application as the first parameter */ + /* put the canonical name of the application as the first parameter */ if ((strcpy_s(lpAsciiCmdLine, iLength, "\"") != SAFECRT_SUCCESS) || (strcat_s(lpAsciiCmdLine, iLength, lpAppPath) != SAFECRT_SUCCESS) || (strcat_s(lpAsciiCmdLine, iLength, "\"") != SAFECRT_SUCCESS) || @@ -3434,7 +3436,7 @@ buildArgv( /* allocate lppargv according to the number of arguments in the command line */ - lppArgv = (char **) InternalMalloc((((*pnArg)+1) * sizeof(char *))); + lppArgv = (char **) malloc((((*pnArg)+1) * sizeof(char *))); if (lppArgv == NULL) { @@ -3658,18 +3660,3 @@ getPath( TRACE("File %s not found in $PATH\n", lpFileName); return FALSE; } - -/*++ -Function: - ~CProcProcessLocalData - -Process data destructor ---*/ -CorUnix::CProcProcessLocalData::~CProcProcessLocalData() -{ - if (pProcessModules != NULL) - { - DestroyProcessModules(pProcessModules); - } -} - diff --git a/src/shared/pal/src/thread/thread.cpp b/src/shared/pal/src/thread/thread.cpp index 638058620c..5cf390fe8b 100644 --- a/src/shared/pal/src/thread/thread.cpp +++ b/src/shared/pal/src/thread/thread.cpp @@ -38,15 +38,11 @@ SET_DEFAULT_DEBUG_CHANNEL(THREAD); // some headers have code with asserts, so do #include #include #include -#elif defined(__sun) -#ifndef _KERNEL -#define _KERNEL -#define UNDEF_KERNEL -#endif -#include -#ifdef UNDEF_KERNEL -#undef _KERNEL #endif + +#if defined(__sun) +#include +#include #endif #include @@ -58,6 +54,7 @@ SET_DEFAULT_DEBUG_CHANNEL(THREAD); // some headers have code with asserts, so do #include #include #include +#include #if HAVE_MACH_THREADS #include #endif // HAVE_MACH_THREADS @@ -67,6 +64,7 @@ SET_DEFAULT_DEBUG_CHANNEL(THREAD); // some headers have code with asserts, so do #include "pal/fakepoll.h" #endif // HAVE_POLL #include +#include #if HAVE_SYS_LWP_H #include @@ -74,13 +72,24 @@ SET_DEFAULT_DEBUG_CHANNEL(THREAD); // some headers have code with asserts, so do #if HAVE_LWP_H #include #endif -// If we don't have sys/lwp.h but do expect to use _lwp_self, declare it to silence compiler warnings -#if HAVE__LWP_SELF && !HAVE_SYS_LWP_H && !HAVE_LWP_H -extern "C" int _lwp_self (); + +#if HAVE_CPUSET_T +typedef cpuset_t cpu_set_t; #endif using namespace CorUnix; +#ifdef __APPLE__ +#define MAX_THREAD_NAME_SIZE 63 +#elif defined(__FreeBSD__) +#define MAX_THREAD_NAME_SIZE MAXCOMLEN +#else +#define MAX_THREAD_NAME_SIZE 15 +#endif + +/* ------------------- Definitions ------------------------------*/ + + void ThreadCleanupRoutine( CPalThread *pThread, @@ -299,7 +308,7 @@ CorUnix::InternalCreateThread( // When coming here from the public API surface, the incoming value is originally a nonnegative signed int32, so // this shouldn't happen ASSERT( - "Couldn't align the requested stack size (%Iu) to the page size because the stack size was too large\n", + "Couldn't align the requested stack size (%zu) to the page size because the stack size was too large\n", alignedStackSize); palError = ERROR_INVALID_PARAMETER; goto EXIT; @@ -372,10 +381,10 @@ CorUnix::InternalCreateThread( alignedStackSize = MinStackSize; } - TRACE("setting thread stack size to %Iu\n", alignedStackSize); + TRACE("setting thread stack size to %zu\n", alignedStackSize); if (0 != pthread_attr_setstacksize(&pthreadAttr, alignedStackSize)) { - ERROR("couldn't set pthread stack size to %Iu\n", alignedStackSize); + ERROR("couldn't set pthread stack size to %zu\n", alignedStackSize); palError = ERROR_INTERNAL_ERROR; goto EXIT; } diff --git a/src/shared/pal/src/thread/threadsusp.cpp b/src/shared/pal/src/thread/threadsusp.cpp index 6c8fc1e307..c9035440e8 100644 --- a/src/shared/pal/src/thread/threadsusp.cpp +++ b/src/shared/pal/src/thread/threadsusp.cpp @@ -28,6 +28,7 @@ Revision History: #include #include +#include #include #include #include diff --git a/src/shared/palrt/CMakeLists.txt b/src/shared/palrt/CMakeLists.txt index c53604e119..ca891bc8a1 100644 --- a/src/shared/palrt/CMakeLists.txt +++ b/src/shared/palrt/CMakeLists.txt @@ -3,11 +3,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(PALRT_SOURCES bstr.cpp - coguid.cpp comem.cpp guid.cpp memorystream.cpp - path.cpp variant.cpp ) diff --git a/src/shared/palrt/bstr.cpp b/src/shared/palrt/bstr.cpp index 93c1da7743..529fbfc924 100644 --- a/src/shared/palrt/bstr.cpp +++ b/src/shared/palrt/bstr.cpp @@ -21,6 +21,7 @@ Revision History: #include "common.h" #include "intsafe.h" +#include #define CCH_BSTRMAX 0x7FFFFFFF // 4 + (0x7ffffffb + 1 ) * 2 ==> 0xFFFFFFFC #define CB_BSTRMAX 0xFFFFFFFa // 4 + (0xfffffff6 + 2) ==> 0xFFFFFFFC @@ -79,7 +80,7 @@ STDAPI_(BSTR) SysAllocStringLen(const OLECHAR *psz, UINT len) if (FAILED(CbSysStringSize(len, FALSE, &cbTotal))) return NULL; - bstr = (OLECHAR *)PAL_malloc(cbTotal); + bstr = (OLECHAR *)malloc(cbTotal); if(bstr != NULL){ @@ -120,7 +121,7 @@ STDAPI_(BSTR) SysAllocString(const OLECHAR* psz) if(psz == NULL) return NULL; - return SysAllocStringLen(psz, (DWORD)wcslen(psz)); + return SysAllocStringLen(psz, (DWORD)u16_strlen(psz)); } STDAPI_(BSTR) @@ -132,7 +133,7 @@ SysAllocStringByteLen(const char FAR* psz, unsigned int len) if (FAILED(CbSysStringSize(len, TRUE, &cbTotal))) return FALSE; - bstr = (OLECHAR *)PAL_malloc(cbTotal); + bstr = (OLECHAR *)malloc(cbTotal); if (bstr != NULL) { #if defined(HOST_64BIT) diff --git a/src/shared/palrt/coguid.cpp b/src/shared/palrt/coguid.cpp deleted file mode 100644 index 8a91d8fa86..0000000000 --- a/src/shared/palrt/coguid.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: coguid.cpp -// -// misc guid functions for PALRT -// =========================================================================== - -#include "common.h" - -STDAPI_(int) StringFromGUID2(REFGUID rguid, LPOLESTR lptsz, int cchMax) -{ - if (cchMax < 39) - return 0; - - return swprintf_s(lptsz, cchMax, W("{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"), - rguid.Data1, rguid.Data2, rguid.Data3, - rguid.Data4[0], rguid.Data4[1], - rguid.Data4[2], rguid.Data4[3], - rguid.Data4[4], rguid.Data4[5], - rguid.Data4[6], rguid.Data4[7]) + 1; -} - -static BOOL wUUIDFromString(LPCWSTR lpsz, GUID * pguid); -static BOOL wGUIDFromString(LPCWSTR lpsz, GUID * pguid); - -static BOOL HexStringToDword(LPCWSTR FAR& lpsz, DWORD FAR& Value, - int cDigits, WCHAR chDelim); - -//+------------------------------------------------------------------------- -// -// Function: IIDFromString -// -// Synopsis: converts string {...} form int guid -// -// Arguments: [lpsz] - ptr to buffer for results -// [lpclsid] - the guid to convert -// -// Returns: NOERROR -// CO_E_CLASSSTRING -// -//-------------------------------------------------------------------------- -STDAPI IIDFromString(LPWSTR lpsz, CLSID * lpclsid) -{ - if (lpsz == NULL) - { - *lpclsid = CLSID_NULL; - return NOERROR; - } - - if (*lpsz == 0) - { - return(CO_E_CLASSSTRING); - } - - return wGUIDFromString(lpsz,lpclsid) - ? NOERROR : CO_E_CLASSSTRING; -} - -//+------------------------------------------------------------------------- -// -// Function: wGUIDFromString (internal) -// -// Synopsis: Parse GUID such as {00000000-0000-0000-0000-000000000000} -// -// Arguments: [lpsz] - the guid string to convert -// [pguid] - guid to return -// -// Returns: TRUE if successful -// -//-------------------------------------------------------------------------- -static BOOL wGUIDFromString(LPCWSTR lpsz, GUID * pguid) -{ - if (*lpsz++ != '{' ) - return FALSE; - - if (wUUIDFromString(lpsz, pguid) != TRUE) - return FALSE; - - lpsz +=36; - - if (*lpsz++ != '}' ) - return FALSE; - - if (*lpsz != '\0') - return FALSE; - - return TRUE; -} - -//+------------------------------------------------------------------------- -// -// Function: wUUIDFromString (internal) -// -// Synopsis: Parse UUID such as 00000000-0000-0000-0000-000000000000 -// -// Arguments: [lpsz] - Supplies the UUID string to convert -// [pguid] - Returns the GUID. -// -// Returns: TRUE if successful -// -//-------------------------------------------------------------------------- -static BOOL wUUIDFromString(LPCWSTR lpsz, GUID * pguid) -{ - DWORD dw; - - if (!HexStringToDword(lpsz, pguid->Data1, sizeof(DWORD)*2, '-')) - return FALSE; - - if (!HexStringToDword(lpsz, dw, sizeof(WORD)*2, '-')) - return FALSE; - pguid->Data2 = (WORD)dw; - - if (!HexStringToDword(lpsz, dw, sizeof(WORD)*2, '-')) - return FALSE; - pguid->Data3 = (WORD)dw; - - if (!HexStringToDword(lpsz, dw, sizeof(BYTE)*2, 0)) - return FALSE; - pguid->Data4[0] = (BYTE)dw; - - if (!HexStringToDword(lpsz, dw, sizeof(BYTE)*2, '-')) - return FALSE; - pguid->Data4[1] = (BYTE)dw; - - if (!HexStringToDword(lpsz, dw, sizeof(BYTE)*2, 0)) - return FALSE; - pguid->Data4[2] = (BYTE)dw; - - if (!HexStringToDword(lpsz, dw, sizeof(BYTE)*2, 0)) - return FALSE; - pguid->Data4[3] = (BYTE)dw; - - if (!HexStringToDword(lpsz, dw, sizeof(BYTE)*2, 0)) - return FALSE; - pguid->Data4[4] = (BYTE)dw; - - if (!HexStringToDword(lpsz, dw, sizeof(BYTE)*2, 0)) - return FALSE; - pguid->Data4[5] = (BYTE)dw; - - if (!HexStringToDword(lpsz, dw, sizeof(BYTE)*2, 0)) - return FALSE; - pguid->Data4[6] = (BYTE)dw; - - if (!HexStringToDword(lpsz, dw, sizeof(BYTE)*2, 0)) - return FALSE; - pguid->Data4[7] = (BYTE)dw; - - return TRUE; -} - -//+------------------------------------------------------------------------- -// -// Function: HexStringToDword (private) -// -// Synopsis: scan lpsz for a number of hex digits (at most 8); update lpsz -// return value in Value; check for chDelim; -// -// Arguments: [lpsz] - the hex string to convert -// [Value] - the returned value -// [cDigits] - count of digits -// -// Returns: TRUE for success -// -//-------------------------------------------------------------------------- -static BOOL HexStringToDword(LPCWSTR FAR& lpsz, DWORD FAR& Value, - int cDigits, WCHAR chDelim) -{ - int Count; - - Value = 0; - for (Count = 0; Count < cDigits; Count++, lpsz++) - { - if (*lpsz >= '0' && *lpsz <= '9') - Value = (Value << 4) + *lpsz - '0'; - else if (*lpsz >= 'A' && *lpsz <= 'F') - Value = (Value << 4) + *lpsz - 'A' + 10; - else if (*lpsz >= 'a' && *lpsz <= 'f') - Value = (Value << 4) + *lpsz - 'a' + 10; - else - return(FALSE); - } - - if (chDelim != 0) - return *lpsz++ == chDelim; - else - return TRUE; -} diff --git a/src/shared/palrt/common.h b/src/shared/palrt/common.h index 9946ed67e8..1040b7c13c 100644 --- a/src/shared/palrt/common.h +++ b/src/shared/palrt/common.h @@ -13,6 +13,5 @@ #include #include -#include "shlwapip.h" #include #endif // _COMMON_H_ diff --git a/src/shared/palrt/memorystream.cpp b/src/shared/palrt/memorystream.cpp index 0ed06547f3..91a5ca8b2d 100644 --- a/src/shared/palrt/memorystream.cpp +++ b/src/shared/palrt/memorystream.cpp @@ -23,6 +23,10 @@ Revision History: #include "common.h" #include "objidl.h" +#include + +using std::min; +using std::max; class MemoryStream : public IStream { @@ -44,7 +48,7 @@ class MemoryStream : public IStream n = min(2 * n, n + n / 4 + 0x100000); // don't allocate tiny chunks - n = max(n, 0x100); + n = max(n, (ULONG)0x100); // compare with the hard limit nNewData = max(n, nNewData); diff --git a/src/shared/palrt/path.cpp b/src/shared/palrt/path.cpp deleted file mode 100644 index 51eb151476..0000000000 --- a/src/shared/palrt/path.cpp +++ /dev/null @@ -1,646 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: path.cpp -// -// Path APIs ported from shlwapi (especially for Fusion) -// =========================================================================== - -#include "common.h" -#include "strsafe.h" - - -#define CH_SLASH W('/') -#define CH_WHACK W('\\') - -// -// Inline function to check for a double-backslash at the -// beginning of a string -// - -static __inline BOOL DBL_BSLASH(LPCWSTR psz) -{ - return (psz[0] == W('\\') && psz[1] == W('\\')); -} - -// -// Inline function to check for a path separator character. -// - -static __inline BOOL IsPathSeparator(WCHAR ch) -{ - return (ch == CH_SLASH || ch == CH_WHACK); -} - -__inline BOOL ChrCmpW_inline(WCHAR w1, WCHAR wMatch) -{ - return(!(w1 == wMatch)); -} - -STDAPI_(LPWSTR) StrRChrW(LPCWSTR lpStart, LPCWSTR lpEnd, WCHAR wMatch) -{ - LPCWSTR lpFound = NULL; - - RIPMSG(lpStart && IS_VALID_STRING_PTRW(lpStart, -1), "StrRChrW: caller passed bad lpStart"); - RIPMSG(!lpEnd || lpEnd <= lpStart + wcslen(lpStart), "StrRChrW: caller passed bad lpEnd"); - // don't need to check for NULL lpStart - - if (!lpEnd) - lpEnd = lpStart + wcslen(lpStart); - - for ( ; lpStart < lpEnd; lpStart++) - { - if (!ChrCmpW_inline(*lpStart, wMatch)) - lpFound = lpStart; - } - return ((LPWSTR)lpFound); -} - - -// check if a path is a root -// -// returns: -// TRUE -// "\" "X:\" "\\" "\\foo" "\\foo\bar" -// -// FALSE for others including "\\foo\bar\" (!) -// -STDAPI_(BOOL) PathIsRootW(LPCWSTR pPath) -{ - RIPMSG(pPath && IS_VALID_STRING_PTR(pPath, -1), "PathIsRoot: caller passed bad pPath"); - - if (!pPath || !*pPath) - { - return FALSE; - } - - if (!lstrcmpiW(pPath + 1, W(":\\"))) - { - return TRUE; // "X:\" case - } - - if (IsPathSeparator(*pPath) && (*(pPath + 1) == 0)) - { - return TRUE; // "/" or "\" case - } - - if (DBL_BSLASH(pPath)) // smells like UNC name - { - LPCWSTR p; - int cBackslashes = 0; - - for (p = pPath + 2; *p; p++) - { - if (*p == W('\\')) - { - // - // return FALSE for "\\server\share\dir" - // so just check if there is more than one slash - // - // "\\server\" without a share name causes - // problems for WNet APIs. we should return - // FALSE for this as well - // - if ((++cBackslashes > 1) || !*(p+1)) - return FALSE; - } - } - // end of string with only 1 more backslash - // must be a bare UNC, which looks like a root dir - return TRUE; - } - return FALSE; -} - -/* -// rips the last part of the path off including the backslash -// C:\foo -> C:\ -// C:\foo\bar -> C:\foo -// C:\foo\ -> C:\foo -// \\x\y\x -> \\x\y -// \\x\y -> \\x -// \\x -> \\ (Just the double slash!) -// \foo -> \ (Just the slash!) -// -// in/out: -// pFile fully qualified path name -// returns: -// TRUE we stripped something -// FALSE didn't strip anything (root directory case) -// -*/ -STDAPI_(BOOL) PathRemoveFileSpecW(LPWSTR pFile) -{ - RIPMSG(pFile && IS_VALID_STRING_PTR(pFile, -1), "PathRemoveFileSpec: caller passed bad pFile"); - - if (pFile) - { - LPWSTR pT; - LPWSTR pT2 = pFile; - - for (pT = pT2; *pT2; pT2++) - { - if (IsPathSeparator(*pT2)) - { - pT = pT2; // last "\" found, (we will strip here) - } - else if (*pT2 == W(':')) // skip ":\" so we don't - { - if (IsPathSeparator(pT2[1])) // strip the "\" from "C:\" - { - pT2++; - } - pT = pT2 + 1; - } - } - - if (*pT == 0) - { - // didn't strip anything - return FALSE; - } - else if (((pT == pFile) && IsPathSeparator(*pT)) || // is it the "\foo" case? - ((pT == pFile+1) && (*pT == CH_WHACK && *pFile == CH_WHACK))) // or the "\\bar" case? - { - // Is it just a '\'? - if (*(pT+1) != W('\0')) - { - // Nope. - *(pT+1) = W('\0'); - return TRUE; // stripped something - } - else - { - // Yep. - return FALSE; - } - } - else - { - *pT = 0; - return TRUE; // stripped something - } - } - return FALSE; -} - -// -// Return a pointer to the end of the next path component in the string. -// ie return a pointer to the next backslash or terminating NULL. -// -LPCWSTR GetPCEnd(LPCWSTR lpszStart) -{ - LPCWSTR lpszEnd; - LPCWSTR lpszSlash; - - lpszEnd = StrChr(lpszStart, CH_WHACK); - lpszSlash = StrChr(lpszStart, CH_SLASH); - if ((lpszSlash && lpszSlash < lpszEnd) || - !lpszEnd) - { - lpszEnd = lpszSlash; - } - if (!lpszEnd) - { - lpszEnd = lpszStart + wcslen(lpszStart); - } - - return lpszEnd; -} - -// -// Given a pointer to the end of a path component, return a pointer to -// its beginning. -// ie return a pointer to the previous backslash (or start of the string). -// -LPCWSTR PCStart(LPCWSTR lpszStart, LPCWSTR lpszEnd) -{ - LPCWSTR lpszBegin = StrRChrW(lpszStart, lpszEnd, CH_WHACK); - LPCWSTR lpszSlash = StrRChrW(lpszStart, lpszEnd, CH_SLASH); - if (lpszSlash > lpszBegin) - { - lpszBegin = lpszSlash; - } - if (!lpszBegin) - { - lpszBegin = lpszStart; - } - return lpszBegin; -} - -// -// Fix up a few special cases so that things roughly make sense. -// -void NearRootFixups(LPWSTR lpszPath, BOOL fUNC) -{ - // Check for empty path. - if (lpszPath[0] == W('\0')) - { - // Fix up. -#ifndef TARGET_UNIX - lpszPath[0] = CH_WHACK; -#else - lpszPath[0] = CH_SLASH; -#endif - lpszPath[1] = W('\0'); - } - // Check for missing slash. - if (lpszPath[1] == W(':') && lpszPath[2] == W('\0')) - { - // Fix up. - lpszPath[2] = W('\\'); - lpszPath[3] = W('\0'); - } - // Check for UNC root. - if (fUNC && lpszPath[0] == W('\\') && lpszPath[1] == W('\0')) - { - // Fix up. - //lpszPath[0] = W('\\'); // already checked in if guard - lpszPath[1] = W('\\'); - lpszPath[2] = W('\0'); - } -} - -/*---------------------------------------------------------- -Purpose: Canonicalize a path. - -Returns: -Cond: -- -*/ -STDAPI_(BOOL) PathCanonicalizeW(LPWSTR lpszDst, LPCWSTR lpszSrc) -{ - LPCWSTR lpchSrc; - LPCWSTR lpchPCEnd; // Pointer to end of path component. - LPWSTR lpchDst; - BOOL fUNC; - int cchPC; - - RIPMSG(lpszDst && IS_VALID_WRITE_BUFFER(lpszDst, WCHAR, MAX_PATH), "PathCanonicalize: caller passed bad lpszDst"); - RIPMSG(lpszSrc && IS_VALID_STRING_PTR(lpszSrc, -1), "PathCanonicalize: caller passed bad lpszSrc"); - RIPMSG(lpszDst != lpszSrc, "PathCanonicalize: caller passed the same buffer for lpszDst and lpszSrc"); - - if (!lpszDst || !lpszSrc) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - *lpszDst = W('\0'); - - fUNC = PathIsUNCW(lpszSrc); // Check for UNCness. - - // Init. - lpchSrc = lpszSrc; - lpchDst = lpszDst; - - while (*lpchSrc) - { - lpchPCEnd = GetPCEnd(lpchSrc); - cchPC = (int) (lpchPCEnd - lpchSrc)+1; - - if (cchPC == 1 && IsPathSeparator(*lpchSrc)) // Check for slashes. - { - // Just copy them. -#ifndef TARGET_UNIX - *lpchDst = CH_WHACK; -#else - *lpchDst = CH_SLASH; -#endif - lpchDst++; - lpchSrc++; - } - else if (cchPC == 2 && *lpchSrc == W('.')) // Check for dots. - { - // Skip it... - // Are we at the end? - if (*(lpchSrc+1) == W('\0')) - { - lpchSrc++; - - // remove the last slash we copied (if we've copied one), but don't make a mal-formed root - if ((lpchDst > lpszDst) && !PathIsRootW(lpszDst)) - lpchDst--; - } - else - { - lpchSrc += 2; - } - } - else if (cchPC == 3 && *lpchSrc == W('.') && *(lpchSrc + 1) == W('.')) // Check for dot dot. - { - // make sure we aren't already at the root - if (!PathIsRootW(lpszDst)) - { - // Go up... Remove the previous path component. - lpchDst = (LPWSTR)PCStart(lpszDst, lpchDst - 1); - } - else - { - // When we can't back up, skip the trailing backslash - // so we don't copy one again. (C:\..\FOO would otherwise - // turn into C:\\FOO). - if (IsPathSeparator(*(lpchSrc + 2))) - { - lpchSrc++; - } - } - - // skip ".." - lpchSrc += 2; - } - else // Everything else - { - // Just copy it. - int cchRemainingBuffer = MAX_PATH - (lpszDst - lpchDst); - StringCchCopyNW(lpchDst, cchRemainingBuffer, lpchSrc, cchPC); - lpchDst += cchPC - 1; - lpchSrc += cchPC - 1; - } - - // Keep everything nice and tidy. - *lpchDst = W('\0'); - } - - // Check for weirdo root directory stuff. - NearRootFixups(lpszDst, fUNC); - - return TRUE; -} - -// Modifies: -// pszRoot -// -// Returns: -// TRUE if a drive root was found -// FALSE otherwise -// -STDAPI_(BOOL) PathStripToRootW(LPWSTR pszRoot) -{ - RIPMSG(pszRoot && IS_VALID_STRING_PTR(pszRoot, -1), "PathStripToRoot: caller passed bad pszRoot"); - - if (pszRoot) - { - while (!PathIsRootW(pszRoot)) - { - if (!PathRemoveFileSpecW(pszRoot)) - { - // If we didn't strip anything off, - // must be current drive - return FALSE; - } - } - return TRUE; - } - return FALSE; -} - - - -/*---------------------------------------------------------- -Purpose: Concatenate lpszDir and lpszFile into a properly formed - path and canonicalize any relative path pieces. - - lpszDest and lpszFile can be the same buffer - lpszDest and lpszDir can be the same buffer - -Returns: pointer to lpszDest -*/ -STDAPI_(LPWSTR) PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile) -{ -#ifdef DEBUG - RIPMSG(lpszDest && IS_VALID_WRITE_BUFFER(lpszDest, TCHAR, MAX_LONGPATH), "PathCombine: caller passed bad lpszDest"); - RIPMSG(!lpszDir || IS_VALID_STRING_PTR(lpszDir, -1), "PathCombine: caller passed bad lpszDir"); - RIPMSG(!lpszFile || IS_VALID_STRING_PTR(lpszFile, -1), "PathCombine: caller passed bad lpszFile"); - RIPMSG(lpszDir || lpszFile, "PathCombine: caller neglected to pass lpszDir or lpszFile"); -#endif // DEBUG - - - if (lpszDest) - { - TCHAR szTemp[MAX_LONGPATH]; - LPWSTR pszT; - - *szTemp = W('\0'); - - if (lpszDir && *lpszDir) - { - if (!lpszFile || *lpszFile==W('\0')) - { - // lpszFile is empty - StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszDir, ARRAY_SIZE(szTemp)); - } - else if (PathIsRelativeW(lpszFile)) - { - StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszDir, ARRAY_SIZE(szTemp)); - pszT = PathAddBackslashW(szTemp); - if (pszT) - { - size_t iRemaining = ARRAY_SIZE(szTemp) - (pszT - szTemp); - - if (wcslen(lpszFile) < iRemaining) - { - StringCchCopyNW(pszT, iRemaining, lpszFile, iRemaining); - } - else - { - *szTemp = W('\0'); - } - } - else - { - *szTemp = W('\0'); - } - } - else if (IsPathSeparator(*lpszFile) && !PathIsUNCW(lpszFile)) - { - StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszDir, ARRAY_SIZE(szTemp)); - // FEATURE: Note that we do not check that an actual root is returned; - // it is assumed that we are given valid parameters - PathStripToRootW(szTemp); - - pszT = PathAddBackslashW(szTemp); - if (pszT) - { - // Skip the backslash when copying - // Note: We don't support strings longer than 4GB, but that's - // okay because we already fail at MAX_PATH - int iRemaining = (int)(ARRAY_SIZE(szTemp) - (pszT - szTemp)); - StringCchCopyNW(pszT, iRemaining, lpszFile+1, iRemaining); - } - else - { - *szTemp = W('\0'); - } - } - else - { - // already fully qualified file part - StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszFile, ARRAY_SIZE(szTemp)); - } - } - else if (lpszFile && *lpszFile) - { - // no dir just use file. - StringCchCopyNW(szTemp, ARRAY_SIZE(szTemp), lpszFile, ARRAY_SIZE(szTemp)); - } - - // - // if szTemp has something in it we succeeded. Also if szTemp is empty and - // the input strings are empty we succeed and PathCanonicalize() will - // return "\" - // - if (*szTemp || ((lpszDir || lpszFile) && !((lpszDir && *lpszDir) || (lpszFile && *lpszFile)))) - { - PathCanonicalizeW(lpszDest, szTemp); // this deals with .. and . stuff - // returns "\" on empty szTemp - } - else - { - *lpszDest = W('\0'); // set output buffer to empty string. - lpszDest = NULL; // return failure. - } - } - - return lpszDest; -} - -// add a backslash to a qualified path -// -// in: -// lpszPath path (A:, C:\foo, etc) -// -// out: -// lpszPath A:\, C:\foo\ ; -// -// returns: -// pointer to the NULL that terminates the path -// -STDAPI_(LPWSTR) PathAddBackslashW(LPWSTR lpszPath) -{ - LPWSTR lpszRet = NULL; - - RIPMSG(lpszPath && IS_VALID_STRING_PTR(lpszPath, -1), "PathAddBackslash: caller passed bad lpszPath"); - - if (lpszPath) - { - size_t ichPath = wcslen(lpszPath); - LPWSTR lpszEnd = lpszPath + ichPath; - - if (ichPath) - { - - // Get the end of the source directory - switch(*(lpszEnd-1)) - { - case CH_SLASH: - case CH_WHACK: - break; - - default: - // try to keep us from tromping over MAX_PATH in size. - // if we find these cases, return NULL. Note: We need to - // check those places that call us to handle their GP fault - // if they try to use the NULL! - if (ichPath >= (MAX_PATH - 2)) // -2 because ichPath doesn't include NULL, and we're adding a CH_WHACK. - { - return(NULL); - } - - *lpszEnd++ = CH_WHACK; - *lpszEnd = W('\0'); - } - } - - lpszRet = lpszEnd; - } - - return lpszRet; -} - - - - -//--------------------------------------------------------------------------- -// Returns TRUE if the given string is a UNC path. -// -// TRUE -// "\\foo\bar" -// "\\foo" <- careful -// "\\" -// FALSE -// "\foo" -// "foo" -// "c:\foo" -// -// -STDAPI_(BOOL) PathIsUNCW(LPCWSTR pszPath) -{ - RIPMSG(pszPath && IS_VALID_STRING_PTR(pszPath, -1), "PathIsUNC: caller passed bad pszPath"); - - if (pszPath) - { - return DBL_BSLASH(pszPath); - } - return FALSE; -} - - - - - -//--------------------------------------------------------------------------- -// Return TRUE if the path isn't absoulte. -// -// TRUE -// "foo.exe" -// ".\foo.exe" -// "..\boo\foo.exe" -// -// FALSE -// "\foo" -// "c:bar" <- be careful -// "c:\bar" -// "\\foo\bar" -// -STDAPI_(BOOL) PathIsRelativeW(LPCWSTR lpszPath) -{ - RIPMSG(lpszPath && IS_VALID_STRING_PTR(lpszPath, -1), "PathIsRelative: caller passed bad lpszPath"); - - if (!lpszPath || *lpszPath == 0) - { - // The NULL path is assumed relative - return TRUE; - } - - if (IsPathSeparator(lpszPath[0])) - { - // Does it begin with a slash ? - return FALSE; - } - else if (lpszPath[1] == W(':')) - { - // Does it begin with a drive and a colon ? - return FALSE; - } - else - { - // Probably relative. - return TRUE; - } -} - -// find the next slash or null terminator -LPWSTR StrSlash(LPCWSTR psz) -{ - for (; *psz && !IsPathSeparator(*psz); psz++); - - // Cast to a non-const string to mimic the behavior - // of wcschr/StrChr and strchr. - return (LPWSTR) psz; -} - - - diff --git a/src/shared/palrt/shlwapip.h b/src/shared/palrt/shlwapip.h deleted file mode 100644 index 490d73f36a..0000000000 --- a/src/shared/palrt/shlwapip.h +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// =========================================================================== -// File: shlwapi.h -// -// Header for ported shlwapi stuff -// =========================================================================== - -#ifndef SHLWAPIP_H_INCLUDED -#define SHLWAPIP_H_INCLUDED - -#define SIZEOF(x) sizeof(x) -#define PRIVATE -#define PUBLIC -#ifndef ASSERT -#define ASSERT _ASSERTE -#endif -#define AssertMsg(f,m) _ASSERTE(f) -#define RIP(f) _ASSERTE(f) -#define RIPMSG(f,m) _ASSERTE(f) - -#define IS_VALID_READ_BUFFER(p, t, n) (p != NULL) -#define IS_VALID_WRITE_BUFFER(p, t, n) (p != NULL) - -#define IS_VALID_READ_PTR(p, t) IS_VALID_READ_BUFFER(p, t, 1) -#define IS_VALID_WRITE_PTR(p, t) IS_VALID_WRITE_BUFFER(p, t, 1) - -#define IS_VALID_STRING_PTR(p, c) (p != NULL) -#define IS_VALID_STRING_PTRW(p, c) (p != NULL) - -#endif // ! SHLWAPIP_H_INCLUDED diff --git a/src/shared/shared.cmake b/src/shared/shared.cmake new file mode 100644 index 0000000000..da02da2a2e --- /dev/null +++ b/src/shared/shared.cmake @@ -0,0 +1,35 @@ +#------------------------- +# Enable C++ EH with SEH +#------------------------- +if (MSVC) + set_property(DIRECTORY PROPERTY CLR_EH_OPTION /EHa) # enable C++ EH (w/ SEH exceptions) +endif() + +include_directories(${CLR_SRC_NATIVE_DIR}) +include_directories(${CLR_SHARED_DIR}/pal/prebuilt/inc) + +# All of the compiler options are specified in file compileoptions.cmake +# Do not add any new options here. They should be added in compileoptions.cmake +if(CLR_CMAKE_HOST_WIN32) + add_compile_options($<$:/Zl>) # omit default library name in .OBJ +endif(CLR_CMAKE_HOST_WIN32) + +#-------------------------------- +# Definition directives +# - all clr specific compile definitions should be included in this file +# - all clr specific feature variable should also be added in this file +#---------------------------------- +include(${CLR_SHARED_DIR}/clrdefinitions.cmake) + +if (CLR_CMAKE_HOST_UNIX) + include_directories("${CLR_SHARED_DIR}/pal/inc") + include_directories("${CLR_SHARED_DIR}/pal/inc/rt") + include_directories("${CLR_SHARED_DIR}/pal/src/safecrt") +endif (CLR_CMAKE_HOST_UNIX) + +include_directories(${CLR_SHARED_DIR}/minipal) +include_directories(${CLR_SHARED_DIR}/debug/inc) +include_directories(${CLR_SHARED_DIR}/debug/inc/dump) +include_directories(${CLR_SHARED_DIR}/hosts/inc) +include_directories(${CLR_SHARED_DIR}/inc) +include_directories(${CLR_SHARED_DIR}/gc) diff --git a/src/shared/utilcode/CMakeLists.txt b/src/shared/utilcode/CMakeLists.txt index 6f0f6d43d9..9cda52a594 100644 --- a/src/shared/utilcode/CMakeLists.txt +++ b/src/shared/utilcode/CMakeLists.txt @@ -1,7 +1,5 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_definitions(-D_BLD_CLR) - set(UTILCODE_COMMON_SOURCES clrhost_nodependencies.cpp ex.cpp @@ -11,23 +9,13 @@ set(UTILCODE_COMMON_SOURCES namespaceutil.cpp check.cpp sstring.cpp + util_nodependencies.cpp safewrap.cpp debug.cpp pedecoder.cpp longfilepathwrappers.cpp ) -# These source file do not yet compile on Linux. -# They should be moved out from here into the declaration -# of UTILCODE_SOURCES above after fixing compiler errors. -if(CLR_CMAKE_TARGET_WIN32) - list(APPEND UTILCODE_COMMON_SOURCES - dlwrap.cpp - securitywrapper.cpp - securityutil.cpp - ) -endif(CLR_CMAKE_TARGET_WIN32) - set(UTILCODE_STATICNOHOST_SOURCES ${UTILCODE_COMMON_SOURCES} hostimpl.cpp @@ -37,6 +25,8 @@ convert_to_absolute_path(UTILCODE_STATICNOHOST_SOURCES ${UTILCODE_STATICNOHOST_S add_library_clr(utilcodestaticnohost STATIC ${UTILCODE_STATICNOHOST_SOURCES}) +target_link_libraries(utilcodestaticnohost PUBLIC coreclrminipal) + if(CLR_CMAKE_HOST_WIN32) target_compile_definitions(utilcodestaticnohost PRIVATE _CRTIMP=) # use static version of crt endif(CLR_CMAKE_HOST_WIN32) diff --git a/src/shared/utilcode/check.cpp b/src/shared/utilcode/check.cpp index 4d7a0c7416..6ca26099d4 100644 --- a/src/shared/utilcode/check.cpp +++ b/src/shared/utilcode/check.cpp @@ -63,7 +63,6 @@ SPECIALIZED_VIOLATION(GCViolation); SPECIALIZED_VIOLATION(ModeViolation); SPECIALIZED_VIOLATION(FaultViolation); SPECIALIZED_VIOLATION(FaultNotFatal); -SPECIALIZED_VIOLATION(HostViolation); SPECIALIZED_VIOLATION(TakesLockViolation); SPECIALIZED_VIOLATION(LoadsTypeViolation); @@ -107,14 +106,11 @@ void CHECK::Trigger(LPCSTR reason) STATIC_CONTRACT_GC_NOTRIGGER; const char *messageString = NULL; - NewHolder pScratch(NULL); NewHolder pMessage(NULL); EX_TRY { FAULT_NOT_FATAL(); - - pScratch = new StackScratchBuffer(); pMessage = new StackSString(); pMessage->AppendASCII(reason); @@ -127,7 +123,7 @@ void CHECK::Trigger(LPCSTR reason) pMessage->AppendASCII(m_condition); #endif - messageString = pMessage->GetANSI(*pScratch); + messageString = pMessage->GetUTF8(); } EX_CATCH { @@ -138,7 +134,7 @@ void CHECK::Trigger(LPCSTR reason) #if _DEBUG DbgAssertDialog((char*)m_file, m_line, (char *)messageString); #else - OutputDebugStringA(messageString); + OutputDebugStringUtf8(messageString); DebugBreak(); #endif @@ -175,7 +171,7 @@ void CHECK::Setup(LPCSTR message, LPCSTR condition, LPCSTR file, INT line) // Try to build a stack of condition failures StackSString context; - context.Printf("%s\n\t%s%s FAILED: %s\n\t\t%s, line: %d", + context.Printf("%s\n\t%s%s FAILED: %s\n\t\t%s:%d", m_condition, message && *message ? message : "", message && *message ? ": " : "", @@ -260,8 +256,7 @@ LPCSTR CHECK::AllocateDynamicMessage(const SString &s) STATIC_CONTRACT_GC_NOTRIGGER; // Make a copy of it. - StackScratchBuffer buffer; - const char * pMsg = s.GetANSI(buffer); + const char * pMsg = s.GetUTF8(); // Must copy that into our own field. size_t len = strlen(pMsg) + 1; diff --git a/src/shared/utilcode/clrhost_nodependencies.cpp b/src/shared/utilcode/clrhost_nodependencies.cpp index ecba72b626..073904db29 100644 --- a/src/shared/utilcode/clrhost_nodependencies.cpp +++ b/src/shared/utilcode/clrhost_nodependencies.cpp @@ -12,55 +12,6 @@ #include "clrnt.h" #include "contract.h" -#if defined __llvm__ -# if defined(__has_feature) && __has_feature(address_sanitizer) -# define HAS_ADDRESS_SANITIZER -# endif -#endif - -#ifdef _DEBUG_IMPL - -// -// I'd very much like for this to go away. Its used to disable all THROWS contracts within whatever DLL this -// function is called from. That's obviously very, very bad, since there's no validation of those macros. But it -// can be difficult to remove this without actually fixing every violation at the same time. -// -// When this flag is finally removed, remove RealCLRThrowsExceptionWorker() too and put CONTRACT_THROWS() in place -// of it. -// -// -static BOOL dbg_fDisableThrowCheck = FALSE; - -void DisableThrowCheck() -{ - LIMITED_METHOD_CONTRACT; - - dbg_fDisableThrowCheck = TRUE; -} - -#ifdef HAS_ADDRESS_SANITIZER -// use the functionality from address santizier (which does not throw exceptions) -#else - -#define CLRThrowsExceptionWorker() RealCLRThrowsExceptionWorker(__FUNCTION__, __FILE__, __LINE__) - -static void RealCLRThrowsExceptionWorker(_In_z_ const char *szFunction, - _In_z_ const char *szFile, - int lineNum) -{ - WRAPPER_NO_CONTRACT; - - if (dbg_fDisableThrowCheck) - { - return; - } - - CONTRACT_THROWSEX(szFunction, szFile, lineNum); -} - -#endif // HAS_ADDRESS_SANITIZER -#endif //_DEBUG_IMPL - #if defined(_DEBUG_IMPL) && defined(ENABLE_CONTRACTS_IMPL) thread_local ClrDebugState* t_pClrDebugState; @@ -213,325 +164,5 @@ ClrDebugState *CLRInitDebugState() #endif //defined(_DEBUG_IMPL) && defined(ENABLE_CONTRACTS_IMPL) -const NoThrow nothrow = { 0 }; - -#if defined(HAS_ADDRESS_SANITIZER) || defined(DACCESS_COMPILE) -// use standard heap functions for address santizier -#else - -#ifdef _DEBUG -#ifdef TARGET_X86 -#define OS_HEAP_ALIGN 8 -#else -#define OS_HEAP_ALIGN 16 -#endif -#define CLRALLOC_TAG 0x2ce145f1 -#endif - -#ifdef HOST_WINDOWS -static HANDLE g_hProcessHeap; -#endif - -FORCEINLINE void* ClrMalloc(size_t size) -{ - STATIC_CONTRACT_NOTHROW; - -#ifdef FAILPOINTS_ENABLED - if (RFS_HashStack()) - return NULL; -#endif - - void* p; - -#ifdef _DEBUG - size += OS_HEAP_ALIGN; -#endif - -#ifdef HOST_WINDOWS - HANDLE hHeap = g_hProcessHeap; - if (hHeap == NULL) - { - InterlockedCompareExchangeT(&g_hProcessHeap, ::GetProcessHeap(), NULL); - hHeap = g_hProcessHeap; - } - - p = HeapAlloc(hHeap, 0, size); -#else - p = malloc(size); -#endif - -#ifdef _DEBUG - // Store the tag to detect heap contamination - if (p != NULL) - { - *((DWORD*)p) = CLRALLOC_TAG; - p = (BYTE*)p + OS_HEAP_ALIGN; - } -#endif - -#ifndef SELF_NO_HOST - if (p == NULL - // If we have not created StressLog ring buffer, we should not try to use it. - // StressLog is going to do a memory allocation. We may enter an endless loop. - && StressLog::t_pCurrentThreadLog != NULL) - { - STRESS_LOG_OOM_STACK(size); - } -#endif - - return p; -} - -FORCEINLINE void ClrFree(void* p) -{ - STATIC_CONTRACT_NOTHROW; - -#ifdef _DEBUG - if (p != NULL) - { - // Check the heap handle to detect heap contamination - p = (BYTE*)p - OS_HEAP_ALIGN; - if (*((DWORD*)p) != CLRALLOC_TAG) - _ASSERTE(!"Heap contamination detected! HeapFree was called on a heap other than the one that memory was allocated from.\n" - "Possible cause: you used new (executable) to allocate the memory, but didn't use DeleteExecutable() to free it."); - } -#endif - -#ifdef HOST_WINDOWS - if (p != NULL) - HeapFree(g_hProcessHeap, 0, p); -#else - free(p); -#endif -} - -void * __cdecl -operator new(size_t n) -{ -#ifdef _DEBUG_IMPL - CLRThrowsExceptionWorker(); -#endif - - STATIC_CONTRACT_THROWS; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_FAULT; - STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY; - - void* result = ClrMalloc(n); - if (result == NULL) { - ThrowOutOfMemory(); - } - TRASH_LASTERROR; - return result; -} - -void * __cdecl -operator new[](size_t n) -{ -#ifdef _DEBUG_IMPL - CLRThrowsExceptionWorker(); -#endif - - STATIC_CONTRACT_THROWS; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_FAULT; - STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY; - - void* result = ClrMalloc(n); - if (result == NULL) { - ThrowOutOfMemory(); - } - TRASH_LASTERROR; - return result; -}; - -#endif // HAS_ADDRESS_SANITIZER || DACCESS_COMPILE - -void * __cdecl operator new(size_t n, const NoThrow&) NOEXCEPT -{ -#if defined(HAS_ADDRESS_SANITIZER) || defined(DACCESS_COMPILE) - // use standard heap functions for address santizier (which doesn't provide for NoThrow) - void * result = operator new(n); -#else - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_FAULT; - STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY; - - INCONTRACT(_ASSERTE(!ARE_FAULTS_FORBIDDEN())); - void* result = ClrMalloc(n); -#endif // HAS_ADDRESS_SANITIZER || DACCESS_COMPILE - TRASH_LASTERROR; - return result; -} - -void * __cdecl operator new[](size_t n, const NoThrow&) NOEXCEPT -{ -#if defined(HAS_ADDRESS_SANITIZER) || defined(DACCESS_COMPILE) - // use standard heap functions for address santizier (which doesn't provide for NoThrow) - void * result = operator new[](n); -#else - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_FAULT; - STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY; - - INCONTRACT(_ASSERTE(!ARE_FAULTS_FORBIDDEN())); - - void* result = ClrMalloc(n); -#endif // HAS_ADDRESS_SANITIZER || DACCESS_COMPILE - TRASH_LASTERROR; - return result; -} - -#if defined(HAS_ADDRESS_SANITIZER) || defined(DACCESS_COMPILE) -// use standard heap functions for address santizier -#else -void __cdecl -operator delete(void *p) NOEXCEPT -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY; - - ClrFree(p); - - TRASH_LASTERROR; -} - -void __cdecl -operator delete[](void *p) NOEXCEPT -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY; - - ClrFree(p); - TRASH_LASTERROR; -} - -#endif // HAS_ADDRESS_SANITIZER || DACCESS_COMPILE - -/* ------------------------------------------------------------------------ * - * New operator overloading for the executable heap - * ------------------------------------------------------------------------ */ - -#ifdef HOST_WINDOWS - -HANDLE ClrGetProcessExecutableHeap() -{ - // Note: this can be called a little early for real contracts, so we use static contracts instead. - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - - static HANDLE g_ExecutableHeapHandle; - - // - // Create the executable heap lazily - // - if (g_ExecutableHeapHandle == NULL) - { - - HANDLE ExecutableHeapHandle = HeapCreate( - HEAP_CREATE_ENABLE_EXECUTE, // heap allocation attributes - 0, // initial heap size - 0 // maximum heap size; 0 == growable - ); - - if (ExecutableHeapHandle == NULL) - return NULL; - - HANDLE ExistingValue = InterlockedCompareExchangeT(&g_ExecutableHeapHandle, ExecutableHeapHandle, NULL); - if (ExistingValue != NULL) - { - HeapDestroy(ExecutableHeapHandle); - } - } - - return g_ExecutableHeapHandle; -} - -const CExecutable executable = { 0 }; - -void * __cdecl operator new(size_t n, const CExecutable&) -{ -#if defined(_DEBUG_IMPL) - CLRThrowsExceptionWorker(); -#endif - - STATIC_CONTRACT_THROWS; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_FAULT; - - HANDLE hExecutableHeap = ClrGetProcessExecutableHeap(); - if (hExecutableHeap == NULL) { - ThrowOutOfMemory(); - } - - void * result = HeapAlloc(hExecutableHeap, 0, n); - if (result == NULL) { - ThrowOutOfMemory(); - } - TRASH_LASTERROR; - return result; -} - -void * __cdecl operator new[](size_t n, const CExecutable&) -{ -#if defined(_DEBUG_IMPL) - CLRThrowsExceptionWorker(); -#endif - - STATIC_CONTRACT_THROWS; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_FAULT; - - HANDLE hExecutableHeap = ClrGetProcessExecutableHeap(); - if (hExecutableHeap == NULL) { - ThrowOutOfMemory(); - } - - void * result = HeapAlloc(hExecutableHeap, 0, n); - if (result == NULL) { - ThrowOutOfMemory(); - } - TRASH_LASTERROR; - return result; -} - -void * __cdecl operator new(size_t n, const CExecutable&, const NoThrow&) -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_FAULT; - - INCONTRACT(_ASSERTE(!ARE_FAULTS_FORBIDDEN())); - - HANDLE hExecutableHeap = ClrGetProcessExecutableHeap(); - if (hExecutableHeap == NULL) - return NULL; - - void * result = HeapAlloc(hExecutableHeap, 0, n); - TRASH_LASTERROR; - return result; -} - -void * __cdecl operator new[](size_t n, const CExecutable&, const NoThrow&) -{ - STATIC_CONTRACT_NOTHROW; - STATIC_CONTRACT_GC_NOTRIGGER; - STATIC_CONTRACT_FAULT; - - INCONTRACT(_ASSERTE(!ARE_FAULTS_FORBIDDEN())); - - HANDLE hExecutableHeap = ClrGetProcessExecutableHeap(); - if (hExecutableHeap == NULL) - return NULL; - - void * result = HeapAlloc(hExecutableHeap, 0, n); - TRASH_LASTERROR; - return result; -} -#endif // HOST_WINDOWS diff --git a/src/shared/utilcode/debug.cpp b/src/shared/utilcode/debug.cpp index 85a71f8c76..7a4ad9c033 100644 --- a/src/shared/utilcode/debug.cpp +++ b/src/shared/utilcode/debug.cpp @@ -15,11 +15,45 @@ #include "log.h" +#ifdef HOST_WINDOWS extern "C" _CRTIMP int __cdecl _flushall(void); +#endif +// Global state counter to implement SUPPRESS_ALLOCATION_ASSERTS_IN_THIS_SCOPE. Volatile g_DbgSuppressAllocationAsserts = 0; -#ifdef _DEBUG +static void GetExecutableFileNameUtf8(SString& value) +{ + CONTRACTL + { + THROWS; + GC_NOTRIGGER; + } + CONTRACTL_END; + + SString tmp; + WCHAR * pCharBuf = tmp.OpenUnicodeBuffer(_MAX_PATH); + DWORD numChars = GetModuleFileNameW(0 /* Get current executable */, pCharBuf, _MAX_PATH); + tmp.CloseBuffer(numChars); + + tmp.ConvertToUTF8(value); +} + +static void DECLSPEC_NORETURN FailFastOnAssert() +{ + WRAPPER_NO_CONTRACT; // If we're calling this, we're well past caring about contract consistency! + + FlushLogging(); // make certain we get the last part of the log +#ifdef HOST_WINDOWS + _flushall(); +#else + fflush(NULL); +#endif + + ShutdownLogging(); + RaiseFailFastException(NULL, NULL, 0); +} + VOID LogAssert( LPCSTR szFile, @@ -33,7 +67,7 @@ VOID LogAssert( // Log asserts to the stress log. Note that we can't include the szExpr b/c that // may not be a string literal (particularly for formatt-able asserts). - STRESS_LOG2(LF_ASSERT, LL_ALWAYS, "ASSERT:%s, line:%d\n", szFile, iLine); + STRESS_LOG2(LF_ASSERT, LL_ALWAYS, "ASSERT:%s:%d\n", szFile, iLine); SYSTEMTIME st; #ifndef TARGET_UNIX @@ -42,8 +76,8 @@ VOID LogAssert( GetSystemTime(&st); #endif - PathString exename; - WszGetModuleFileName(NULL, exename); + SString exename; + GetExecutableFileNameUtf8(exename); LOG((LF_ASSERT, LL_FATALERROR, @@ -62,7 +96,7 @@ VOID LogAssert( szFile, iLine, szExpr)); - LOG((LF_ASSERT, LL_FATALERROR, "RUNNING EXE: %ws\n", exename.GetUnicode())); + LOG((LF_ASSERT, LL_FATALERROR, "RUNNING EXE: %s\n", exename.GetUTF8())); } //***************************************************************************** @@ -70,7 +104,7 @@ VOID LogAssert( // failed hresult. But this code will check what environment you are running // in and give an assert for running in a debug build environment. Usually // out of memory on a dev machine is a bogus allocation, and this allows you -// to catch such errors. But when run in a stress envrionment where you are +// to catch such errors. But when run in a stress environment where you are // trying to get out of memory, assert behavior stops the tests. //***************************************************************************** HRESULT _OutOfMemory(LPCSTR szFile, int iLine) @@ -78,10 +112,11 @@ HRESULT _OutOfMemory(LPCSTR szFile, int iLine) STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_GC_NOTRIGGER; STATIC_CONTRACT_DEBUG_ONLY; + + printf("WARNING: Out of memory condition being issued from: %s, line %d\n", szFile, iLine); return (E_OUTOFMEMORY); } -int _DbgBreakCount = 0; static const char * szLowMemoryAssertMessage = "Assert failure (unable to format)"; //***************************************************************************** @@ -90,7 +125,7 @@ static const char * szLowMemoryAssertMessage = "Assert failure (unable to format bool _DbgBreakCheck( LPCSTR szFile, int iLine, - LPCSTR szExpr, + LPCUTF8 szExpr, BOOL fConstrained) { STATIC_CONTRACT_THROWS; @@ -100,11 +135,9 @@ bool _DbgBreakCheck( CONTRACT_VIOLATION(FaultNotFatal | GCViolation | TakesLockViolation); - SString debugOutput; - SString dialogOutput; + char formatBuffer[4096]; + SString modulePath; - SString dialogTitle; - SString dialogIgnoreMessage; BOOL formattedMessages = FALSE; // If we are low on memory we cannot even format a message. If this happens we want to @@ -113,29 +146,15 @@ bool _DbgBreakCheck( { EX_TRY { - ClrGetModuleFileName(0, modulePath); - debugOutput.Printf( - W("\nAssert failure(PID %d [0x%08x], Thread: %d [0x%04x]): %hs\n") - W(" File: %hs Line: %d\n") - W(" Image: "), + GetExecutableFileNameUtf8(modulePath); + + sprintf_s(formatBuffer, sizeof(formatBuffer), + "\nAssert failure(PID %d [0x%08x], Thread: %d [0x%04x]): %s\n" + " File: %s:%d\n" + " Image: %s\n\n", GetCurrentProcessId(), GetCurrentProcessId(), GetCurrentThreadId(), GetCurrentThreadId(), - szExpr, szFile, iLine); - debugOutput.Append(modulePath); - debugOutput.Append(W("\n\n")); - - // Change format for message box. The extra spaces in the title - // are there to get around format truncation. - dialogOutput.Printf( - W("%hs\n\n%hs, Line: %d\n\nAbort - Kill program\nRetry - Debug\nIgnore - Keep running\n") - W("\n\nImage:\n"), szExpr, szFile, iLine); - dialogOutput.Append(modulePath); - dialogOutput.Append(W("\n")); - dialogTitle.Printf(W("Assert Failure (PID %d, Thread %d/0x%04x)"), - GetCurrentProcessId(), GetCurrentThreadId(), GetCurrentThreadId()); - - dialogIgnoreMessage.Printf(W("Ignore the assert for the rest of this run?\nYes - Assert will never fire again.\nNo - Assert will continue to fire.\n\n%hs\nLine: %d\n"), - szFile, iLine); + szExpr, szFile, iLine, modulePath.GetUTF8()); formattedMessages = TRUE; } @@ -148,37 +167,36 @@ bool _DbgBreakCheck( // Emit assert in debug output and console for easy access. if (formattedMessages) { - WszOutputDebugString(debugOutput); - fwprintf(stderr, W("%s"), (const WCHAR*)debugOutput); + OutputDebugStringUtf8(formatBuffer); + fprintf(stderr, "%s", formatBuffer); } else { // Note: we cannot convert to unicode or concatenate in this situation. - OutputDebugStringA(szLowMemoryAssertMessage); - OutputDebugStringA("\n"); - OutputDebugStringA(szFile); - OutputDebugStringA("\n"); - OutputDebugStringA(szExpr); - OutputDebugStringA("\n"); - printf(szLowMemoryAssertMessage); + OutputDebugStringUtf8(szLowMemoryAssertMessage); + OutputDebugStringUtf8("\n"); + OutputDebugStringUtf8(szFile); + OutputDebugStringUtf8("\n"); + OutputDebugStringUtf8(szExpr); + OutputDebugStringUtf8("\n"); + printf("%s", szLowMemoryAssertMessage); printf("\n"); - printf(szFile); + printf("%s", szFile); printf("\n"); printf("%s", szExpr); printf("\n"); } LogAssert(szFile, iLine, szExpr); - FlushLogging(); // make certain we get the last part of the log - _flushall(); + if (IsDebuggerPresent()) { return true; // like a retry } - TerminateProcess(GetCurrentProcess(), 1); - return false; + FailFastOnAssert(); + UNREACHABLE(); } bool _DbgBreakCheckNoThrow( @@ -211,15 +229,6 @@ bool _DbgBreakCheckNoThrow( return result; } -// Called from within the IfFail...() macros. Set a breakpoint here to break on -// errors. -VOID DebBreak() -{ - STATIC_CONTRACT_LEAF; - static int i = 0; // add some code here so that we'll be able to set a BP - i++; -} - VOID DebBreakHr(HRESULT hr) { STATIC_CONTRACT_LEAF; @@ -238,7 +247,7 @@ VOID DbgAssertDialog(const char *szFile, int iLine, const char *szExpr) STATIC_CONTRACT_FORBID_FAULT; STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY; - DEBUG_ONLY_FUNCTION; + //DEBUG_ONLY_FUNCTION; #ifdef DACCESS_COMPILE // In the DAC case, asserts can mean one of two things. @@ -266,12 +275,6 @@ VOID DbgAssertDialog(const char *szFile, int iLine, const char *szExpr) SUPPRESS_ALLOCATION_ASSERTS_IN_THIS_SCOPE; - // Raising the assert dialog can cause us to re-enter the host when allocating - // memory for the string. Since this is debug-only code, we can safely skip - // violation asserts here, particularly since they can also cause infinite - // recursion. - PERMANENT_CONTRACT_VIOLATION(HostViolation, ReasonDebugOnly); - dbgForceToMemory = &szFile; //make certain these args are available in the debugger dbgForceToMemory = &iLine; dbgForceToMemory = &szExpr; @@ -295,5 +298,3 @@ VOID DbgAssertDialog(const char *szFile, int iLine, const char *szExpr) g_BufferLock = 0; } } // DbgAssertDialog - -#endif // _DEBUG diff --git a/src/shared/utilcode/dlwrap.cpp b/src/shared/utilcode/dlwrap.cpp deleted file mode 100644 index 8cb312f8f8..0000000000 --- a/src/shared/utilcode/dlwrap.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - - -#include "stdafx.h" // Precompiled header key. -#include "utilcode.h" -#include "metadata.h" -#include "ex.h" -#include "pedecoder.h" - -#include -#include - -DWORD -GetFileVersionInfoSizeW_NoThrow( - LPCWSTR lptstrFilename, /* Filename of version stamped file */ - LPDWORD lpdwHandle - ) -{ - WRAPPER_NO_CONTRACT; - HRESULT hr=S_OK; - DWORD dwRet=0; - EX_TRY - { - dwRet=GetFileVersionInfoSize( (LPWSTR)lptstrFilename, lpdwHandle ); - } - EX_CATCH_HRESULT(hr); - if (hr!=S_OK) - SetLastError(hr); - return dwRet; - -} - -BOOL -GetFileVersionInfoW_NoThrow( - LPCWSTR lptstrFilename, /* Filename of version stamped file */ - DWORD dwHandle, /* Information from GetFileVersionSize */ - DWORD dwLen, /* Length of buffer for info */ - LPVOID lpData - ) -{ - WRAPPER_NO_CONTRACT; - HRESULT hr=S_OK; - BOOL bRet=FALSE; - EX_TRY - { - bRet=GetFileVersionInfo( (LPWSTR)lptstrFilename, dwHandle,dwLen,lpData ); - } - EX_CATCH_HRESULT(hr); - if (hr!=S_OK) - SetLastError(hr); - return bRet; - -} - -BOOL -VerQueryValueW_NoThrow( - const LPVOID pBlock, - LPCWSTR lpSubBlock, - LPVOID * lplpBuffer, - PUINT puLen - ) -{ - WRAPPER_NO_CONTRACT; - HRESULT hr=S_OK; - BOOL bRet=FALSE; - EX_TRY - { - bRet=VerQueryValueW( pBlock, (LPWSTR)lpSubBlock,lplpBuffer,puLen ); - } - EX_CATCH_HRESULT(hr); - if (hr!=S_OK) - SetLastError(hr); - return bRet; - -} - diff --git a/src/shared/utilcode/ex.cpp b/src/shared/utilcode/ex.cpp index 47cb488de7..e6a010add7 100644 --- a/src/shared/utilcode/ex.cpp +++ b/src/shared/utilcode/ex.cpp @@ -15,7 +15,7 @@ // error codes #include "corerror.h" -#include "resource.h" +#include "../dlls/mscorrc/resource.h" #include "olectl.h" @@ -63,6 +63,23 @@ Exception * Exception::GetOOMException() return GetOOMException(); } +#ifdef DACCESS_COMPILE + +extern void* AllocDbiMemory(size_t size); +extern void DeleteDbiMemory(void* p); + +void * Exception::operator new(size_t size) +{ + return AllocDbiMemory(size); +} + +void Exception::operator delete(void* ptr) +{ + DeleteDbiMemory(ptr); +} + +#endif + //------------------------------------------------------------------------------ void Exception::Delete(Exception* pvMemory) { @@ -79,7 +96,12 @@ void Exception::Delete(Exception* pvMemory) return; } - ::delete((Exception *) pvMemory); +#ifdef DACCESS_COMPILE + delete pvMemory; +#else + ::delete pvMemory; +#endif + } void Exception::GetMessage(SString &result) @@ -548,21 +570,11 @@ LPCSTR Exception::GetHRSymbolicName(HRESULT hr) #ifdef _DEBUG // @todo: do we want to burn strings for this in a free build? - CASE_HRESULT(CEE_E_CVTRES_NOT_FOUND) CASE_HRESULT(COR_E_APPDOMAINUNLOADED) CASE_HRESULT(COR_E_CANNOTUNLOADAPPDOMAIN) CASE_HRESULT(MSEE_E_ASSEMBLYLOADINPROGRESS) - CASE_HRESULT(COR_E_FIXUPSINEXE) - CASE_HRESULT(COR_E_MODULE_HASH_CHECK_FAILED) - CASE_HRESULT(FUSION_E_LOADFROM_BLOCKED) - CASE_HRESULT(FUSION_E_CACHEFILE_FAILED) CASE_HRESULT(FUSION_E_REF_DEF_MISMATCH) - CASE_HRESULT(FUSION_E_INVALID_PRIVATE_ASM_LOCATION) - CASE_HRESULT(FUSION_E_ASM_MODULE_MISSING) - CASE_HRESULT(FUSION_E_PRIVATE_ASM_DISALLOWED) - CASE_HRESULT(FUSION_E_SIGNATURE_CHECK_FAILED) CASE_HRESULT(FUSION_E_INVALID_NAME) - CASE_HRESULT(FUSION_E_CODE_DOWNLOAD_DISABLED) CASE_HRESULT(CLDB_E_FILE_BADREAD) CASE_HRESULT(CLDB_E_FILE_BADWRITE) CASE_HRESULT(CLDB_S_TRUNCATION) @@ -686,20 +698,15 @@ LPCSTR Exception::GetHRSymbolicName(HRESULT hr) CASE_HRESULT(CORPROF_E_NOT_MANAGED_THREAD) CASE_HRESULT(CORPROF_E_CALL_ONLY_FROM_INIT) CASE_HRESULT(CORPROF_E_NOT_YET_AVAILABLE) - CASE_HRESULT(SECURITY_E_INCOMPATIBLE_SHARE) - CASE_HRESULT(SECURITY_E_UNVERIFIABLE) - CASE_HRESULT(SECURITY_E_INCOMPATIBLE_EVIDENCE) CASE_HRESULT(CLDB_E_INTERNALERROR) CASE_HRESULT(CORSEC_E_POLICY_EXCEPTION) CASE_HRESULT(CORSEC_E_MIN_GRANT_FAIL) CASE_HRESULT(CORSEC_E_NO_EXEC_PERM) CASE_HRESULT(CORSEC_E_XMLSYNTAX) CASE_HRESULT(CORSEC_E_INVALID_STRONGNAME) - CASE_HRESULT(CORSEC_E_MISSING_STRONGNAME) CASE_HRESULT(CORSEC_E_INVALID_IMAGE_FORMAT) CASE_HRESULT(CORSEC_E_CRYPTO) CASE_HRESULT(CORSEC_E_CRYPTO_UNEX_OPER) - CASE_HRESULT(CORSECATTR_E_BAD_ACTION) CASE_HRESULT(COR_E_APPLICATION) CASE_HRESULT(COR_E_ARGUMENTOUTOFRANGE) CASE_HRESULT(COR_E_ARITHMETIC) @@ -804,11 +811,13 @@ HRESULT SEHException::GetHR() return m_exception.ExceptionCode; } +#ifdef FEATURE_COMINTEROP IErrorInfo *SEHException::GetErrorInfo() { LIMITED_METHOD_CONTRACT; return NULL; } +#endif // FEATURE_COMINTEROP void SEHException::GetMessage(SString &string) { @@ -889,6 +898,7 @@ HRESULT DelegatingException::GetHR() } // HRESULT DelegatingException::GetHR() +#ifdef FEATURE_COMINTEROP //------------------------------------------------------------------------------ IErrorInfo *DelegatingException::GetErrorInfo() { @@ -902,6 +912,7 @@ IErrorInfo *DelegatingException::GetErrorInfo() return pDelegate ? pDelegate->GetErrorInfo() : NULL; } // IErrorInfo *DelegatingException::GetErrorInfo() +#endif // FEATURE_COMINTEROP //------------------------------------------------------------------------------ void DelegatingException::GetMessage(SString &result) @@ -1124,9 +1135,7 @@ void GetHRMsg(HRESULT hr, SString &result, BOOL bNoGeekStuff/* = FALSE*/) } CONTRACTL_END; - result = W(""); // Make sure this routine isn't an inadvertent data-leak exploit! - - + result.Set(W("")); // Make sure this routine isn't an inadvertent data-leak exploit! SString strDescr; BOOL fHaveDescr = FALSE; @@ -1143,8 +1152,6 @@ void GetHRMsg(HRESULT hr, SString &result, BOOL bNoGeekStuff/* = FALSE*/) fHaveDescr = strDescr.FormatMessage(dwFlags, 0, hr, 0); } - LPCSTR name = Exception::GetHRSymbolicName(hr); - // If we can't get a resource string, print the hresult regardless. if (!fHaveDescr) { @@ -1158,21 +1165,26 @@ void GetHRMsg(HRESULT hr, SString &result, BOOL bNoGeekStuff/* = FALSE*/) if (!bNoGeekStuff) { + SString geekStuffUtf8; if (fHaveDescr) { - result.Append(W(" (")); + geekStuffUtf8.AppendUTF8(" ("); } - result.AppendPrintf(W("0x%.8X"), hr); + geekStuffUtf8.AppendPrintf("0x%.8X", hr); + + LPCSTR name = Exception::GetHRSymbolicName(hr); if (name != NULL) { - result.AppendPrintf(W(" (%S)"), name); + geekStuffUtf8.AppendPrintf(" (%s)", name); } if (fHaveDescr) { - result.Append(W(")")); + geekStuffUtf8.AppendUTF8(")"); } + + result.Append(geekStuffUtf8); } } @@ -1189,7 +1201,7 @@ void GenerateTopLevelHRExceptionMessage(HRESULT hresult, SString &result) } CONTRACTL_END; - result = W(""); // Make sure this routine isn't an inadvertent data-leak exploit! + result.Set(W("")); // Make sure this routine isn't an inadvertent data-leak exploit! GetHRMsg(hresult, result); } diff --git a/src/shared/utilcode/fstring.cpp b/src/shared/utilcode/fstring.cpp index 9bcd12d1ff..6b4c7988a2 100644 --- a/src/shared/utilcode/fstring.cpp +++ b/src/shared/utilcode/fstring.cpp @@ -65,7 +65,7 @@ HRESULT Unicode_Utf8_Length(_In_z_ LPCWSTR pString, _Out_ bool * pAllAscii, _Out } else // use WideCharToMultiByte to calculate result length { - * pLength = WszWideCharToMultiByte(CP_UTF8, 0, pString, -1, NULL, 0, NULL, NULL); + * pLength = WideCharToMultiByte(CP_UTF8, 0, pString, -1, NULL, 0, NULL, NULL); if (*pLength == 0) { @@ -131,7 +131,7 @@ HRESULT Unicode_Utf8(_In_z_ LPCWSTR pString, bool allAscii, _Out_writes_bytes_(l } else { - length = WszWideCharToMultiByte(CP_UTF8, 0, pString, -1, pBuffer, (int) length + 1, NULL, NULL); + length = WideCharToMultiByte(CP_UTF8, 0, pString, -1, pBuffer, (int) length + 1, NULL, NULL); if (length == 0) { @@ -185,7 +185,7 @@ HRESULT Utf8_Unicode_Length(_In_z_ LPCSTR pString, _Out_ bool * pAllAscii, _Out_ } else { - * pLength = WszMultiByteToWideChar(CP_UTF8, 0, pString, -1, NULL, 0); + * pLength = MultiByteToWideChar(CP_UTF8, 0, pString, -1, NULL, 0); if (* pLength == 0) { @@ -252,7 +252,7 @@ HRESULT Utf8_Unicode(_In_z_ LPCSTR pString, bool allAscii, _Out_writes_bytes_(le } else { - length = WszMultiByteToWideChar(CP_UTF8, 0, pString, -1, pBuffer, (int) length + 1); + length = MultiByteToWideChar(CP_UTF8, 0, pString, -1, pBuffer, (int) length + 1); if (length == 0) { diff --git a/src/shared/utilcode/hostimpl.cpp b/src/shared/utilcode/hostimpl.cpp index bd5c25a6f5..2286aa270d 100644 --- a/src/shared/utilcode/hostimpl.cpp +++ b/src/shared/utilcode/hostimpl.cpp @@ -38,10 +38,6 @@ void ClrLeaveCriticalSection(CRITSEC_COOKIE cookie) LPVOID ClrVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) { -#ifdef FAILPOINTS_ENABLED - if (RFS_HashStack ()) - return NULL; -#endif return VirtualAlloc(lpAddress, dwSize, flAllocationType, flProtect); } diff --git a/src/shared/utilcode/longfilepathwrappers.cpp b/src/shared/utilcode/longfilepathwrappers.cpp index bf23f23ba4..09e3118fc8 100644 --- a/src/shared/utilcode/longfilepathwrappers.cpp +++ b/src/shared/utilcode/longfilepathwrappers.cpp @@ -7,314 +7,30 @@ #include "sstring.h" #include "ex.h" +#ifdef HOST_WINDOWS class LongFile { private: -#ifdef HOST_WINDOWS static const WCHAR* ExtendedPrefix; static const WCHAR* DevicePathPrefix; static const WCHAR* UNCPathPrefix; static const WCHAR* UNCExtendedPathPrefix; static const WCHAR VolumeSeparatorChar; #define UNCPATHPREFIX W("\\\\") -#endif //HOST_WINDOWS - static const WCHAR DirectorySeparatorChar; static const WCHAR AltDirectorySeparatorChar; + static const WCHAR DirectorySeparatorChar; public: - static BOOL ContainsDirectorySeparator(SString & path); static BOOL IsDirectorySeparator(WCHAR c); static BOOL IsPathNotFullyQualified(const SString & path); static HRESULT NormalizePath(SString& path); -#ifdef HOST_WINDOWS static BOOL IsExtended(const SString & path); static BOOL IsUNCExtended(const SString & path); static BOOL IsDevice(const SString & path); static void NormalizeDirectorySeparators(SString& path); -#endif }; - -HMODULE -LoadLibraryExWrapper( - LPCWSTR lpLibFileName, - HANDLE hFile, - DWORD dwFlags - ) -{ - CONTRACTL - { - NOTHROW; - } - CONTRACTL_END; - - HRESULT hr = S_OK; - HMODULE ret = NULL; - DWORD lastError = 0; - - EX_TRY - { - - LongPathString path(LongPathString::Literal, lpLibFileName); - - if (LongFile::IsPathNotFullyQualified(path) || SUCCEEDED(LongFile::NormalizePath(path))) - { -#ifdef HOST_WINDOWS - //Adding the assert to ensure relative paths which are not just filenames are not used for LoadLibrary Calls - _ASSERTE(!LongFile::IsPathNotFullyQualified(path) || !LongFile::ContainsDirectorySeparator(path)); - LongFile::NormalizeDirectorySeparators(path); -#endif //HOST_WINDOWS - - ret = LoadLibraryExW(path.GetUnicode(), hFile, dwFlags); - } - - lastError = GetLastError(); - } - EX_CATCH_HRESULT(hr); - - if (hr != S_OK) - { - SetLastError(hr); - } - else if(ret == NULL) - { - SetLastError(lastError); - } - - return ret; -} - -HANDLE -CreateFileWrapper( - _In_ LPCWSTR lpFileName, - _In_ DWORD dwDesiredAccess, - _In_ DWORD dwShareMode, - _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, - _In_ DWORD dwCreationDisposition, - _In_ DWORD dwFlagsAndAttributes, - _In_opt_ HANDLE hTemplateFile - ) -{ - CONTRACTL - { - NOTHROW; - } - CONTRACTL_END; - - HRESULT hr = S_OK; - DWORD lastError = 0; - HANDLE ret = INVALID_HANDLE_VALUE; - - EX_TRY - { - LongPathString path(LongPathString::Literal, lpFileName); - - if (SUCCEEDED(LongFile::NormalizePath(path))) - { - ret = CreateFileW(path.GetUnicode(), - dwDesiredAccess, - dwShareMode, - lpSecurityAttributes, - dwCreationDisposition, - dwFlagsAndAttributes, - hTemplateFile); - - } - - lastError = GetLastError(); - } - EX_CATCH_HRESULT(hr); - - if (hr != S_OK ) - { - SetLastError(hr); - } - else if(ret == INVALID_HANDLE_VALUE) - { - SetLastError(lastError); - } - - return ret; -} - -DWORD -GetFileAttributesWrapper( - _In_ LPCWSTR lpFileName - ) -{ - CONTRACTL - { - NOTHROW; - } - CONTRACTL_END; - - HRESULT hr = S_OK; - DWORD ret = INVALID_FILE_ATTRIBUTES; - DWORD lastError = 0; - - EX_TRY - { - LongPathString path(LongPathString::Literal, lpFileName); - - if (SUCCEEDED(LongFile::NormalizePath(path))) - { - ret = GetFileAttributesW( - path.GetUnicode() - ); - } - - lastError = GetLastError(); - } - EX_CATCH_HRESULT(hr); - - if (hr != S_OK ) - { - SetLastError(hr); - } - else if(ret == INVALID_FILE_ATTRIBUTES) - { - SetLastError(lastError); - } - - return ret; -} - -BOOL -GetFileAttributesExWrapper( - _In_ LPCWSTR lpFileName, - _In_ GET_FILEEX_INFO_LEVELS fInfoLevelId, - _Out_writes_bytes_(sizeof(WIN32_FILE_ATTRIBUTE_DATA)) LPVOID lpFileInformation - ) -{ - CONTRACTL - { - NOTHROW; - } - CONTRACTL_END; - - HRESULT hr = S_OK; - BOOL ret = FALSE; - DWORD lastError = 0; - - EX_TRY - { - LongPathString path(LongPathString::Literal, lpFileName); - - if (SUCCEEDED(LongFile::NormalizePath(path))) - { - ret = GetFileAttributesExW( - path.GetUnicode(), - fInfoLevelId, - lpFileInformation - ); - - } - - lastError = GetLastError(); - } - EX_CATCH_HRESULT(hr); - - if (hr != S_OK ) - { - SetLastError(hr); - } - else if(ret == FALSE) - { - SetLastError(lastError); - } - - return ret; -} - -BOOL -DeleteFileWrapper( - _In_ LPCWSTR lpFileName - ) -{ - CONTRACTL - { - NOTHROW; - } - CONTRACTL_END; - - HRESULT hr = S_OK; - BOOL ret = FALSE; - DWORD lastError = 0; - - EX_TRY - { - LongPathString path(LongPathString::Literal, lpFileName); - - if (SUCCEEDED(LongFile::NormalizePath(path))) - { - ret = DeleteFileW( - path.GetUnicode() - ); - } - - lastError = GetLastError(); - } - EX_CATCH_HRESULT(hr); - - if (hr != S_OK ) - { - SetLastError(hr); - } - else if(ret == FALSE) - { - SetLastError(lastError); - } - - return ret; -} - -BOOL -MoveFileExWrapper( - _In_ LPCWSTR lpExistingFileName, - _In_opt_ LPCWSTR lpNewFileName, - _In_ DWORD dwFlags - ) -{ - CONTRACTL - { - NOTHROW; - } - CONTRACTL_END; - - HRESULT hr = S_OK; - BOOL ret = FALSE; - DWORD lastError = 0; - - EX_TRY - { - LongPathString Existingpath(LongPathString::Literal, lpExistingFileName); - LongPathString Newpath(LongPathString::Literal, lpNewFileName); - - if (SUCCEEDED(LongFile::NormalizePath(Existingpath)) && SUCCEEDED(LongFile::NormalizePath(Newpath))) - { - ret = MoveFileExW( - Existingpath.GetUnicode(), - Newpath.GetUnicode(), - dwFlags - ); - } - - lastError = GetLastError(); - } - EX_CATCH_HRESULT(hr); - - if (hr != S_OK ) - { - SetLastError(hr); - } - else if(ret == FALSE) - { - SetLastError(lastError); - } - - return ret; - -} +#endif // HOST_WINDOWS DWORD SearchPathWrapper( @@ -338,8 +54,8 @@ SearchPathWrapper( EX_TRY { +#ifdef HOST_WINDOWS LongPathString Existingpath(LongPathString::Literal, lpPath); - if (lpPath != NULL) { if (FAILED(LongFile::NormalizePath(Existingpath))) @@ -351,6 +67,7 @@ SearchPathWrapper( lpPath = Existingpath.GetUnicode(); } } +#endif // HOST_WINDOWS if (!getPath) { @@ -467,11 +184,9 @@ GetModuleFileNameWrapper( return ret; } -UINT WINAPI GetTempFileNameWrapper( - _In_ LPCTSTR lpPathName, - _In_ LPCTSTR lpPrefixString, - _In_ UINT uUnique, - SString& lpTempFileName +DWORD WINAPI GetEnvironmentVariableWrapper( + _In_opt_ LPCTSTR lpName, + _Out_opt_ SString& lpBuffer ) { CONTRACTL @@ -481,25 +196,38 @@ UINT WINAPI GetTempFileNameWrapper( CONTRACTL_END; HRESULT hr = S_OK; - UINT ret = 0; + DWORD ret = 0; DWORD lastError = 0; EX_TRY { - //Change the behaviour in Redstone to retry - COUNT_T size = MAX_LONGPATH; - WCHAR* buffer = lpTempFileName.OpenUnicodeBuffer(size - 1); - ret = GetTempFileNameW( - lpPathName, - lpPrefixString, - uUnique, - buffer + + COUNT_T size = lpBuffer.GetUnicodeAllocation() + 1; + + ret = GetEnvironmentVariableW( + lpName, + lpBuffer.OpenUnicodeBuffer(size - 1), + size ); - lastError = GetLastError(); - size = (COUNT_T)wcslen(buffer); - lpTempFileName.CloseBuffer(size); + // We loop round getting the length of the env var and then trying to copy + // the value into a the allocated buffer. Usually we'll go through this loop + // precisely once, but the caution is necessary in case the variable mutates + // beneath us, as the environment variable can be modified by another thread + //between two calls to GetEnvironmentVariableW + while (ret > size) + { + size = ret; + lpBuffer.CloseBuffer(); + ret = GetEnvironmentVariableW( + lpName, + lpBuffer.OpenUnicodeBuffer(size - 1), + size); + } + + lastError = GetLastError(); + lpBuffer.CloseBuffer(ret); } EX_CATCH_HRESULT(hr); @@ -514,9 +242,15 @@ UINT WINAPI GetTempFileNameWrapper( return ret; } -DWORD WINAPI GetTempPathWrapper( - SString& lpBuffer - ) + +#ifdef HOST_WINDOWS + +HMODULE +LoadLibraryExWrapper( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ) { CONTRACTL { @@ -524,22 +258,22 @@ DWORD WINAPI GetTempPathWrapper( } CONTRACTL_END; - HRESULT hr = S_OK; - DWORD ret = 0; + HRESULT hr = S_OK; + HMODULE ret = NULL; DWORD lastError = 0; EX_TRY { - //Change the behaviour in Redstone to retry - COUNT_T size = MAX_LONGPATH; + LongPathString path(LongPathString::Literal, lpLibFileName); - ret = GetTempPathW( - size, - lpBuffer.OpenUnicodeBuffer(size - 1) - ); + if (LongFile::IsPathNotFullyQualified(path) || SUCCEEDED(LongFile::NormalizePath(path))) + { + LongFile::NormalizeDirectorySeparators(path); + + ret = LoadLibraryExW(path.GetUnicode(), hFile, dwFlags); + } lastError = GetLastError(); - lpBuffer.CloseBuffer(ret); } EX_CATCH_HRESULT(hr); @@ -547,7 +281,7 @@ DWORD WINAPI GetTempPathWrapper( { SetLastError(hr); } - else if (ret == 0) + else if(ret == NULL) { SetLastError(lastError); } @@ -555,9 +289,16 @@ DWORD WINAPI GetTempPathWrapper( return ret; } -DWORD WINAPI GetCurrentDirectoryWrapper( - SString& lpBuffer - ) +HANDLE +CreateFileWrapper( + _In_ LPCWSTR lpFileName, + _In_ DWORD dwDesiredAccess, + _In_ DWORD dwShareMode, + _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, + _In_ DWORD dwCreationDisposition, + _In_ DWORD dwFlagsAndAttributes, + _In_opt_ HANDLE hTemplateFile + ) { CONTRACTL { @@ -566,29 +307,34 @@ DWORD WINAPI GetCurrentDirectoryWrapper( CONTRACTL_END; HRESULT hr = S_OK; - DWORD ret = 0; DWORD lastError = 0; + HANDLE ret = INVALID_HANDLE_VALUE; EX_TRY { - //Change the behaviour in Redstone to retry - COUNT_T size = MAX_LONGPATH; + LongPathString path(LongPathString::Literal, lpFileName); - ret = GetCurrentDirectoryW( - size, - lpBuffer.OpenUnicodeBuffer(size - 1) - ); + if (SUCCEEDED(LongFile::NormalizePath(path))) + { + ret = CreateFileW(path.GetUnicode(), + dwDesiredAccess, + dwShareMode, + lpSecurityAttributes, + dwCreationDisposition, + dwFlagsAndAttributes, + hTemplateFile); + + } lastError = GetLastError(); - lpBuffer.CloseBuffer(ret); } EX_CATCH_HRESULT(hr); - if (hr != S_OK) + if (hr != S_OK ) { SetLastError(hr); } - else if (ret == 0) + else if(ret == INVALID_HANDLE_VALUE) { SetLastError(lastError); } @@ -596,10 +342,12 @@ DWORD WINAPI GetCurrentDirectoryWrapper( return ret; } -DWORD WINAPI GetEnvironmentVariableWrapper( - _In_opt_ LPCTSTR lpName, - _Out_opt_ SString& lpBuffer - ) +BOOL +GetFileAttributesExWrapper( + _In_ LPCWSTR lpFileName, + _In_ GET_FILEEX_INFO_LEVELS fInfoLevelId, + _Out_writes_bytes_(sizeof(WIN32_FILE_ATTRIBUTE_DATA)) LPVOID lpFileInformation + ) { CONTRACTL { @@ -608,46 +356,32 @@ DWORD WINAPI GetEnvironmentVariableWrapper( CONTRACTL_END; HRESULT hr = S_OK; - DWORD ret = 0; + BOOL ret = FALSE; DWORD lastError = 0; EX_TRY { + LongPathString path(LongPathString::Literal, lpFileName); - COUNT_T size = lpBuffer.GetUnicodeAllocation() + 1; - - ret = GetEnvironmentVariableW( - lpName, - lpBuffer.OpenUnicodeBuffer(size - 1), - size - ); - - // We loop round getting the length of the env var and then trying to copy - // the value into a the allocated buffer. Usually we'll go through this loop - // precisely once, but the caution is ncessary in case the variable mutates - // beneath us, as the environment variable can be modified by another thread - //between two calls to GetEnvironmentVariableW - - while (ret > size) + if (SUCCEEDED(LongFile::NormalizePath(path))) { - size = ret; - lpBuffer.CloseBuffer(); - ret = GetEnvironmentVariableW( - lpName, - lpBuffer.OpenUnicodeBuffer(size - 1), - size); + ret = GetFileAttributesExW( + path.GetUnicode(), + fInfoLevelId, + lpFileInformation + ); + } lastError = GetLastError(); - lpBuffer.CloseBuffer(ret); } EX_CATCH_HRESULT(hr); - if (hr != S_OK) + if (hr != S_OK ) { SetLastError(hr); } - else if (ret == 0) + else if(ret == FALSE) { SetLastError(lastError); } @@ -655,9 +389,6 @@ DWORD WINAPI GetEnvironmentVariableWrapper( return ret; } - -#ifdef HOST_WINDOWS - BOOL CopyFileExWrapper( _In_ LPCWSTR lpExistingFileName, @@ -712,63 +443,9 @@ CopyFileExWrapper( return ret; } -HANDLE -FindFirstFileExWrapper( - _In_ LPCWSTR lpFileName, - _In_ FINDEX_INFO_LEVELS fInfoLevelId, - _Out_writes_bytes_(sizeof(WIN32_FIND_DATAW)) LPVOID lpFindFileData, - _In_ FINDEX_SEARCH_OPS fSearchOp, - _Reserved_ LPVOID lpSearchFilter, - _In_ DWORD dwAdditionalFlags - ) -{ - CONTRACTL - { - NOTHROW; - } - CONTRACTL_END; - - HRESULT hr = S_OK; - HANDLE ret = INVALID_HANDLE_VALUE; - DWORD lastError = 0; - - EX_TRY - { - LongPathString path(LongPathString::Literal, lpFileName); - - if (SUCCEEDED(LongFile::NormalizePath(path))) - { - ret = FindFirstFileExW( - path.GetUnicode(), - fInfoLevelId, - lpFindFileData, - fSearchOp, - lpSearchFilter, - dwAdditionalFlags - ); - } - - lastError = GetLastError(); - } - EX_CATCH_HRESULT(hr); - - if (hr != S_OK ) - { - SetLastError(hr); - } - else if(ret == INVALID_HANDLE_VALUE) - { - SetLastError(lastError); - } - - return ret; -} -#endif // HOST_WINDOWS - //Implementation of LongFile Helpers const WCHAR LongFile::DirectorySeparatorChar = W('\\'); const WCHAR LongFile::AltDirectorySeparatorChar = W('/'); -#ifdef HOST_WINDOWS const WCHAR LongFile::VolumeSeparatorChar = W(':'); const WCHAR* LongFile::ExtendedPrefix = W("\\\\?\\"); const WCHAR* LongFile::DevicePathPrefix = W("\\\\.\\"); @@ -853,7 +530,7 @@ HRESULT LongFile::NormalizePath(SString & path) //In this case if path is \\server the extended syntax should be like \\?\UNC\server //The below logic populates the path from prefixLen offset from the start. This ensures that first 2 characters are overwritten // - prefixLen = prefix.GetCount() - (COUNT_T)wcslen(UNCPATHPREFIX); + prefixLen = prefix.GetCount() - (COUNT_T)u16_strlen(UNCPATHPREFIX); _ASSERTE(prefixLen > 0 ); } @@ -897,10 +574,10 @@ HRESULT LongFile::NormalizePath(SString & path) SString fullpath(SString::Literal,buffer + prefixLen); //Check if the resolved path is a UNC. By default we assume relative path to resolve to disk - if (fullpath.BeginsWith(SL(UNCPathPrefix)) && prefixLen != prefix.GetCount() - (COUNT_T)wcslen(UNCPATHPREFIX)) + if (fullpath.BeginsWith(SL(UNCPathPrefix)) && prefixLen != prefix.GetCount() - (COUNT_T)u16_strlen(UNCPATHPREFIX)) { //Remove the leading '\\' from the UNC path to be replaced with UNCExtendedPathPrefix - fullpath.Replace(fullpath.Begin(), (COUNT_T)wcslen(UNCPATHPREFIX), UNCExtendedPathPrefix); + fullpath.Replace(fullpath.Begin(), (COUNT_T)u16_strlen(UNCPATHPREFIX), SL(UNCExtendedPathPrefix)); path.CloseBuffer(); path.Set(fullpath); } @@ -915,25 +592,10 @@ HRESULT LongFile::NormalizePath(SString & path) return S_OK; } -#else -BOOL LongFile::IsPathNotFullyQualified(const SString & path) -{ - return TRUE; -} - -//Don't need to do anything For XPlat -HRESULT LongFile::NormalizePath(SString & path) -{ - return S_OK; -} -#endif //HOST_WINDOWS - -BOOL LongFile::ContainsDirectorySeparator(SString & path) -{ - return path.Find(path.Begin(), DirectorySeparatorChar) || path.Find(path.Begin(), AltDirectorySeparatorChar); -} BOOL LongFile::IsDirectorySeparator(WCHAR c) { - return c == DirectorySeparatorChar || c == AltDirectorySeparatorChar; + return c == DirectorySeparatorChar || c == AltDirectorySeparatorChar;; } + +#endif //HOST_WINDOWS diff --git a/src/shared/utilcode/namespaceutil.cpp b/src/shared/utilcode/namespaceutil.cpp index 5b6d3d9f95..c606e31a7f 100644 --- a/src/shared/utilcode/namespaceutil.cpp +++ b/src/shared/utilcode/namespaceutil.cpp @@ -36,9 +36,9 @@ int ns::GetFullLength( // Number of chars in full name. int iLen = 1; // Null terminator. if (szNameSpace) - iLen += (int)wcslen(szNameSpace); + iLen += (int)u16_strlen(szNameSpace); if (szName) - iLen += (int)wcslen(szName); + iLen += (int)u16_strlen(szName); if (szNameSpace && *szNameSpace && szName && *szName) ++iLen; return iLen; @@ -81,7 +81,7 @@ WCHAR *ns::FindSep( // Pointer to separator or null. STATIC_CONTRACT_FORBID_FAULT; _ASSERTE(szPath); - WCHAR *ptr = (WCHAR*)wcsrchr(szPath, NAMESPACE_SEPARATOR_WCHAR); + WCHAR *ptr = (WCHAR*)u16_strrchr(szPath, NAMESPACE_SEPARATOR_WCHAR); if((ptr == NULL) || (ptr == szPath)) return NULL; if(*(ptr - 1) == NAMESPACE_SEPARATOR_WCHAR) // here ptr is at least szPath+1 --ptr; @@ -229,7 +229,7 @@ int ns::SplitPath( // true ok, false trunction. ++ptr; else ptr = szPath; - iLen = (int)wcslen(ptr); + iLen = (int)u16_strlen(ptr); iCopyMax = min(iCopyMax, iLen); wcsncpy_s(szName, cchName, ptr, iCopyMax); szName[iCopyMax] = 0; @@ -403,11 +403,11 @@ int ns::MakePath( // true ok, false truncation. int count; // We use cBuffer - 2 to account for the '.' and at least a 1 character name below. - count = WszMultiByteToWideChar(CP_UTF8, 0, szNamespace, -1, szOut, cchChars-2); + count = MultiByteToWideChar(CP_UTF8, 0, szNamespace, -1, szOut, cchChars-2); if (count == 0) return false; // Supply a bigger buffer! - // buffer access is bounded: WszMultiByteToWideChar returns 0 if access doesn't fit in range + // buffer access is bounded: MultiByteToWideChar returns 0 if access doesn't fit in range #ifdef _PREFAST_ #pragma warning( suppress: 26015 ) #endif @@ -417,7 +417,7 @@ int ns::MakePath( // true ok, false truncation. } if (((cchChars == 0) && (szName != NULL) && (*szName != '\0')) || - (WszMultiByteToWideChar(CP_UTF8, 0, szName, -1, szOut, cchChars) == 0)) + (MultiByteToWideChar(CP_UTF8, 0, szName, -1, szOut, cchChars) == 0)) return false; // supply a bigger buffer! return true; } // int ns::MakePath() @@ -473,9 +473,9 @@ int ns::MakePath( // true ok, false out of memory int iLen = 2; if (szNameSpace) - iLen += (int)wcslen(szNameSpace); + iLen += (int)u16_strlen(szNameSpace); if (szName) - iLen += (int)wcslen(szName); + iLen += (int)u16_strlen(szName); WCHAR *szOut = (WCHAR *) qb.AllocNoThrow(iLen * sizeof(WCHAR)); if (!szOut) return false; @@ -529,7 +529,7 @@ bool ns::MakeAssemblyQualifiedName( // tr int iCopyMax = 0; _ASSERTE(pBuffer); - *pBuffer = NULL; + *pBuffer = W('\0'); if (szTypeName && *szTypeName != W('\0')) { @@ -586,9 +586,9 @@ bool ns::MakeAssemblyQualifiedName( // tr int iTypeName = 0; int iAssemblyName = 0; if (szTypeName) - iTypeName = (int)wcslen(szTypeName); + iTypeName = (int)u16_strlen(szTypeName); if (szAssemblyName) - iAssemblyName = (int)wcslen(szAssemblyName); + iAssemblyName = (int)u16_strlen(szAssemblyName); int iLen = ASSEMBLY_SEPARATOR_LEN + iTypeName + iAssemblyName + 1; // Space for null terminator WCHAR *szOut = (WCHAR *) qb.AllocNoThrow(iLen * sizeof(WCHAR)); diff --git a/src/shared/utilcode/pedecoder.cpp b/src/shared/utilcode/pedecoder.cpp index ad4f018231..c089f42b76 100644 --- a/src/shared/utilcode/pedecoder.cpp +++ b/src/shared/utilcode/pedecoder.cpp @@ -571,7 +571,7 @@ CHECK PEDecoder::CheckOffset(COUNT_T fileOffset, IsNullOK ok) const } CONTRACT_CHECK_END; - if (fileOffset == NULL) + if (fileOffset == 0) CHECK_MSG(ok == NULL_OK, "Null pointer illegal"); else { @@ -840,7 +840,7 @@ TADDR PEDecoder::GetRvaData(RVA rva, IsNullOK ok /*= NULL_NOT_OK*/) const CONTRACT_END; if ((rva == 0)&&(ok == NULL_NOT_OK)) - RETURN NULL; + RETURN (TADDR)NULL; RVA offset; if (IsMapped()) @@ -867,7 +867,7 @@ RVA PEDecoder::GetDataRva(const TADDR data) const } CONTRACT_END; - if (data == NULL) + if (data == (TADDR)NULL) RETURN 0; COUNT_T offset = (COUNT_T) (data - m_base); @@ -915,7 +915,7 @@ TADDR PEDecoder::GetOffsetData(COUNT_T fileOffset, IsNullOK ok /*= NULL_NOT_OK*/ CONTRACT_END; if ((fileOffset == 0)&&(ok == NULL_NOT_OK)) - RETURN NULL; + RETURN (TADDR)NULL; RETURN GetRvaData(OffsetToRva(fileOffset)); } @@ -1083,7 +1083,7 @@ CHECK PEDecoder::CheckCorHeader() const COUNT_T ctMD = (COUNT_T)VAL32(pDirMD->Size); TADDR pcMD = (TADDR)GetDirectoryData(pDirMD); - if(pcMD != NULL) + if(pcMD != (TADDR)NULL) { // Storage signature checks CHECK(ctMD >= sizeof(STORAGESIGNATURE)); @@ -1123,9 +1123,6 @@ CHECK PEDecoder::CheckCorHeader() const for(namelen=0; (namelen<32)&&(pSS->rcName[namelen]!=0); namelen++); CHECK((0 < namelen)&&(namelen < 32)); - // Forbid HOT_MODEL_STREAM - CHECK(strcmp(pSS->rcName, HOT_MODEL_STREAM_A) != 0); - pcMD = dac_cast(NextStorageStream(pSS)); ctMD -= (COUNT_T)(pcMD - dac_cast(pSS)); @@ -1539,7 +1536,7 @@ CHECK PEDecoder::CheckILOnlyImportByNameTable(RVA rva) const IMAGE_IMPORT_BY_NAME *import = (IMAGE_IMPORT_BY_NAME*) GetRvaData(importRVA); - CHECK(SString::_stricmp((char *) import->Name, DLL_NAME) == 0 || _stricmp((char *) import->Name, EXE_NAME) == 0); + CHECK(SString::_stricmp((char *) import->Name, DLL_NAME) == 0 || SString::_stricmp((char *) import->Name, EXE_NAME) == 0); CHECK_OK; } @@ -1759,7 +1756,7 @@ DWORD ReadResourceDirectory(const PEDecoder *pDecoder, DWORD rvaOfResourceSectio return 0; size_t entryNameLen = *(WORD*)pDecoder->GetRvaData(entryNameRva); - if (wcslen(name) != entryNameLen) + if (u16_strlen(name) != entryNameLen) continue; if (!pDecoder->CheckRva(entryNameRva, (COUNT_T)(sizeof(WORD) * (1 + entryNameLen)))) @@ -1927,7 +1924,7 @@ bool DoesResourceNameMatch(LPCWSTR nameA, LPCWSTR nameB) if (IS_INTRESOURCE(nameB)) return false; else - foundEntry = !wcscmp(nameB, nameA); + foundEntry = !u16_strcmp(nameB, nameA); } return foundEntry; @@ -2161,7 +2158,7 @@ CHECK PEDecoder::CheckILMethod(RVA rva) CONTRACT_CHECK_END; // - // Incrementaly validate that the entire IL method body is within the bounds of the image + // Incrementally validate that the entire IL method body is within the bounds of the image // // We need to have at least the tiny header @@ -2208,7 +2205,7 @@ CHECK PEDecoder::CheckILMethod(RVA rva) // Optional sections following the code // - for (;;) + while (true) { CHECK(CheckRva(rva, UINT32(pSect - pIL) + sizeof(IMAGE_COR_ILMETHOD_SECT_SMALL))); @@ -2295,7 +2292,7 @@ SIZE_T PEDecoder::ComputeILMethodSize(TADDR pIL) // DACized copy of code:COR_ILMETHOD_FAT::GetSect TADDR pSect = AlignUp(pIL + codeEnd, 4); - for (;;) + while (true) { PTR_COR_ILMETHOD_SECT_SMALL pSectSmall = PTR_COR_ILMETHOD_SECT_SMALL(pSect); @@ -2436,20 +2433,6 @@ PTR_CVOID PEDecoder::GetNativeManifestMetadata(COUNT_T *pSize) const RETURN dac_cast(GetDirectoryData(pDir)); } -// Get the SizeOfStackReserve and SizeOfStackCommit from the PE file that was used to create -// the calling process (.exe file). -void PEDecoder::GetEXEStackSizes(SIZE_T *PE_SizeOfStackReserve, SIZE_T *PE_SizeOfStackCommit) const -{ - CONTRACTL { - PRECONDITION(!IsDll()); // This routine should only be called for EXE files. - NOTHROW; - GC_NOTRIGGER; - } CONTRACTL_END; - - * PE_SizeOfStackReserve = GetSizeOfStackReserve(); - * PE_SizeOfStackCommit = GetSizeOfStackCommit(); -} - BOOL PEDecoder::HasNativeEntryPoint() const { CONTRACTL { diff --git a/src/shared/utilcode/safewrap.cpp b/src/shared/utilcode/safewrap.cpp index 2090386281..40708191ea 100644 --- a/src/shared/utilcode/safewrap.cpp +++ b/src/shared/utilcode/safewrap.cpp @@ -19,148 +19,6 @@ #include "sstring.h" #include "ex.h" -//----------------------------------------------------------------------------- -// Get the current directory. -// On success, returns true and sets 'Value' to unicode version of cur dir. -// Throws on all failures. This should mainly be oom. -//----------------------------------------------------------------------------- -void ClrGetCurrentDirectory(SString & value) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - } - CONTRACTL_END; - - // Get size needed - DWORD len = WszGetCurrentDirectory(value); - - - // An actual API failure in GetCurrentDirectory failure should be very rare, so we'll throw on those. - if (len == 0) - { - ThrowLastError(); - } -} - -//----------------------------------------------------------------------------- -// Reads an environment variable into the given SString. -// Returns true on success, false on failure (includes if the var does not exist). -// May throw on oom. -//----------------------------------------------------------------------------- -bool ClrGetEnvironmentVariable(LPCSTR szEnvVarName, SString & value) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - - PRECONDITION(szEnvVarName != NULL); - } - CONTRACTL_END; - - // First read it to get the needed length. - DWORD lenWithNull = GetEnvironmentVariableA(szEnvVarName, NULL, 0); - if (lenWithNull == 0) - { - return false; - } - - // Now read it for content. - char * pCharBuf = value.OpenANSIBuffer(lenWithNull); - DWORD lenWithoutNull = GetEnvironmentVariableA(szEnvVarName, pCharBuf, lenWithNull); - value.CloseBuffer(lenWithoutNull); - - if (lenWithoutNull != (lenWithNull - 1)) - { - // Env var must have changed underneath us. - return false; - } - return true; -} - -void ClrGetModuleFileName(HMODULE hModule, SString & value) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - } - CONTRACTL_END; - - WCHAR * pCharBuf = value.OpenUnicodeBuffer(_MAX_PATH); - DWORD numChars = GetModuleFileNameW(hModule, pCharBuf, _MAX_PATH); - value.CloseBuffer(numChars); -} - -ClrDirectoryEnumerator::ClrDirectoryEnumerator(LPCWSTR pBaseDirectory, LPCWSTR pMask /*= W("*")*/) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - } - CONTRACTL_END; - - StackSString strMask(pBaseDirectory); - SString s(SString::Literal, DIRECTORY_SEPARATOR_STR_W); - if (!strMask.EndsWith(s)) - { - strMask.Append(s); - } - strMask.Append(pMask); - dirHandle = WszFindFirstFile(strMask, &data); - - if (dirHandle == INVALID_HANDLE_VALUE) - { - DWORD dwLastError = GetLastError(); - - // We either ran out of files, or didnt encounter even a single file matching the - // search mask. If it is neither of these conditions, then convert the error to an exception - // and raise it. - if ((dwLastError != ERROR_FILE_NOT_FOUND) && (dwLastError != ERROR_NO_MORE_FILES)) - ThrowLastError(); - } - - fFindNext = FALSE; -} - -bool ClrDirectoryEnumerator::Next() -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - } - CONTRACTL_END; - - if (dirHandle == INVALID_HANDLE_VALUE) - return FALSE; - - for (;;) - { - if (fFindNext) - { - if (!WszFindNextFile(dirHandle, &data)) - { - if (GetLastError() != ERROR_NO_MORE_FILES) - ThrowLastError(); - - return FALSE; - } - } - else - { - fFindNext = TRUE; - } - - // Skip junk - if (wcscmp(data.cFileName, W(".")) != 0 && wcscmp(data.cFileName, W("..")) != 0) - return TRUE; - } -} - DWORD ClrReportEvent( LPCWSTR pEventSource, WORD wType, @@ -232,105 +90,3 @@ DWORD ClrReportEvent( { return ClrReportEvent(pEventSource, wType, wCategory, dwEventID, lpUserSid, 1, &pMessage); } - -#ifndef TARGET_UNIX -// Read a REG_SZ (null-terminated string) value from the registry. Throws. -// -// Arguments: -// hKey - key to registry hive. -// szValueName - null-terminated string for value name to lookup. -// If this is empty, this gets the (default) value in the registry hive. -// value - out parameter to hold registry value string contents. -// -// Returns: -// value is set on success. Throws on any failure, including if the value doesn't exist -// or if the value exists but is not a REG_SZ. -// -// Notes: -// REG_SZ is a single null-terminated string in the registry. -// This is only support on Windows because the registry is windows specific. -void ClrRegReadString(HKEY hKey, const SString & szValueName, SString & value) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - } - CONTRACTL_END; - - DWORD type; - DWORD numBytesData; - - // Preemptively clear the string such that it's empty in any failure case. - value.Clear(); - - // - // Step 1: First call to find size of buffer and ensure data type is correct - // - LONG ret = WszRegQueryValueEx( - hKey, - szValueName.GetUnicode(), // NULL or "\0" represents the (default) key. - NULL, // reserved - &type, // should be REG_SZ - NULL, // not requesting data yet - &numBytesData - ); - - if (ret != ERROR_SUCCESS) - { - ThrowWin32(ret); - } - - if (type != REG_SZ) - { - // The registry value is not a string. - ThrowHR(E_INVALIDARG); - } - - // REG_SZ includes the null terminator. - DWORD numCharsIncludingNull = numBytesData / sizeof(WCHAR); - - // - // Step 2: Allocate buffer to hold final result - // - WCHAR * pData = value.OpenUnicodeBuffer(numCharsIncludingNull); - DWORD numBytesData2 = numBytesData; - - - // - // Step 3: Requery to get actual contents - // - ret = WszRegQueryValueEx( - hKey, - szValueName.GetUnicode(), - NULL, // reserved - &type, // should still be REG_SZ - (LPBYTE) pData, - &numBytesData2 - ); - - // This check should only fail if the registry was changed inbetween the first query - // and the second. In practice, that should never actually happen. - if ((numBytesData2 != numBytesData) || (type != REG_SZ)) - { - // On error, leave string empty. - value.CloseBuffer(0); - - ThrowHR(E_FAIL); - } - - if (ret != ERROR_SUCCESS) - { - // On error, leave string empty. - value.CloseBuffer(0); - ThrowWin32(ret); - } - - - // - // Step 4: Close the string buffer - // - COUNT_T numCharsNoNull = numCharsIncludingNull - 1; - value.CloseBuffer(numCharsNoNull); -} -#endif // TARGET_UNIX diff --git a/src/shared/utilcode/sstring.cpp b/src/shared/utilcode/sstring.cpp index 1901d65315..2fb454c369 100644 --- a/src/shared/utilcode/sstring.cpp +++ b/src/shared/utilcode/sstring.cpp @@ -10,7 +10,7 @@ #include "sstring.h" #include "ex.h" #include "holder.h" - +#include #if defined(_MSC_VER) #pragma inline_depth (25) @@ -87,7 +87,7 @@ static WCHAR MapChar(WCHAR wc, DWORD dwFlags) #ifdef SELF_NO_HOST toupper(wc); #else - PAL_ToUpperInvariant(wc); + minipal_toupper_invariant(wc); #endif } else @@ -97,7 +97,7 @@ static WCHAR MapChar(WCHAR wc, DWORD dwFlags) #ifdef SELF_NO_HOST tolower(wc); #else - PAL_ToLowerInvariant(wc); + minipal_tolower_invariant(wc); #endif } #endif // !TARGET_UNIX @@ -244,7 +244,7 @@ void SString::Set(const WCHAR *string) Clear(); else { - Resize((COUNT_T) wcslen(string), REPRESENTATION_UNICODE); + Resize((COUNT_T) u16_strlen(string), REPRESENTATION_UNICODE); wcscpy_s(GetRawUnicode(), GetBufferSizeInCharIncludeNullChar(), string); } @@ -417,54 +417,24 @@ void SString::SetUTF8(const UTF8 *string, COUNT_T count) } //----------------------------------------------------------------------------- -// Set this string to a copy of the given ANSI string +// Set this string to a copy of the given UTF16 string transcoded to UTF8 //----------------------------------------------------------------------------- -void SString::SetANSI(const ANSI *string) +void SString::SetAndConvertToUTF8(const WCHAR *string) { SS_CONTRACT_VOID { + // !!! Check for illegal UTF8 encoding? INSTANCE_CHECK; PRECONDITION(CheckPointer(string, NULL_OK)); THROWS; GC_NOTRIGGER; + SUPPORTS_DAC_HOST_ONLY; } SS_CONTRACT_END; - if (string == NULL || *string == 0) - Clear(); - else - { - Resize((COUNT_T) strlen(string), REPRESENTATION_ANSI); - strcpy_s(GetRawANSI(), GetBufferSizeInCharIncludeNullChar(), string); - } - - SS_RETURN; -} - -//----------------------------------------------------------------------------- -// Set this string to a copy of the first count characters of the given -// ANSI string. -//----------------------------------------------------------------------------- -void SString::SetANSI(const ANSI *string, COUNT_T count) -{ - SS_CONTRACT_VOID - { - INSTANCE_CHECK; - PRECONDITION(CheckPointer(string, NULL_OK)); - PRECONDITION(CheckCount(count)); - THROWS; - GC_NOTRIGGER; - } - SS_CONTRACT_END; + SString utf16Str(Literal, string); - if (count == 0) - Clear(); - else - { - Resize(count, REPRESENTATION_ANSI); - strncpy_s(GetRawANSI(), GetBufferSizeInCharIncludeNullChar(), string, count); - GetRawANSI()[count] = 0; - } + utf16Str.ConvertToUTF8(*this); SS_RETURN; } @@ -778,107 +748,84 @@ void SString::ConvertToUnicode(const CIterator &i) const } //----------------------------------------------------------------------------- -// Set s to be a copy of this string's contents, but in the unicode format. +// Convert the internal representation for this String to UTF8. //----------------------------------------------------------------------------- -void SString::ConvertToUnicode(SString &s) const +void SString::ConvertToUTF8() const { CONTRACT_VOID { - PRECONDITION(s.Check()); - POSTCONDITION(s.IsRepresentation(REPRESENTATION_UNICODE)); - THROWS; + POSTCONDITION(IsRepresentation(REPRESENTATION_UTF8)); + if (IsRepresentation(REPRESENTATION_UTF8)) NOTHROW; else THROWS; GC_NOTRIGGER; SUPPORTS_DAC_HOST_ONLY; } CONTRACT_END; - int page = 0; - - switch (GetRepresentation()) + if (!IsRepresentation(REPRESENTATION_UTF8)) { - case REPRESENTATION_EMPTY: - s.Clear(); - RETURN; - - case REPRESENTATION_UNICODE: - s.Set(*this); - RETURN; - - case REPRESENTATION_UTF8: - page = CP_UTF8; - break; - - case REPRESENTATION_ASCII: - ConvertASCIIToUnicode(s); - RETURN; - - case REPRESENTATION_ANSI: - page = CP_ACP; - break; - - default: - UNREACHABLE(); + if (IsRepresentation(REPRESENTATION_ASCII)) + { + // ASCII is a subset of UTF8, so we can just set the representation. + (const_cast(this))->SetRepresentation(REPRESENTATION_UTF8); + } + else + { + StackSString s; + ConvertToUTF8(s); + PREFIX_ASSUME(!s.IsImmutable()); + (const_cast(this))->Set(s); + } } - COUNT_T length = WszMultiByteToWideChar(page, 0, GetRawANSI(), GetRawCount()+1, 0, 0); - if (length == 0) - ThrowLastError(); - - s.Resize(length-1, REPRESENTATION_UNICODE); - - length = WszMultiByteToWideChar(page, 0, GetRawANSI(), GetRawCount()+1, s.GetRawUnicode(), length); - if (length == 0) - ThrowLastError(); - RETURN; } //----------------------------------------------------------------------------- -// Set s to be a copy of this string's contents, but in the ANSI format. +// Set s to be a copy of this string's contents, but in the unicode format. //----------------------------------------------------------------------------- -void SString::ConvertToANSI(SString &s) const +void SString::ConvertToUnicode(SString &s) const { CONTRACT_VOID { PRECONDITION(s.Check()); - POSTCONDITION(s.IsRepresentation(REPRESENTATION_ANSI)); + POSTCONDITION(s.IsRepresentation(REPRESENTATION_UNICODE)); THROWS; GC_NOTRIGGER; + SUPPORTS_DAC_HOST_ONLY; } CONTRACT_END; + int page = 0; + switch (GetRepresentation()) { case REPRESENTATION_EMPTY: s.Clear(); RETURN; - case REPRESENTATION_ASCII: - case REPRESENTATION_ANSI: + case REPRESENTATION_UNICODE: s.Set(*this); RETURN; case REPRESENTATION_UTF8: - // No direct conversion to ANSI - ConvertToUnicode(); - FALLTHROUGH; - - case REPRESENTATION_UNICODE: + page = CP_UTF8; break; + case REPRESENTATION_ASCII: + ConvertASCIIToUnicode(s); + RETURN; + default: UNREACHABLE(); } - // @todo: use WC_NO_BEST_FIT_CHARS - COUNT_T length = WszWideCharToMultiByte(CP_ACP, 0, GetRawUnicode(), GetRawCount()+1, - NULL, 0, NULL, NULL); + COUNT_T length = MultiByteToWideChar(page, 0, GetRawANSI(), GetRawCount()+1, 0, 0); + if (length == 0) + ThrowLastError(); - s.Resize(length-1, REPRESENTATION_ANSI); + s.Resize(length-1, REPRESENTATION_UNICODE); - // @todo: use WC_NO_BEST_FIT_CHARS - length = WszWideCharToMultiByte(CP_ACP, 0, GetRawUnicode(), GetRawCount()+1, - s.GetRawANSI(), length, NULL, NULL); + length = MultiByteToWideChar(page, 0, GetRawANSI(), GetRawCount()+1, s.GetRawUnicode(), length); if (length == 0) ThrowLastError(); @@ -910,11 +857,6 @@ COUNT_T SString::ConvertToUTF8(SString &s) const s.Set(*this); RETURN s.GetRawCount()+1; - case REPRESENTATION_ANSI: - // No direct conversion from ANSI to UTF8 - ConvertToUnicode(); - FALLTHROUGH; - case REPRESENTATION_UNICODE: break; @@ -1043,7 +985,7 @@ BOOL SString::Find(CIterator &i, const SString &s) const const WCHAR *end = GetUnicode() + GetRawCount() - count; while (start <= end) { - if (wcsncmp(start, source.GetRawUnicode(), count) == 0) + if (u16_strncmp(start, source.GetRawUnicode(), count) == 0) { i.Resync(this, (BYTE*) start); RETURN TRUE; @@ -1053,7 +995,6 @@ BOOL SString::Find(CIterator &i, const SString &s) const } break; - case REPRESENTATION_ANSI: case REPRESENTATION_ASCII: { COUNT_T count = source.GetRawCount(); @@ -1123,7 +1064,6 @@ BOOL SString::Find(CIterator &i, WCHAR c) const } break; - case REPRESENTATION_ANSI: case REPRESENTATION_ASCII: { const CHAR *start = i.GetASCII(); @@ -1184,7 +1124,7 @@ BOOL SString::FindBack(CIterator &i, const SString &s) const while (start >= end) { - if (wcsncmp(start, source.GetRawUnicode(), count) == 0) + if (u16_strncmp(start, source.GetRawUnicode(), count) == 0) { i.Resync(this, (BYTE*) start); RETURN TRUE; @@ -1194,7 +1134,6 @@ BOOL SString::FindBack(CIterator &i, const SString &s) const } break; - case REPRESENTATION_ANSI: case REPRESENTATION_ASCII: { COUNT_T count = source.GetRawCount(); @@ -1271,7 +1210,6 @@ BOOL SString::FindBack(CIterator &i, WCHAR c) const } break; - case REPRESENTATION_ANSI: case REPRESENTATION_ASCII: { const CHAR *start = GetRawASCII() + GetRawCount() - 1; @@ -1396,11 +1334,10 @@ int SString::Compare(const SString &s) const switch (GetRepresentation()) { case REPRESENTATION_UNICODE: - result = wcsncmp(GetRawUnicode(), source.GetRawUnicode(), smaller); + result = u16_strncmp(GetRawUnicode(), source.GetRawUnicode(), smaller); break; case REPRESENTATION_ASCII: - case REPRESENTATION_ANSI: result = strncmp(GetRawASCII(), source.GetRawASCII(), smaller); break; @@ -1461,7 +1398,6 @@ int SString::CompareCaseInsensitive(const SString &s) const switch (GetRepresentation()) { case REPRESENTATION_UNICODE: - case REPRESENTATION_ANSI: result = CaseCompareHelper(GetRawUnicode(), source.GetRawUnicode(), smaller, FALSE, TRUE); break; @@ -1512,10 +1448,9 @@ BOOL SString::Equals(const SString &s) const switch (GetRepresentation()) { case REPRESENTATION_UNICODE: - RETURN (wcsncmp(GetRawUnicode(), source.GetRawUnicode(), count) == 0); + RETURN (u16_strncmp(GetRawUnicode(), source.GetRawUnicode(), count) == 0); case REPRESENTATION_ASCII: - case REPRESENTATION_ANSI: RETURN (strncmp(GetRawASCII(), source.GetRawASCII(), count) == 0); case REPRESENTATION_EMPTY: @@ -1556,7 +1491,6 @@ BOOL SString::EqualsCaseInsensitive(const SString &s) const switch (GetRepresentation()) { case REPRESENTATION_UNICODE: - case REPRESENTATION_ANSI: RETURN (CaseCompareHelper(GetRawUnicode(), source.GetRawUnicode(), count, FALSE, TRUE) == 0); case REPRESENTATION_ASCII: @@ -1602,10 +1536,9 @@ BOOL SString::Match(const CIterator &i, const SString &s) const switch (GetRepresentation()) { case REPRESENTATION_UNICODE: - RETURN (wcsncmp(i.GetUnicode(), source.GetRawUnicode(), count) == 0); + RETURN (u16_strncmp(i.GetUnicode(), source.GetRawUnicode(), count) == 0); case REPRESENTATION_ASCII: - case REPRESENTATION_ANSI: RETURN (strncmp(i.GetASCII(), source.GetRawASCII(), count) == 0); case REPRESENTATION_EMPTY: @@ -1647,7 +1580,6 @@ BOOL SString::MatchCaseInsensitive(const CIterator &i, const SString &s) const switch (GetRepresentation()) { case REPRESENTATION_UNICODE: - case REPRESENTATION_ANSI: RETURN (CaseCompareHelper(i.GetUnicode(), source.GetRawUnicode(), count, FALSE, TRUE) == 0); case REPRESENTATION_ASCII: @@ -1767,86 +1699,6 @@ void SString::UpperCase() } } -//----------------------------------------------------------------------------- -// Get a const pointer to the internal buffer as an ANSI string. -//----------------------------------------------------------------------------- -const CHAR *SString::GetANSI(AbstractScratchBuffer &scratch) const -{ - SS_CONTRACT(const CHAR *) - { - INSTANCE_CHECK_NULL; - THROWS; - GC_NOTRIGGER; - } - SS_CONTRACT_END; - - if (IsRepresentation(REPRESENTATION_ANSI)) - SS_RETURN GetRawANSI(); - - ConvertToANSI((SString&)scratch); - SS_RETURN ((SString&)scratch).GetRawANSI(); -} - -//----------------------------------------------------------------------------- -// Get a const pointer to the internal buffer as a UTF8 string. -//----------------------------------------------------------------------------- -const UTF8 *SString::GetUTF8(AbstractScratchBuffer &scratch) const -{ - CONTRACT(const UTF8 *) - { - INSTANCE_CHECK_NULL; - THROWS; - GC_NOTRIGGER; - } - CONTRACT_END; - - if (IsRepresentation(REPRESENTATION_UTF8)) - RETURN GetRawUTF8(); - - ConvertToUTF8((SString&)scratch); - RETURN ((SString&)scratch).GetRawUTF8(); -} - -const UTF8 *SString::GetUTF8(AbstractScratchBuffer &scratch, COUNT_T *pcbUtf8) const -{ - CONTRACT(const UTF8 *) - { - INSTANCE_CHECK_NULL; - THROWS; - GC_NOTRIGGER; - } - CONTRACT_END; - - if (IsRepresentation(REPRESENTATION_UTF8)) - { - *pcbUtf8 = GetRawCount() + 1; - RETURN GetRawUTF8(); - } - - *pcbUtf8 = ConvertToUTF8((SString&)scratch); - RETURN ((SString&)scratch).GetRawUTF8(); -} - -//----------------------------------------------------------------------------- -// Get a const pointer to the internal buffer which must already be a UTF8 string. -// This avoids the need to create a scratch buffer we know will never be used. -//----------------------------------------------------------------------------- -const UTF8 *SString::GetUTF8NoConvert() const -{ - CONTRACT(const UTF8 *) - { - INSTANCE_CHECK_NULL; - THROWS; - GC_NOTRIGGER; - } - CONTRACT_END; - - if (IsRepresentation(REPRESENTATION_UTF8)) - RETURN GetRawUTF8(); - - ThrowHR(E_INVALIDARG); -} - //----------------------------------------------------------------------------- // Safe version of sprintf. // Prints formatted ansi text w/ var args to this buffer. @@ -1861,66 +1713,6 @@ void SString::Printf(const CHAR *format, ...) va_end(args); } -#ifdef _DEBUG -// -// Check the Printf use for potential globalization bugs. %S formatting -// specifier does Unicode->Ansi or Ansi->Unicode conversion using current -// C-locale. This almost always means globalization bug in the CLR codebase. -// -// Ideally, we would elimitate %S from all format strings. Unfortunately, -// %S is too widespread in non-shipping code that such cleanup is not feasible. -// -static void CheckForFormatStringGlobalizationIssues(const SString &format, const SString &result) -{ - CONTRACTL - { - THROWS; - GC_NOTRIGGER; - DEBUG_ONLY; - } - CONTRACTL_END; - - BOOL fDangerousFormat = FALSE; - - // Check whether the format string contains the %S formatting specifier - SString::CIterator itrFormat = format.Begin(); - while (*itrFormat) - { - if (*itrFormat++ == '%') - { - // Handle the complex format strings like %blahS - if (*itrFormat++ == 'S') - { - fDangerousFormat = TRUE; - break; - } - } - } - - if (fDangerousFormat) - { - BOOL fNonAsciiUsed = FALSE; - - // Now check whether there are any non-ASCII characters in the output. - - // Check whether the result contains non-Ascii characters - SString::CIterator itrResult = format.Begin(); - while (*itrResult) - { - if (*itrResult++ > 127) - { - fNonAsciiUsed = TRUE; - break; - } - } - - CONSISTENCY_CHECK_MSGF(!fNonAsciiUsed, - ("Non-ASCII string was produced by %%S format specifier. This is likely globalization bug." - "To fix this, change the format string to %%s and do the correct encoding at the Printf callsite")); - } -} -#endif - #ifndef EBADF #define EBADF 9 #endif @@ -1949,6 +1741,9 @@ void SString::VPrintf(const CHAR *format, va_list args) } CONTRACT_END; + // This method overrides the content of the SString, so it can come in with any format. + // We're going to change the representation here. + va_list ap; // sprintf gives us no means to know how many characters are written // other than guessing and trying @@ -1957,15 +1752,13 @@ void SString::VPrintf(const CHAR *format, va_list args) { // First, try to use the existing buffer va_copy(ap, args); - int result = _vsnprintf_s(GetRawANSI(), GetRawCount()+1, _TRUNCATE, format, ap); + int result = _vsnprintf_s(GetRawUTF8(), GetRawCount()+1, _TRUNCATE, format, ap); va_end(ap); if (result >=0) { // Succeeded in writing. Now resize - - Resize(result, REPRESENTATION_ANSI, PRESERVE); - SString sss(Ansi, format); - INDEBUG(CheckForFormatStringGlobalizationIssues(sss, *this)); + Resize(result, REPRESENTATION_UTF8, PRESERVE); RETURN; } } @@ -1982,21 +1775,19 @@ void SString::VPrintf(const CHAR *format, va_list args) { // Double the previous guess - eventually we will get enough space guess *= 2; - Resize(guess, REPRESENTATION_ANSI); + Resize(guess, REPRESENTATION_UTF8); // Clear errno to avoid false alarms errno = 0; va_copy(ap, args); - int result = _vsnprintf_s(GetRawANSI(), GetRawCount()+1, _TRUNCATE, format, ap); + int result = _vsnprintf_s(GetRawUTF8(), GetRawCount()+1, _TRUNCATE, format, ap); va_end(ap); if (result >= 0) { // Succeed in writing. Shrink the buffer to fit exactly. - Resize(result, REPRESENTATION_ANSI, PRESERVE); - SString sss(Ansi, format); - INDEBUG(CheckForFormatStringGlobalizationIssues(sss, *this)); + Resize(result, REPRESENTATION_UTF8, PRESERVE); RETURN; } @@ -2014,184 +1805,6 @@ void SString::VPrintf(const CHAR *format, va_list args) RETURN; } -void SString::Printf(const WCHAR *format, ...) -{ - WRAPPER_NO_CONTRACT; - - va_list args; - va_start(args, format); - VPrintf(format, args); - va_end(args); -} - -void SString::PPrintf(const WCHAR *format, ...) -{ - CONTRACT_VOID - { - INSTANCE_CHECK; - PRECONDITION(CheckPointer(format)); - THROWS; - GC_NOTRIGGER; - } - CONTRACT_END; - - va_list argItr; - va_start(argItr, format); - PVPrintf(format, argItr); - va_end(argItr); - - RETURN; -} - -void SString::VPrintf(const WCHAR *format, va_list args) -{ - CONTRACT_VOID - { - INSTANCE_CHECK; - PRECONDITION(CheckPointer(format)); - THROWS; - GC_NOTRIGGER; - } - CONTRACT_END; - - va_list ap; - // sprintf gives us no means to know how many characters are written - // other than guessing and trying - - if (GetRawCount() > 0) - { - // First, try to use the existing buffer - va_copy(ap, args); - int result = _vsnwprintf_s(GetRawUnicode(), GetRawCount()+1, _TRUNCATE, format, ap); - va_end(ap); - - if (result >= 0) - { - // succeeded - Resize(result, REPRESENTATION_UNICODE, PRESERVE); - SString sss(format); - INDEBUG(CheckForFormatStringGlobalizationIssues(sss, *this)); - RETURN; - } - } - - // Make a guess how long the result will be (note this will be doubled) - - COUNT_T guess = (COUNT_T) wcslen(format)+1; - if (guess < GetRawCount()) - guess = GetRawCount(); - if (guess < MINIMUM_GUESS) - guess = MINIMUM_GUESS; - - while (TRUE) - { - // Double the previous guess - eventually we will get enough space - guess *= 2; - Resize(guess, REPRESENTATION_UNICODE); - - // Clear errno to avoid false alarms - errno = 0; - - va_copy(ap, args); - int result = _vsnwprintf_s(GetRawUnicode(), GetRawCount()+1, _TRUNCATE, format, ap); - va_end(ap); - - if (result >= 0) - { - Resize(result, REPRESENTATION_UNICODE, PRESERVE); - SString sss(format); - INDEBUG(CheckForFormatStringGlobalizationIssues(sss, *this)); - RETURN; - } - - if (errno==ENOMEM) - { - ThrowOutOfMemory(); - } - else - if (errno!=0 && errno!=EBADF && errno!=ERANGE) - { - CONSISTENCY_CHECK_MSG(FALSE, "_vsnwprintf_s failed. Potential globalization bug."); - ThrowHR(HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION)); - } - } - RETURN; -} - -void SString::PVPrintf(const WCHAR *format, va_list args) -{ - CONTRACT_VOID - { - INSTANCE_CHECK; - PRECONDITION(CheckPointer(format)); - THROWS; - GC_NOTRIGGER; - } - CONTRACT_END; - - va_list ap; - // sprintf gives us no means to know how many characters are written - // other than guessing and trying - - if (GetRawCount() > 0) - { - // First, try to use the existing buffer - va_copy(ap, args); - int result = _vsnwprintf_s(GetRawUnicode(), GetRawCount()+1, _TRUNCATE, format, ap); - va_end(ap); - if (result >= 0) - { - // succeeded - Resize(result, REPRESENTATION_UNICODE, PRESERVE); - SString sss(format); - INDEBUG(CheckForFormatStringGlobalizationIssues(sss, *this)); - RETURN; - } - } - - // Make a guess how long the result will be (note this will be doubled) - - COUNT_T guess = (COUNT_T) wcslen(format)+1; - if (guess < GetRawCount()) - guess = GetRawCount(); - if (guess < MINIMUM_GUESS) - guess = MINIMUM_GUESS; - - while (TRUE) - { - // Double the previous guess - eventually we will get enough space - guess *= 2; - Resize(guess, REPRESENTATION_UNICODE, DONT_PRESERVE); - - // Clear errno to avoid false alarms - errno = 0; - - va_copy(ap, args); - int result = _vsnwprintf_s(GetRawUnicode(), GetRawCount()+1, _TRUNCATE, format, ap); - va_end(ap); - - if (result >= 0) - { - Resize(result, REPRESENTATION_UNICODE, PRESERVE); - SString sss(format); - INDEBUG(CheckForFormatStringGlobalizationIssues(sss, *this)); - RETURN; - } - - if (errno==ENOMEM) - { - ThrowOutOfMemory(); - } - else - if (errno!=0 && errno!=EBADF && errno!=ERANGE) - { - CONSISTENCY_CHECK_MSG(FALSE, "_vsnwprintf_s failed. Potential globalization bug."); - ThrowHR(HRESULT_FROM_WIN32(ERROR_NO_UNICODE_TRANSLATION)); - } - } - RETURN; -} - void SString::AppendPrintf(const CHAR *format, ...) { WRAPPER_NO_CONTRACT; @@ -2211,25 +1824,6 @@ void SString::AppendVPrintf(const CHAR *format, va_list args) Append(s); } -void SString::AppendPrintf(const WCHAR *format, ...) -{ - WRAPPER_NO_CONTRACT; - - va_list args; - va_start(args, format); - AppendVPrintf(format, args); - va_end(args); -} - -void SString::AppendVPrintf(const WCHAR *format, va_list args) -{ - WRAPPER_NO_CONTRACT; - - StackSString s; - s.VPrintf(format, args); - Append(s); -} - //---------------------------------------------------------------------------- // LoadResource - moved to sstring_com.cpp //---------------------------------------------------------------------------- @@ -2262,7 +1856,7 @@ BOOL SString::FormatMessage(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, // First, try to use our existing buffer to hold the result. Resize(GetRawCount(), REPRESENTATION_UNICODE); - DWORD result = ::WszFormatMessage(dwFlags | FORMAT_MESSAGE_ARGUMENT_ARRAY, + DWORD result = ::FormatMessage(dwFlags | FORMAT_MESSAGE_ARGUMENT_ARRAY, lpSource, dwMessageId, dwLanguageId, GetRawUnicode(), GetRawCount()+1, (va_list*)args); @@ -2284,7 +1878,7 @@ BOOL SString::FormatMessage(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, // We don't have enough space in our buffer, do dynamic allocation. LocalAllocHolder string; - DWORD result = ::WszFormatMessage(dwFlags | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ARGUMENT_ARRAY, + DWORD result = ::FormatMessage(dwFlags | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ARGUMENT_ARRAY, lpSource, dwMessageId, dwLanguageId, (LPWSTR)(LPWSTR*)&string, 0, (va_list*)args); @@ -2428,7 +2022,6 @@ const SString &SString::GetCompatibleString(const SString &s, SString &scratch, return scratch; case REPRESENTATION_UTF8: - case REPRESENTATION_ANSI: // These should all be impossible since we have an CIterator on us. default: UNREACHABLE_MSG("Unexpected string representation"); @@ -2463,13 +2056,6 @@ const SString &SString::GetCompatibleString(const SString &s, SString &scratch) case REPRESENTATION_EMPTY: return s; - case REPRESENTATION_ANSI: - if (s.IsRepresentation(REPRESENTATION_ANSI)) - return s; - - s.ConvertToANSI(scratch); - return scratch; - case REPRESENTATION_ASCII: if (s.IsRepresentation(REPRESENTATION_ASCII)) return s; @@ -2637,7 +2223,6 @@ void * SString::DacGetRawContent() const case REPRESENTATION_UNICODE: case REPRESENTATION_UTF8: case REPRESENTATION_ASCII: - case REPRESENTATION_ANSI: // Note: no need to call DacInstantiateString because we know the exact length already. return SBuffer::DacGetRawContent(); @@ -2756,15 +2341,14 @@ bool SString::DacGetUnicode(COUNT_T cBufChars, iPage = CP_UTF8; FALLTHROUGH; case REPRESENTATION_ASCII: - case REPRESENTATION_ANSI: // iPage defaults to CP_ACP. if (pcNeedChars) { - *pcNeedChars = WszMultiByteToWideChar(iPage, 0, reinterpret_cast(pContent), -1, NULL, 0); + *pcNeedChars = MultiByteToWideChar(iPage, 0, reinterpret_cast(pContent), -1, NULL, 0); } if (pBuffer && cBufChars) { - if (!WszMultiByteToWideChar(iPage, 0, reinterpret_cast(pContent), -1, pBuffer, cBufChars)) + if (!MultiByteToWideChar(iPage, 0, reinterpret_cast(pContent), -1, pBuffer, cBufChars)) { return false; } @@ -2779,4 +2363,4 @@ bool SString::DacGetUnicode(COUNT_T cBufChars, return false; } -#endif //DACCESS_COMPILE \ No newline at end of file +#endif //DACCESS_COMPILE diff --git a/src/shared/utilcode/sstring_com.cpp b/src/shared/utilcode/sstring_com.cpp index 9449b3d05a..b674556741 100644 --- a/src/shared/utilcode/sstring_com.cpp +++ b/src/shared/utilcode/sstring_com.cpp @@ -21,12 +21,6 @@ BOOL SString::LoadResource(CCompRC::ResourceCategory eCategory, int resourceID) } HRESULT SString::LoadResourceAndReturnHR(CCompRC::ResourceCategory eCategory, int resourceID) -{ - WRAPPER_NO_CONTRACT; - return LoadResourceAndReturnHR(NULL, eCategory,resourceID); -} - -HRESULT SString::LoadResourceAndReturnHR(CCompRC* pResourceDLL, CCompRC::ResourceCategory eCategory, int resourceID) { CONTRACT(HRESULT) { @@ -38,11 +32,7 @@ HRESULT SString::LoadResourceAndReturnHR(CCompRC* pResourceDLL, CCompRC::Resourc HRESULT hr = E_FAIL; #ifndef FEATURE_UTILCODE_NO_DEPENDENCIES - if (pResourceDLL == NULL) - { - pResourceDLL = CCompRC::GetDefaultResourceDll(); - } - + CCompRC* pResourceDLL = CCompRC::GetDefaultResourceDll(); if (pResourceDLL != NULL) { @@ -83,7 +73,7 @@ HRESULT SString::LoadResourceAndReturnHR(CCompRC* pResourceDLL, CCompRC::Resourc if (SUCCEEDED(hr)) { - Truncate(Begin() + (COUNT_T) wcslen(GetRawUnicode())); + Truncate(Begin() + (COUNT_T) u16_strlen(GetRawUnicode())); } Normalize(); diff --git a/src/shared/utilcode/stdafx.h b/src/shared/utilcode/stdafx.h index f04d0e47f8..3f721e1de2 100644 --- a/src/shared/utilcode/stdafx.h +++ b/src/shared/utilcode/stdafx.h @@ -11,6 +11,10 @@ #include #include +#include +#include +using std::min; +using std::max; #define IN_WINFIX_CPP @@ -18,4 +22,3 @@ #include "volatile.h" #include "static_assert.h" - diff --git a/src/shared/utilcode/util_nodependencies.cpp b/src/shared/utilcode/util_nodependencies.cpp new file mode 100644 index 0000000000..971cb386d4 --- /dev/null +++ b/src/shared/utilcode/util_nodependencies.cpp @@ -0,0 +1,28 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +//***************************************************************************** +// Util_NoDependencies.cpp +// + +// +// This contains a bunch of C++ utility classes needed also for UtilCode without dependencies +// (standalone version without CLR/clr.dll/mscoree.dll dependencies). +// +//***************************************************************************** + +#include "stdafx.h" +#include "utilcode.h" +#include "ex.h" + +void OutputDebugStringUtf8(LPCUTF8 utf8DebugMsg) +{ +#ifdef TARGET_UNIX + OutputDebugStringA(utf8DebugMsg); +#else + if (utf8DebugMsg == NULL) + utf8DebugMsg = ""; + + MAKE_WIDEPTR_FROMUTF8_NOTHROW(wideDebugMsg, utf8DebugMsg); + OutputDebugStringW(wideDebugMsg); +#endif // !TARGET_UNIX +} diff --git a/src/shared/gcdump/gcinfodecoder.cpp b/src/shared/vm/gcinfodecoder.cpp similarity index 79% rename from src/shared/gcdump/gcinfodecoder.cpp rename to src/shared/vm/gcinfodecoder.cpp index adb22d7023..097037fd81 100644 --- a/src/shared/gcdump/gcinfodecoder.cpp +++ b/src/shared/vm/gcinfodecoder.cpp @@ -1,6 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +#ifndef SOS_INCLUDE +#include "common.h" +#endif + #include "gcinfodecoder.h" #ifdef USE_GC_INFO_DECODER @@ -81,96 +85,51 @@ bool GcInfoDecoder::SetIsInterruptibleCB (UINT32 startOffset, UINT32 stopOffset, return fStop; } -GcInfoDecoder::GcInfoDecoder( - GCInfoToken gcInfoToken, - GcInfoDecoderFlags flags, - UINT32 breakOffset - ) - : m_Reader(dac_cast(gcInfoToken.Info)) - , m_InstructionOffset(breakOffset) - , m_IsInterruptible(false) - , m_ReturnKind(RT_Illegal) -#ifdef _DEBUG - , m_Flags( flags ) - , m_GcInfoAddress(dac_cast(gcInfoToken.Info)) -#endif - , m_Version(gcInfoToken.Version) +// returns true if we decoded all that was asked; +bool GcInfoDecoder::PredecodeFatHeader(int remainingFlags) { - _ASSERTE( (flags & (DECODE_INTERRUPTIBILITY | DECODE_GC_LIFETIMES)) || (0 == breakOffset) ); + int numFlagBits = (m_Version == 1) ? GC_INFO_FLAGS_BIT_SIZE_VERSION_1 : GC_INFO_FLAGS_BIT_SIZE; + m_headerFlags = (GcInfoHeaderFlags)m_Reader.Read(numFlagBits); - // The current implementation doesn't support the two flags together - _ASSERTE( - ((flags & (DECODE_INTERRUPTIBILITY | DECODE_GC_LIFETIMES)) != (DECODE_INTERRUPTIBILITY | DECODE_GC_LIFETIMES)) - ); - - //-------------------------------------------- - // Pre-decode information - //-------------------------------------------- + m_ReturnKind = (ReturnKind)((UINT32)m_Reader.Read(SIZE_OF_RETURN_KIND_IN_FAT_HEADER)); - GcInfoHeaderFlags headerFlags; - bool slimHeader = (m_Reader.ReadOneFast() == 0); - - if (slimHeader) - { - headerFlags = (GcInfoHeaderFlags)(m_Reader.ReadOneFast() ? GC_INFO_HAS_STACK_BASE_REGISTER : 0); - } - else + remainingFlags &= ~(DECODE_RETURN_KIND | DECODE_VARARG); +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) + remainingFlags &= ~DECODE_HAS_TAILCALLS; +#endif + if (remainingFlags == 0) { - int numFlagBits = (m_Version == 1) ? GC_INFO_FLAGS_BIT_SIZE_VERSION_1 : GC_INFO_FLAGS_BIT_SIZE; - headerFlags = (GcInfoHeaderFlags) m_Reader.Read(numFlagBits); - } - - m_IsVarArg = headerFlags & GC_INFO_IS_VARARG; - int hasSecurityObject = headerFlags & GC_INFO_HAS_SECURITY_OBJECT; - int hasGSCookie = headerFlags & GC_INFO_HAS_GS_COOKIE; - int hasPSPSym = headerFlags & GC_INFO_HAS_PSP_SYM; - int hasGenericsInstContext = (headerFlags & GC_INFO_HAS_GENERICS_INST_CONTEXT_MASK) != GC_INFO_HAS_GENERICS_INST_CONTEXT_NONE; - m_GenericSecretParamIsMD = (headerFlags & GC_INFO_HAS_GENERICS_INST_CONTEXT_MASK) == GC_INFO_HAS_GENERICS_INST_CONTEXT_MD; - m_GenericSecretParamIsMT = (headerFlags & GC_INFO_HAS_GENERICS_INST_CONTEXT_MASK) == GC_INFO_HAS_GENERICS_INST_CONTEXT_MT; - int hasStackBaseRegister = headerFlags & GC_INFO_HAS_STACK_BASE_REGISTER; -#ifdef TARGET_AMD64 - m_WantsReportOnlyLeaf = ((headerFlags & GC_INFO_WANTS_REPORT_ONLY_LEAF) != 0); -#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) - m_HasTailCalls = ((headerFlags & GC_INFO_HAS_TAILCALLS) != 0); -#endif // TARGET_AMD64 - int hasSizeOfEditAndContinuePreservedArea = headerFlags & GC_INFO_HAS_EDIT_AND_CONTINUE_PRESERVED_SLOTS; - int hasReversePInvokeFrame = headerFlags & GC_INFO_REVERSE_PINVOKE_FRAME; - - int returnKindBits = (slimHeader) ? SIZE_OF_RETURN_KIND_IN_SLIM_HEADER : SIZE_OF_RETURN_KIND_IN_FAT_HEADER; - m_ReturnKind = - (ReturnKind)((UINT32)m_Reader.Read(returnKindBits)); - - if (flags == DECODE_RETURN_KIND) { // Bail, if we've decoded enough, - return; + return true; } - m_CodeLength = (UINT32) DENORMALIZE_CODE_LENGTH((UINT32) m_Reader.DecodeVarLengthUnsigned(CODE_LENGTH_ENCBASE)); - - if (flags == DECODE_CODE_LENGTH) { + m_CodeLength = (UINT32)DENORMALIZE_CODE_LENGTH((UINT32)m_Reader.DecodeVarLengthUnsigned(CODE_LENGTH_ENCBASE)); + remainingFlags &= ~DECODE_CODE_LENGTH; + if (remainingFlags == 0) + { // Bail, if we've decoded enough, - return; + return true; } - if (hasGSCookie) + if (m_headerFlags & GC_INFO_HAS_GS_COOKIE) { // Note that normalization as a code offset can be different than // normalization as code length UINT32 normCodeLength = NORMALIZE_CODE_OFFSET(m_CodeLength); // Decode prolog/epilog information - UINT32 normPrologSize = (UINT32) m_Reader.DecodeVarLengthUnsigned(NORM_PROLOG_SIZE_ENCBASE) + 1; - UINT32 normEpilogSize = (UINT32) m_Reader.DecodeVarLengthUnsigned(NORM_EPILOG_SIZE_ENCBASE); + UINT32 normPrologSize = (UINT32)m_Reader.DecodeVarLengthUnsigned(NORM_PROLOG_SIZE_ENCBASE) + 1; + UINT32 normEpilogSize = (UINT32)m_Reader.DecodeVarLengthUnsigned(NORM_EPILOG_SIZE_ENCBASE); - m_ValidRangeStart = (UINT32) DENORMALIZE_CODE_OFFSET(normPrologSize); - m_ValidRangeEnd = (UINT32) DENORMALIZE_CODE_OFFSET(normCodeLength - normEpilogSize); + m_ValidRangeStart = (UINT32)DENORMALIZE_CODE_OFFSET(normPrologSize); + m_ValidRangeEnd = (UINT32)DENORMALIZE_CODE_OFFSET(normCodeLength - normEpilogSize); _ASSERTE(m_ValidRangeStart < m_ValidRangeEnd); } - else if (hasSecurityObject || hasGenericsInstContext) + else if ((m_headerFlags & GC_INFO_HAS_GENERICS_INST_CONTEXT_MASK) != GC_INFO_HAS_GENERICS_INST_CONTEXT_NONE) { // Decode prolog information - UINT32 normPrologSize = (UINT32) m_Reader.DecodeVarLengthUnsigned(NORM_PROLOG_SIZE_ENCBASE) + 1; - m_ValidRangeStart = (UINT32) DENORMALIZE_CODE_OFFSET(normPrologSize); + UINT32 normPrologSize = (UINT32)m_Reader.DecodeVarLengthUnsigned(NORM_PROLOG_SIZE_ENCBASE) + 1; + m_ValidRangeStart = (UINT32)DENORMALIZE_CODE_OFFSET(normPrologSize); // satisfy asserts that assume m_GSCookieValidRangeStart != 0 ==> m_GSCookieValidRangeStart < m_GSCookieValidRangeEnd m_ValidRangeEnd = m_ValidRangeStart + 1; } @@ -179,98 +138,97 @@ GcInfoDecoder::GcInfoDecoder( m_ValidRangeStart = m_ValidRangeEnd = 0; } - if (flags == DECODE_PROLOG_LENGTH) { - // Bail, if we've decoded enough, - return; - } - - // Decode the offset to the security object. - if(hasSecurityObject) + remainingFlags &= ~DECODE_PROLOG_LENGTH; + if (remainingFlags == 0) { - m_SecurityObjectStackSlot = (INT32) DENORMALIZE_STACK_SLOT(m_Reader.DecodeVarLengthSigned(SECURITY_OBJECT_STACK_SLOT_ENCBASE)); - } - else - { - m_SecurityObjectStackSlot = NO_SECURITY_OBJECT; - } - - if (flags == DECODE_SECURITY_OBJECT) { // Bail, if we've decoded enough, - return; + return true; } // Decode the offset to the GS cookie. - if(hasGSCookie) + if (m_headerFlags & GC_INFO_HAS_GS_COOKIE) { - m_GSCookieStackSlot = (INT32) DENORMALIZE_STACK_SLOT(m_Reader.DecodeVarLengthSigned(GS_COOKIE_STACK_SLOT_ENCBASE)); + m_GSCookieStackSlot = (INT32)DENORMALIZE_STACK_SLOT(m_Reader.DecodeVarLengthSigned(GS_COOKIE_STACK_SLOT_ENCBASE)); } else { - m_GSCookieStackSlot = NO_GS_COOKIE; + m_GSCookieStackSlot = NO_GS_COOKIE; } - if (flags == DECODE_GS_COOKIE) { + remainingFlags &= ~DECODE_GS_COOKIE; + if (remainingFlags == 0) + { // Bail, if we've decoded enough, - return; + return true; } // Decode the offset to the PSPSym. // The PSPSym is relative to the caller SP on IA64 and the initial stack pointer before any stack allocation on X64 (InitialSP). - if(hasPSPSym) + if (m_headerFlags & GC_INFO_HAS_PSP_SYM) { - m_PSPSymStackSlot = (INT32) DENORMALIZE_STACK_SLOT(m_Reader.DecodeVarLengthSigned(PSP_SYM_STACK_SLOT_ENCBASE)); + m_PSPSymStackSlot = (INT32)DENORMALIZE_STACK_SLOT(m_Reader.DecodeVarLengthSigned(PSP_SYM_STACK_SLOT_ENCBASE)); } else { - m_PSPSymStackSlot = NO_PSP_SYM; + m_PSPSymStackSlot = NO_PSP_SYM; } - if (flags == DECODE_PSP_SYM) { + remainingFlags &= ~DECODE_PSP_SYM; + if (remainingFlags == 0) + { // Bail, if we've decoded enough, - return; + return true; } // Decode the offset to the generics type context. - if(hasGenericsInstContext) + if ((m_headerFlags & GC_INFO_HAS_GENERICS_INST_CONTEXT_MASK) != GC_INFO_HAS_GENERICS_INST_CONTEXT_NONE) { - m_GenericsInstContextStackSlot = (INT32) DENORMALIZE_STACK_SLOT(m_Reader.DecodeVarLengthSigned(GENERICS_INST_CONTEXT_STACK_SLOT_ENCBASE)); + m_GenericsInstContextStackSlot = (INT32)DENORMALIZE_STACK_SLOT(m_Reader.DecodeVarLengthSigned(GENERICS_INST_CONTEXT_STACK_SLOT_ENCBASE)); } else { m_GenericsInstContextStackSlot = NO_GENERICS_INST_CONTEXT; } - if (flags == DECODE_GENERICS_INST_CONTEXT) { + remainingFlags &= ~DECODE_GENERICS_INST_CONTEXT; + if (remainingFlags == 0) + { // Bail, if we've decoded enough, - return; + return true; } - if(hasStackBaseRegister) + if (m_headerFlags & GC_INFO_HAS_STACK_BASE_REGISTER) { - if (slimHeader) - { - m_StackBaseRegister = (UINT32) DENORMALIZE_STACK_BASE_REGISTER(0); - } - else - { - m_StackBaseRegister = (UINT32) DENORMALIZE_STACK_BASE_REGISTER(m_Reader.DecodeVarLengthUnsigned(STACK_BASE_REGISTER_ENCBASE)); - } + m_StackBaseRegister = (UINT32)DENORMALIZE_STACK_BASE_REGISTER(m_Reader.DecodeVarLengthUnsigned(STACK_BASE_REGISTER_ENCBASE)); } else { m_StackBaseRegister = NO_STACK_BASE_REGISTER; } - if (hasSizeOfEditAndContinuePreservedArea) + if (m_headerFlags & GC_INFO_HAS_EDIT_AND_CONTINUE_INFO) { - m_SizeOfEditAndContinuePreservedArea = (UINT32) m_Reader.DecodeVarLengthUnsigned(SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE); + m_SizeOfEditAndContinuePreservedArea = (UINT32)m_Reader.DecodeVarLengthUnsigned(SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE); +#ifdef TARGET_ARM64 + m_SizeOfEditAndContinueFixedStackFrame = (UINT32)m_Reader.DecodeVarLengthUnsigned(SIZE_OF_EDIT_AND_CONTINUE_FIXED_STACK_FRAME_ENCBASE); +#endif } else { m_SizeOfEditAndContinuePreservedArea = NO_SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA; +#ifdef TARGET_ARM64 + m_SizeOfEditAndContinueFixedStackFrame = 0; +#endif } - if (hasReversePInvokeFrame) + remainingFlags &= ~DECODE_EDIT_AND_CONTINUE; + if (remainingFlags == 0) + { + // Bail, if we've decoded enough, + return true; + } + + if (m_headerFlags & GC_INFO_REVERSE_PINVOKE_FRAME) { m_ReversePInvokeFrameStackSlot = (INT32)DENORMALIZE_STACK_SLOT(m_Reader.DecodeVarLengthSigned(REVERSE_PINVOKE_FRAME_ENCBASE)); } @@ -279,20 +237,122 @@ GcInfoDecoder::GcInfoDecoder( m_ReversePInvokeFrameStackSlot = NO_REVERSE_PINVOKE_FRAME; } + remainingFlags &= ~DECODE_REVERSE_PINVOKE_VAR; + if (remainingFlags == 0) + { + // Bail, if we've decoded enough, + return true; + } #ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA - if (slimHeader) + m_SizeOfStackOutgoingAndScratchArea = (UINT32)DENORMALIZE_SIZE_OF_STACK_AREA(m_Reader.DecodeVarLengthUnsigned(SIZE_OF_STACK_AREA_ENCBASE)); +#endif // FIXED_STACK_PARAMETER_SCRATCH_AREA + + return false; +} + +GcInfoDecoder::GcInfoDecoder( + GCInfoToken gcInfoToken, + GcInfoDecoderFlags flags, + UINT32 breakOffset + ) + : m_Reader(dac_cast(gcInfoToken.Info)) + , m_InstructionOffset(breakOffset) + , m_IsInterruptible(false) + , m_ReturnKind(RT_Illegal) +#ifdef _DEBUG + , m_Flags( flags ) + , m_GcInfoAddress(dac_cast(gcInfoToken.Info)) +#endif + , m_Version(gcInfoToken.Version) +{ + _ASSERTE( (flags & (DECODE_INTERRUPTIBILITY | DECODE_GC_LIFETIMES)) || (0 == breakOffset) ); + + // The current implementation doesn't support the two flags together + _ASSERTE( + ((flags & (DECODE_INTERRUPTIBILITY | DECODE_GC_LIFETIMES)) != (DECODE_INTERRUPTIBILITY | DECODE_GC_LIFETIMES)) + ); + + //-------------------------------------------- + // Pre-decode information + //-------------------------------------------- + + bool slimHeader = (m_Reader.ReadOneFast() == 0); + // Use flag mask to bail out early if we already decoded all the pieces that caller requested + int remainingFlags = flags == DECODE_EVERYTHING ? ~0 : flags; + + if (!slimHeader) { - m_SizeOfStackOutgoingAndScratchArea = 0; + if (PredecodeFatHeader(remainingFlags)) + return; } else { - m_SizeOfStackOutgoingAndScratchArea = (UINT32)DENORMALIZE_SIZE_OF_STACK_AREA(m_Reader.DecodeVarLengthUnsigned(SIZE_OF_STACK_AREA_ENCBASE)); - } + if (m_Reader.ReadOneFast()) + { + m_headerFlags = GC_INFO_HAS_STACK_BASE_REGISTER; + m_StackBaseRegister = (UINT32)DENORMALIZE_STACK_BASE_REGISTER(0); + } + else + { + m_headerFlags = (GcInfoHeaderFlags)0; + m_StackBaseRegister = NO_STACK_BASE_REGISTER; + } + + m_ReturnKind = (ReturnKind)((UINT32)m_Reader.Read(SIZE_OF_RETURN_KIND_IN_SLIM_HEADER)); + + remainingFlags &= ~(DECODE_RETURN_KIND | DECODE_VARARG); +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) + remainingFlags &= ~DECODE_HAS_TAILCALLS; +#endif + + if (remainingFlags == 0) + { + // Bail, if we've decoded enough, + return; + } + + m_CodeLength = (UINT32)DENORMALIZE_CODE_LENGTH((UINT32)m_Reader.DecodeVarLengthUnsigned(CODE_LENGTH_ENCBASE)); + + // + // predecoding the rest of slim header does not require any reading. + // + + m_ValidRangeStart = m_ValidRangeEnd = 0; + m_GSCookieStackSlot = NO_GS_COOKIE; + m_PSPSymStackSlot = NO_PSP_SYM; + m_GenericsInstContextStackSlot = NO_GENERICS_INST_CONTEXT; + m_SizeOfEditAndContinuePreservedArea = NO_SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA; + +#ifdef TARGET_ARM64 + m_SizeOfEditAndContinueFixedStackFrame = 0; +#endif + + m_ReversePInvokeFrameStackSlot = NO_REVERSE_PINVOKE_FRAME; + +#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA + m_SizeOfStackOutgoingAndScratchArea = 0; #endif // FIXED_STACK_PARAMETER_SCRATCH_AREA + remainingFlags &= ~(DECODE_CODE_LENGTH + | DECODE_PROLOG_LENGTH + | DECODE_GS_COOKIE + | DECODE_PSP_SYM + | DECODE_GENERICS_INST_CONTEXT + | DECODE_EDIT_AND_CONTINUE + | DECODE_REVERSE_PINVOKE_VAR + ); + + if (remainingFlags == 0) + { + // Bail, if we've decoded enough, + return; + } + } + #ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED m_NumSafePoints = (UINT32) DENORMALIZE_NUM_SAFE_POINTS(m_Reader.DecodeVarLengthUnsigned(NUM_SAFE_POINTS_ENCBASE)); + m_SafePointIndex = m_NumSafePoints; #endif if (slimHeader) @@ -305,15 +365,15 @@ GcInfoDecoder::GcInfoDecoder( } #ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED - if(flags & (DECODE_INTERRUPTIBILITY | DECODE_GC_LIFETIMES)) + if(flags & (DECODE_GC_LIFETIMES | DECODE_INTERRUPTIBILITY)) { if(m_NumSafePoints) { - m_SafePointIndex = FindSafePoint(m_InstructionOffset); - } - else - { - m_SafePointIndex = 0; + // Safepoints are encoded with a -1 adjustment + // DECODE_GC_LIFETIMES adjusts the offset accordingly, but DECODE_INTERRUPTIBILITY does not + // adjust here + UINT32 offset = flags & DECODE_INTERRUPTIBILITY ? m_InstructionOffset - 1 : m_InstructionOffset; + m_SafePointIndex = FindSafePoint(offset); } } else if(flags & DECODE_FOR_RANGES_CALLBACK) @@ -327,7 +387,13 @@ GcInfoDecoder::GcInfoDecoder( } #endif - if(!m_IsInterruptible && (flags & DECODE_INTERRUPTIBILITY)) + // we do not support both DECODE_INTERRUPTIBILITY and DECODE_FOR_RANGES_CALLBACK at the same time + // as both will enumerate and consume interruptible ranges. + _ASSERTE((flags & (DECODE_INTERRUPTIBILITY | DECODE_FOR_RANGES_CALLBACK)) != + (DECODE_INTERRUPTIBILITY | DECODE_FOR_RANGES_CALLBACK)); + + _ASSERTE(!m_IsInterruptible); + if(flags & DECODE_INTERRUPTIBILITY) { EnumerateInterruptibleRanges(&SetIsInterruptibleCB, this); } @@ -339,16 +405,48 @@ bool GcInfoDecoder::IsInterruptible() return m_IsInterruptible; } +bool GcInfoDecoder::HasInterruptibleRanges() +{ + _ASSERTE(m_Flags & (DECODE_INTERRUPTIBILITY | DECODE_GC_LIFETIMES)); + return m_NumInterruptibleRanges > 0; +} + +bool GcInfoDecoder::IsSafePoint() +{ + _ASSERTE(m_Flags & (DECODE_INTERRUPTIBILITY | DECODE_GC_LIFETIMES)); + return m_SafePointIndex != m_NumSafePoints; +} + +bool GcInfoDecoder::AreSafePointsInterruptible() +{ + return m_Version >= 3; +} + +bool GcInfoDecoder::IsInterruptibleSafePoint() +{ + return IsSafePoint() && AreSafePointsInterruptible(); +} + +bool GcInfoDecoder::CouldBeInterruptibleSafePoint() +{ + // This is used in asserts. Ideally it would return false + // if current location canot possibly be a safepoint. + // However in some cases we optimize away "boring" callsites when no variables are tracked. + // So there is no way to tell precisely that a point is indeed not a safe point. + // Thus we do what we can here, but this could be better if we could have more data + return AreSafePointsInterruptible() && m_NumInterruptibleRanges == 0; +} + bool GcInfoDecoder::HasMethodDescGenericsInstContext() { _ASSERTE( m_Flags & DECODE_GENERICS_INST_CONTEXT ); - return m_GenericSecretParamIsMD; + return (m_headerFlags & GC_INFO_HAS_GENERICS_INST_CONTEXT_MASK) == GC_INFO_HAS_GENERICS_INST_CONTEXT_MD; } bool GcInfoDecoder::HasMethodTableGenericsInstContext() { _ASSERTE( m_Flags & DECODE_GENERICS_INST_CONTEXT ); - return m_GenericSecretParamIsMT; + return (m_headerFlags & GC_INFO_HAS_GENERICS_INST_CONTEXT_MASK) == GC_INFO_HAS_GENERICS_INST_CONTEXT_MT; } #ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED @@ -361,7 +459,7 @@ bool GcInfoDecoder::IsSafePoint(UINT32 codeOffset) if(m_NumSafePoints == 0) return false; -#if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64)|| defined(TARGET_RISCV64) +#if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) // Safepoints are encoded with a -1 adjustment codeOffset--; #endif @@ -372,47 +470,78 @@ bool GcInfoDecoder::IsSafePoint(UINT32 codeOffset) } -UINT32 GcInfoDecoder::FindSafePoint(UINT32 breakOffset) +// Repositioning within a bit stream is an involved operation, compared to sequential read, +// so we prefer linear search unless the number of safepoints is too high. +// The limit is not very significant as most methods will have just a few safe points. +// At 32, even if a single point is 16bit encoded (64K method length), +// the whole run will be under 64 bytes, so likely we will stay in the same cache line. +#define MAX_LINEAR_SEARCH 32 + +NOINLINE +UINT32 GcInfoDecoder::NarrowSafePointSearch(size_t savedPos, UINT32 breakOffset, UINT32* searchEnd) { - if(m_NumSafePoints == 0) - return 0; + INT32 low = 0; + INT32 high = (INT32)m_NumSafePoints; - const size_t savedPos = m_Reader.GetCurrentPos(); const UINT32 numBitsPerOffset = CeilOfLog2(NORMALIZE_CODE_OFFSET(m_CodeLength)); + while (high - low > MAX_LINEAR_SEARCH) + { + const INT32 mid = (low + high) / 2; + _ASSERTE(mid >= 0 && mid < (INT32)m_NumSafePoints); + m_Reader.SetCurrentPos(savedPos + (UINT32)mid * numBitsPerOffset); + UINT32 midSpOffset = (UINT32)m_Reader.Read(numBitsPerOffset); + + if (breakOffset < midSpOffset) + high = mid; + else + low = mid; + } + + m_Reader.SetCurrentPos(savedPos +(UINT32)low * numBitsPerOffset); + *searchEnd = high; + return low; +} + +UINT32 GcInfoDecoder::FindSafePoint(UINT32 breakOffset) +{ + _ASSERTE(m_NumSafePoints > 0); UINT32 result = m_NumSafePoints; + const size_t savedPos = m_Reader.GetCurrentPos(); + const UINT32 numBitsPerOffset = CeilOfLog2(NORMALIZE_CODE_OFFSET(m_CodeLength)); -#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) // Safepoints are encoded with a -1 adjustment - // but normalizing them masks off the low order bit - // Thus only bother looking if the address is odd if ((breakOffset & 1) != 0) #endif { const UINT32 normBreakOffset = NORMALIZE_CODE_OFFSET(breakOffset); + UINT32 linearSearchStart = 0; + UINT32 linearSearchEnd = m_NumSafePoints; + if (linearSearchEnd - linearSearchStart > MAX_LINEAR_SEARCH) + { + linearSearchStart = NarrowSafePointSearch(savedPos, normBreakOffset, &linearSearchEnd); + } - INT32 low = 0; - INT32 high = (INT32)m_NumSafePoints; - - while(low < high) + for (UINT32 i = linearSearchStart; i < linearSearchEnd; i++) { - const INT32 mid = (low+high)/2; - _ASSERTE(mid >= 0 && mid < (INT32)m_NumSafePoints); - m_Reader.SetCurrentPos(savedPos + (UINT32)mid * numBitsPerOffset); - UINT32 normOffset = (UINT32)m_Reader.Read(numBitsPerOffset); - if(normOffset == normBreakOffset) + UINT32 spOffset = (UINT32)m_Reader.Read(numBitsPerOffset); + if (spOffset == normBreakOffset) { - result = (UINT32) mid; + result = i; break; } - if(normOffset < normBreakOffset) - low = mid+1; - else - high = mid; + if (spOffset > normBreakOffset) + { + break; + } } } - m_Reader.SetCurrentPos(savedPos + m_NumSafePoints * numBitsPerOffset); + // Cannot just set the "savedPos + m_NumSafePoints * numBitsPerOffset" as + // there could be no more data if method tracks no variables of any kind. + // Must use Skip, which handles potential stream end. + m_Reader.Skip(savedPos + m_NumSafePoints * numBitsPerOffset - m_Reader.GetCurrentPos()); return result; } @@ -428,12 +557,12 @@ void GcInfoDecoder::EnumerateSafePoints(EnumerateSafePointsCallback *pCallback, UINT32 normOffset = (UINT32)m_Reader.Read(numBitsPerOffset); UINT32 offset = DENORMALIZE_CODE_OFFSET(normOffset) + 2; -#if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) // Safepoints are encoded with a -1 adjustment offset--; #endif - pCallback(offset, hCallback); + pCallback(this, offset, hCallback); } } #endif @@ -466,12 +595,6 @@ void GcInfoDecoder::EnumerateInterruptibleRanges ( } } -INT32 GcInfoDecoder::GetSecurityObjectStackSlot() -{ - _ASSERTE( m_Flags & DECODE_SECURITY_OBJECT ); - return m_SecurityObjectStackSlot; -} - INT32 GcInfoDecoder::GetGSCookieStackSlot() { _ASSERTE( m_Flags & DECODE_GS_COOKIE ); @@ -517,22 +640,22 @@ INT32 GcInfoDecoder::GetPSPSymStackSlot() bool GcInfoDecoder::GetIsVarArg() { _ASSERTE( m_Flags & DECODE_VARARG ); - return m_IsVarArg; + return m_headerFlags & GC_INFO_IS_VARARG; } -#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) +#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64) bool GcInfoDecoder::HasTailCalls() { _ASSERTE( m_Flags & DECODE_HAS_TAILCALLS ); - return m_HasTailCalls; + return ((m_headerFlags & GC_INFO_HAS_TAILCALLS) != 0); } -#endif // TARGET_ARM || TARGET_ARM64 || TARGET_RISCV64 +#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64 || TARGET_RISCV64 bool GcInfoDecoder::WantsReportOnlyLeaf() { // Only AMD64 with JIT64 can return false here. #ifdef TARGET_AMD64 - return m_WantsReportOnlyLeaf; + return ((m_headerFlags & GC_INFO_WANTS_REPORT_ONLY_LEAF) != 0); #else return true; #endif @@ -563,6 +686,14 @@ UINT32 GcInfoDecoder::GetSizeOfEditAndContinuePreservedArea() return m_SizeOfEditAndContinuePreservedArea; } +#ifdef TARGET_ARM64 +UINT32 GcInfoDecoder::GetSizeOfEditAndContinueFixedStackFrame() +{ + _ASSERTE( m_Flags & DECODE_EDIT_AND_CONTINUE ); + return m_SizeOfEditAndContinueFixedStackFrame; +} +#endif + size_t GcInfoDecoder::GetNumBytesRead() { return (m_Reader.GetCurrentPos() + 7) / 8; @@ -1349,9 +1480,9 @@ OBJECTREF* GcInfoDecoder::GetRegisterSlot( _ASSERTE(regNum >= 0 && regNum <= 16); _ASSERTE(regNum != 4); // rsp -#ifdef FEATURE_REDHAWK - PTR_UIntNative* ppRax = &pRD->pRax; - if (regNum > 4) regNum--; // rsp is skipped in Redhawk RegDisplay +#ifdef FEATURE_NATIVEAOT + PTR_uintptr_t* ppRax = &pRD->pRax; + if (regNum > 4) regNum--; // rsp is skipped in NativeAOT RegDisplay #else // The fields of KNONVOLATILE_CONTEXT_POINTERS are in the same order as // the processor encoding numbers. @@ -1362,7 +1493,7 @@ OBJECTREF* GcInfoDecoder::GetRegisterSlot( return (OBJECTREF*)*(ppRax + regNum); } -#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK) +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) OBJECTREF* GcInfoDecoder::GetCapturedRegister( int regNum, PREGDISPLAY pRD @@ -1378,7 +1509,7 @@ OBJECTREF* GcInfoDecoder::GetCapturedRegister( return (OBJECTREF*)(pRax + regNum); } -#endif // TARGET_UNIX && !FEATURE_REDHAWK +#endif // TARGET_UNIX && !FEATURE_NATIVEAOT bool GcInfoDecoder::IsScratchRegister(int regNum, PREGDISPLAY pRD) { @@ -1432,7 +1563,7 @@ void GcInfoDecoder::ReportRegisterToGC( // AMD64 LOG((LF_GCROOTS, LL_INFO1000, "Reporting " FMT_REG, regNum )); OBJECTREF* pObjRef = GetRegisterSlot( regNum, pRD ); -#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK) && !defined(SOS_TARGET_AMD64) +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) && !defined(SOS_TARGET_AMD64) // On PAL, we don't always have the context pointers available due to // a limitation of an unwinding library. In such case, the context // pointers for some nonvolatile registers are NULL. @@ -1452,7 +1583,7 @@ void GcInfoDecoder::ReportRegisterToGC( // AMD64 gcFlags |= GC_CALL_PINNED; } -#endif // TARGET_UNIX && !FEATURE_REDHAWK && !SOS_TARGET_AMD64 +#endif // TARGET_UNIX && !FEATURE_NATIVEAOT && !SOS_TARGET_AMD64 #ifdef _DEBUG if(IsScratchRegister(regNum, pRD)) @@ -1484,10 +1615,10 @@ OBJECTREF* GcInfoDecoder::GetRegisterSlot( _ASSERTE(regNum >= 0 && regNum <= 14); _ASSERTE(regNum != 13); // sp -#ifdef FEATURE_REDHAWK +#ifdef FEATURE_NATIVEAOT if(regNum < 14) { - PTR_UIntNative* ppReg = &pRD->pR0; + PTR_uintptr_t* ppReg = &pRD->pR0; return (OBJECTREF*)*(ppReg + regNum); } else @@ -1517,7 +1648,7 @@ OBJECTREF* GcInfoDecoder::GetRegisterSlot( #endif } -#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK) +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) OBJECTREF* GcInfoDecoder::GetCapturedRegister( int regNum, PREGDISPLAY pRD @@ -1533,7 +1664,7 @@ OBJECTREF* GcInfoDecoder::GetCapturedRegister( return (OBJECTREF*)(pR0 + regNum); } -#endif // TARGET_UNIX && !FEATURE_REDHAWK +#endif // TARGET_UNIX && !FEATURE_NATIVEAOT bool GcInfoDecoder::IsScratchRegister(int regNum, PREGDISPLAY pRD) @@ -1607,8 +1738,8 @@ OBJECTREF* GcInfoDecoder::GetRegisterSlot( _ASSERTE(regNum >= 0 && regNum <= 30); _ASSERTE(regNum != 18); // TEB -#ifdef FEATURE_REDHAWK - PTR_UIntNative* ppReg = &pRD->pX0; +#ifdef FEATURE_NATIVEAOT + PTR_uintptr_t* ppReg = &pRD->pX0; return (OBJECTREF*)*(ppReg + regNum); #else @@ -1673,7 +1804,7 @@ void GcInfoDecoder::ReportRegisterToGC( // ARM64 LOG((LF_GCROOTS, LL_INFO1000, "Reporting " FMT_REG, regNum )); OBJECTREF* pObjRef = GetRegisterSlot( regNum, pRD ); -#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK) && !defined(SOS_TARGET_ARM64) +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) && !defined(SOS_TARGET_ARM64) // On PAL, we don't always have the context pointers available due to // a limitation of an unwinding library. In such case, the context // pointers for some nonvolatile registers are NULL. @@ -1715,7 +1846,7 @@ void GcInfoDecoder::ReportRegisterToGC( // ARM64 pCallBack(hCallBack, pObjRef, gcFlags DAC_ARG(DacSlotLocation(regNum, 0, false))); } -#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK) +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) OBJECTREF* GcInfoDecoder::GetCapturedRegister( int regNum, PREGDISPLAY pRD @@ -1740,11 +1871,138 @@ OBJECTREF* GcInfoDecoder::GetCapturedRegister( return (OBJECTREF*)(pX0 + regNum); } -#endif // TARGET_UNIX && !FEATURE_REDHAWK +#endif // TARGET_UNIX && !FEATURE_NATIVEAOT + +#elif defined(TARGET_LOONGARCH64) + +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) +OBJECTREF* GcInfoDecoder::GetCapturedRegister( + int regNum, + PREGDISPLAY pRD + ) +{ + _ASSERTE(regNum >= 1 && regNum <= 31); + + // The fields of CONTEXT are in the same order as + // the processor encoding numbers. + + DWORD64 *pR0 = &pRD->pCurrentContext->R0; + + return (OBJECTREF*)(pR0 + regNum); +} +#endif // TARGET_UNIX && !FEATURE_NATIVEAOT + +OBJECTREF* GcInfoDecoder::GetRegisterSlot( + int regNum, + PREGDISPLAY pRD + ) +{ + _ASSERTE((regNum == 1) || (regNum >= 4 && regNum <= 31)); + +#ifdef FEATURE_NATIVEAOT + PTR_uintptr_t* ppReg = &pRD->pR0; + + return (OBJECTREF*)*(ppReg + regNum); +#else + if(regNum == 1) + { + return (OBJECTREF*) pRD->pCurrentContextPointers->Ra; + } + else if(regNum == 22) + { + return (OBJECTREF*) pRD->pCurrentContextPointers->Fp; + } + else if (regNum < 22) + { + return (OBJECTREF*)*(DWORD64**)(&pRD->volatileCurrContextPointers.A0 + (regNum - 4));//A0=4. + } + + return (OBJECTREF*)*(DWORD64**)(&pRD->pCurrentContextPointers->S0 + (regNum-23)); +#endif +} + +bool GcInfoDecoder::IsScratchRegister(int regNum, PREGDISPLAY pRD) +{ + _ASSERTE(regNum >= 0 && regNum <= 31); + + return (regNum <= 21 && ((regNum >= 4) || (regNum == 1))); +} + +bool GcInfoDecoder::IsScratchStackSlot(INT32 spOffset, GcStackSlotBase spBase, PREGDISPLAY pRD) +{ +#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA + _ASSERTE( m_Flags & DECODE_GC_LIFETIMES ); + + TADDR pSlot = (TADDR) GetStackSlot(spOffset, spBase, pRD); + _ASSERTE(pSlot >= pRD->SP); + + return (pSlot < pRD->SP + m_SizeOfStackOutgoingAndScratchArea); +#else + return FALSE; +#endif +} + +void GcInfoDecoder::ReportRegisterToGC( + int regNum, + unsigned gcFlags, + PREGDISPLAY pRD, + unsigned flags, + GCEnumCallback pCallBack, + void * hCallBack) +{ + GCINFODECODER_CONTRACT; + + _ASSERTE(regNum > 0 && regNum <= 31); + + LOG((LF_GCROOTS, LL_INFO1000, "Reporting " FMT_REG, regNum )); + + OBJECTREF* pObjRef = GetRegisterSlot( regNum, pRD ); +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) && !defined(SOS_TARGET_LOONGARCH64) + + // On PAL, we don't always have the context pointers available due to + // a limitation of an unwinding library. In such case, the context + // pointers for some nonvolatile registers are NULL. + // In such case, we let the pObjRef point to the captured register + // value in the context and pin the object itself. + if (pObjRef == NULL) + { + // Report a pinned object to GC only in the promotion phase when the + // GC is scanning roots. + GCCONTEXT* pGCCtx = (GCCONTEXT*)(hCallBack); + if (!pGCCtx->sc->promotion) + { + return; + } + + pObjRef = GetCapturedRegister(regNum, pRD); + + gcFlags |= GC_CALL_PINNED; + } +#endif // TARGET_UNIX && !SOS_TARGET_LOONGARCH64 + +#ifdef _DEBUG + if(IsScratchRegister(regNum, pRD)) + { + // Scratch registers cannot be reported for non-leaf frames + _ASSERTE(flags & ActiveStackFrame); + } + + LOG((LF_GCROOTS, LL_INFO1000, /* Part Two */ + "at" FMT_ADDR "as ", DBG_ADDR(pObjRef) )); + + VALIDATE_ROOT((gcFlags & GC_CALL_INTERIOR), hCallBack, pObjRef); + + LOG_PIPTR(pObjRef, gcFlags, hCallBack); +#endif //_DEBUG + + gcFlags |= CHECK_APP_DOMAIN; + + pCallBack(hCallBack, pObjRef, gcFlags DAC_ARG(DacSlotLocation(regNum, 0, false))); +} #elif defined(TARGET_RISCV64) -#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK) +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) OBJECTREF* GcInfoDecoder::GetCapturedRegister( int regNum, PREGDISPLAY pRD @@ -1759,7 +2017,7 @@ OBJECTREF* GcInfoDecoder::GetCapturedRegister( return (OBJECTREF*)(pR0 + regNum); } -#endif // TARGET_UNIX && !FEATURE_REDHAWK +#endif // TARGET_UNIX && !FEATURE_NATIVEAOT OBJECTREF* GcInfoDecoder::GetRegisterSlot( int regNum, @@ -1768,8 +2026,8 @@ OBJECTREF* GcInfoDecoder::GetRegisterSlot( { _ASSERTE((regNum == 1) || (regNum >= 5 && regNum <= 31)); -#ifdef FEATURE_REDHAWK - PTR_UIntNative* ppReg = &pRD->pR0; +#ifdef FEATURE_NATIVEAOT + PTR_uintptr_t* ppReg = &pRD->pR0; return (OBJECTREF*)*(ppReg + regNum); #else @@ -1837,7 +2095,8 @@ void GcInfoDecoder::ReportRegisterToGC( LOG((LF_GCROOTS, LL_INFO1000, "Reporting " FMT_REG, regNum )); OBJECTREF* pObjRef = GetRegisterSlot( regNum, pRD ); -#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK) && !defined(SOS_TARGET_RISCV64) +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) && !defined(SOS_TARGET_RISCV64) + // On PAL, we don't always have the context pointers available due to // a limitation of an unwinding library. In such case, the context // pointers for some nonvolatile registers are NULL. @@ -1939,7 +2198,7 @@ OBJECTREF* GcInfoDecoder::GetStackSlot( SIZE_T * pFrameReg = (SIZE_T*) GetRegisterSlot(m_StackBaseRegister, pRD); -#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK) +#if defined(TARGET_UNIX) && !defined(FEATURE_NATIVEAOT) // On PAL, we don't always have the context pointers available due to // a limitation of an unwinding library. In such case, the context // pointers for some nonvolatile registers are NULL. @@ -1947,7 +2206,7 @@ OBJECTREF* GcInfoDecoder::GetStackSlot( { pFrameReg = (SIZE_T*) GetCapturedRegister(m_StackBaseRegister, pRD); } -#endif // TARGET_UNIX && !FEATURE_REDHAWK +#endif // TARGET_UNIX && !FEATURE_NATIVEAOT pObjRef = (OBJECTREF*)(*pFrameReg + spOffset); } @@ -1964,6 +2223,8 @@ int GcInfoDecoder::GetStackReg(int spBase) int esp = 13; #elif defined(TARGET_ARM64) int esp = 31; +#elif defined(TARGET_LOONGARCH64) + int esp = 3; #elif defined(TARGET_RISCV64) int esp = 2; #endif diff --git a/src/sos-packaging.props b/src/sos-packaging.props index 7ca956b59d..77556c0557 100644 --- a/src/sos-packaging.props +++ b/src/sos-packaging.props @@ -10,7 +10,9 @@ + + diff --git a/src/tests/DbgShim.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt b/src/tests/DbgShim.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt index e8ba9834e5..836082dd3c 100644 --- a/src/tests/DbgShim.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt +++ b/src/tests/DbgShim.UnitTests/ConfigFiles/Unix/Debugger.Tests.Config.txt @@ -30,6 +30,9 @@ true false + true + false +