Skip to content

Commit 4a0be76

Browse files
committed
Changes relating to post 8
1 parent e9dc6de commit 4a0be76

17 files changed

+593
-333
lines changed

CMakeLists.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

MySQLHostManager40/MySQLHostManager40.csproj

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,42 @@
3535
<PropertyGroup>
3636
<AssemblyOriginatorKeyFile>generic_signing.snk</AssemblyOriginatorKeyFile>
3737
</PropertyGroup>
38+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
39+
<DebugSymbols>true</DebugSymbols>
40+
<OutputPath>bin\x64\Debug\</OutputPath>
41+
<DefineConstants>TRACE;DEBUG;DOTNET40</DefineConstants>
42+
<DebugType>full</DebugType>
43+
<PlatformTarget>x64</PlatformTarget>
44+
<ErrorReport>prompt</ErrorReport>
45+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
48+
<OutputPath>bin\x64\Release\</OutputPath>
49+
<DefineConstants>TRACE</DefineConstants>
50+
<Optimize>true</Optimize>
51+
<DebugType>pdbonly</DebugType>
52+
<PlatformTarget>x64</PlatformTarget>
53+
<ErrorReport>prompt</ErrorReport>
54+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
55+
</PropertyGroup>
56+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
57+
<DebugSymbols>true</DebugSymbols>
58+
<OutputPath>bin\x86\Debug\</OutputPath>
59+
<DefineConstants>TRACE;DEBUG;DOTNET40</DefineConstants>
60+
<DebugType>full</DebugType>
61+
<PlatformTarget>x86</PlatformTarget>
62+
<ErrorReport>prompt</ErrorReport>
63+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
64+
</PropertyGroup>
65+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
66+
<OutputPath>bin\x86\Release\</OutputPath>
67+
<DefineConstants>TRACE</DefineConstants>
68+
<Optimize>true</Optimize>
69+
<DebugType>pdbonly</DebugType>
70+
<PlatformTarget>x86</PlatformTarget>
71+
<ErrorReport>prompt</ErrorReport>
72+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
73+
</PropertyGroup>
3874
<ItemGroup>
3975
<Reference Include="System" />
4076
<Reference Include="System.Configuration" />

MySQLTestHarness/MySQLTestHarness.csproj

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,46 @@
3131
<ErrorReport>prompt</ErrorReport>
3232
<WarningLevel>4</WarningLevel>
3333
</PropertyGroup>
34+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
35+
<DebugSymbols>true</DebugSymbols>
36+
<OutputPath>bin\x64\Debug\</OutputPath>
37+
<DefineConstants>DEBUG;TRACE</DefineConstants>
38+
<DebugType>full</DebugType>
39+
<PlatformTarget>x64</PlatformTarget>
40+
<ErrorReport>prompt</ErrorReport>
41+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
42+
<Prefer32Bit>true</Prefer32Bit>
43+
</PropertyGroup>
44+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
45+
<OutputPath>bin\x64\Release\</OutputPath>
46+
<DefineConstants>TRACE</DefineConstants>
47+
<Optimize>true</Optimize>
48+
<DebugType>pdbonly</DebugType>
49+
<PlatformTarget>x64</PlatformTarget>
50+
<ErrorReport>prompt</ErrorReport>
51+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
52+
<Prefer32Bit>true</Prefer32Bit>
53+
</PropertyGroup>
54+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
55+
<DebugSymbols>true</DebugSymbols>
56+
<OutputPath>bin\x86\Debug\</OutputPath>
57+
<DefineConstants>DEBUG;TRACE</DefineConstants>
58+
<DebugType>full</DebugType>
59+
<PlatformTarget>x86</PlatformTarget>
60+
<ErrorReport>prompt</ErrorReport>
61+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
62+
<Prefer32Bit>true</Prefer32Bit>
63+
</PropertyGroup>
64+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
65+
<OutputPath>bin\x86\Release\</OutputPath>
66+
<DefineConstants>TRACE</DefineConstants>
67+
<Optimize>true</Optimize>
68+
<DebugType>pdbonly</DebugType>
69+
<PlatformTarget>x86</PlatformTarget>
70+
<ErrorReport>prompt</ErrorReport>
71+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
72+
<Prefer32Bit>true</Prefer32Bit>
73+
</PropertyGroup>
3474
<ItemGroup>
3575
<Reference Include="MySql.Data, Version=6.9.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
3676
<Reference Include="System" />

