-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Showing
2,300 changed files
with
644,953 additions
and
2 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 |
---|---|---|
@@ -1,2 +1,36 @@ | ||
# Windows-driver-samples | ||
This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both universal driver and desktop-only driver samples. | ||
# Driver samples for Windows 10 # | ||
These are the official Microsoft Windows Driver Kit (WDK) team driver code samples for Windows 10. They provide a foundation for universal driver support of all hardware form factors, from phones to desktop PCs. Use these samples with Microsoft Visual Studio 2015 CTP 6, Microsoft Visual Studio Tools for Windows 10 Technical Preview, Windows SDK for Windows 10, and WDK 10. | ||
|
||
## Windows 10 driver development ## | ||
Use Visual Studio 2015 CTP 6 and the the Windows 10 Driver Kit (WDK) to build, test, and deploy your drivers. With Windows 10, the driver development environment is integrated into Visual Studio. To get Windows 10 Technical Preview and the driver development kits and tools, join the Windows Insider Program. | ||
|
||
[Become a Windows Insider](https://insider.windows.com/ "Become a Windows Insider") | ||
|
||
### Windows 10 Driver Kit (WDK) ### | ||
Take a look at the compilation of the new and changed driver-related content for Windows 10. Areas of improvement include camera, print, display, Near Field Communication (NFC), WLAN, Bluetooth, and more. | ||
|
||
[Find out what’s new in the WDK](http://go.microsoft.com/fwlink/?LinkId=528349 "Find out what’s new in the WDK") | ||
|
||
### Universal drivers in Windows 10 ### | ||
Write one driver that runs on both Windows 10 for desktop editions and Windows 10 for mobile devices, as well as other Windows 10 editions that share a common set of interfaces. | ||
|
||
[Build your universal drivers](http://go.microsoft.com/fwlink/p/?LinkId=524488 "Build your universal drivers") | ||
|
||
### Windows Driver Frameworks ### | ||
The Windows Driver Frameworks (WDF) are a set of libraries that make it simple to write high-quality device drivers. | ||
|
||
[WDF driver development guide](http://go.microsoft.com/fwlink/p/?LinkId=524489 "WDF driver development guide") | ||
|
||
### Samples ### | ||
Use the samples in this repo to guide your Windows driver development. Whether you’re just getting started or porting an older driver to the newest version of Windows, code samples are valuable guides on how to write drivers. | ||
|
||
### Build your first driver ### | ||
If you're writing your first driver, use these exercises to get started. Each exercise is independent of the others, so you can do them in any order. | ||
|
||
[Write a UMDF driver based on a template](http://go.microsoft.com/fwlink/p/?LinkId=524492 "Write a UMDF driver based on a template") | ||
|
||
[Write a KMDF Hello World driver](http://go.microsoft.com/fwlink/p/?LinkId=524493 "Write a KMDF Hello World driver") | ||
|
||
[Write a KMDF driver based on a template](http://go.microsoft.com/fwlink/p/?LinkId=524494 "Write a KMDF driver based on a template") | ||
|
||
|
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,10 @@ | ||
AVStream simulated hardware sample driver (Avshws) | ||
================================================== | ||
|
||
The AVStream simulated hardware sample driver (Avshws) provides a pin-centric [AVStream](http://msdn.microsoft.com/en-us/library/windows/hardware/ff554240) capture driver for a simulated piece of hardware. This streaming media driver performs video captures at 320 x 240 pixels in either RGB24 or YUV422 format using direct memory access (DMA) into capture buffers. The purpose of the sample is to demonstrate how to write a pin-centric AVStream minidriver. The sample also shows how to implement DMA by using the related functionality provided by the AVStream class driver. | ||
|
||
This sample features enhanced parameter validation and overflow detection. | ||
|
||
## Universal Compliant | ||
This sample builds a Windows Universal driver. It uses only APIs and DDIs that are included in Windows Core. | ||
|
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,232 @@ | ||
/************************************************************************** | ||
AVStream Simulated Hardware Sample | ||
Copyright (c) 2001, Microsoft Corporation. | ||
File: | ||
avshws.h | ||
Abstract: | ||
AVStream Simulated Hardware Sample header file. This is the | ||
main header. | ||
History: | ||
created 3/12/2001 | ||
**************************************************************************/ | ||
|
||
/************************************************* | ||
Standard Includes | ||
*************************************************/ | ||
|
||
#ifndef _avshws_h_ | ||
#define _avshws_h_ | ||
|
||
extern "C" { | ||
#include <wdm.h> | ||
} | ||
|
||
#include <windef.h> | ||
#include <stdio.h> | ||
#include <ntstrsafe.h> | ||
#include <stdlib.h> | ||
#include <windef.h> | ||
#define NOBITMAP | ||
#include <mmreg.h> | ||
#undef NOBITMAP | ||
#include <unknown.h> | ||
#include <ks.h> | ||
#include <ksmedia.h> | ||
#include <kcom.h> | ||
|
||
/************************************************* | ||
Misc Definitions | ||
*************************************************/ | ||
#pragma warning (disable : 4100 4127 4131 4189 4701 4706) | ||
#define STR_MODULENAME "avshws: " | ||
#define DEBUGLVL_VERBOSE 2 | ||
#define DEBUGLVL_TERSE 1 | ||
#define DEBUGLVL_ERROR 0 | ||
|
||
const DebugLevel = DEBUGLVL_TERSE; | ||
|
||
#if (DBG) | ||
#define _DbgPrintF(lvl, strings) \ | ||
{ \ | ||
if (lvl <= DebugLevel) {\ | ||
DbgPrint(STR_MODULENAME);\ | ||
DbgPrint##strings;\ | ||
DbgPrint("\n");\ | ||
if ((lvl) == DEBUGLVL_ERROR) {\ | ||
NT_ASSERT(0);\ | ||
} \ | ||
}\ | ||
} | ||
#else // !DBG | ||
#define _DbgPrintF(lvl, strings) | ||
#endif // !DBG | ||
|
||
#define ABS(x) ((x) < 0 ? (-(x)) : (x)) | ||
|
||
#ifndef mmioFOURCC | ||
#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \ | ||
( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \ | ||
( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) ) | ||
#endif | ||
|
||
#define FOURCC_YUY2 mmioFOURCC('Y', 'U', 'Y', '2') | ||
// | ||
// CAPTURE_PIN_DATA_RANGE_COUNT: | ||
// | ||
// The number of ranges supported on the capture pin. | ||
// | ||
#define CAPTURE_PIN_DATA_RANGE_COUNT 2 | ||
|
||
// | ||
// CAPTURE_FILTER_PIN_COUNT: | ||
// | ||
// The number of pins on the capture filter. | ||
// | ||
#define CAPTURE_FILTER_PIN_COUNT 1 | ||
|
||
// | ||
// CAPTURE_FILTER_CATEGORIES_COUNT: | ||
// | ||
// The number of categories for the capture filter. | ||
// | ||
#define CAPTURE_FILTER_CATEGORIES_COUNT 3 | ||
|
||
#define AVSHWS_POOLTAG 'hSVA' | ||
|
||
/************************************************* | ||
Externed information | ||
*************************************************/ | ||
// | ||
// filter.cpp externs: | ||
// | ||
extern | ||
const | ||
KSFILTER_DISPATCH | ||
CaptureFilterDispatch; | ||
|
||
extern | ||
const | ||
KSFILTER_DESCRIPTOR | ||
CaptureFilterDescriptor; | ||
|
||
extern | ||
const | ||
KSPIN_DESCRIPTOR_EX | ||
CaptureFilterPinDescriptors [CAPTURE_FILTER_PIN_COUNT]; | ||
|
||
extern | ||
const | ||
GUID | ||
CaptureFilterCategories [CAPTURE_FILTER_CATEGORIES_COUNT]; | ||
|
||
// | ||
// capture.cpp externs: | ||
// | ||
extern | ||
const | ||
KSALLOCATOR_FRAMING_EX | ||
CapturePinAllocatorFraming; | ||
|
||
extern | ||
const | ||
KSPIN_DISPATCH | ||
CapturePinDispatch; | ||
|
||
extern | ||
const | ||
PKSDATARANGE | ||
CapturePinDataRanges [CAPTURE_PIN_DATA_RANGE_COUNT]; | ||
|
||
/************************************************* | ||
Enums / Typedefs | ||
*************************************************/ | ||
|
||
typedef enum _HARDWARE_STATE { | ||
|
||
HardwareStopped = 0, | ||
HardwarePaused, | ||
HardwareRunning | ||
|
||
} HARDWARE_STATE, *PHARDWARE_STATE; | ||
|
||
/************************************************* | ||
Class Definitions | ||
*************************************************/ | ||
|
||
// | ||
// IHardwareSink: | ||
// | ||
// This interface is used by the hardware simulation to fake interrupt | ||
// service routines. The Interrupt method is called at DPC as a fake | ||
// interrupt. | ||
// | ||
class IHardwareSink { | ||
|
||
public: | ||
|
||
virtual | ||
void | ||
Interrupt ( | ||
) = 0; | ||
|
||
}; | ||
|
||
// | ||
// ICaptureSink: | ||
// | ||
// This is a capture sink interface. The device level calls back the | ||
// CompleteMappings method passing the number of completed mappings for | ||
// the capture pin. This method is called during the device DPC. | ||
// | ||
class ICaptureSink { | ||
|
||
public: | ||
|
||
virtual | ||
void | ||
CompleteMappings ( | ||
IN ULONG NumMappings | ||
) = 0; | ||
|
||
}; | ||
|
||
|
||
|
||
/************************************************* | ||
Global Functions | ||
*************************************************/ | ||
|
||
/************************************************* | ||
Internal Includes | ||
*************************************************/ | ||
|
||
#include "image.h" | ||
#include "hwsim.h" | ||
#include "device.h" | ||
#include "filter.h" | ||
#include "capture.h" | ||
#include <uuids.h> | ||
#endif //_avshws_h_ |
Oops, something went wrong.
97cf519
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under which license are this samples?
97cf519
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are published under the MS-PL. License file added to the repo.