Skip to content

Commit 892908e

Browse files
committed
temp: no idea what to do with those changes
1 parent a53ed3e commit 892908e

18 files changed

Lines changed: 228 additions & 180 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace ConsoleAppTest;
2+
3+
public class CatBowlEmptyException
4+
{
5+
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using System.Threading;
3+
4+
namespace ConsoleAppTest
5+
{
6+
class Program
7+
{
8+
static void Main(string[] args)
9+
{
10+
new CatBowlEmptyException();
11+
Console.ReadLine();
12+
//Fn1();
13+
Console.ReadLine();
14+
}
15+
16+
static void Fn1()
17+
{
18+
Fn2();
19+
}
20+
21+
static void Fn2()
22+
{
23+
Fn3(0);
24+
}
25+
26+
static void Fn3(int index)
27+
{
28+
if (index > 30)
29+
{
30+
return;
31+
}
32+
Fn3(index + 1);
33+
}
34+
}
35+
}

blog-posts/net-internals/profiler-fn-enter-leave-x64/code/DevToNetProfiler/DevToNetProfiler.sln

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,46 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30011.22
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.6.33815.320
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DevToNetProfiler", "DevToNetProfiler\DevToNetProfiler.vcxproj", "{F13041AA-47F6-408D-8BC6-B869813B9C43}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{7FFFACD3-D8CC-4E99-82CD-F600F61C1AEC}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleAppTest", "ConsoleAppTest\ConsoleAppTest.csproj", "{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}"
99
EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
1213
Debug|x64 = Debug|x64
1314
Debug|x86 = Debug|x86
15+
Release|Any CPU = Release|Any CPU
1416
Release|x64 = Release|x64
1517
Release|x86 = Release|x86
1618
EndGlobalSection
1719
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Debug|Any CPU.ActiveCfg = Debug|x64
21+
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Debug|Any CPU.Build.0 = Debug|x64
1822
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Debug|x64.ActiveCfg = Debug|x64
1923
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Debug|x64.Build.0 = Debug|x64
2024
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Debug|x86.ActiveCfg = Debug|Win32
2125
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Debug|x86.Build.0 = Debug|Win32
26+
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Release|Any CPU.ActiveCfg = Release|x64
27+
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Release|Any CPU.Build.0 = Release|x64
2228
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Release|x64.ActiveCfg = Release|x64
2329
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Release|x64.Build.0 = Release|x64
2430
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Release|x86.ActiveCfg = Release|Win32
2531
{F13041AA-47F6-408D-8BC6-B869813B9C43}.Release|x86.Build.0 = Release|Win32
26-
{7FFFACD3-D8CC-4E99-82CD-F600F61C1AEC}.Debug|x64.ActiveCfg = Debug|x64
27-
{7FFFACD3-D8CC-4E99-82CD-F600F61C1AEC}.Debug|x64.Build.0 = Debug|x64
28-
{7FFFACD3-D8CC-4E99-82CD-F600F61C1AEC}.Debug|x86.ActiveCfg = Debug|x86
29-
{7FFFACD3-D8CC-4E99-82CD-F600F61C1AEC}.Debug|x86.Build.0 = Debug|x86
30-
{7FFFACD3-D8CC-4E99-82CD-F600F61C1AEC}.Release|x64.ActiveCfg = Release|x64
31-
{7FFFACD3-D8CC-4E99-82CD-F600F61C1AEC}.Release|x64.Build.0 = Release|x64
32-
{7FFFACD3-D8CC-4E99-82CD-F600F61C1AEC}.Release|x86.ActiveCfg = Release|x86
33-
{7FFFACD3-D8CC-4E99-82CD-F600F61C1AEC}.Release|x86.Build.0 = Release|x86
32+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Debug|x64.ActiveCfg = Debug|Any CPU
35+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Debug|x64.Build.0 = Debug|Any CPU
36+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Debug|x86.ActiveCfg = Debug|Any CPU
37+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Debug|x86.Build.0 = Debug|Any CPU
38+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Release|x64.ActiveCfg = Release|Any CPU
41+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Release|x64.Build.0 = Release|Any CPU
42+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Release|x86.ActiveCfg = Release|Any CPU
43+
{D7B99040-4862-453A-8FE8-D5E7EF34B2D2}.Release|x86.Build.0 = Release|Any CPU
3444
EndGlobalSection
3545
GlobalSection(SolutionProperties) = preSolution
3646
HideSolutionNode = FALSE

blog-posts/net-internals/profiler-fn-enter-leave-x64/code/DevToNetProfiler/DevToNetProfiler/DevToNetProfiler.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,25 @@
2828
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2929
<ConfigurationType>DynamicLibrary</ConfigurationType>
3030
<UseDebugLibraries>true</UseDebugLibraries>
31-
<PlatformToolset>v142</PlatformToolset>
31+
<PlatformToolset>v143</PlatformToolset>
3232
<CharacterSet>Unicode</CharacterSet>
3333
</PropertyGroup>
3434
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3535
<ConfigurationType>DynamicLibrary</ConfigurationType>
3636
<UseDebugLibraries>false</UseDebugLibraries>
37-
<PlatformToolset>v142</PlatformToolset>
37+
<PlatformToolset>v143</PlatformToolset>
3838
<CharacterSet>Unicode</CharacterSet>
3939
</PropertyGroup>
4040
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4141
<ConfigurationType>DynamicLibrary</ConfigurationType>
4242
<UseDebugLibraries>true</UseDebugLibraries>
43-
<PlatformToolset>v142</PlatformToolset>
43+
<PlatformToolset>v143</PlatformToolset>
4444
<CharacterSet>Unicode</CharacterSet>
4545
</PropertyGroup>
4646
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4747
<ConfigurationType>DynamicLibrary</ConfigurationType>
4848
<UseDebugLibraries>false</UseDebugLibraries>
49-
<PlatformToolset>v142</PlatformToolset>
49+
<PlatformToolset>v143</PlatformToolset>
5050
<CharacterSet>Unicode</CharacterSet>
5151
</PropertyGroup>
5252
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

blog-posts/net-internals/profiler-fn-enter-leave-x64/code/DevToNetProfiler/DevToNetProfiler/DevToNetProfiler_i.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
/* link this file in with the server and any clients */
66

77

8-
/* File created by MIDL compiler version 8.01.0622 */
8+
/* File created by MIDL compiler version 8.01.0626 */
99
/* at Tue Jan 19 04:14:07 2038
1010
*/
1111
/* Compiler settings for DevToNetProfiler.idl:
12-
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0622
12+
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0626
1313
protocol : all , ms_ext, c_ext, robust
1414
error checks: allocation ref bounds_check enum stub_data
1515
VC __declspec() decoration level:

blog-posts/net-internals/profiler-fn-enter-leave-x64/code/DevToNetProfiler/DevToNetProfiler/DevToNetProfiler_i.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
44

55

6-
/* File created by MIDL compiler version 8.01.0622 */
6+
/* File created by MIDL compiler version 8.01.0626 */
77
/* at Tue Jan 19 04:14:07 2038
88
*/
99
/* Compiler settings for DevToNetProfiler.idl:
10-
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0622
10+
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0626
1111
protocol : all , ms_ext, c_ext, robust
1212
error checks: allocation ref bounds_check enum stub_data
1313
VC __declspec() decoration level:
@@ -42,6 +42,14 @@
4242
#pragma once
4343
#endif
4444

45+
#ifndef DECLSPEC_XFGVIRT
46+
#if _CONTROL_FLOW_GUARD_XFG
47+
#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
48+
#else
49+
#define DECLSPEC_XFGVIRT(base, func)
50+
#endif
51+
#endif
52+
4553
/* Forward Declarations */
4654

4755
#ifndef __INetProfiler_FWD_DEFINED__
@@ -96,15 +104,18 @@ EXTERN_C const IID IID_INetProfiler;
96104
{
97105
BEGIN_INTERFACE
98106

107+
DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
99108
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
100109
INetProfiler * This,
101110
/* [in] */ REFIID riid,
102111
/* [annotation][iid_is][out] */
103112
_COM_Outptr_ void **ppvObject);
104113

114+
DECLSPEC_XFGVIRT(IUnknown, AddRef)
105115
ULONG ( STDMETHODCALLTYPE *AddRef )(
106116
INetProfiler * This);
107117

118+
DECLSPEC_XFGVIRT(IUnknown, Release)
108119
ULONG ( STDMETHODCALLTYPE *Release )(
109120
INetProfiler * This);
110121

blog-posts/net-internals/profiler-fn-enter-leave-x64/code/DevToNetProfiler/DevToNetProfiler/DevToNetProfiler_p.c

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
/* this ALWAYS GENERATED file contains the proxy stub code */
44

55

6-
/* File created by MIDL compiler version 8.01.0622 */
6+
/* File created by MIDL compiler version 8.01.0626 */
77
/* at Tue Jan 19 04:14:07 2038
88
*/
99
/* Compiler settings for DevToNetProfiler.idl:
10-
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0622
10+
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0626
1111
protocol : all , ms_ext, c_ext, robust
1212
error checks: allocation ref bounds_check enum stub_data
1313
VC __declspec() decoration level:
@@ -77,6 +77,58 @@ static const RPC_SYNTAX_IDENTIFIER _RpcTransferSyntax =
7777
static const RPC_SYNTAX_IDENTIFIER _NDR64_RpcTransferSyntax =
7878
{{0x71710533,0xbeba,0x4937,{0x83,0x19,0xb5,0xdb,0xef,0x9c,0xcc,0x36}},{1,0}};
7979

80+
#if defined(_CONTROL_FLOW_GUARD_XFG)
81+
#define XFG_TRAMPOLINES(ObjectType)\
82+
static unsigned long ObjectType ## _UserSize_XFG(unsigned long * pFlags, unsigned long Offset, void * pObject)\
83+
{\
84+
return ObjectType ## _UserSize(pFlags, Offset, pObject);\
85+
}\
86+
static unsigned char * ObjectType ## _UserMarshal_XFG(unsigned long * pFlags, unsigned char * pBuffer, void * pObject)\
87+
{\
88+
return ObjectType ## _UserMarshal(pFlags, pBuffer, pObject);\
89+
}\
90+
static unsigned char * ObjectType ## _UserUnmarshal_XFG(unsigned long * pFlags, unsigned char * pBuffer, void * pObject)\
91+
{\
92+
return ObjectType ## _UserUnmarshal(pFlags, pBuffer, pObject);\
93+
}\
94+
static void ObjectType ## _UserFree_XFG(unsigned long * pFlags, void * pObject)\
95+
{\
96+
ObjectType ## _UserFree(pFlags, pObject);\
97+
}
98+
#define XFG_TRAMPOLINES64(ObjectType)\
99+
static unsigned long ObjectType ## _UserSize64_XFG(unsigned long * pFlags, unsigned long Offset, void * pObject)\
100+
{\
101+
return ObjectType ## _UserSize64(pFlags, Offset, pObject);\
102+
}\
103+
static unsigned char * ObjectType ## _UserMarshal64_XFG(unsigned long * pFlags, unsigned char * pBuffer, void * pObject)\
104+
{\
105+
return ObjectType ## _UserMarshal64(pFlags, pBuffer, pObject);\
106+
}\
107+
static unsigned char * ObjectType ## _UserUnmarshal64_XFG(unsigned long * pFlags, unsigned char * pBuffer, void * pObject)\
108+
{\
109+
return ObjectType ## _UserUnmarshal64(pFlags, pBuffer, pObject);\
110+
}\
111+
static void ObjectType ## _UserFree64_XFG(unsigned long * pFlags, void * pObject)\
112+
{\
113+
ObjectType ## _UserFree64(pFlags, pObject);\
114+
}
115+
#define XFG_BIND_TRAMPOLINES(HandleType, ObjectType)\
116+
static void* ObjectType ## _bind_XFG(HandleType pObject)\
117+
{\
118+
return ObjectType ## _bind((ObjectType) pObject);\
119+
}\
120+
static void ObjectType ## _unbind_XFG(HandleType pObject, handle_t ServerHandle)\
121+
{\
122+
ObjectType ## _unbind((ObjectType) pObject, ServerHandle);\
123+
}
124+
#define XFG_TRAMPOLINE_FPTR(Function) Function ## _XFG
125+
#else
126+
#define XFG_TRAMPOLINES(ObjectType)
127+
#define XFG_TRAMPOLINES64(ObjectType)
128+
#define XFG_BIND_TRAMPOLINES(HandleType, ObjectType)
129+
#define XFG_TRAMPOLINE_FPTR(Function) Function
130+
#endif
131+
80132

81133

82134
extern const DevToNetProfiler_MIDL_TYPE_FORMAT_STRING DevToNetProfiler__MIDL_TypeFormatString;
@@ -138,11 +190,11 @@ static const unsigned short INetProfiler_FormatStringOffsetTable[] =
138190
/* this ALWAYS GENERATED file contains the proxy stub code */
139191

140192

141-
/* File created by MIDL compiler version 8.01.0622 */
193+
/* File created by MIDL compiler version 8.01.0626 */
142194
/* at Tue Jan 19 04:14:07 2038
143195
*/
144196
/* Compiler settings for DevToNetProfiler.idl:
145-
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0622
197+
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0626
146198
protocol : all , ms_ext, c_ext, robust
147199
error checks: allocation ref bounds_check enum stub_data
148200
VC __declspec() decoration level:
@@ -271,7 +323,7 @@ static const MIDL_STUB_DESC Object_StubDesc =
271323
1, /* -error bounds_check flag */
272324
0x60001, /* Ndr library version */
273325
0,
274-
0x801026e, /* MIDL Version 8.1.622 */
326+
0x8010272, /* MIDL Version 8.1.626 */
275327
0,
276328
0,
277329
0, /* notify & notify_flag routine table */

blog-posts/net-internals/profiler-fn-enter-leave-x64/code/DevToNetProfiler/DevToNetProfiler/Naked32Bit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#include<iostream>
33

44
extern "C" void _stdcall StackOverflowDetected(FunctionID funcId, int count) {
5-
std::cout << "stackoverflow: " << funcId << ", count: " << count;
5+
//std::cout << "stackoverflow: " << funcId << ", count: " << count;
66
}
77

88
extern "C" void _stdcall EnterCpp(
99
FunctionID funcId,
1010
int identifier) {
11-
std::cout << "enter funcion id: " << funcId << ", Arguments in correct order: " << (identifier == 12345) << "\r\n";
11+
//std::cout << "enter funcion id: " << funcId << ", Arguments in correct order: " << (identifier == 12345) << "\r\n";
1212
}
1313

1414
#ifdef _WIN64

blog-posts/net-internals/profiler-fn-enter-leave-x64/code/DevToNetProfiler/DevToNetProfiler/ProfilerConcreteImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ HRESULT __stdcall ProfilerConcreteImpl::ObjectAllocated(ObjectID objectID, Class
6666
if (utils->GetClassNameByClassId(classID, className, 1000)) {
6767
//cout << "\t\nfrom profiler: class allocated: " << className << "\r\n";
6868

69-
if (strcmp(className, "TestApp.CatBowlEmptyException") == 0) {
69+
if (strcmp(className, "ConsoleAppTest.CatBowlEmptyException") == 0) {
7070
char* stack = new char[1000];
7171
memset(stack, 0, 1000);
7272
SnapshotClientData clientData;

0 commit comments

Comments
 (0)