Permalink
Browse files

Updated to VS2012, added some performance improvements

  • Loading branch information...
tyranid committed Aug 20, 2013
1 parent 51acfdb commit 870ff089f9151665a14d1075e51ec3219c6421f6
@@ -28,19 +28,23 @@
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
0 LICENSE 100755 → 100644
No changes.
@@ -1,10 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OleViewDotNet", "OleViewDotNet\OleViewDotNet.csproj", "{81F5C6AA-AC60-4F6E-9467-426997BB9D80}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EnumerateInterfaces", "EnumerateInterfaces\EnumerateInterfaces.vcxproj", "{39EA6147-9029-444E-AF23-9C841D3DEB9E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{877F606D-20A0-40A5-BDC6-1EEA64F7BC0C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -285,8 +285,8 @@ public void DoSerialization(string strFileName)
/// <param name="rootKey">The root registry key, e.g. HKEY_CLASSES_ROOT</param>
private void LoadCLSIDs(RegistryKey rootKey)
{
m_clsids = new SortedDictionary<Guid, COMCLSIDEntry>();
m_clsidbyserver = new SortedDictionary<string, List<COMCLSIDEntry>>();
Dictionary<Guid, COMCLSIDEntry> clsids = new Dictionary<Guid, COMCLSIDEntry>();
Dictionary<string, List<COMCLSIDEntry>> clsidbyserver = new Dictionary<string, List<COMCLSIDEntry>>();
m_categories = new Dictionary<Guid, List<COMCLSIDEntry>>();
RegistryKey clsidKey = rootKey.OpenSubKey("CLSID");
@@ -299,25 +299,25 @@ private void LoadCLSIDs(RegistryKey rootKey)
{
Guid clsid = new Guid(key);
if (!m_clsids.ContainsKey(clsid))
if (!clsids.ContainsKey(clsid))
{
RegistryKey regKey = clsidKey.OpenSubKey(key);
if (regKey != null)
{
COMCLSIDEntry ent = new COMCLSIDEntry(clsid, regKey);
m_clsids.Add(clsid, ent);
clsids.Add(clsid, ent);
if (!String.IsNullOrEmpty(ent.Server) && ent.Type != (COMCLSIDEntry.ServerType.UnknownServer))
{
List<COMCLSIDEntry> list = null;
string strServer = ent.Server.ToLower();
if (m_clsidbyserver.ContainsKey(strServer))
if (clsidbyserver.ContainsKey(strServer))
{
list = m_clsidbyserver[strServer];
list = clsidbyserver[strServer];
}
else
{
list = new List<COMCLSIDEntry>();
m_clsidbyserver[strServer] = list;
clsidbyserver[strServer] = list;
}
list.Add(ent);
}
@@ -352,12 +352,15 @@ private void LoadCLSIDs(RegistryKey rootKey)
}
int pos = 0;
m_clsidbyname = new COMCLSIDEntry[m_clsids.Count];
foreach (COMCLSIDEntry ent in m_clsids.Values)
m_clsidbyname = new COMCLSIDEntry[clsids.Count];
foreach (COMCLSIDEntry ent in clsids.Values)
{
m_clsidbyname[pos++] = ent;
}
Array.Sort(m_clsidbyname);
m_clsids = new SortedDictionary<Guid, COMCLSIDEntry>(clsids);
m_clsidbyserver = new SortedDictionary<string, List<COMCLSIDEntry>>(clsidbyserver);
}
private void LoadProgIDs(RegistryKey rootKey)
@@ -400,11 +403,11 @@ private void LoadProgIDs(RegistryKey rootKey)
/// <param name="rootKey">Root key of registry</param>
private void LoadInterfaces(RegistryKey rootKey)
{
m_interfaces = new SortedDictionary<Guid, COMInterfaceEntry>();
Dictionary<Guid, COMInterfaceEntry> interfaces = new Dictionary<Guid, COMInterfaceEntry>();
COMInterfaceEntry unk = COMInterfaceEntry.CreateKnownInterface(COMInterfaceEntry.KnownInterfaces.IUnknown);
m_interfaces.Add(unk.Iid, unk);
interfaces.Add(unk.Iid, unk);
unk = COMInterfaceEntry.CreateKnownInterface(COMInterfaceEntry.KnownInterfaces.IMarshal);
m_interfaces.Add(unk.Iid, unk);
interfaces.Add(unk.Iid, unk);
RegistryKey iidKey = rootKey.OpenSubKey("Interface");
if (iidKey != null)
{
@@ -415,13 +418,13 @@ private void LoadInterfaces(RegistryKey rootKey)
{
Guid iid = new Guid(key);
if (!m_interfaces.ContainsKey(iid))
if (!interfaces.ContainsKey(iid))
{
RegistryKey regKey = iidKey.OpenSubKey(key);
if (regKey != null)
{
COMInterfaceEntry ent = new COMInterfaceEntry(iid, regKey);
m_interfaces.Add(iid, ent);
interfaces.Add(iid, ent);
if (ent.ProxyClsid != Guid.Empty)
{
if (m_clsids.ContainsKey(ent.ProxyClsid))
@@ -440,12 +443,14 @@ private void LoadInterfaces(RegistryKey rootKey)
}
int pos = 0;
m_interfacebyname = new COMInterfaceEntry[m_interfaces.Count];
foreach (COMInterfaceEntry ent in m_interfaces.Values)
m_interfacebyname = new COMInterfaceEntry[interfaces.Count];
foreach (COMInterfaceEntry ent in interfaces.Values)
{
m_interfacebyname[pos++] = ent;
}
Array.Sort(m_interfacebyname);
m_interfaces = new SortedDictionary<Guid, COMInterfaceEntry>(interfaces);
}
void LoadPreApproved()
@@ -90,6 +90,7 @@ private static void ThreadEntry()
CreateConsoleWindow();
RunspaceConfiguration config = RunspaceConfiguration.Create();
config.Assemblies.Append(new AssemblyConfigurationEntry(asm.FullName, asm.Location));
/* Load all cmdlets from the assembly */

0 comments on commit 870ff08

Please sign in to comment.