summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Cook <[email protected]>2021-03-18 16:38:55 -0600
committerDoug Cook <[email protected]>2021-03-18 16:38:55 -0600
commit0ed5e823a263dd0d6747b2cf2ca3264b792042d2 (patch)
tree97e99b389a4d5235de9620d65b814742eaf7520f
parentb5fcd95c891f44000619c26635a483e5a7448ee1 (diff)
kcs - add sha256, cleanup, use Ctrpp task
- Set FileDigestAlgorithm=sha256 - Replace custom "Run Ctrpp" task with Ctrpp task. - Minor cleanup and comments.
-rw-r--r--general/perfcounters/kcs/kcs.c21
-rw-r--r--general/perfcounters/kcs/kcs.h8
-rw-r--r--general/perfcounters/kcs/kcs.rc2
-rw-r--r--general/perfcounters/kcs/kcs.vcxproj54
-rw-r--r--general/perfcounters/kcs/kcs.vcxproj.Filters10
5 files changed, 76 insertions, 19 deletions
diff --git a/general/perfcounters/kcs/kcs.c b/general/perfcounters/kcs/kcs.c
index ae4405b9..4c5d5f7b 100644
--- a/general/perfcounters/kcs/kcs.c
+++ b/general/perfcounters/kcs/kcs.c
@@ -25,7 +25,7 @@ Environment:
#include <wdm.h>
#include "kcs.h"
-#include "kcsCounters.h"
+#include <kcsCounters.h> // Generated by running ctrpp.exe kcs.man
#pragma code_seg("PAGE")
@@ -44,7 +44,8 @@ KcsAddGeometricInstance (
Routine Description:
- This utility function adds instance to the callback buffer.
+ This utility function computes the value of a synthetic counter
+ instance and adds the value to the PCW buffer.
Arguments:
@@ -93,7 +94,11 @@ KcsGeometricWaveCallback (
Routine Description:
- This function returns the list of counter instances and counter data.
+ This function is called by PCW.sys when a consumer is collecting data
+ from the GeometricWave counterset.
+
+ This function collects the requested information and adds it to the provided
+ buffer.
Arguments:
@@ -201,7 +206,8 @@ KcsAddTrignometricInstance (
Routine Description:
- This utility function adds instance to the callback buffer.
+ This utility function computes the value of a synthetic counter
+ instance and adds the value to the PCW buffer.
Arguments:
@@ -264,7 +270,11 @@ KcsTrignometricWaveCallback (
Routine Description:
- This function returns the list of counter instances and counter data.
+ This function is called by PCW.sys when a consumer is collecting data
+ from the TrignometricWave counterset.
+
+ This function collects the requested information and adds it to the provided
+ buffer.
Arguments:
@@ -404,4 +414,3 @@ Return Value:
return STATUS_SUCCESS;
}
-
diff --git a/general/perfcounters/kcs/kcs.h b/general/perfcounters/kcs/kcs.h
index 4d845cc3..12c1cad1 100644
--- a/general/perfcounters/kcs/kcs.h
+++ b/general/perfcounters/kcs/kcs.h
@@ -22,13 +22,13 @@ Environment:
--*/
-typedef struct _GEOMETRIC_WAVE_VALUES {
+typedef struct GEOMETRIC_WAVE_VALUES {
ULONG Square;
ULONG Triangle;
-} GEOMETRIC_WAVE_VALUES, *PGEOMETRIC_WAVE_VALUES;
+} GEOMETRIC_WAVE_VALUES;
-typedef struct _TRIGNOMETRIC_WAVE_VALUES {
+typedef struct TRIGNOMETRIC_WAVE_VALUES {
ULONG Constant;
ULONG Cosine;
ULONG Sine;
-} TRIGNOMETRIC_WAVE_VALUES, *PTRIGNOMETRIC_WAVE_VALUES; \ No newline at end of file
+} TRIGNOMETRIC_WAVE_VALUES;
diff --git a/general/perfcounters/kcs/kcs.rc b/general/perfcounters/kcs/kcs.rc
index 7c19d061..86e8008f 100644
--- a/general/perfcounters/kcs/kcs.rc
+++ b/general/perfcounters/kcs/kcs.rc
@@ -1 +1 @@
-#include "kcsCounters.rc"
+#include <kcsCounters.rc> // Generated by running ctrpp.exe kcs.man
diff --git a/general/perfcounters/kcs/kcs.vcxproj b/general/perfcounters/kcs/kcs.vcxproj
index e97abb07..6afa9d83 100644
--- a/general/perfcounters/kcs/kcs.vcxproj
+++ b/general/perfcounters/kcs/kcs.vcxproj
@@ -74,7 +74,11 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
- <ItemGroup Label="WrappedTaskItems" />
+ <ItemGroup Label="WrappedTaskItems">
+ <Ctrpp Include="kcs.man">
+ <FileType>Manifest</FileType>
+ </Ctrpp>
+ </ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>kcs</TargetName>
</PropertyGroup>
@@ -128,31 +132,65 @@
<ExceptionHandling>
</ExceptionHandling>
</ClCompile>
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ <Ctrpp>
+ <AddPrefix>Kcs</AddPrefix>
+ <HeaderFileNameForProvider>$(IntDir)%(Filename)Counters.h</HeaderFileNameForProvider>
+ <GenerateResourceSourceFile>true</GenerateResourceSourceFile>
+ <HeaderFileNameForCounter>$(IntDir)%(Filename)_counterIds.h</HeaderFileNameForCounter>
+ <ResourceFileName>$(IntDir)%(Filename)Counters.rc</ResourceFileName>
+ </Ctrpp>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<ExceptionHandling>
</ExceptionHandling>
</ClCompile>
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ <Ctrpp>
+ <AddPrefix>Kcs</AddPrefix>
+ <HeaderFileNameForProvider>$(IntDir)%(Filename)Counters.h</HeaderFileNameForProvider>
+ <GenerateResourceSourceFile>true</GenerateResourceSourceFile>
+ <HeaderFileNameForCounter>$(IntDir)%(Filename)_counterIds.h</HeaderFileNameForCounter>
+ <ResourceFileName>$(IntDir)%(Filename)Counters.rc</ResourceFileName>
+ </Ctrpp>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<ExceptionHandling>
</ExceptionHandling>
</ClCompile>
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ <Ctrpp>
+ <AddPrefix>Kcs</AddPrefix>
+ <HeaderFileNameForProvider>$(IntDir)%(Filename)Counters.h</HeaderFileNameForProvider>
+ <GenerateResourceSourceFile>true</GenerateResourceSourceFile>
+ <HeaderFileNameForCounter>$(IntDir)%(Filename)_counterIds.h</HeaderFileNameForCounter>
+ <ResourceFileName>$(IntDir)%(Filename)Counters.rc</ResourceFileName>
+ </Ctrpp>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<ExceptionHandling>
</ExceptionHandling>
</ClCompile>
+ <DriverSign>
+ <FileDigestAlgorithm>sha256</FileDigestAlgorithm>
+ </DriverSign>
+ <Ctrpp>
+ <AddPrefix>Kcs</AddPrefix>
+ <HeaderFileNameForProvider>$(IntDir)%(Filename)Counters.h</HeaderFileNameForProvider>
+ <GenerateResourceSourceFile>true</GenerateResourceSourceFile>
+ <HeaderFileNameForCounter>$(IntDir)%(Filename)_counterIds.h</HeaderFileNameForCounter>
+ <ResourceFileName>$(IntDir)%(Filename)Counters.rc</ResourceFileName>
+ </Ctrpp>
</ItemDefinitionGroup>
- <Target Name="Run Ctrpp" BeforeTargets="ClCompile">
- <PropertyGroup>
- <CTRPP_ODIR>$([System.IO.Path]::GetDirectoryName($(ProjectDir)\$(IntDir)))</CTRPP_ODIR>
- </PropertyGroup>
- <Exec Command="&quot;ctrpp.exe&quot; kcs.man -prefix Kcs -o &quot;$(CTRPP_ODIR)\KcsCounters.h&quot; -ch &quot;$(CTRPP_ODIR)\KcsCounters_counters.h&quot; -rc &quot;$(CTRPP_ODIR)\KcsCounters.rc&quot;" WorkingDirectory="$(MSBuildProjectDirectory)" />
- </Target>
<ItemGroup>
<ClCompile Include="Kcs.c" />
<ResourceCompile Include="Kcs.rc" />
@@ -170,4 +208,4 @@
<ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
+</Project> \ No newline at end of file
diff --git a/general/perfcounters/kcs/kcs.vcxproj.Filters b/general/perfcounters/kcs/kcs.vcxproj.Filters
index 0a2b4eef..c4daa27c 100644
--- a/general/perfcounters/kcs/kcs.vcxproj.Filters
+++ b/general/perfcounters/kcs/kcs.vcxproj.Filters
@@ -28,4 +28,14 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <Ctrpp Include="kcs.man">
+ <Filter>Resource Files</Filter>
+ </Ctrpp>
+ </ItemGroup>
</Project> \ No newline at end of file