summaryrefslogtreecommitdiff
path: root/avstream/avssamp
diff options
context:
space:
mode:
authorsaredd <[email protected]>2018-01-19 17:19:00 -0800
committerWei Mao <[email protected]>2018-01-19 17:19:00 -0800
commit6e7c8cb437135e55917c34cfebe1be944bbf6d3f (patch)
treef7570fe170194facd45e4f9f887ff56dc683a31c /avstream/avssamp
parentdd7e6f697ed67e94dc45cd33078b1dbcb643f439 (diff)
Updating Camera WDK Samples to RS3 version (#193)
Diffstat (limited to 'avstream/avssamp')
-rw-r--r--avstream/avssamp/avssamp.cpp118
-rw-r--r--avstream/avssamp/avssamp.h84
-rw-r--r--avstream/avssamp/avssamp.inf4
3 files changed, 108 insertions, 98 deletions
diff --git a/avstream/avssamp/avssamp.cpp b/avstream/avssamp/avssamp.cpp
index 5a2c2b77..68741c9e 100644
--- a/avstream/avssamp/avssamp.cpp
+++ b/avstream/avssamp/avssamp.cpp
@@ -1,20 +1,20 @@
/**************************************************************************
-AVStream Filter-Centric Sample
+ AVStream Filter-Centric Sample
-Copyright (c) 1999 - 2001, Microsoft Corporation
+ Copyright (c) 1999 - 2001, Microsoft Corporation
-File:
+ File:
-avssamp.cpp
+ avssamp.cpp
-Abstract:
+ Abstract:
-This is the main file for the filter-centric sample.
+ This is the main file for the filter-centric sample.
-History:
+ History:
-created 6/18/01
+ created 6/18/01
**************************************************************************/
@@ -22,26 +22,26 @@ created 6/18/01
/**************************************************************************
-INITIALIZATION CODE
+ INITIALIZATION CODE
**************************************************************************/
-
+
extern "C" DRIVER_INITIALIZE DriverEntry;
PVOID operator new
(
size_t iSize,
_When_((poolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
+ __drv_reportError("Must succeed pool allocations are forbidden. "
+ "Allocation failures cause a system crash"))
POOL_TYPE poolType
- )
+)
{
- PVOID result = ExAllocatePoolWithTag(poolType, iSize, 'wNCK');
+ PVOID result = ExAllocatePoolWithTag(poolType,iSize,'wNCK');
if (result) {
- RtlZeroMemory(result, iSize);
+ RtlZeroMemory(result,iSize);
}
return result;
@@ -51,16 +51,16 @@ PVOID operator new
(
size_t iSize,
_When_((poolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
+ __drv_reportError("Must succeed pool allocations are forbidden. "
+ "Allocation failures cause a system crash"))
POOL_TYPE poolType,
ULONG tag
- )
+)
{
- PVOID result = ExAllocatePoolWithTag(poolType, iSize, tag);
+ PVOID result = ExAllocatePoolWithTag(poolType,iSize,tag);
if (result) {
- RtlZeroMemory(result, iSize);
+ RtlZeroMemory(result,iSize);
}
return result;
@@ -70,23 +70,23 @@ PVOID operator new
Routine Description:
-Array delete() operator.
+ Array delete() operator.
Arguments:
-pVoid -
-The memory to free.
+ pVoid -
+ The memory to free.
Return Value:
-None
+ None
--*/
-void
-__cdecl
+void
+__cdecl
operator delete[](
PVOID pVoid
- )
+)
{
if (pVoid)
{
@@ -98,19 +98,19 @@ operator delete[](
Routine Description:
-Sized delete() operator.
+ Sized delete() operator.
Arguments:
-pVoid -
-The memory to free.
+ pVoid -
+ The memory to free.
-size -
-The size of the memory to free.
+ size -
+ The size of the memory to free.
Return Value:
-None
+ None
--*/
void __cdecl operator delete
@@ -129,26 +129,26 @@ void __cdecl operator delete
Routine Description:
-Sized delete[]() operator.
+ Sized delete[]() operator.
Arguments:
-pVoid -
-The memory to free.
+ pVoid -
+ The memory to free.
-size -
-The size of the memory to free.
+ size -
+ The size of the memory to free.
Return Value:
-None
+ None
--*/
void __cdecl operator delete[]
(
void *pVoid,
size_t /*size*/
- )
+)
{
if (pVoid)
{
@@ -156,31 +156,41 @@ void __cdecl operator delete[]
}
}
+void __cdecl operator delete
+(
+ PVOID pVoid
+ )
+{
+ if (pVoid) {
+ ExFreePool(pVoid);
+ }
+}
+
extern "C"
NTSTATUS
-DriverEntry(
+DriverEntry (
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
-)
+ )
/*++
Routine Description:
-Driver entry point. Pass off control to the AVStream initialization
-function (KsInitializeDriver) and return the status code from it.
+ Driver entry point. Pass off control to the AVStream initialization
+ function (KsInitializeDriver) and return the status code from it.
Arguments:
-DriverObject -
-The WDM driver object for our driver
+ DriverObject -
+ The WDM driver object for our driver
-RegistryPath -
-The registry path for our registry info
+ RegistryPath -
+ The registry path for our registry info
Return Value:
-As from KsInitializeDriver
+ As from KsInitializeDriver
--*/
@@ -193,17 +203,17 @@ As from KsInitializeDriver
// here.
//
return
- KsInitializeDriver(
+ KsInitializeDriver (
DriverObject,
RegistryPath,
&CaptureDeviceDescriptor
- );
+ );
}
/**************************************************************************
-DESCRIPTOR AND DISPATCH LAYOUT
+ DESCRIPTOR AND DISPATCH LAYOUT
**************************************************************************/
@@ -213,7 +223,7 @@ DESCRIPTOR AND DISPATCH LAYOUT
// The table of filter descriptors that this device supports. Each one of
// these will be used as a template to create a filter-factory on the device.
//
-DEFINE_KSFILTER_DESCRIPTOR_TABLE(FilterDescriptors) {
+DEFINE_KSFILTER_DESCRIPTOR_TABLE (FilterDescriptors) {
&CaptureFilterDescriptor
};
@@ -236,7 +246,7 @@ CaptureDeviceDescriptor = {
// by AVStream will be quite sufficient.
//
NULL,
- SIZEOF_ARRAY(FilterDescriptors),
+ SIZEOF_ARRAY (FilterDescriptors),
FilterDescriptors,
KSDEVICE_DESCRIPTOR_VERSION
};
diff --git a/avstream/avssamp/avssamp.h b/avstream/avssamp/avssamp.h
index 7d0bd7c3..b00cb7ba 100644
--- a/avstream/avssamp/avssamp.h
+++ b/avstream/avssamp/avssamp.h
@@ -1,27 +1,27 @@
/**************************************************************************
-AVStream Filter-Centric Sample
+ AVStream Filter-Centric Sample
-Copyright (c) 2001, Microsoft Corporation
+ Copyright (c) 2001, Microsoft Corporation
-File:
+ File:
-avssamp.h
+ avssamp.h
-Abstract:
+ Abstract:
-AVStream Filter-Centric Sample header file. This is the main
-header.
+ AVStream Filter-Centric Sample header file. This is the main
+ header.
-History:
+ History:
-created 6/18/01
+ created 6/18/01
**************************************************************************/
/*************************************************
-Standard Includes
+ Standard Includes
*************************************************/
@@ -42,7 +42,7 @@ extern "C" {
#pragma warning (disable : 4100 4101 4131 4127 4189 4701 4706)
/*************************************************
-Misc Definitions
+ Misc Definitions
*************************************************/
@@ -81,7 +81,7 @@ Misc Definitions
/*************************************************
-Externed information
+ Externed information
*************************************************/
@@ -101,12 +101,12 @@ CaptureFilterDescriptor;
extern
const
KSPIN_DESCRIPTOR_EX
-CaptureFilterPinDescriptors[CAPTURE_FILTER_PIN_COUNT];
+CaptureFilterPinDescriptors [CAPTURE_FILTER_PIN_COUNT];
extern
const
GUID
-CaptureFilterCategories[CAPTURE_FILTER_CATEGORIES_COUNT];
+CaptureFilterCategories [CAPTURE_FILTER_CATEGORIES_COUNT];
//
// video.cpp externs:
@@ -124,7 +124,7 @@ VideoCapturePinDispatch;
extern
const
PKSDATARANGE
-VideoCapturePinDataRanges[CAPTURE_PIN_DATA_RANGE_COUNT];
+VideoCapturePinDataRanges [CAPTURE_PIN_DATA_RANGE_COUNT];
//
// audio.cpp externs:
@@ -149,60 +149,60 @@ PVOID operator new
(
size_t iSize,
_When_((poolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
+ __drv_reportError("Must succeed pool allocations are forbidden. "
+ "Allocation failures cause a system crash"))
POOL_TYPE poolType
- );
+);
PVOID operator new
(
size_t iSize,
_When_((poolType & NonPagedPoolMustSucceed) != 0,
- __drv_reportError("Must succeed pool allocations are forbidden. "
- "Allocation failures cause a system crash"))
+ __drv_reportError("Must succeed pool allocations are forbidden. "
+ "Allocation failures cause a system crash"))
POOL_TYPE poolType,
ULONG tag
- );
+);
/*++
Routine Description:
-Array delete() operator.
+ Array delete() operator.
Arguments:
-pVoid -
-The memory to free.
+ pVoid -
+ The memory to free.
Return Value:
-None
+ None
--*/
-void
-__cdecl
+void
+__cdecl
operator delete[](
PVOID pVoid
- );
+);
/*++
Routine Description:
-Sized delete() operator.
+ Sized delete() operator.
Arguments:
-pVoid -
-The memory to free.
+ pVoid -
+ The memory to free.
-size -
-The size of the memory to free.
+ size -
+ The size of the memory to free.
Return Value:
-None
+ None
--*/
void __cdecl operator delete
@@ -215,32 +215,32 @@ void __cdecl operator delete
Routine Description:
-Sized delete[]() operator.
+ Sized delete[]() operator.
Arguments:
-pVoid -
-The memory to free.
+ pVoid -
+ The memory to free.
-size -
-The size of the memory to free.
+ size -
+ The size of the memory to free.
Return Value:
-None
+ None
--*/
void __cdecl operator delete[]
(
void *pVoid,
size_t /*size*/
- );
+);
#endif // _NEW_DELETE_OPERATORS_
/*************************************************
-Internal Includes
+ Internal Includes
*************************************************/
diff --git a/avstream/avssamp/avssamp.inf b/avstream/avssamp/avssamp.inf
index 62db5009..00003e78 100644
--- a/avstream/avssamp/avssamp.inf
+++ b/avstream/avssamp/avssamp.inf
@@ -14,8 +14,8 @@
[Version]
Signature="$Windows NT$"
-Class=MEDIA
-ClassGUID={4d36e96c-e325-11ce-bfc1-08002be10318}
+Class=Camera
+ClassGuid={ca3e7ab9-b4c3-4ae6-8251-579ef933890f}
Provider=%ProviderName%
CatalogFile=avssamp.cat
DriverVer=09/30/2004,1.0.0.0