-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c279812
commit 07a3fc2
Showing
15 changed files
with
1,717 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Express 15 for Windows Desktop | ||
VisualStudioVersion = 15.0.27004.2006 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "npClient", "npClient\npClient.vcxproj", "{59443398-5751-4A8E-8C28-E1FB8D45FF96}" | ||
EndProject | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "npServer", "npServer\npServer.vcxproj", "{1093E7C7-E4DB-4B57-89F0-961ABEACCD58}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{59443398-5751-4A8E-8C28-E1FB8D45FF96}.Debug|x64.ActiveCfg = Debug|x64 | ||
{59443398-5751-4A8E-8C28-E1FB8D45FF96}.Debug|x64.Build.0 = Debug|x64 | ||
{59443398-5751-4A8E-8C28-E1FB8D45FF96}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{59443398-5751-4A8E-8C28-E1FB8D45FF96}.Debug|x86.Build.0 = Debug|Win32 | ||
{59443398-5751-4A8E-8C28-E1FB8D45FF96}.Release|x64.ActiveCfg = Release|x64 | ||
{59443398-5751-4A8E-8C28-E1FB8D45FF96}.Release|x64.Build.0 = Release|x64 | ||
{59443398-5751-4A8E-8C28-E1FB8D45FF96}.Release|x86.ActiveCfg = Release|Win32 | ||
{59443398-5751-4A8E-8C28-E1FB8D45FF96}.Release|x86.Build.0 = Release|Win32 | ||
{1093E7C7-E4DB-4B57-89F0-961ABEACCD58}.Debug|x64.ActiveCfg = Debug|x64 | ||
{1093E7C7-E4DB-4B57-89F0-961ABEACCD58}.Debug|x64.Build.0 = Debug|x64 | ||
{1093E7C7-E4DB-4B57-89F0-961ABEACCD58}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{1093E7C7-E4DB-4B57-89F0-961ABEACCD58}.Debug|x86.Build.0 = Debug|Win32 | ||
{1093E7C7-E4DB-4B57-89F0-961ABEACCD58}.Release|x64.ActiveCfg = Release|x64 | ||
{1093E7C7-E4DB-4B57-89F0-961ABEACCD58}.Release|x64.Build.0 = Release|x64 | ||
{1093E7C7-E4DB-4B57-89F0-961ABEACCD58}.Release|x86.ActiveCfg = Release|Win32 | ||
{1093E7C7-E4DB-4B57-89F0-961ABEACCD58}.Release|x86.Build.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {55E4D0C1-CE55-4166-B6F2-42814819A21F} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#pragma once | ||
|
||
#include <cstddef> | ||
#include <cstdint> | ||
#include <windows.h> | ||
#include <tchar.h> | ||
|
||
#define FOURCC(a,b,c,d) ( (uint32_t) (((d)<<24) | ((c)<<16) | ((b)<<8) | (a)) ) | ||
|
||
namespace NamepPipe | ||
{ | ||
static const LPTSTR myPipeName = TEXT("\\\\.\\pipe\\mynamedpipe"); | ||
|
||
enum npMessageType | ||
{ | ||
Request = 1, | ||
Response = 2 | ||
}; | ||
|
||
enum npStatus | ||
{ | ||
NA = 0, //not applicable | ||
OK = 1, | ||
ERR = -1 | ||
}; | ||
|
||
enum npFunction | ||
{ | ||
Reply = 0, // not applicable, the message is a reply | ||
Connect = 1, //actually not used | ||
Get = 2, | ||
Set = 3, | ||
Disconnect = 4 | ||
}; | ||
|
||
struct npProto | ||
{ | ||
npMessageType type; | ||
npStatus status; | ||
npFunction function; | ||
size_t payload_size; | ||
}; | ||
|
||
struct npObjectHeader | ||
{ | ||
uint32_t type; | ||
size_t size; | ||
}; | ||
|
||
struct npId | ||
{ | ||
npObjectHeader header; | ||
uint32_t type; | ||
uintptr_t id; | ||
}; | ||
static const npObjectHeader npIdHeader = { FOURCC('n','p','i','d'), sizeof(npId) }; | ||
|
||
struct npPerson | ||
{ | ||
npObjectHeader header; | ||
char firstName[32]; | ||
char lastName[32]; | ||
uint8_t age; | ||
}; | ||
static const npObjectHeader npPersonHeader = { FOURCC('p','e','r','s'), sizeof(npPerson) }; | ||
|
||
struct npCar | ||
{ | ||
npObjectHeader header; | ||
char make[32]; | ||
char model[32]; | ||
uint16_t yearMade; | ||
uint32_t mileage; | ||
}; | ||
static const npObjectHeader npCarHeader = { FOURCC('n','c','a','r'), sizeof(npCar) }; | ||
|
||
} //namespace NamepPipe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|x64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<VCProjectVersion>15.0</VCProjectVersion> | ||
<ProjectGuid>{59443398-5751-4A8E-8C28-E1FB8D45FF96}</ProjectGuid> | ||
<RootNamespace>NamedPipeTest</RootNamespace> | ||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v141</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="Shared"> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<OutDir>$(SolutionDir)\Build\$(Configuration)_$(Platform)\bin\</OutDir> | ||
<IntDir>$(SolutionDir)\Build\$(Configuration)_$(Platform)\obj\$(ProjectName)\</IntDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<IntDir>$(SolutionDir)\Build\$(Configuration)_$(Platform)\obj\$(ProjectName)\</IntDir> | ||
<OutDir>$(SolutionDir)\Build\$(Configuration)_$(Platform)\bin\</OutDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<OutDir>$(SolutionDir)\Build\$(Configuration)_$(Platform)\bin\</OutDir> | ||
<IntDir>$(SolutionDir)\Build\$(Configuration)_$(Platform)\obj\$(ProjectName)\</IntDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<OutDir>$(SolutionDir)\Build\$(Configuration)_$(Platform)\bin\</OutDir> | ||
<IntDir>$(SolutionDir)\Build\$(Configuration)_$(Platform)\obj\$(ProjectName)\</IntDir> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<SDLCheck>true</SDLCheck> | ||
</ClCompile> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<SDLCheck>true</SDLCheck> | ||
</ClCompile> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<SDLCheck>true</SDLCheck> | ||
</ClCompile> | ||
<Link> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<SDLCheck>true</SDLCheck> | ||
</ClCompile> | ||
<Link> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
</Link> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClCompile Include="src\npClient.cpp" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="..\include\NamedPipeTest.h" /> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Source Files"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="Header Files"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="src\npClient.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="..\include\NamedPipeTest.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.