Skip to content

Commit 0bb7a57

Browse files
author
Kevin Welton
committed
Windows 10 Creator's Update SDK preview release
1 parent 7500c0e commit 0bb7a57

File tree

1,570 files changed

+1044150
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,570 files changed

+1044150
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsyncReader", "AsyncReader.vcxproj", "{079790FD-97A0-428D-BF8D-83D24C1D6A56}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Debug|x86 = Debug|x86
12+
Release|x64 = Release|x64
13+
Release|x86 = Release|x86
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{079790FD-97A0-428D-BF8D-83D24C1D6A56}.Debug|x64.ActiveCfg = Debug|x64
17+
{079790FD-97A0-428D-BF8D-83D24C1D6A56}.Debug|x64.Build.0 = Debug|x64
18+
{079790FD-97A0-428D-BF8D-83D24C1D6A56}.Debug|x86.ActiveCfg = Debug|Win32
19+
{079790FD-97A0-428D-BF8D-83D24C1D6A56}.Debug|x86.Build.0 = Debug|Win32
20+
{079790FD-97A0-428D-BF8D-83D24C1D6A56}.Release|x64.ActiveCfg = Release|x64
21+
{079790FD-97A0-428D-BF8D-83D24C1D6A56}.Release|x64.Build.0 = Release|x64
22+
{079790FD-97A0-428D-BF8D-83D24C1D6A56}.Release|x86.ActiveCfg = Release|Win32
23+
{079790FD-97A0-428D-BF8D-83D24C1D6A56}.Release|x86.Build.0 = Release|Win32
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
EndGlobal
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|x64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release|Win32">
13+
<Configuration>Release</Configuration>
14+
<Platform>Win32</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<ProjectGuid>{079790FD-97A0-428D-BF8D-83D24C1D6A56}</ProjectGuid>
23+
<Keyword>Win32Proj</Keyword>
24+
<RootNamespace>Console</RootNamespace>
25+
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
26+
</PropertyGroup>
27+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
29+
<ConfigurationType>Application</ConfigurationType>
30+
<UseDebugLibraries>true</UseDebugLibraries>
31+
<PlatformToolset>v140</PlatformToolset>
32+
<CharacterSet>Unicode</CharacterSet>
33+
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>true</UseDebugLibraries>
38+
<PlatformToolset>v140</PlatformToolset>
39+
<CharacterSet>Unicode</CharacterSet>
40+
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>false</UseDebugLibraries>
45+
<PlatformToolset>v140</PlatformToolset>
46+
<WholeProgramOptimization>true</WholeProgramOptimization>
47+
<CharacterSet>Unicode</CharacterSet>
48+
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
49+
</PropertyGroup>
50+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
51+
<ConfigurationType>Application</ConfigurationType>
52+
<UseDebugLibraries>false</UseDebugLibraries>
53+
<PlatformToolset>v140</PlatformToolset>
54+
<WholeProgramOptimization>true</WholeProgramOptimization>
55+
<CharacterSet>Unicode</CharacterSet>
56+
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
57+
</PropertyGroup>
58+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
59+
<ImportGroup Label="ExtensionSettings">
60+
</ImportGroup>
61+
<ImportGroup Label="Shared">
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
73+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
74+
</ImportGroup>
75+
<PropertyGroup Label="UserMacros" />
76+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
77+
<LinkIncremental>true</LinkIncremental>
78+
<OutDir>$(Configuration)\$(Platform)\</OutDir>
79+
<IntDir>$(Configuration)\$(Platform)\temp\</IntDir>
80+
</PropertyGroup>
81+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
82+
<LinkIncremental>true</LinkIncremental>
83+
<OutDir>$(Configuration)\$(Platform)\</OutDir>
84+
<IntDir>$(Configuration)\$(Platform)\temp\</IntDir>
85+
</PropertyGroup>
86+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
87+
<LinkIncremental>false</LinkIncremental>
88+
<OutDir>$(Configuration)\$(Platform)\</OutDir>
89+
<IntDir>$(Configuration)\$(Platform)\temp\</IntDir>
90+
</PropertyGroup>
91+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
92+
<LinkIncremental>false</LinkIncremental>
93+
<OutDir>$(Configuration)\$(Platform)\</OutDir>
94+
<IntDir>$(Configuration)\$(Platform)\temp\</IntDir>
95+
</PropertyGroup>
96+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
97+
<ClCompile>
98+
<PrecompiledHeader>Use</PrecompiledHeader>
99+
<WarningLevel>Level4</WarningLevel>
100+
<Optimization>Disabled</Optimization>
101+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
102+
<SDLCheck>false</SDLCheck>
103+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
104+
<AdditionalIncludeDirectories>..\..</AdditionalIncludeDirectories>
105+
<AdditionalOptions>/bigobj /await /std:c++latest /d1permissive- %(AdditionalOptions)</AdditionalOptions>
106+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
107+
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
108+
<DisableSpecificWarnings>4702</DisableSpecificWarnings>
109+
</ClCompile>
110+
<Link>
111+
<SubSystem>Console</SubSystem>
112+
<GenerateDebugInformation>true</GenerateDebugInformation>
113+
</Link>
114+
<PostBuildEvent>
115+
<Command>copy message.txt $(OutDir)</Command>
116+
</PostBuildEvent>
117+
</ItemDefinitionGroup>
118+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
119+
<ClCompile>
120+
<PrecompiledHeader>Use</PrecompiledHeader>
121+
<WarningLevel>Level4</WarningLevel>
122+
<Optimization>Disabled</Optimization>
123+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
124+
<SDLCheck>false</SDLCheck>
125+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
126+
<AdditionalIncludeDirectories>..\..</AdditionalIncludeDirectories>
127+
<AdditionalOptions>/bigobj /await /std:c++latest /d1permissive- %(AdditionalOptions)</AdditionalOptions>
128+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
129+
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
130+
<DisableSpecificWarnings>4702</DisableSpecificWarnings>
131+
</ClCompile>
132+
<Link>
133+
<SubSystem>Console</SubSystem>
134+
<GenerateDebugInformation>true</GenerateDebugInformation>
135+
</Link>
136+
<PostBuildEvent>
137+
<Command>copy message.txt $(OutDir)</Command>
138+
</PostBuildEvent>
139+
</ItemDefinitionGroup>
140+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
141+
<ClCompile>
142+
<WarningLevel>Level4</WarningLevel>
143+
<PrecompiledHeader>Use</PrecompiledHeader>
144+
<Optimization>MaxSpeed</Optimization>
145+
<FunctionLevelLinking>true</FunctionLevelLinking>
146+
<IntrinsicFunctions>true</IntrinsicFunctions>
147+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
148+
<SDLCheck>false</SDLCheck>
149+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
150+
<AdditionalIncludeDirectories>..\..</AdditionalIncludeDirectories>
151+
<AdditionalOptions>/bigobj /await /std:c++latest /d1permissive- %(AdditionalOptions)</AdditionalOptions>
152+
<DisableSpecificWarnings>4702</DisableSpecificWarnings>
153+
</ClCompile>
154+
<Link>
155+
<SubSystem>Console</SubSystem>
156+
<GenerateDebugInformation>true</GenerateDebugInformation>
157+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
158+
<OptimizeReferences>true</OptimizeReferences>
159+
</Link>
160+
<PostBuildEvent>
161+
<Command>copy message.txt $(OutDir)</Command>
162+
</PostBuildEvent>
163+
</ItemDefinitionGroup>
164+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
165+
<ClCompile>
166+
<WarningLevel>Level4</WarningLevel>
167+
<PrecompiledHeader>Use</PrecompiledHeader>
168+
<Optimization>MaxSpeed</Optimization>
169+
<FunctionLevelLinking>true</FunctionLevelLinking>
170+
<IntrinsicFunctions>true</IntrinsicFunctions>
171+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
172+
<SDLCheck>false</SDLCheck>
173+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
174+
<AdditionalIncludeDirectories>..\..</AdditionalIncludeDirectories>
175+
<AdditionalOptions>/bigobj /await /std:c++latest /d1permissive- %(AdditionalOptions)</AdditionalOptions>
176+
<DisableSpecificWarnings>4702</DisableSpecificWarnings>
177+
</ClCompile>
178+
<Link>
179+
<SubSystem>Console</SubSystem>
180+
<GenerateDebugInformation>true</GenerateDebugInformation>
181+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
182+
<OptimizeReferences>true</OptimizeReferences>
183+
</Link>
184+
<PostBuildEvent>
185+
<Command>copy message.txt $(OutDir)</Command>
186+
</PostBuildEvent>
187+
</ItemDefinitionGroup>
188+
<ItemGroup>
189+
<ClCompile Include="Main.cpp" />
190+
<ClCompile Include="pch.cpp">
191+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
192+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
193+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
194+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
195+
</ClCompile>
196+
</ItemGroup>
197+
<ItemGroup>
198+
<ClInclude Include="pch.h" />
199+
</ItemGroup>
200+
<ItemGroup>
201+
<Text Include="message.txt" />
202+
</ItemGroup>
203+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
204+
<ImportGroup Label="ExtensionTargets">
205+
</ImportGroup>
206+
</Project>
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#include "pch.h"
2+
3+
using namespace winrt;
4+
using namespace Windows::Foundation;
5+
6+
struct file
7+
{
8+
file(wchar_t const * const filename) :
9+
m_handle(create(filename)),
10+
m_io(get_abi(m_handle))
11+
{
12+
}
13+
14+
auto read(uint64_t const offset, void * const buffer, size_t const size)
15+
{
16+
return m_io.start([=, handle = get_abi(m_handle)](OVERLAPPED & overlapped)
17+
{
18+
overlapped.Offset = static_cast<DWORD>(offset);
19+
overlapped.OffsetHigh = offset >> 32;
20+
21+
if (!ReadFile(handle, buffer, static_cast<DWORD>(size), nullptr, &overlapped))
22+
{
23+
const DWORD error = GetLastError();
24+
25+
if (error != ERROR_IO_PENDING)
26+
{
27+
throw hresult_error(HRESULT_FROM_WIN32(error));
28+
}
29+
}
30+
});
31+
}
32+
33+
private:
34+
35+
struct file_traits
36+
{
37+
using type = HANDLE;
38+
39+
static type invalid() noexcept
40+
{
41+
return INVALID_HANDLE_VALUE;
42+
}
43+
44+
static void close(type value) noexcept
45+
{
46+
WINRT_VERIFY(CloseHandle(value));
47+
}
48+
};
49+
50+
using file_handle = impl::handle<file_traits>;
51+
52+
static file_handle create(wchar_t const * const filename)
53+
{
54+
file_handle handle = CreateFile(filename,
55+
GENERIC_READ,
56+
0,
57+
nullptr,
58+
OPEN_EXISTING,
59+
FILE_FLAG_OVERLAPPED,
60+
nullptr);
61+
62+
if (!handle)
63+
{
64+
throw_last_error();
65+
}
66+
67+
return handle;
68+
}
69+
70+
file_handle m_handle;
71+
resumable_io m_io;
72+
};
73+
74+
IAsyncAction sample()
75+
{
76+
file reader(L"message.txt");
77+
78+
std::array<char, 10> buffer;
79+
uint64_t offset = 0;
80+
81+
while (uint32_t const bytes = co_await reader.read(offset, buffer.data(), buffer.size()))
82+
{
83+
printf("%.*s", bytes, buffer.data());
84+
offset += bytes;
85+
}
86+
87+
printf("\n");
88+
}
89+
90+
int main()
91+
{
92+
init_apartment();
93+
94+
sample().get();
95+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/microsoft/cppwinrt
2+
3+
C++/WinRT is a standard C++ language projection for the Windows Runtime implemented solely in header files. It allows you to both author and consume Windows Runtime APIs using any standards-compliant C++ compiler. C++/WinRT is designed to provide C++ developers with first-class access to the modern Windows API.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "pch.h"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#pragma once
2+
3+
#pragma comment(lib, "windowsapp")
4+
5+
#include "winrt/base.h"

0 commit comments

Comments
 (0)