MySQLTestHarness/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Program
1212
static object objLock = new object();
1313
static void Main(string[] args)
1414
{
15-
for (int i = 0; i < 1; i++)
15+
for (int i = 0; i < 5; i++)
1616
{
1717

1818
var tp = System.Threading.ThreadPool.QueueUserWorkItem(RunQueries);

clr_host/ClrHost.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,3 +443,8 @@ STDMETHODIMP CClrHost::raw_UnloadAppDomain(IManagedHost * managedHost, VARIANT_B
443443
return S_OK;
444444

445445
}
446+
447+
STDMETHODIMP CClrHost::OnMemoryNotification(EMemoryAvailable eMemoryAvailable)
448+
{
449+
return S_OK;
450+
}

clr_host/ClrHost.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ _COM_SMARTPTR_TYPEDEF(IErrorInfo, __uuidof(IErrorInfo));
1010
class ATL_NO_VTABLE CClrHost : public CComObjectRootEx<CComSingleThreadModel>,
1111
public IHostControl,
1212
public IHostGCManager,
13-
public IUnmanagedHost
13+
public IUnmanagedHost,
14+
public ICLRMemoryNotificationCallback
1415
{
1516
protected:
1617
BEGIN_COM_MAP(CClrHost)
1718
COM_INTERFACE_ENTRY(IHostControl)
1819
COM_INTERFACE_ENTRY(IHostGCManager)
1920
COM_INTERFACE_ENTRY(IUnmanagedHost)
21+
COM_INTERFACE_ENTRY(ICLRMemoryNotificationCallback)
2022
END_COM_MAP()
2123
DECLARE_PROTECT_FINAL_CONSTRUCT()
2224

@@ -70,6 +72,10 @@ class ATL_NO_VTABLE CClrHost : public CComObjectRootEx<CComSingleThreadModel>,
7072
STDMETHODIMP SuspensionEnding(DWORD generation);
7173
STDMETHODIMP SuspensionStarting();
7274
STDMETHODIMP ThreadIsBlockingForSuspension();
75+
76+
// ICLRMemoryNotificationCallback
77+
public:
78+
STDMETHODIMP OnMemoryNotification(EMemoryAvailable eMemoryAvailable);
7379
};
7480

7581
// we don't have an AppDomainManager for the specified domain

clr_host/clr_host.vcxproj

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@
55
<Configuration>Debug</Configuration>
66
<Platform>Win32</Platform>
77
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|x64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
812
<ProjectConfiguration Include="Release|Win32">
913
<Configuration>Release</Configuration>
1014
<Platform>Win32</Platform>
1115
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
1220
</ItemGroup>
1321
<ItemGroup>
1422
<ClCompile Include="ClrHost.cpp" />
@@ -29,28 +37,57 @@
2937
<PlatformToolset>v120</PlatformToolset>
3038
<CharacterSet>MultiByte</CharacterSet>
3139
</PropertyGroup>
40+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
41+
<ConfigurationType>StaticLibrary</ConfigurationType>
42+
<UseDebugLibraries>true</UseDebugLibraries>
43+
<PlatformToolset>v120</PlatformToolset>
44+
<CharacterSet>MultiByte</CharacterSet>
45+
</PropertyGroup>
3246
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3347
<ConfigurationType>StaticLibrary</ConfigurationType>
3448
<UseDebugLibraries>false</UseDebugLibraries>
3549
<PlatformToolset>v120</PlatformToolset>
3650
<WholeProgramOptimization>true</WholeProgramOptimization>
3751
<CharacterSet>MultiByte</CharacterSet>
3852
</PropertyGroup>
53+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
54+
<ConfigurationType>StaticLibrary</ConfigurationType>
55+
<UseDebugLibraries>false</UseDebugLibraries>
56+
<PlatformToolset>v120</PlatformToolset>
57+
<WholeProgramOptimization>true</WholeProgramOptimization>
58+
<CharacterSet>MultiByte</CharacterSet>
59+
</PropertyGroup>
3960
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
4061
<ImportGroup Label="ExtensionSettings">
4162
</ImportGroup>
4263
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
4364
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
4465
</ImportGroup>
66+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
4569
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
4670
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
4771
</ImportGroup>
72+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
73+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
74+
</ImportGroup>
4875
<PropertyGroup Label="UserMacros" />
4976
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
5077
<TargetExt>.lib</TargetExt>
78+
<IntDir>$(PlatformTarget)\$(Configuration)\</IntDir>
79+
<OutDir>$(SolutionDir)$(PlatformTarget)\$(Configuration)\</OutDir>
80+
</PropertyGroup>
81+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
82+
<TargetExt>.lib</TargetExt>
5183
</PropertyGroup>
5284
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
5385
<TargetExt>.lib</TargetExt>
86+
<OutDir>$(SolutionDir)$(PlatformTarget)\$(Configuration)\</OutDir>
87+
<IntDir>$(PlatformTarget)\$(Configuration)\</IntDir>
88+
</PropertyGroup>
89+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
90+
<TargetExt>.lib</TargetExt>
5491
</PropertyGroup>
5592
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
5693
<ClCompile>
@@ -67,6 +104,21 @@
67104
<Command>"$(TargetFrameworkSDKToolsDirectory)TlbExp.exe" "$(SolutionDir)mysql_managed_interface\bin\$(Configuration)\MySQLHostManager.dll" /out:"$(IntDir)MySQLHostManager.tlb"</Command>
68105
</PreBuildEvent>
69106
</ItemDefinitionGroup>
107+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
108+
<ClCompile>
109+
<WarningLevel>Level3</WarningLevel>
110+
<Optimization>Disabled</Optimization>
111+
<SDLCheck>true</SDLCheck>
112+
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
113+
<BrowseInformation>true</BrowseInformation>
114+
</ClCompile>
115+
<Link>
116+
<GenerateDebugInformation>true</GenerateDebugInformation>
117+
</Link>
118+
<PreBuildEvent>
119+
<Command>"$(TargetFrameworkSDKToolsDirectory)TlbExp.exe" "$(SolutionDir)mysql_managed_interface\bin\$(Configuration)\MySQLHostManager.dll" /out:"$(IntDir)MySQLHostManager.tlb"</Command>
120+
</PreBuildEvent>
121+
</ItemDefinitionGroup>
70122
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
71123
<ClCompile>
72124
<WarningLevel>Level3</WarningLevel>
@@ -85,6 +137,24 @@
85137
<Command>"$(TargetFrameworkSDKToolsDirectory)TlbExp.exe" "$(SolutionDir)mysql_managed_interface\bin\$(Configuration)\MySQLHostManager.dll" /out:"$(IntDir)MySQLHostManager.tlb"</Command>
86138
</PreBuildEvent>
87139
</ItemDefinitionGroup>
140+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
141+
<ClCompile>
142+
<WarningLevel>Level3</WarningLevel>
143+
<Optimization>MaxSpeed</Optimization>
144+
<FunctionLevelLinking>true</FunctionLevelLinking>
145+
<IntrinsicFunctions>true</IntrinsicFunctions>
146+
<SDLCheck>true</SDLCheck>
147+
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
148+
</ClCompile>
149+
<Link>
150+
<GenerateDebugInformation>true</GenerateDebugInformation>
151+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
152+
<OptimizeReferences>true</OptimizeReferences>
153+
</Link>
154+
<PreBuildEvent>
155+
<Command>"$(TargetFrameworkSDKToolsDirectory)TlbExp.exe" "$(SolutionDir)mysql_managed_interface\bin\$(Configuration)\MySQLHostManager.dll" /out:"$(IntDir)MySQLHostManager.tlb"</Command>
156+
</PreBuildEvent>
157+
</ItemDefinitionGroup>
88158
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
89159
<ImportGroup Label="ExtensionTargets">
90160
</ImportGroup>

clr_host/stdafx.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@
3535
#include <tchar.h>
3636
#include <mscoree.h>
3737
#ifdef DEBUG
38-
#import "Debug/MySQLHostManager.tlb" no_namespace
39-
//#import "Debug/MySQLHostManager40.tlb" no_namespace
38+
#if _WIN64
39+
#import "x64/Debug/MySQLHostManager.tlb" no_namespace
4040
#else
41-
#import "Release/MySQLHostManager.tlb" no_namespace
42-
//#import "Release/MySQLHostManager40.tlb" no_namespace
41+
#import "x86/Debug/MySQLHostManager.tlb" no_namespace
42+
#endif
43+
#else
44+
#if _WIN64
45+
#import "x64/Release/MySQLHostManager.tlb" no_namespace
46+
#else
47+
#import "x86/Release/MySQLHostManager.tlb" no_namespace
48+
#endif
4349
#endif
4450

4551
#pragma warning (pop)

mysql_managed_interface/MySQLAssemblyList.cs

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,19 @@ public string permissions
121121
this["permissions"] = value;
122122
}
123123
}
124+
125+
[ConfigurationProperty("lifetime", DefaultValue = "00:10:00")]
126+
public TimeSpan lifetime
127+
{
128+
get
129+
{
130+
return (TimeSpan)this["lifetime"];
131+
}
132+
set
133+
{
134+
this["lifetime"] = value;
135+
}
136+
}
124137
}
125138

