Skip to content

Commit

Permalink
Windows 10 Version 1803 - July 2018 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed Jul 19, 2018
2 parents fe8567f + cff2a43 commit 157c9eb
Show file tree
Hide file tree
Showing 97 changed files with 3,745 additions and 920 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@ FakesAssemblies/

# Custom ignores
gallery.xml
project.lock.json
project.lock.json
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
</tr>
<tr>
<td><a href="Samples/ExtendedExecution">Extended execution</a></td>
<td><a href="https://aka.ms/Kcrqst">Multi-instance apps</a></td>
<td><a href="Samples/BasicSuspension">Suspend and resume</a></td>
</tr>
</table>
Expand Down
6 changes: 5 additions & 1 deletion Samples/BluetoothLE/cs/Scenario1_Discovery.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ private void StartBleDeviceWatcher()
// Start over with an empty collection.
KnownDevices.Clear();

// Start the watcher.
// Start the watcher. Active enumeration is limited to approximately 30 seconds.
// This limits power usage and reduces interference with other Bluetooth activities.
// To monitor for the presence of Bluetooth LE devices for an extended period,
// use the BluetoothLEAdvertisementWatcher runtime class. See the BluetoothAdvertisement
// sample for an example.
deviceWatcher.Start();
}

Expand Down
34 changes: 33 additions & 1 deletion Samples/CustomCapability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Before you run this scenario, you must start the corresponding NT service.

* Build the NT service portion of the sample, which requires that the Windows SDK for Desktop C++ Apps be installed.
* Start the service from an elevated command prompt in one of two ways:
* Install it as a service: `rpcserver.exe -install`
* Install it as a service using `rpcserver.exe -install` and start it using `sc start hsaservice`.
* Run the service in console mode: `rpcserver.exe -console`

## Using a custom capability to access a custom device
Expand Down Expand Up @@ -115,6 +115,37 @@ When they are full, the next write operation will wait until a message is read,
thereby freeing up a message buffer.
When they are empty, the next read operation will wait until a message is written.

## Raising Custom System Event Trigger

Demonstrates how to register background task with the CustomSystemEventTrigger type and
raise a custom system event when an OSR FX-2 device is connected to a system. The code to
raise the event is part of the OSR FX-2 driver. This enables custom devices/NT services to raise a custom system event which triggers a background task.

The code for the OSR USB FX-2 driver can be found in the
[Microsoft Windows-driver-samples repo](https://github.com/Microsoft/Windows-driver-samples/)
under
[usb/kmdf_fx2/driver](https://github.com/Microsoft/Windows-driver-samples/tree/master/usb/kmdf_fx2).
The driver must be built for Windows 10 version 1803 or higher in order to support
the custom system event trigger used by this sample.

## Firmware access

Declaring the restricted capability `smbios` allows apps to read the SMBIOS.
Call the
[GetSystemFirmwareTable](https://msdn.microsoft.com/en-us/library/windows/desktop/ms724379(v=vs.85).aspx)
and
[EnumSystemFirmwareTables](https://msdn.microsoft.com/en-us/library/windows/desktop/ms724259(v=vs.85).aspx)
functions with the 'RSMB' (Raw SMBIOS) table provider.

The following custom capabilities can be used for accessing UEFI variables:

- `microsoft.firmwareRead_cw5n1h2txyewy`: Read UEFI variables using [GetFirmwareEnvironmentVariable](https://msdn.microsoft.com/en-us/library/windows/desktop/ms724325(v=vs.85).aspx)
- `microsoft.firmwareWrite_cw5n1h2txyewy`: Read/Write UEFI variables using [SetFirmwareEnvironmentVariable](https://msdn.microsoft.com/en-us/library/windows/desktop/ms724934(v=vs.85).aspx)

UEFI access also requires the app to declare 'protectedApp' restricted capability and enable [INTEGRITYCHECK](https://docs.microsoft.com/en-us/cpp/build/reference/integritycheck-require-signature-check) for the project. This would trigger necessary store signing for protected apps during store submission. Currently the [INTEGRITYCHECK](https://docs.microsoft.com/en-us/cpp/build/reference/integritycheck-require-signature-check) can only be enabled on C++ projects properties.

UEFI variables can be accessed only when the app is being used by a user belonging to Administrators group.

**Note** The Windows universal samples require Visual Studio 2017 to build and Windows 10 to execute.

To obtain information about Windows 10 development, go to the [Windows Dev Center](http://go.microsoft.com/fwlink/?LinkID=532421)
Expand All @@ -140,6 +171,7 @@ To obtain information about Microsoft Visual Studio and the tools for developing
* [How to use RPC callbacks](https://support.microsoft.com/kb/96781)
* [Custom Capabilities for Universal Windows Platform apps](https://msdn.microsoft.com/windows/hardware/drivers/devapps/custom-capabilities-for-universal-windows-platform-apps)
* [Hardware access for Universal Windows Platform apps](https://msdn.microsoft.com/windows/hardware/drivers/devapps/hardware-access-for-universal-windows-platform-apps)

## System requirements

**Client:** Windows 10 version 1703
Expand Down
19 changes: 19 additions & 0 deletions Samples/CustomCapability/Service/Client/FirmwareAccess.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

extern "C" {

#define MANUFACTURER_NAME_LENGTH_MAX 1024

__declspec(dllexport)
DWORD
GetManufacturerNameFromSmbios(
_Out_ wchar_t* ManufacturerName,
_In_ DWORD Size
);

__declspec(dllexport)
DWORD
GetSecureBootEnabledFromUefi(
_Out_ bool* SecureBootEnabled
);
}
3 changes: 3 additions & 0 deletions Samples/CustomCapability/Service/Client/RpcClient.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="FirmwareAccess.h" />
<ClInclude Include="RpcClient.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="RpcClientApi.h">
Expand Down Expand Up @@ -234,6 +235,8 @@
<ClCompile Include="RpcClientApi.cpp">
<DeploymentContent>true</DeploymentContent>
</ClCompile>
<ClCompile Include="smbios.cpp" />
<ClCompile Include="uefi.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
<ClCompile Include="pch.cpp" />
<ClCompile Include="RpcClientApi.cpp" />
<ClCompile Include="$(OutDir)\RpcInterface_c.c" />
<ClCompile Include="smbios.cpp" />
<ClCompile Include="uefi.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="RpcClient.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="RpcClientApi.h" />
<ClInclude Include="FirmwareAccess.h" />
</ItemGroup>
</Project>
Loading

0 comments on commit 157c9eb

Please sign in to comment.