Ignore:
Timestamp:
Dec 30, 2017, 6:40:04 AM (6 years ago)
Author:
roman
Message:
 
Location:
trunk/Utilities/LogicalProcessorInformation
Files:
5 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/LogicalProcessorInformation

    • Property svn:ignore set to
      .vs
  • trunk/Utilities/LogicalProcessorInformation/Application.cpp

    r506 r795  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Alax.Info, 2006-2015
    3 // http://alax.info
     2// Copyright (C) Roman Ryltsov, 2006-2017
     3// Created by Roman Ryltsov roman@alax.info
    44//
    55// A permission to use the source code is granted as long as reference to
    66// source website http://alax.info is retained.
    7 //
    8 // Created by Roman Ryltsov roman@alax.info
    97
    108#include "stdafx.h"
    11 #include <atlframe.h>
    12 #include <atlctrls.h>
    13 #include <atldlgs.h>
    149#include "resource.h"
     10//#include "Module_i.h"
    1511#include "MainDialog.h"
    1612
    17 CAppModule _Module;
     13////////////////////////////////////////////////////////////
     14// CLogicalProcessorInformationModule
    1815
    19 INT WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR, INT)
     16class CLogicalProcessorInformationModule :
     17        public CAtlExeModuleT<CLogicalProcessorInformationModule>,
     18        public CWtlExeModuleT<CLogicalProcessorInformationModule>
    2019{
    21         //AtlTraceLoadSettings(NULL);
    22         ATLVERIFY(SUCCEEDED(CoInitialize(NULL)));
    23         DefWindowProc(NULL, 0, 0, 0);
    24         AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls
    25         ATLVERIFY(SUCCEEDED(_Module.Init(NULL, hInstance)));
    26         CMainDialog Dialog;
    27         Dialog.DoModal();
    28         _Module.Term();
    29         CoUninitialize();
    30         return 0;
     20public:
     21
     22//DECLARE_LIBID(LIBID_AlaxInfoLogicalProcessorInformationModule)
     23
     24//DECLARE_REGISTRY_APPID_RESOURCEID(IDI_MODULE, "{...}")
     25
     26public:
     27// CLogicalProcessorInformationModule
     28        CLogicalProcessorInformationModule()
     29        {
     30                AtlTraceSetDefaultSettings();
     31                _Z4_THIS();
     32                _W(CExceptionFilter::Initialize());
     33        }
     34        ~CLogicalProcessorInformationModule()
     35        {
     36                _Z4_THIS();
     37                CExceptionFilter::Terminate();
     38        }
     39        HRESULT PreMessageLoop(INT nShowCommand)
     40        {
     41                _ATLTRY
     42                {
     43                        TraceModuleVersion();
     44                        __E(AtlInitCommonControls(ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_COOL_CLASSES));
     45                        //__C(CWtlExeModule::Initialize());
     46                        __C(__super::PreMessageLoop(nShowCommand));
     47                }
     48                _ATLCATCH(Exception)
     49                {
     50                        _C(Exception);
     51                }
     52                return S_OK;
     53        }
     54        VOID RunMessageLoop()
     55        {
     56                Lock();
     57                {
     58                        CMainDialog MainDialog;
     59                        MainDialog.DoModal();
     60                }
     61                if(GetLockCount() == 1)
     62                {
     63                        m_dwTimeOut = 0L;
     64                        m_dwPause = 0L;
     65                }
     66                Unlock();
     67        }
     68        HRESULT PostMessageLoop()
     69        {
     70                _ATLTRY
     71                {
     72                        _V(__super::PostMessageLoop());
     73                        //CWtlExeModule::Terminate();
     74                }
     75                _ATLCATCH(Exception)
     76                {
     77                        _C(Exception);
     78                }
     79                return S_OK;
     80        }
     81};
     82
     83CLogicalProcessorInformationModule _AtlModule;
     84
     85////////////////////////////////////////////////////////////
     86// Main
     87
     88extern "C" int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, INT nShowCommand)
     89{
     90    return _AtlModule.WinMain(nShowCommand);
    3191}
     92
  • trunk/Utilities/LogicalProcessorInformation/LogicalProcessorInformation.sln

    r506 r795  
    11Microsoft Visual Studio Solution File, Format Version 11.00
    2 # Visual Studio 2013
     2# Visual Studio 2017
    33Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LogicalProcessorInformation", "LogicalProcessorInformation.vcxproj", "{3454D960-8277-4756-BD5B-B01DC91590F6}"
    44EndProject
  • trunk/Utilities/LogicalProcessorInformation/LogicalProcessorInformation.vcxproj

    r506 r795  
    2222    <ProjectGuid>{3454D960-8277-4756-BD5B-B01DC91590F6}</ProjectGuid>
    2323    <RootNamespace>LogicalProcessorInformation</RootNamespace>
     24    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
    2425  </PropertyGroup>
    2526  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
     
    2930    <CharacterSet>Unicode</CharacterSet>
    3031    <WholeProgramOptimization>true</WholeProgramOptimization>
    31     <PlatformToolset>v120_xp</PlatformToolset>
     32    <PlatformToolset>v141</PlatformToolset>
    3233  </PropertyGroup>
    3334  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     
    3637    <CharacterSet>Unicode</CharacterSet>
    3738    <WholeProgramOptimization>true</WholeProgramOptimization>
    38     <PlatformToolset>v120_xp</PlatformToolset>
     39    <PlatformToolset>v141</PlatformToolset>
    3940  </PropertyGroup>
    4041  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    4142    <ConfigurationType>Application</ConfigurationType>
    4243    <CharacterSet>Unicode</CharacterSet>
    43     <PlatformToolset>v120_xp</PlatformToolset>
     44    <PlatformToolset>v141</PlatformToolset>
    4445  </PropertyGroup>
    4546  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    4647    <ConfigurationType>Application</ConfigurationType>
    4748    <CharacterSet>Unicode</CharacterSet>
    48     <PlatformToolset>v120_xp</PlatformToolset>
     49    <PlatformToolset>v141</PlatformToolset>
    4950  </PropertyGroup>
    5051  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
     
    9596    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
    9697  </PropertyGroup>
     98  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     99    <PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
     100  </PropertyGroup>
     101  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     102    <PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
     103  </PropertyGroup>
    97104  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    98105    <Midl>
     
    132139      <TargetMachine>MachineX86</TargetMachine>
    133140    </Link>
     141    <PostBuildEvent>
     142      <Command>rem "$(TargetPath)" /RegServer
     143"$(AlaxInfo_Common)\..\Utilities\IncrementBuild\_Bin\IncrementBuild-$(PlatformName).exe" configuration "$(ProjectDir)Module.ini" binary "$(TargetPath)" string "ConfigurationName" "$(ConfigurationName)"
     144"$(WindowsSdkDir)bin\x64\signtool" sign /v /f "$(AlaxInfo_Common)\Certificate\PrivateSPC.pfx" /d "Alax.Info $(ProjectName) Application" /du http://alax.info /n "Roman Ryltsov" "$(TargetPath)"
     145</Command>
     146    </PostBuildEvent>
     147    <PostBuildEvent>
     148      <Message>COM Registration, Build Increment, Digital Signature</Message>
     149    </PostBuildEvent>
    134150  </ItemDefinitionGroup>
    135151  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     
    167183      </DataExecutionPrevention>
    168184    </Link>
     185    <PostBuildEvent>
     186      <Command>rem "$(TargetPath)" /RegServer
     187"$(AlaxInfo_Common)\..\Utilities\IncrementBuild\_Bin\IncrementBuild-$(PlatformName).exe" configuration "$(ProjectDir)Module.ini" binary "$(TargetPath)" string "ConfigurationName" "$(ConfigurationName)"
     188"$(WindowsSdkDir)bin\x64\signtool" sign /v /f "$(AlaxInfo_Common)\Certificate\PrivateSPC.pfx" /d "Alax.Info $(ProjectName) Application" /du http://alax.info /n "Roman Ryltsov" "$(TargetPath)"
     189</Command>
     190    </PostBuildEvent>
     191    <PostBuildEvent>
     192      <Message>COM Registration, Build Increment, Digital Signature</Message>
     193    </PostBuildEvent>
    169194  </ItemDefinitionGroup>
    170195  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     
    211236      <TargetMachine>MachineX86</TargetMachine>
    212237    </Link>
     238    <PostBuildEvent>
     239      <Command>rem "$(TargetPath)" /RegServer
     240"$(AlaxInfo_Common)\..\Utilities\IncrementBuild\_Bin\IncrementBuild-$(PlatformName).exe" configuration "$(ProjectDir)Module.ini" binary "$(TargetPath)" string "ConfigurationName" "$(ConfigurationName)"
     241"$(WindowsSdkDir)bin\x64\signtool" sign /v /f "$(AlaxInfo_Common)\Certificate\PrivateSPC.pfx" /d "Alax.Info $(ProjectName) Application" /du http://alax.info /n "Roman Ryltsov" "$(TargetPath)"
     242</Command>
     243    </PostBuildEvent>
     244    <PostBuildEvent>
     245      <Message>COM Registration, Build Increment, Digital Signature</Message>
     246    </PostBuildEvent>
    213247  </ItemDefinitionGroup>
    214248  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     
    253287      </DataExecutionPrevention>
    254288    </Link>
     289    <PostBuildEvent>
     290      <Command>rem "$(TargetPath)" /RegServer
     291"$(AlaxInfo_Common)\..\Utilities\IncrementBuild\_Bin\IncrementBuild-$(PlatformName).exe" configuration "$(ProjectDir)Module.ini" binary "$(TargetPath)" string "ConfigurationName" "$(ConfigurationName)"
     292"$(WindowsSdkDir)bin\x64\signtool" sign /v /f "$(AlaxInfo_Common)\Certificate\PrivateSPC.pfx" /d "Alax.Info $(ProjectName) Application" /du http://alax.info /n "Roman Ryltsov" "$(TargetPath)"
     293</Command>
     294    </PostBuildEvent>
     295    <PostBuildEvent>
     296      <Message>COM Registration, Build Increment, Digital Signature</Message>
     297    </PostBuildEvent>
    255298  </ItemDefinitionGroup>
    256299  <ItemGroup>
     
    264307  </ItemGroup>
    265308  <ItemGroup>
     309    <ClInclude Include="AboutDialog.h" />
    266310    <ClInclude Include="MainDialog.h" />
    267311    <ClInclude Include="resource.h" />
    268312    <ClInclude Include="stdafx.h" />
     313    <ClInclude Include="targetver.h" />
    269314  </ItemGroup>
    270315  <ItemGroup>
    271316    <None Include="Module.ico" />
     317    <None Include="Module.ini" />
    272318  </ItemGroup>
    273319  <ItemGroup>
    274320    <ResourceCompile Include="Module.rc" />
     321  </ItemGroup>
     322  <ItemGroup>
     323    <Manifest Include="Application.manifest" />
    275324  </ItemGroup>
    276325  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  • trunk/Utilities/LogicalProcessorInformation/LogicalProcessorInformation.vcxproj.filters

    r506 r795  
    3333      <Filter>Header Files</Filter>
    3434    </ClInclude>
     35    <ClInclude Include="targetver.h">
     36      <Filter>Header Files</Filter>
     37    </ClInclude>
     38    <ClInclude Include="AboutDialog.h">
     39      <Filter>Header Files</Filter>
     40    </ClInclude>
    3541  </ItemGroup>
    3642  <ItemGroup>
     
    3844      <Filter>Resource Files</Filter>
    3945    </None>
     46    <None Include="Module.ini" />
    4047  </ItemGroup>
    4148  <ItemGroup>
     
    4451    </ResourceCompile>
    4552  </ItemGroup>
     53  <ItemGroup>
     54    <Manifest Include="Application.manifest">
     55      <Filter>Header Files</Filter>
     56    </Manifest>
     57  </ItemGroup>
    4658</Project>
  • trunk/Utilities/LogicalProcessorInformation/MainDialog.h

    r506 r795  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Alax.Info, 2006-2015
    3 // http://alax.info
     2// Copyright (C) Roman Ryltsov, 2006-2017
     3// Created by Roman Ryltsov roman@alax.info
    44//
    55// A permission to use the source code is granted as long as reference to
    66// source website http://alax.info is retained.
    7 //
    8 // Created by Roman Ryltsov roman@alax.info
    97
    108#pragma once
    119
    12 #include <atlsecurity.h>
    13 #include <atlcoll.h>
    14 #include <atlcrack.h>
    15 #include <atlmisc.h>
     10#define SECURITY_WIN32
     11#include <security.h>
     12#include "rocrypt.h"
     13#include "rowinhttp.h"
     14#include "AboutDialog.h"
     15//#include "..\DeflateTools\Bzip2Item.h"
     16
     17#pragma comment(lib, "secur32.lib")
    1618
    1719////////////////////////////////////////////////////////////
     
    2325{
    2426public:
    25 
    2627        enum { IDD = IDD_MAIN };
    2728
     
    3132        COMMAND_ID_HANDLER_EX(IDOK, OnCommand)
    3233        COMMAND_ID_HANDLER_EX(IDCANCEL, OnCommand)
     34        //COMMAND_ID_HANDLER_EX(IDC_UPDATE, OnUpdate)
     35        COMMAND_ID_HANDLER_EX(IDC_SUBMIT, OnSubmit)
     36        COMMAND_ID_HANDLER_EX(IDC_SAVEAS, OnSaveAs)
    3337END_MSG_MAP()
    3438
    3539BEGIN_DLGRESIZE_MAP(CMainDialog)
    3640        DLGRESIZE_CONTROL(IDC_TEXT, DLSZ_SIZE_X | DLSZ_SIZE_Y)
     41        //DLGRESIZE_CONTROL(IDC_UPDATE, DLSZ_MOVE_X | DLSZ_MOVE_Y)
     42        DLGRESIZE_CONTROL(IDC_SUBMIT, DLSZ_MOVE_X | DLSZ_MOVE_Y)
     43        DLGRESIZE_CONTROL(IDC_SAVEAS, DLSZ_MOVE_X | DLSZ_MOVE_Y)
    3744        DLGRESIZE_CONTROL(IDOK, DLSZ_MOVE_X | DLSZ_MOVE_Y)
    3845END_DLGRESIZE_MAP()
     
    4047public:
    4148
    42         ////////////////////////////////////////////////////////
    43         // VALUENAME
    44 
    45         typedef struct _VALUENAME
    46         {
    47                 INT_PTR nValue;
    48                 LPCTSTR pszName;
    49         } VALUENAME;
    50 
    5149private:
     50        CDpiAwareness m_DpiAwareness;
     51        CFont m_TextFont;
     52        CFont m_ButtonFont;
     53        CRoArrayT<CString> m_SpecifierArray;
    5254        CString m_sText;
    53         CEdit m_TextEdit;
     55        CRoEdit m_TextEdit;
     56        CButton m_UpdateButton;
     57        CButton m_SubmitButton;
     58        CButton m_SaveAsButton;
     59        CButton m_CloseButton;
    5460
    5561public:
    5662// CMainDialog
    57         static CString AtlFormatString(LPCTSTR pszFormat, ...)
    58         {
    59                 CString sValue;
    60                 va_list Arguments;
    61                 va_start(Arguments, pszFormat);
    62                 sValue.FormatV(pszFormat, Arguments);
    63                 va_end(Arguments);
    64                 return sValue;
    65         }
    66         static CString NameFromValue(INT_PTR nValue, const VALUENAME* pValueNames)
    67         {
    68                 ATLASSERT(pValueNames);
    69                 CString sName;
    70                 for(const VALUENAME* pValueName = pValueNames; pValueName->pszName; pValueName++)
    71                         if(pValueName->nValue == nValue)
    72                         {
    73                                 sName.Format(_T("%s (0x%x)"), pValueName->pszName, nValue);
    74                                 break;
    75                         }
    76                 if(sName.IsEmpty())
    77                         sName.Format(_T("0x%x"), nValue);
    78                 return sName;
    79         }
    8063        VOID Initialize()
    8164        {
    8265                m_sText.Empty();
     66                CString sText;
    8367                #pragma region System
    8468                {
    85                         m_sText += _T("## System") _T("\r\n") _T("\r\n");
     69                        sText += _T("# System") _T("\r\n") _T("\r\n");
    8670                        #pragma region Version
    87                         if(IsWindowsServer())
    88                         {
    89                         } else
    90                         {
    91                                 static const struct
    92                                 {
    93                                         bool (*pIsOrGreater)();
    94                                         LPCTSTR pszTitle;
    95                                 } g_pMap[] =
    96                                 {
    97                                         { &IsWindows8Point1OrGreater,   _T("Windows 8.1") },
    98                                         { &IsWindows8OrGreater,                 _T("Windows 8") },
    99                                         { &IsWindows7SP1OrGreater,              _T("Windows 7 Service Pack 1") },
    100                                         { &IsWindows7OrGreater,                 _T("Windows 7") },
    101                                         { &IsWindowsVistaSP2OrGreater,  _T("Windows Vista Service Pack 2") },
    102                                         { &IsWindowsVistaSP1OrGreater,  _T("Windows Vista Service Pack 1") },
    103                                         { &IsWindowsVistaOrGreater,             _T("Windows Vista") },
    104                                         { &IsWindowsXPSP3OrGreater,             _T("Windows XP Service Pack 3") },
    105                                         { &IsWindowsXPSP2OrGreater,             _T("Windows XP Service Pack 2") },
    106                                         { &IsWindowsXPSP1OrGreater,             _T("Windows XP Service Pack 1") },
    107                                         { &IsWindowsXPOrGreater,                _T("Windows XP") },
    108                                 };
    109                                 for(auto&& Item: g_pMap)
    110                                         if((Item.pIsOrGreater)())
    111                                         {
    112                                                 m_sText += AtlFormatString(_T(" * ") _T("Version: %s") _T("\r\n"), Item.pszTitle);
     71                        // NOTE: Operating system version changes in Windows 8.1 and Windows Server 2012 R2 https://msdn.microsoft.com/en-us/library/windows/desktop/dn302074
     72                        {
     73                                OSVERSIONINFOEX Version = { sizeof Version };
     74                                #pragma warning(disable: 4996) // 'GetVersionExW': was declared deprecated
     75                                _W(GetVersionEx((OSVERSIONINFO*) &Version));
     76                                #pragma warning(default: 4996)
     77                                CRoArrayT<CString> Array;
     78                                Array.Add(AtlFormatString(_T("%d.%d.%d"), Version.dwMajorVersion, Version.dwMinorVersion, Version.dwBuildNumber));
     79                                #pragma region Friendly Version
     80                                {
     81                                        //NOTE: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724833
     82                                        static const struct
     83                                        {
     84                                                LPCSTR pszFriendlyName;
     85                                                INT nMajorVersion; // DWORD
     86                                                INT nMinorVersion; // DWORD
     87                                                INT wProductType; // WORD
     88                                        } g_pMap[] =
     89                                        {
     90                                                { "Windows 10", 10, 0, VER_NT_WORKSTATION },
     91                                                { "Windows Server 2016", 10, 0, ~VER_NT_WORKSTATION },
     92                                                { "Windows 8.1", 6, 3, VER_NT_WORKSTATION },
     93                                                { "Windows Server 2012 R2", 6, 3, ~VER_NT_WORKSTATION },
     94                                                { "Windows 8", 6, 2, VER_NT_WORKSTATION },
     95                                                { "Windows Server 2012", 6, 2, ~VER_NT_WORKSTATION },
     96                                                { "Windows 7", 6, 1, VER_NT_WORKSTATION },
     97                                                { "Windows Server 2008 R2", 6, 1, ~VER_NT_WORKSTATION },
     98                                                { "Windows Server 2008", 6, 0, ~VER_NT_WORKSTATION },
     99                                                { "Windows Vista", 6, 0, VER_NT_WORKSTATION },
     100                                                //{ "Windows Server 2003 R2", 5, 2, GetSystemMetrics(SM_SERVERR2) != 0
     101                                                //{ "Windows Home Server", 5, 2, OSVERSIONINFOEX.wSuiteMask & VER_SUITE_WH_SERVER
     102                                                //{ "Windows Server 2003", 5, 2, GetSystemMetrics(SM_SERVERR2) == 0
     103                                                //{ "Windows XP Professional x64 Edition", 5, 2, (OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION) && (SYSTEM_INFO.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
     104                                                { "Windows XP", 5, 1 },
     105                                                { "Windows 2000", 5, 0 },
     106                                        };
     107                                        for(auto&& Item: g_pMap)
     108                                        {
     109                                                if(Item.nMajorVersion != Version.dwMajorVersion || Item.nMinorVersion != Version.dwMinorVersion)
     110                                                        continue;
     111                                                if(Item.wProductType == VER_NT_WORKSTATION && Version.wProductType != VER_NT_WORKSTATION)
     112                                                        continue;
     113                                                if(Item.wProductType == ~VER_NT_WORKSTATION && Version.wProductType == VER_NT_WORKSTATION)
     114                                                        continue;
     115                                                const CString sFriendlyName(Item.pszFriendlyName);
     116                                                Array.Add(sFriendlyName);
     117                                                #pragma region Version Specifier
     118                                                if(m_SpecifierArray.IsEmpty())
     119                                                {
     120                                                        m_SpecifierArray.Add(sFriendlyName);
     121                                                        if(Version.dwMajorVersion >= 10)
     122                                                                m_SpecifierArray.Add(AtlFormatString(_T("%d.%d.%d"), Version.dwMajorVersion, Version.dwMinorVersion, Version.dwBuildNumber));
     123                                                        if(Version.wServicePackMinor)
     124                                                                m_SpecifierArray.Add(AtlFormatString(_T("SP %d.%d"), Version.wServicePackMajor, Version.wServicePackMinor));
     125                                                        else if(Version.wServicePackMajor)
     126                                                                m_SpecifierArray.Add(AtlFormatString(_T("SP %d"), Version.wServicePackMajor));
     127                                                }
     128                                                #pragma endregion
    113129                                                break;
    114130                                        }
     131                                }
     132                                #pragma endregion
     133                                if(Version.wServicePackMajor > 0)
     134                                        Array.Add(AtlFormatString(_T("Service Pack %d.%d"), Version.wServicePackMajor, Version.wServicePackMinor));
     135                                if(Version.wSuiteMask)
     136                                {
     137                                        #pragma region Map
     138                                        static CFlagNameT<WORD> g_pMap[] =
     139                                        {
     140                                                #define A(x) { x, #x },
     141                                                A(VER_SUITE_SMALLBUSINESS)
     142                                                A(VER_SUITE_ENTERPRISE)
     143                                                A(VER_SUITE_BACKOFFICE)
     144                                                A(VER_SUITE_COMMUNICATIONS)
     145                                                A(VER_SUITE_TERMINAL)
     146                                                A(VER_SUITE_SMALLBUSINESS_RESTRICTED)
     147                                                A(VER_SUITE_EMBEDDEDNT)
     148                                                A(VER_SUITE_DATACENTER)
     149                                                A(VER_SUITE_SINGLEUSERTS)
     150                                                A(VER_SUITE_PERSONAL)
     151                                                A(VER_SUITE_BLADE)
     152                                                A(VER_SUITE_EMBEDDED_RESTRICTED)
     153                                                A(VER_SUITE_SECURITY_APPLIANCE)
     154                                                A(VER_SUITE_STORAGE_SERVER)
     155                                                A(VER_SUITE_COMPUTE_SERVER)
     156                                                A(VER_SUITE_WH_SERVER)
     157                                                #undef A
     158                                        };
     159                                        #pragma endregion
     160                                        Array.Add(FormatFlagsT(g_pMap, Version.wSuiteMask));
     161                                }
     162                                if(Version.wProductType)
     163                                {
     164                                        #pragma region Map
     165                                        static CEnumerationNameT<BYTE> g_pMap[] =
     166                                        {
     167                                                #define A(x) { x, #x },
     168                                                A(VER_NT_WORKSTATION)
     169                                                A(VER_NT_DOMAIN_CONTROLLER)
     170                                                A(VER_NT_SERVER)
     171                                                #undef A
     172                                        };
     173                                        #pragma endregion
     174                                        Array.Add(FormatEnumerationT(g_pMap, Version.wProductType));
     175                                }
     176                                CString sTitle;
     177                                // ...
     178                                CString sItems = _StringHelper::Join(Array, _T(", "));
     179                                if(sTitle.IsEmpty())
     180                                        sTitle = sItems;
     181                                else
     182                                        sTitle = AtlFormatString(_T("%s (%s)"), sTitle, sItems);
     183                                sText += AtlFormatString(_T(" * ") _T("Version: %s") _T("\r\n"), sTitle);
     184                                _ATLTRY
     185                                {
     186                                        // NOTE: Requires Win Vista, Win Server 2003
     187                                        typedef BOOL (WINAPI *GETPRODUCTINFO)(DWORD dwOSMajorVersion, DWORD dwOSMinorVersion, DWORD dwSpMajorVersion, DWORD dwSpMinorVersion, PDWORD pdwReturnedProductType);
     188                                        GETPRODUCTINFO pGetProductInfo = (GETPRODUCTINFO) GetProcAddress(GetModuleHandle(_T("kernel32.dll")), "GetProductInfo");
     189                                        if(pGetProductInfo)
     190                                        {
     191                                                DWORD nProductType = 0;
     192                                                __E(pGetProductInfo(Version.dwMajorVersion, Version.dwMinorVersion, Version.wServicePackMajor, Version.wServicePackMinor, &nProductType));
     193                                                if(nProductType)
     194                                                {
     195                                                        #pragma region Map
     196                                                        static CEnumerationNameT<DWORD> g_pMap[] =
     197                                                        {
     198                                                                #define A(x) { x, #x },
     199                                                                A(PRODUCT_UNDEFINED)
     200                                                                A(PRODUCT_ULTIMATE)
     201                                                                A(PRODUCT_HOME_BASIC)
     202                                                                A(PRODUCT_HOME_PREMIUM)
     203                                                                A(PRODUCT_ENTERPRISE)
     204                                                                A(PRODUCT_HOME_BASIC_N)
     205                                                                A(PRODUCT_BUSINESS)
     206                                                                A(PRODUCT_STANDARD_SERVER)
     207                                                                A(PRODUCT_DATACENTER_SERVER)
     208                                                                A(PRODUCT_SMALLBUSINESS_SERVER)
     209                                                                A(PRODUCT_ENTERPRISE_SERVER)
     210                                                                A(PRODUCT_STARTER)
     211                                                                A(PRODUCT_DATACENTER_SERVER_CORE)
     212                                                                A(PRODUCT_STANDARD_SERVER_CORE)
     213                                                                A(PRODUCT_ENTERPRISE_SERVER_CORE)
     214                                                                A(PRODUCT_ENTERPRISE_SERVER_IA64)
     215                                                                A(PRODUCT_BUSINESS_N)
     216                                                                A(PRODUCT_WEB_SERVER)
     217                                                                A(PRODUCT_CLUSTER_SERVER)
     218                                                                A(PRODUCT_HOME_SERVER)
     219                                                                A(PRODUCT_STORAGE_EXPRESS_SERVER)
     220                                                                A(PRODUCT_STORAGE_STANDARD_SERVER)
     221                                                                A(PRODUCT_STORAGE_WORKGROUP_SERVER)
     222                                                                A(PRODUCT_STORAGE_ENTERPRISE_SERVER)
     223                                                                A(PRODUCT_SERVER_FOR_SMALLBUSINESS)
     224                                                                A(PRODUCT_SMALLBUSINESS_SERVER_PREMIUM)
     225                                                                A(PRODUCT_HOME_PREMIUM_N)
     226                                                                A(PRODUCT_ENTERPRISE_N)
     227                                                                A(PRODUCT_ULTIMATE_N)
     228                                                                A(PRODUCT_WEB_SERVER_CORE)
     229                                                                A(PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT)
     230                                                                A(PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY)
     231                                                                A(PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING)
     232                                                                A(PRODUCT_SERVER_FOUNDATION)
     233                                                                A(PRODUCT_HOME_PREMIUM_SERVER)
     234                                                                A(PRODUCT_SERVER_FOR_SMALLBUSINESS_V)
     235                                                                A(PRODUCT_STANDARD_SERVER_V)
     236                                                                A(PRODUCT_DATACENTER_SERVER_V)
     237                                                                A(PRODUCT_ENTERPRISE_SERVER_V)
     238                                                                A(PRODUCT_DATACENTER_SERVER_CORE_V)
     239                                                                A(PRODUCT_STANDARD_SERVER_CORE_V)
     240                                                                A(PRODUCT_ENTERPRISE_SERVER_CORE_V)
     241                                                                A(PRODUCT_HYPERV)
     242                                                                A(PRODUCT_STORAGE_EXPRESS_SERVER_CORE)
     243                                                                A(PRODUCT_STORAGE_STANDARD_SERVER_CORE)
     244                                                                A(PRODUCT_STORAGE_WORKGROUP_SERVER_CORE)
     245                                                                A(PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE)
     246                                                                A(PRODUCT_STARTER_N)
     247                                                                A(PRODUCT_PROFESSIONAL)
     248                                                                A(PRODUCT_PROFESSIONAL_N)
     249                                                                A(PRODUCT_SB_SOLUTION_SERVER)
     250                                                                A(PRODUCT_SERVER_FOR_SB_SOLUTIONS)
     251                                                                A(PRODUCT_STANDARD_SERVER_SOLUTIONS)
     252                                                                A(PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE)
     253                                                                A(PRODUCT_SB_SOLUTION_SERVER_EM)
     254                                                                A(PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM)
     255                                                                A(PRODUCT_SOLUTION_EMBEDDEDSERVER)
     256                                                                A(PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE)
     257                                                                A(PRODUCT_PROFESSIONAL_EMBEDDED)
     258                                                                A(PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT)
     259                                                                A(PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL)
     260                                                                A(PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC)
     261                                                                A(PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC)
     262                                                                A(PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE)
     263                                                                A(PRODUCT_CLUSTER_SERVER_V)
     264                                                                A(PRODUCT_EMBEDDED)
     265                                                                A(PRODUCT_STARTER_E)
     266                                                                A(PRODUCT_HOME_BASIC_E)
     267                                                                A(PRODUCT_HOME_PREMIUM_E)
     268                                                                A(PRODUCT_PROFESSIONAL_E)
     269                                                                A(PRODUCT_ENTERPRISE_E)
     270                                                                A(PRODUCT_ULTIMATE_E)
     271                                                                A(PRODUCT_ENTERPRISE_EVALUATION)
     272                                                                A(PRODUCT_MULTIPOINT_STANDARD_SERVER)
     273                                                                A(PRODUCT_MULTIPOINT_PREMIUM_SERVER)
     274                                                                A(PRODUCT_STANDARD_EVALUATION_SERVER)
     275                                                                A(PRODUCT_DATACENTER_EVALUATION_SERVER)
     276                                                                A(PRODUCT_ENTERPRISE_N_EVALUATION)
     277                                                                A(PRODUCT_EMBEDDED_AUTOMOTIVE)
     278                                                                A(PRODUCT_EMBEDDED_INDUSTRY_A)
     279                                                                A(PRODUCT_THINPC)
     280                                                                A(PRODUCT_EMBEDDED_A)
     281                                                                A(PRODUCT_EMBEDDED_INDUSTRY)
     282                                                                A(PRODUCT_EMBEDDED_E)
     283                                                                A(PRODUCT_EMBEDDED_INDUSTRY_E)
     284                                                                A(PRODUCT_EMBEDDED_INDUSTRY_A_E)
     285                                                                A(PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER)
     286                                                                A(PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER)
     287                                                                A(PRODUCT_CORE_ARM)
     288                                                                A(PRODUCT_CORE_N)
     289                                                                A(PRODUCT_CORE_COUNTRYSPECIFIC)
     290                                                                A(PRODUCT_CORE_SINGLELANGUAGE)
     291                                                                A(PRODUCT_CORE)
     292                                                                A(PRODUCT_PROFESSIONAL_WMC)
     293                                                                A(PRODUCT_MOBILE_CORE)
     294                                                                A(PRODUCT_EMBEDDED_INDUSTRY_EVAL)
     295                                                                A(PRODUCT_EMBEDDED_INDUSTRY_E_EVAL)
     296                                                                A(PRODUCT_EMBEDDED_EVAL)
     297                                                                A(PRODUCT_EMBEDDED_E_EVAL)
     298                                                                A(PRODUCT_NANO_SERVER) //A(PRODUCT_CORE_SERVER)
     299                                                                A(PRODUCT_CLOUD_STORAGE_SERVER)
     300                                                                A(PRODUCT_CORE_CONNECTED)
     301                                                                A(PRODUCT_PROFESSIONAL_STUDENT)
     302                                                                A(PRODUCT_CORE_CONNECTED_N)
     303                                                                A(PRODUCT_PROFESSIONAL_STUDENT_N)
     304                                                                A(PRODUCT_CORE_CONNECTED_SINGLELANGUAGE)
     305                                                                A(PRODUCT_CORE_CONNECTED_COUNTRYSPECIFIC)
     306                                                                A(PRODUCT_UNLICENSED)
     307                                                                #undef A
     308                                                        };
     309                                                        #pragma endregion
     310                                                        sText += AtlFormatString(_T(" * ") _T("Product: %s") _T("\r\n"), FormatEnumerationT(g_pMap, nProductType));
     311                                                }
     312                                        }
     313                                }
     314                                _ATLCATCHALL()
     315                                {
     316                                        _Z_EXCEPTION();
     317                                }
    115318                        }
    116319                        #pragma endregion
    117                         TCHAR pszComputerName[256] = { 0 };
    118                         DWORD nComputerNameLength = _countof(pszComputerName);
    119                         GetComputerName(pszComputerName, &nComputerNameLength);
    120                         m_sText += AtlFormatString(_T(" * ") _T("Computer Name: `%s`") _T("\r\n"), pszComputerName);
     320                        TCHAR pszComputerName[MAX_COMPUTERNAME_LENGTH] = { 0 };
     321                        #if TRUE
     322                                ULONG nComputerNameLength = DIM(pszComputerName);
     323                                _W(GetComputerNameEx(ComputerNameDnsFullyQualified, pszComputerName, &nComputerNameLength));
     324                        #else
     325                                DWORD nComputerNameLength = DIM(pszComputerName);
     326                                _W(GetComputerName(pszComputerName, &nComputerNameLength));
     327                        #endif
     328                        sText += AtlFormatString(_T(" * ") _T("Computer Name: `%s`") _T("\r\n"), pszComputerName);
    121329                        TCHAR pszUserName[256] = { 0 };
    122                         DWORD nUserNameLength = _countof(pszUserName);
    123                         GetUserName(pszUserName, &nUserNameLength);
    124                         CString sUserName(pszUserName);
     330                        #if TRUE
     331                                ULONG nUserNameLength = DIM(pszUserName);
     332                                _W(GetUserNameEx(NameSamCompatible, pszUserName, &nUserNameLength));
     333                        #else
     334                                DWORD nUserNameLength = DIM(pszUserName);
     335                                _W(GetUserName(pszUserName, &nUserNameLength));
     336                        #endif
    125337                        BOOL bAdministrator = FALSE;
    126338                        bool bIsMember = FALSE;
    127339                        if(CAccessToken().CheckTokenMembership(Sids::Admins(), &bIsMember) && bIsMember)
    128340                                bAdministrator = TRUE;
    129                         m_sText += AtlFormatString(_T(" * ") _T("User Name: `%s` %s") _T("\r\n"), sUserName, bAdministrator ? _T("(Administrator)") : _T(""));
    130                         //SYSTEMTIME LocalTime;
    131                         //GetLocalTime(&LocalTime);
    132                         //m_sText += AtlFormatString(_T(" * ") _T("Local Time: `%s`") _T("\r\n"), _StringHelper::FormatDateTime(&LocalTime));
     341                        sText += AtlFormatString(_T(" * ") _T("User Name: `%s` %s") _T("\r\n"), pszUserName, bAdministrator ? _T("(Administrator)") : _T(""));
     342                        WCHAR pszSystemLocaleName[64] = { 0 }, pszUserLocaleName[64] = { 0 };
     343                        _W(GetSystemDefaultLocaleName(pszSystemLocaleName, DIM(pszSystemLocaleName)));
     344                        _W(GetUserDefaultLocaleName(pszUserLocaleName, DIM(pszUserLocaleName)));
     345                        sText += AtlFormatString(_T(" * ") _T("Locale: System `%ls`, User `%ls`") _T("\r\n"), pszSystemLocaleName, pszUserLocaleName);
     346                        SYSTEMTIME LocalTime;
     347                        GetLocalTime(&LocalTime);
     348                        sText += AtlFormatString(_T(" * ") _T("Local Time: `%s`") _T("\r\n"), _StringHelper::FormatDateTime(&LocalTime));
    133349                        SYSTEM_INFO SystemInformation;
    134350                        GetSystemInfo(&SystemInformation);
     
    150366                        }
    151367                        #if defined(_WIN64)
    152                                 m_sText += AtlFormatString(_T(" * ") _T("Architecture: %s (x64 Application)") _T("\r\n"), sArchitecture);
     368                                sText += AtlFormatString(_T(" * ") _T("Architecture: %s (x64 Application)") _T("\r\n"), sArchitecture);
    153369                        #else
    154                                 m_sText += AtlFormatString(_T(" * ") _T("Architecture: %s") _T("\r\n"), sArchitecture);
     370                                sText += AtlFormatString(_T(" * ") _T("Architecture: %s") _T("\r\n"), sArchitecture);
    155371                        #endif // defined(_WIN64)
    156372                        #pragma endregion
    157                         m_sText += AtlFormatString(_T(" * ") _T("Processors: `%d`, Active Mask `0x%X`") _T("\r\n"), SystemInformation.dwNumberOfProcessors, SystemInformation.dwActiveProcessorMask);
    158                         m_sText += AtlFormatString(_T(" * ") _T("Page Size: `0x%X`") _T("\r\n"), SystemInformation.dwPageSize);
    159                         m_sText += AtlFormatString(_T(" * ") _T("Application Address Space: `0x%p`..`0x%p`") _T("\r\n"), SystemInformation.lpMinimumApplicationAddress, SystemInformation.lpMaximumApplicationAddress);
     373                        sText += AtlFormatString(_T(" * ") _T("Processors: `%d`, Active Mask `0x%X`") _T("\r\n"), SystemInformation.dwNumberOfProcessors, SystemInformation.dwActiveProcessorMask);
     374                        sText += AtlFormatString(_T(" * ") _T("Page Size: `0x%X`") _T("\r\n"), SystemInformation.dwPageSize);
     375                        sText += AtlFormatString(_T(" * ") _T("Application Address Space: `0x%p`..`0x%p`") _T("\r\n"), SystemInformation.lpMinimumApplicationAddress, SystemInformation.lpMaximumApplicationAddress);
     376                        #pragma region Memory
     377                        MEMORYSTATUSEX MemoryStatus = { sizeof MemoryStatus };
     378                        _W(GlobalMemoryStatusEx(&MemoryStatus));
     379                        sText += AtlFormatString(_T(" * ") _T("Physical Memory: `%s` MB") _T("\r\n"), _StringHelper::FormatNumber((LONG) (MemoryStatus.ullTotalPhys >> 20)));
     380                        sText += AtlFormatString(_T(" * ") _T("Committed Memory Limit: `%s` MB") _T("\r\n"), _StringHelper::FormatNumber((LONG) (MemoryStatus.ullTotalPageFile >> 20)));
     381                        #pragma endregion
     382                        sText += AtlFormatString(_T(" * ") _T("Application Version: `%s`") _T("\r\n"), _VersionInfoHelper::GetVersionString(_VersionInfoHelper::GetFileVersion(_VersionInfoHelper::GetModulePath())));
     383                        //sText += _T("\r\n");
    160384                        #pragma region CPU Identification and Features
    161385                        _ATLTRY
    162386                        {
    163 //                              CRoArrayT<CString> Array;
     387                                CRoArrayT<CString> Array;
    164388                                // NOTE: __cpuid, __cpuidex https://msdn.microsoft.com/en-us/library/hskdteyh.aspx
    165389                                //       http://stackoverflow.com/questions/6121792/how-to-check-if-a-cpu-supports-the-sse3-instruction-set
     390                                //               https://docs.microsoft.com/en-us/cpp/intrinsics/cpuid-cpuidex
     391                                //               https://en.wikipedia.org/wiki/CPUID
    166392                                INT pnInformation[4] = { -1 };
    167393                                __cpuid(pnInformation, 0);
     
    176402                                *reinterpret_cast<INT*>(pszVendor + 4) = pnData[3];
    177403                                *reinterpret_cast<INT*>(pszVendor + 8) = pnData[2];
    178 //                              Array.Add(AtlFormatString(_T("`%hs`"), pszVendor));
     404                                Array.Add(AtlFormatString(_T("`%hs`"), pszVendor));
    179405                                #pragma endregion
    180 /*
    181406                                INT n1Ecx = 0, n1Edx = 0;
    182407                                if(nIdentifierCount >= 1)
     
    231456                                        }
    232457                                }
    233 */
    234458                                __cpuid(pnInformation, 0x80000000);
    235459                                const UINT nExtendedIdentifierCount = (UINT) pnInformation[0];
     
    249473                                {
    250474                                        memcpy(pszBrand, pnExtendedData + 2 * 4, 3 * 4 * sizeof (INT));
    251 //                                      Array.Add(AtlFormatString(_T("Brand `%hs`"), pszBrand));
    252                                         m_sText += AtlFormatString(_T(" * ") _T("CPU Brand: %hs") _T("\r\n"), pszBrand);
     475                                        sText += AtlFormatString(_T(" * ") _T("CPU Brand: %hs") _T("\r\n"), pszBrand);
    253476                                }
    254477                                #pragma endregion
    255 //                              m_sText += AtlFormatString(_T(" * ") _T("CPU: %s") _T("\r\n"), _StringHelper::Join(Array, _T(", ")));
     478                                sText += AtlFormatString(_T(" * ") _T("CPUID: %s") _T("\r\n"), _StringHelper::Join(Array, _T(", ")));
    256479                        }
    257480                        _ATLCATCHALL()
     
    260483                        }
    261484                        #pragma endregion
     485                        #pragma region IsProcessorFeaturePresent
     486                        // NOTE: IsProcessorFeaturePresent function https://msdn.microsoft.com/en-us/library/windows/desktop/ms724482
     487                        {
     488                                static const CEnumerationNameT<DWORD> g_pMap[] =
     489                                {
     490                                        #define A(x) { x, #x },
     491                                        A(PF_FLOATING_POINT_PRECISION_ERRATA)
     492                                        A(PF_FLOATING_POINT_EMULATED)
     493                                        A(PF_COMPARE_EXCHANGE_DOUBLE)
     494                                        A(PF_MMX_INSTRUCTIONS_AVAILABLE)
     495                                        A(PF_PPC_MOVEMEM_64BIT_OK)
     496                                        A(PF_ALPHA_BYTE_INSTRUCTIONS)
     497                                        A(PF_XMMI_INSTRUCTIONS_AVAILABLE)
     498                                        A(PF_3DNOW_INSTRUCTIONS_AVAILABLE)
     499                                        A(PF_RDTSC_INSTRUCTION_AVAILABLE)
     500                                        A(PF_PAE_ENABLED)
     501                                        A(PF_XMMI64_INSTRUCTIONS_AVAILABLE)
     502                                        A(PF_SSE_DAZ_MODE_AVAILABLE)
     503                                        A(PF_NX_ENABLED)
     504                                        A(PF_SSE3_INSTRUCTIONS_AVAILABLE)
     505                                        A(PF_COMPARE_EXCHANGE128)
     506                                        A(PF_COMPARE64_EXCHANGE128)
     507                                        A(PF_CHANNELS_ENABLED)
     508                                        A(PF_XSAVE_ENABLED)
     509                                        A(PF_ARM_VFP_32_REGISTERS_AVAILABLE)
     510                                        A(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE)
     511                                        A(PF_SECOND_LEVEL_ADDRESS_TRANSLATION)
     512                                        A(PF_VIRT_FIRMWARE_ENABLED)
     513                                        A(PF_RDWRFSGSBASE_AVAILABLE)
     514                                        A(PF_FASTFAIL_AVAILABLE)
     515                                        A(PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE)
     516                                        A(PF_ARM_64BIT_LOADSTORE_ATOMIC)
     517                                        A(PF_ARM_EXTERNAL_CACHE_AVAILABLE)
     518                                        A(PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE)
     519                                        A(PF_RDRAND_INSTRUCTION_AVAILABLE)
     520                                        A(PF_ARM_V8_INSTRUCTIONS_AVAILABLE)
     521                                        A(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)
     522                                        A(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE)
     523                                        A(PF_RDTSCP_INSTRUCTION_AVAILABLE)
     524                                        #undef A
     525                                };
     526                                sText += AtlFormatString(_T(" * ") _T("IsProcessorFeaturePresent:") _T("\r\n"));
     527                                for(auto&& Item: g_pMap)
     528                                        if(IsProcessorFeaturePresent(Item.Value))
     529                                                sText += AtlFormatString(_T("  * %hs") _T("\r\n"), Item.pszName);
     530                        }
     531                        #pragma endregion
     532                        m_sText += sText;
    262533                }
    263534                m_sText += _T("\r\n");
     
    268539                ATLVERIFY(pLogicalProcessorInformation.AllocateBytes(nSize));
    269540                ATLENSURE_THROW(GetLogicalProcessorInformation(pLogicalProcessorInformation, &nSize), AtlHresultFromLastError());
    270                 static const VALUENAME g_pLogicalProcessorRelationshipNames[] =
     541                static const CEnumerationNameT<LOGICAL_PROCESSOR_RELATIONSHIP> g_pLogicalProcessorRelationshipMap[] =
    271542                {
    272                         { RelationProcessorCore, _T("RelationProcessorCore") },
    273                         { RelationNumaNode, _T("RelationNumaNode") },
    274                         { RelationCache, _T("RelationCache") },
    275                         { RelationProcessorPackage, _T("RelationProcessorPackage") },
    276                         { RelationGroup, _T("RelationGroup") },
    277                         //{ RelationAll,
    278                         { 0, NULL }
    279                 };
    280                 static const VALUENAME g_pProcessorCacheTypeNames[] =
    281                 {
    282                         { CacheUnified, _T("CacheUnified") },
    283                         { CacheInstruction, _T("CacheInstruction") },
    284                         { CacheData, _T("CacheData") },
    285                         { CacheTrace, _T("CacheTrace") },
    286                         { 0, NULL }
     543                        #define A(x) { x, #x },
     544                        A(RelationProcessorCore)
     545                        A(RelationNumaNode)
     546                        A(RelationCache)
     547                        A(RelationProcessorPackage)
     548                        A(RelationGroup)
     549                        //A(RelationAll)
     550                        #undef A
    287551                };
    288552                m_sText.Append(_T("## Logical Processors") _T("\r\n"));
    289553                m_sText.Append(_T("\r\n"));
    290                 ATLTRACE2(atlTraceGeneral, 4, _T("nSize %d, sizeof (SYSTEM_LOGICAL_PROCESSOR_INFORMATION) %d\n"), nSize, sizeof (SYSTEM_LOGICAL_PROCESSOR_INFORMATION));
     554                _Z4(atlTraceGeneral, 4, _T("nSize %d, sizeof (SYSTEM_LOGICAL_PROCESSOR_INFORMATION) %d\n"), nSize, sizeof (SYSTEM_LOGICAL_PROCESSOR_INFORMATION));
    291555                CAtlMap<LOGICAL_PROCESSOR_RELATIONSHIP, UINT> RelationshipMap;
    292556                RelationshipMap[RelationProcessorCore] = 0;
     
    297561                for(const SYSTEM_LOGICAL_PROCESSOR_INFORMATION* pCurrentLogicalProcessorInformation = pLogicalProcessorInformation; (const BYTE*) (pCurrentLogicalProcessorInformation + 1) <= (const BYTE*) ((const SYSTEM_LOGICAL_PROCESSOR_INFORMATION*) pLogicalProcessorInformation) + nSize; pCurrentLogicalProcessorInformation++)
    298562                {
    299                         ATLTRACE2(atlTraceGeneral, 4, _T("pCurrentLogicalProcessorInformation 0x%p\n"), pCurrentLogicalProcessorInformation);
    300                         m_sText.AppendFormat(_T("Mask: 0x%08x\r\n"), pCurrentLogicalProcessorInformation->ProcessorMask);
    301                         m_sText.AppendFormat(_T("Relationship: %s\r\n"), NameFromValue(pCurrentLogicalProcessorInformation->Relationship, g_pLogicalProcessorRelationshipNames));
     563                        _Z4(atlTraceGeneral, 4, _T("pCurrentLogicalProcessorInformation 0x%p\n"), pCurrentLogicalProcessorInformation);
     564                        m_sText.AppendFormat(_T("Record %s (0x%02X)") _T("\r\n"), FormatEnumerationT(g_pLogicalProcessorRelationshipMap, pCurrentLogicalProcessorInformation->Relationship), pCurrentLogicalProcessorInformation->ProcessorMask);
     565                        m_sText += _T("\r\n");
     566                        #pragma region RelationProcessorCore
    302567                        if(pCurrentLogicalProcessorInformation->Relationship == RelationProcessorCore)
    303568                        {
    304                                 m_sText.AppendFormat(_T("ProcessorCore.Flags: 0x%02x\r\n"), pCurrentLogicalProcessorInformation->ProcessorCore.Flags);
     569                                static const CFlagNameT<BYTE> g_pFlagMap[] =
     570                                {
     571                                        #define A(x) { x, #x },
     572                                        A(LTP_PC_SMT)
     573                                        #undef A
     574                                };
     575                                m_sText.AppendFormat(_T("  * ProcessorCore.Flags: %s") _T("\r\n"), FormatFlagsT(g_pFlagMap, pCurrentLogicalProcessorInformation->ProcessorCore.Flags));
     576                                m_sText += _T("\r\n");
    305577                                RelationshipMap[RelationProcessorCore]++;
    306578                        }
     579                        #pragma endregion
     580                        #pragma region RelationNumaNode
    307581                        if(pCurrentLogicalProcessorInformation->Relationship == RelationNumaNode)
    308582                        {
    309                                 m_sText.AppendFormat(_T("NumaNode.NodeNumber: 0x%x\r\n"), pCurrentLogicalProcessorInformation->NumaNode.NodeNumber);
     583                                m_sText.AppendFormat(_T("  * NumaNode.NodeNumber: 0x%X\r\n"), pCurrentLogicalProcessorInformation->NumaNode.NodeNumber);
     584                                m_sText += _T("\r\n");
    310585                                RelationshipMap[RelationNumaNode]++;
    311586                        }
     587                        #pragma endregion
     588                        #pragma region RelationCache
    312589                        if(pCurrentLogicalProcessorInformation->Relationship == RelationCache)
    313590                        {
    314                                 m_sText.AppendFormat(_T("Cache.Level: %d\r\n"), pCurrentLogicalProcessorInformation->Cache.Level);
    315                                 m_sText.AppendFormat(_T("Cache.Associativity: %d\r\n"), pCurrentLogicalProcessorInformation->Cache.Associativity);
    316                                 m_sText.AppendFormat(_T("Cache.LineSize: %d (0x%x)\r\n"), pCurrentLogicalProcessorInformation->Cache.LineSize, pCurrentLogicalProcessorInformation->Cache.LineSize);
    317                                 m_sText.AppendFormat(_T("Cache.Size: %d (0x%x)\r\n"), pCurrentLogicalProcessorInformation->Cache.Size, pCurrentLogicalProcessorInformation->Cache.Size);
    318                                 m_sText.AppendFormat(_T("Cache.Type: %s\r\n"), NameFromValue(pCurrentLogicalProcessorInformation->Cache.Type, g_pProcessorCacheTypeNames));
     591                                static const CEnumerationNameT<BYTE> g_pAssociativityMap[] =
     592                                {
     593                                        #define A(x) { x, #x },
     594                                        A(CACHE_FULLY_ASSOCIATIVE)
     595                                        #undef A
     596                                };
     597                                static const CEnumerationNameT<PROCESSOR_CACHE_TYPE> g_pTypeMap[] =
     598                                {
     599                                        #define A(x) { x, #x },
     600                                        A(CacheUnified)
     601                                        A(CacheInstruction)
     602                                        A(CacheData)
     603                                        A(CacheTrace)
     604                                        #undef A
     605                                };
     606                                m_sText.AppendFormat(_T("  * Cache.Level: %d") _T("\r\n"), pCurrentLogicalProcessorInformation->Cache.Level);
     607                                m_sText.AppendFormat(_T("  * Cache.Associativity: %s") _T("\r\n"), FormatEnumerationT(g_pAssociativityMap, pCurrentLogicalProcessorInformation->Cache.Associativity));
     608                                m_sText.AppendFormat(_T("  * Cache.LineSize: %d (0x%X)") _T("\r\n"), pCurrentLogicalProcessorInformation->Cache.LineSize, pCurrentLogicalProcessorInformation->Cache.LineSize);
     609                                m_sText.AppendFormat(_T("  * Cache.Size: %d (0x%X)") _T("\r\n"), pCurrentLogicalProcessorInformation->Cache.Size, pCurrentLogicalProcessorInformation->Cache.Size);
     610                                m_sText.AppendFormat(_T("  * Cache.Type: %s") _T("\r\n"), FormatEnumerationT(g_pTypeMap, pCurrentLogicalProcessorInformation->Cache.Type));
     611                                m_sText += _T("\r\n");
    319612                                RelationshipMap[RelationCache]++;
    320613                        }
     614                        #pragma endregion
     615                        #pragma region RelationProcessorPackage
    321616                        if(pCurrentLogicalProcessorInformation->Relationship == RelationProcessorPackage)
    322617                                RelationshipMap[RelationProcessorPackage]++;
     618                        #pragma endregion
     619                        #pragma region RelationGroup
    323620                        if(pCurrentLogicalProcessorInformation->Relationship == RelationGroup)
    324621                                RelationshipMap[RelationGroup]++;
    325                         m_sText.Append(_T("\r\n"));
     622                        #pragma endregion
    326623                }
     624                #pragma region Summary
    327625                m_sText.Append(_T("### Record Count per Relationship") _T("\r\n") _T("\r\n"));
    328                 m_sText.AppendFormat(_T(" *  %s: `%d`\r\n"), NameFromValue(RelationProcessorCore, g_pLogicalProcessorRelationshipNames), RelationshipMap[RelationProcessorCore]);
    329                 m_sText.AppendFormat(_T(" *  %s: `%d`\r\n"), NameFromValue(RelationNumaNode, g_pLogicalProcessorRelationshipNames), RelationshipMap[RelationNumaNode]);
    330                 m_sText.AppendFormat(_T(" *  %s: `%d`\r\n"), NameFromValue(RelationCache, g_pLogicalProcessorRelationshipNames), RelationshipMap[RelationCache]);
    331                 m_sText.AppendFormat(_T(" *  %s: `%d`\r\n"), NameFromValue(RelationProcessorPackage, g_pLogicalProcessorRelationshipNames), RelationshipMap[RelationProcessorPackage]);
    332                 m_sText.AppendFormat(_T(" *  %s: `%d`\r\n"), NameFromValue(RelationGroup, g_pLogicalProcessorRelationshipNames), RelationshipMap[RelationGroup]);
     626                m_sText.AppendFormat(_T(" *  %s: %d") _T("\r\n"), FormatEnumerationT(g_pLogicalProcessorRelationshipMap, RelationProcessorCore), RelationshipMap[RelationProcessorCore]);
     627                m_sText.AppendFormat(_T(" *  %s: %d") _T("\r\n"), FormatEnumerationT(g_pLogicalProcessorRelationshipMap, RelationNumaNode), RelationshipMap[RelationNumaNode]);
     628                m_sText.AppendFormat(_T(" *  %s: %d") _T("\r\n"), FormatEnumerationT(g_pLogicalProcessorRelationshipMap, RelationCache), RelationshipMap[RelationCache]);
     629                m_sText.AppendFormat(_T(" *  %s: %d") _T("\r\n"), FormatEnumerationT(g_pLogicalProcessorRelationshipMap, RelationProcessorPackage), RelationshipMap[RelationProcessorPackage]);
     630                m_sText.AppendFormat(_T(" *  %s: %d") _T("\r\n"), FormatEnumerationT(g_pLogicalProcessorRelationshipMap, RelationGroup), RelationshipMap[RelationGroup]);
    333631                m_sText += _T("\r\n");
     632                #pragma endregion
    334633        }
    335 
    336 // Window message handlers
     634        VOID UpdateControls()
     635        {
     636        }
     637
     638// Window Message Handler
    337639        LRESULT OnInitDialog(HWND, LPARAM)
    338640        {
    339641                Initialize();
    340642                DlgResize_Init(FALSE);
     643                SetIcon(AtlLoadIconImage(IDI_MODULE, LR_DEFAULTCOLOR, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)), TRUE);
     644                SetIcon(AtlLoadIconImage(IDI_MODULE, LR_DEFAULTCOLOR, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)), FALSE);
     645                CMenuHandle Menu = GetSystemMenu(FALSE);
     646                _W(Menu.AppendMenu(MF_SEPARATOR));
     647                _W(Menu.AppendMenu(MF_STRING, ID_APP_ABOUT, _T("&About...")));
     648                CAboutDialog::UpdateCaption(*this);
    341649                m_TextEdit = GetDlgItem(IDC_TEXT);
     650                m_TextFont = m_DpiAwareness.ScaleFont(m_TextEdit.GetFont(), 11);
     651                m_TextEdit.SetFont(m_TextFont);
    342652                m_TextEdit.SetWindowText(m_sText);
    343                 SetIcon(AtlLoadIconImage(IDR_MAINFRAME, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR), TRUE);
    344                 //SetIcon(AtlLoadIconImage(IDR_MAINFRAME, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR), FALSE);
    345                 ATLVERIFY(CenterWindow());
     653                m_UpdateButton = GetDlgItem(IDC_UPDATE);
     654                m_SubmitButton = GetDlgItem(IDC_SUBMIT);
     655                m_SaveAsButton = GetDlgItem(IDC_SAVEAS);
     656                m_CloseButton = GetDlgItem(IDOK);
     657                m_ButtonFont = m_DpiAwareness.ScaleFont(GetFont(), 9);
     658                m_UpdateButton.SetFont(m_ButtonFont);
     659                m_SubmitButton.SetFont(m_ButtonFont);
     660                m_SaveAsButton.SetFont(m_ButtonFont);
     661                m_CloseButton.SetFont(m_ButtonFont);
     662                #pragma region Position
     663                {
     664                        CRect Position;
     665                        _W(GetWindowRect(Position));
     666                        const HMONITOR hMonitor = MonitorFromPoint(Position.CenterPoint(), MONITOR_DEFAULTTONEAREST);
     667                        MONITORINFO Information = { sizeof Information };
     668                        if(GetMonitorInfo(hMonitor, &Information))
     669                        {
     670                                CSize DefaultExtent = reinterpret_cast<const CRect&>(Information.rcWork).Size();
     671                                DefaultExtent.cx = DefaultExtent.cx * 6 / 8;
     672                                DefaultExtent.cy = DefaultExtent.cy * 6 / 8;
     673                                BOOL bUpdate = FALSE;
     674                                CSize ExcessExtent(DefaultExtent.cx - Position.Width(), DefaultExtent.cy - Position.Height());
     675                                if(ExcessExtent.cx > 0)
     676                                {
     677                                        Position.left -= ExcessExtent.cx / 2;
     678                                        Position.right = Position.left + DefaultExtent.cx;
     679                                        bUpdate = TRUE;
     680                                }
     681                                if(ExcessExtent.cy > 0)
     682                                {
     683                                        Position.top -= ExcessExtent.cy / 2;
     684                                        Position.bottom = Position.top + DefaultExtent.cy;
     685                                        bUpdate = TRUE;
     686                                }
     687                                if(bUpdate)
     688                                        _W(MoveWindow(Position, FALSE));
     689                        }
     690                }
     691                _W(CenterWindow());
     692                #pragma endregion
     693                UpdateControls();
    346694                return TRUE;
    347695        }
    348696        LRESULT OnCommand(UINT, INT nIdentifier, HWND)
    349697        {
    350                 ATLVERIFY(EndDialog(nIdentifier));
     698                _W(EndDialog(nIdentifier));
     699                return 0;
     700        }
     701        LRESULT OnSubmit(UINT, INT nIdentifier, HWND)
     702        {
     703                CWaitCursor WaitCursor;
     704                const CString sFileDescription = _VersionInfoHelper::GetString(_VersionInfoHelper::GetModulePath(), _T("FileDescription"));
     705                CWinHttpPostData PostData;
     706                PostData.AddValue(_T("subj"), sFileDescription);
     707                CStringA sTextA = Utf8StringFromString(m_TextEdit.GetValue());
     708                static const UINT g_nFlags = _Base64Helper::FLAG_NOPAD | _Base64Helper::FLAG_NOCRLF;
     709                #if TRUE
     710                        CStringA sBodyTextA = sTextA;
     711                        static const SIZE_T g_nMaximalBodyLength = 24 << 10; // 24 KB
     712                        if(sBodyTextA.GetLength() > (INT) g_nMaximalBodyLength)
     713                        {
     714                                sBodyTextA = sBodyTextA.Left((INT) g_nMaximalBodyLength);
     715                                sBodyTextA += "\r\n";
     716                                sBodyTextA += AtlFormatStringT<CStringA>("<%d more characters truncated>", sTextA.GetLength() - sBodyTextA.GetLength()) + "\r\n";
     717                                PostData.AddValue(_T("body"), CString(_Base64Helper::Encode<CStringA>((const BYTE*) (LPCSTR) sBodyTextA, sBodyTextA.GetLength(), g_nFlags)));
     718                                #pragma region Bzip2 Body
     719                                //_ATLTRY
     720                                //{
     721                                //      CLocalObjectPtr<CBzip2Item> pItem;
     722                                //      pItem->SetRawData((const BYTE*) (LPCSTR) sTextA, sTextA.GetLength());
     723                                //      CComBSTR sDataText;
     724                                //      __C(pItem->get_DataText(&sDataText));
     725                                //      #if defined(_DEBUG) && FALSE
     726                                //              COMPILER_MESSAGE("Debug: Write Base64 Bzip2 Output to File")
     727                                //              CPath sPath;
     728                                //              sPath.Combine(GetPathDirectory(GetModulePath()), _T("Output.bz2.b64"));
     729                                //              CAtlFile File;
     730                                //              _V(File.Create(sPath, GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS));
     731                                //              _V(File.Write(CStringA(sDataText), sDataText.Length()));
     732                                //      #endif // defined(_DEBUG)
     733                                //      PostData.AddValue(_T("attachment_0_body"), sDataText);
     734                                //      PostData.AddValue(_T("attachment_0_filename"), _T("body.md.bz2"));
     735                                //      PostData.AddValue(_T("attachment_count"), _T("1"));
     736                                //}
     737                                //_ATLCATCHALL()
     738                                //{
     739                                //      _Z_EXCEPTION();
     740                                //}
     741                                #pragma endregion
     742                        } else
     743                                PostData.AddValue(_T("body"), CString(_Base64Helper::Encode<CStringA>((const BYTE*) (LPCSTR) sTextA, sTextA.GetLength(), g_nFlags)));
     744                #else
     745                        PostData.AddValue(_T("body"), CString(_Base64Helper::Encode<CStringA>((const BYTE*) (LPCSTR) sTextA, sTextA.GetLength(), g_nFlags)));
     746                #endif
     747                #if defined(_DEBUG)
     748                        PostData.AddValue(_T("debug"), _T("1"));
     749                #endif // defined(_DEBUG)
     750                CWinHttpSessionHandle Session = OpenWinHttpSessionHandle(sFileDescription);
     751                __E(Session);
     752                CWinHttpConnectionHandle Connection = Session.Connect(CStringW(_T("alax.info")));
     753                __E(Connection);
     754                CWinHttpRequestHandle Request = Connection.OpenRequest(CStringW(_T("POST")), CStringW(_T("/post.php")));
     755                __E(Request);
     756                CStringW sPostHeaders = PostData.GetHeaders();
     757                CStringA sPostData(PostData.GetValue());
     758                __E(Request.Send(sPostHeaders, -1, const_cast<LPSTR>((LPCSTR) sPostData), sPostData.GetLength(), sPostData.GetLength()));
     759                __E(Request.ReceiveResponse());
     760                DWORD nStatusCode = 0;
     761                __E(Request.QueryNumberHeader(WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, nStatusCode));
     762                __D(nStatusCode / 100 == HTTP_STATUS_OK / 100, E_UNNAMED);
     763                MessageBeep(MB_OK);
     764                UpdateControls();
     765                return 0;
     766        }
     767        LRESULT OnSaveAs(UINT, INT nIdentifier, HWND)
     768        {
     769                CWaitCursor WaitCursor;
     770                const CStringA sTextA = Utf8StringFromString(m_TextEdit.GetValue());
     771                static const COMDLG_FILTERSPEC g_pFilter[] =
     772                {
     773                        { _T("Markdown Files"), _T("*.md") },
     774                        //{ _T("Markdown Files, Bzip2 Compressed"), _T("*.md.bz2") },
     775                        { _T("All Files"), _T("*.*") },
     776                };
     777                const CPath sPath = _CommonDialogHelper::QuerySavePath(m_hWnd, g_pFilter, _T("md"), _T("Output.md"));
     778                if(!_tcslen(sPath))
     779                        return 0;
     780                LPCTSTR pszExtension = FindExtension(sPath);
     781                CAtlFile File;
     782                __C(File.Create(sPath, GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS));
     783                _ATLTRY
     784                {
     785                        //if(_tcsicmp(pszExtension, _T(".bz2")) == 0)
     786                        //{
     787                        //      CLocalObjectPtr<CBzip2Item> pItem;
     788                        //      pItem->SetRawData((const BYTE*) (LPCSTR) sTextA, sTextA.GetLength());
     789                        //      CHeapPtr<BYTE> pnData;
     790                        //      SIZE_T nDataSize;
     791                        //      pItem->GetData(pnData, nDataSize);
     792                        //      __C(File.Write(pnData, (DWORD) nDataSize));
     793                        //} else
     794                        {
     795                                __C(File.Write(sTextA, sTextA.GetLength() * sizeof (CHAR)));
     796                        }
     797                }
     798                _ATLCATCHALL()
     799                {
     800                        File.Close();
     801                        DeleteFile(sPath);
     802                        _ATLRETHROW;
     803                }
    351804                return 0;
    352805        }
  • trunk/Utilities/LogicalProcessorInformation/Module.rc

    r506 r795  
    5454// Icon with lowest ID value placed first to ensure application icon
    5555// remains consistent on all systems.
    56 IDR_MAINFRAME           ICON                    "Module.ico"
     56IDI_MODULE           ICON                    "Module.ico"
    5757
    5858/////////////////////////////////////////////////////////////////////////////
     
    6767BEGIN
    6868    EDITTEXT        IDC_TEXT,6,6,324,186,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP
     69    PUSHBUTTON      "&Update",IDC_UPDATE,108,198,50,14,NOT WS_VISIBLE
     70    PUSHBUTTON      "S&ubmit",IDC_SUBMIT,162,198,50,14
     71    PUSHBUTTON      "&Save As...",IDC_SAVEAS,216,198,50,14
    6972    DEFPUSHBUTTON   "Close",IDOK,276,198,50,14
    7073END
     
    9295/////////////////////////////////////////////////////////////////////////////
    9396//
    94 // Accelerator
    95 //
    96 
    97 IDR_MAINFRAME ACCELERATORS
    98 BEGIN
    99     "N",            ID_FILE_NEW,            VIRTKEY, CONTROL
    100     "O",            ID_FILE_OPEN,           VIRTKEY, CONTROL
    101     "S",            ID_FILE_SAVE,           VIRTKEY, CONTROL
    102     "P",            ID_FILE_PRINT,          VIRTKEY, CONTROL
    103     "Z",            ID_EDIT_UNDO,           VIRTKEY, CONTROL
    104     "X",            ID_EDIT_CUT,            VIRTKEY, CONTROL
    105     "C",            ID_EDIT_COPY,           VIRTKEY, CONTROL
    106     "V",            ID_EDIT_PASTE,          VIRTKEY, CONTROL
    107     VK_BACK,        ID_EDIT_UNDO,           VIRTKEY, ALT
    108     VK_DELETE,      ID_EDIT_CUT,            VIRTKEY, SHIFT
    109     VK_INSERT,      ID_EDIT_COPY,           VIRTKEY, CONTROL
    110     VK_INSERT,      ID_EDIT_PASTE,          VIRTKEY, SHIFT
    111     VK_F6,          ID_NEXT_PANE,           VIRTKEY
    112     VK_F6,          ID_PREV_PANE,           VIRTKEY, SHIFT
    113 END
    114 
    115 
    116 /////////////////////////////////////////////////////////////////////////////
    117 //
    11897// Version
    11998//
    12099
    121100VS_VERSION_INFO VERSIONINFO
    122  FILEVERSION  1, 0, 0, 59
     101 FILEVERSION  1, 0, 0, 78
    123102 PRODUCTVERSION 1,0,0,1
    124103 FILEFLAGSMASK 0x3fL
     
    137116        BEGIN
    138117            VALUE "Comments", "Created by Roman Ryltsov roman@alax.info"
    139             VALUE "CompanyName", "Alax.Info"
    140             VALUE "FileDescription", "LogicalProcessorInformation Module"
    141             VALUE "FileVersion",  "1, 0, 0, 59\0"
     118            VALUE "CompanyName", "Roman Ryltsov"
     119            VALUE "FileDescription", "Alax.Info Logical Processor Information Utility"
     120            VALUE "FileVersion",  "1, 0, 0, 78\0"
    142121            VALUE "InternalName", "LogicalProcessorInformation"
    143             VALUE "LegalCopyright", "Copyright (C) Alax.Info, 2006-2011"
     122            VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2006-2017"
    144123            VALUE "OriginalFilename", "LogicalProcessorInformation.exe"
    145             VALUE "ProductName", "LogicalProcessorInformation Module"
     124            VALUE "ProductName", "Alax.Info Logical Processor Information"
    146125            VALUE "ProductVersion", "1, 0, 0, 1"
    147126        END
     
    158137// String Table
    159138//
    160 
    161 STRINGTABLE
    162 BEGIN
    163     IDR_MAINFRAME           "LogicalProcessorInformation"
    164 END
    165139
    166140STRINGTABLE
  • trunk/Utilities/LogicalProcessorInformation/resource.h

    r506 r795  
    11//{{NO_DEPENDENCIES}}
    22// Microsoft Visual C++ generated include file.
    3 // Used by LogicalProcessorInformation.rc
     3// Used by Module.rc
    44//
    5 #define IDR_MAINFRAME                   128
    6 #define IDD_MAINDLG                     129
    7 #define IDD_MAIN                        129
    8 #define IDC_TEXT                        1000
    9 #define IDC_COMBO1                      1001
    10 #define IDC_MODE                        1001
     5#define IDI_MODULE                                              100
     6#define IDD_MAIN                        1000
     7#define IDC_TEXT                        1010
     8#define IDC_UPDATE                      1015
     9#define IDC_SUBMIT                      1016
     10#define IDC_SAVEAS                      1017
     11#define IDD_ABOUT                       29900
     12#define IDC_ABOUT_ICON                  29901
     13#define IDC_ABOUT_TITLE                 29902
     14#define IDC_ABOUT_PRODUCTVERSION        29903
     15#define IDC_ABOUT_FILEVERSION           29904
     16#define IDC_ABOUT_WEBSITETITLE          29905
     17#define IDC_ABOUT_WEBSITE               29906
     18#define IDC_ABOUT_EMAILTITLE            29907
     19#define IDC_ABOUT_EMAIL                 29908
     20#define IDC_ABOUT_COPYRIGHT             29909
     21#define IDC_ABOUT_COPYRIGHTWARNING      29910
     22#define IDR_ABOUT_PROPERTYPAGE          29925
     23#define IDD_ABOUT_PROPERTYPAGE          29926
     24#define IDC_ABOUT_LICENSEE              29927
    1125
    1226// Next default values for new objects
     
    1630#define _APS_NEXT_RESOURCE_VALUE        201
    1731#define _APS_NEXT_COMMAND_VALUE         32772
    18 #define _APS_NEXT_CONTROL_VALUE         1002
     32#define _APS_NEXT_CONTROL_VALUE         1005
    1933#define _APS_NEXT_SYMED_VALUE           101
    2034#endif
  • trunk/Utilities/LogicalProcessorInformation/stdafx.cpp

    r506 r795  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Alax.Info, 2006-2015
    3 // http://alax.info
     2// Copyright (C) Roman Ryltsov, 2006-2017
     3// Created by Roman Ryltsov roman@alax.info
    44//
    55// A permission to use the source code is granted as long as reference to
    66// source website http://alax.info is retained.
    7 //
    8 // Created by Roman Ryltsov roman@alax.info
    97
    108#include "stdafx.h"
  • trunk/Utilities/LogicalProcessorInformation/stdafx.h

    r506 r795  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Alax.Info, 2006-2015
    3 // http://alax.info
     2// Copyright (C) Roman Ryltsov, 2006-2017
     3// Created by Roman Ryltsov roman@alax.info
    44//
    55// A permission to use the source code is granted as long as reference to
    66// source website http://alax.info is retained.
    7 //
    8 // Created by Roman Ryltsov roman@alax.info
    97
    108#pragma once
     
    1311// Windows definitions
    1412
    15 //#define STRICT
    16 #define WINVER                                          0x0501  // Windows XP
    17 #define _WIN32_WINNT                            0x0501  // Windows XP
    18 #define _WIN32_WINDOWS                          0x0410  // Windows 98
    19 #define _WIN32_IE                                       0x0501  // Internet Explorer 5.01
    20 #define _RICHEDIT_VER                           0x0200  // RichEdit 2.0
     13#include "targetver.h"
     14
    2115#define INLINE_HRESULT_FROM_WIN32
     16#define _INC_WINDOWSX
     17#define _WINSOCKAPI_ // We will want Winsock 2
     18
     19#include <windows.h>
     20#include <shellapi.h>
    2221
    2322////////////////////////////////////////////////////////////
     
    2827#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
    2928#define _ATL_ALL_WARNINGS
    30 #define _ATL_ATTRIBUTES
     29//#define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW
    3130
    32 //#include "roatltrace.h" // Replacement for <atltrace.h>
     31#include "roatltrace.h" // Replacement for <atltrace.h>
    3332#include <atlbase.h>
    3433#include <atlcom.h>
     
    4746
    4847////////////////////////////////////////////////////////////
    49 // WTL definitions
     48// WTL
    5049
    5150#define _WTL_NO_CSTRING
     
    6968// Alax.Info ATL/WTL
    7069
    71 //#define REGISTRY_PRODUCTROOT  _T("SOFTWARE\\Alax.Info\\...")
    72 //#define REGISTRY_FILEROOT             REGISTRY_PRODUCTROOT
    73 //#define REGISTRY_ROOT                 REGISTRY_FILEROOT
     70#define REGISTRY_PRODUCTROOT    _T("SOFTWARE\\Alax.Info\\Utility\\LogicalProcessorInformation")
     71#define REGISTRY_FILEROOT               REGISTRY_PRODUCTROOT
     72#define REGISTRY_ROOT                   REGISTRY_FILEROOT
    7473
    75 //#include "roatlbase.h"
    76 //#include "roatlvariants.h"
    77 //#include "roatlcom.h"
    78 //#include "roatlpersist.h"
    79 //#include "roatlmisc.h"
    80 //#include "roatlexceptionfilter.h"
    81 //#include "rowtlapp.h"
    82 //#include "rowtlcrack.h"
    83 //#include "rodialogs.h"
    84 //#include "rocontrols.h"
     74#include "roatlbase.h"
     75#include "roatlvariants.h"
     76#include "roatlcom.h"
     77#include "roatlpersist.h"
     78#include "roatlmisc.h"
     79#include "roatlexceptionfilter.h"
     80#include "rowtlapp.h"
     81#include "rowtlcrack.h"
     82#include "rodialogs.h"
     83#include "rocontrols.h"
    8584
    8685////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.