126139
public class MySQLPermissionSets : ConfigurationElementCollection
@@ -224,7 +237,7 @@ public string Name
224237

225238
public class MySQLAppDomainCleanup : ConfigurationElement
226239
{
227-
[ConfigurationProperty("interval", IsKey = true, IsRequired = true)]
240+
[ConfigurationProperty("interval", DefaultValue = "00:01:00")]
228241
public TimeSpan interval
229242
{
230243
get
@@ -237,7 +250,7 @@ public TimeSpan interval
237250
}
238251
}
239252

240-
[ConfigurationProperty("forcedInterval", IsKey = true, IsRequired = true)]
253+
[ConfigurationProperty("forcedInterval", DefaultValue = "06:00:00")]
241254
public TimeSpan forcedInterval
242255
{
243256
get
@@ -250,5 +263,32 @@ public TimeSpan forcedInterval
250263
}
251264
}
252265

266+
[ConfigurationProperty("defaultLifetime", DefaultValue = "00:10:00")]
267+
public TimeSpan defaultLifetime
268+
{
269+
get
270+
{
271+
return (TimeSpan)this["defaultLifetime"];
272+
}
273+
set
274+
{
275+
this["defaultLifetime"] = value;
276+
}
277+
}
278+
279+
[ConfigurationProperty("maxAllowableDomains", DefaultValue = "1000")]
280+
[IntegerValidator(MinValue = 20, MaxValue = int.MaxValue)] // Why impose a MinValue? This keeps people from creating a slow environment
281+
public int maxAllowableDomains
282+
{
283+
get
284+
{
285+
return (int)this["maxAllowableDomains"];
286+
}
287+
set
288+
{
289+
this["maxAllowableDomains"] = value;
290+
}
291+
}
292+
253293
}
254294
}

0 commit comments

Comments
 (0)