ReactOS  0.4.13-dev-464-g6b95727
property.c File Reference
#include "precomp.h"
#include <pseh/pseh2.h>
#include <debug.h>
Include dependency graph for property.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS FindPropertyHandler (IN PIO_STATUS_BLOCK IoStatus, IN const KSPROPERTY_SET *PropertySet, IN ULONG PropertySetCount, IN PKSPROPERTY Property, IN ULONG InputBufferLength, IN ULONG OutputBufferLength, OUT PVOID OutputBuffer, OUT PFNKSHANDLER *PropertyHandler, OUT PKSPROPERTY_SET *Set, OUT PKSPROPERTY_ITEM *PropertyItem)
 
NTSTATUS KspPropertyHandler (IN PIRP Irp, IN ULONG PropertySetsCount, IN const KSPROPERTY_SET *PropertySet, IN PFNKSALLOCATOR Allocator OPTIONAL, IN ULONG PropertyItemSize OPTIONAL)
 
KSDDKAPI NTSTATUS NTAPI KsPropertyHandler (IN PIRP Irp, IN ULONG PropertySetsCount, IN const KSPROPERTY_SET *PropertySet)
 
 _IRQL_requires_max_ (PASSIVE_LEVEL)
 
NTSTATUS FindFastPropertyHandler (IN ULONG FastIoCount, IN const KSFASTPROPERTY_ITEM *FastIoTable, IN PKSPROPERTY PropertyId, OUT PFNKSFASTHANDLER *FastPropertyHandler)
 
KSDDKAPI BOOLEAN NTAPI KsFastPropertyHandler (IN PFILE_OBJECT FileObject, IN PKSPROPERTY UNALIGNED Property, IN ULONG PropertyLength, IN OUT PVOID UNALIGNED Data, IN ULONG DataLength, OUT PIO_STATUS_BLOCK IoStatus, IN ULONG PropertySetsCount, IN const KSPROPERTY_SET *PropertySet)
 
KSDDKAPI NTSTATUS NTAPI KsDispatchSpecificProperty (IN PIRP Irp, IN PFNKSHANDLER Handler)
 

Variables

const GUID KSPROPTYPESETID_General = {0x97E99BA0L, 0xBDEA, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 14 of file property.c.

Function Documentation

◆ _IRQL_requires_max_()

_IRQL_requires_max_ ( PASSIVE_LEVEL  )

Definition at line 370 of file property.c.

380 {
381  return KspPropertyHandler(Irp, PropertySetsCount, PropertySet, Allocator, PropertyItemSize);
382 }
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS KspPropertyHandler(IN PIRP Irp, IN ULONG PropertySetsCount, IN const KSPROPERTY_SET *PropertySet, IN PFNKSALLOCATOR Allocator OPTIONAL, IN ULONG PropertyItemSize OPTIONAL)
Definition: property.c:138

◆ FindFastPropertyHandler()

NTSTATUS FindFastPropertyHandler ( IN ULONG  FastIoCount,
IN const KSFASTPROPERTY_ITEM *  FastIoTable,
IN PKSPROPERTY  PropertyId,
OUT PFNKSFASTHANDLER *  FastPropertyHandler 
)

Definition at line 385 of file property.c.

390 {
391  ULONG Index;
392 
393  /* iterate through all items */
394  for(Index = 0; Index < FastIoCount; Index++)
395  {
396  if (PropertyId->Id == FastIoTable[Index].PropertyId)
397  {
398  if (PropertyId->Flags & KSPROPERTY_TYPE_SET)
399  {
400  if (FastIoTable[Index].SetSupported)
401  {
402  *FastPropertyHandler = FastIoTable[Index].SetPropertyHandler;
403  return STATUS_SUCCESS;
404  }
405  }
406 
407  if (PropertyId->Flags & KSPROPERTY_TYPE_GET)
408  {
409  if (FastIoTable[Index].GetSupported)
410  {
411  *FastPropertyHandler = FastIoTable[Index].GetPropertyHandler;
412  return STATUS_SUCCESS;
413  }
414  }
415  }
416 
417  }
418  /* no fast property handler found */
419  return STATUS_NOT_FOUND;
420 }
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: classpnp.h:966
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define STATUS_NOT_FOUND
Definition: shellext.h:67
static const UCHAR Index[8]
Definition: usbohci.c:18
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43

Referenced by KsFastPropertyHandler().

◆ FindPropertyHandler()

NTSTATUS FindPropertyHandler ( IN PIO_STATUS_BLOCK  IoStatus,
IN const KSPROPERTY_SET *  PropertySet,
IN ULONG  PropertySetCount,
IN PKSPROPERTY  Property,
IN ULONG  InputBufferLength,
IN ULONG  OutputBufferLength,
OUT PVOID  OutputBuffer,
OUT PFNKSHANDLER *  PropertyHandler,
OUT PKSPROPERTY_SET *  Set,
OUT PKSPROPERTY_ITEM *  PropertyItem 
)

Definition at line 20 of file property.c.

31 {
32  ULONG Index, ItemIndex;
33  PULONG Flags;
35 
36  for(Index = 0; Index < PropertySetCount; Index++)
37  {
38  ASSERT(PropertySet[Index].Set);
39 
40  if (IsEqualGUIDAligned(&Property->Set, PropertySet[Index].Set))
41  {
42  for(ItemIndex = 0; ItemIndex < PropertySet[Index].PropertiesCount; ItemIndex++)
43  {
44 
45  /* store property set */
46  *Set = (PKSPROPERTY_SET)&PropertySet[Index];
47  *PropertyItem = (PKSPROPERTY_ITEM)&PropertySet[Index].PropertyItem[ItemIndex];
48 
49 
50  if (PropertySet[Index].PropertyItem[ItemIndex].PropertyId == Property->Id)
51  {
53  {
54  if (sizeof(ULONG) > OutputBufferLength)
55  {
56  /* too small buffer */
58  }
59 
60  /* get output buffer */
62 
63  /* clear flags */
64  *Flags = 0;
65 
66  IoStatus->Information = sizeof(ULONG);
67 
68  if (PropertySet[Index].PropertyItem[ItemIndex].SupportHandler)
69  {
70  /* use support handler from driver */
71  *PropertyHandler = PropertySet[Index].PropertyItem[ItemIndex].SupportHandler;
72  return STATUS_SUCCESS;
73  }
74 
75  if (PropertySet[Index].PropertyItem[ItemIndex].GetSupported)
77 
78  if (PropertySet[Index].PropertyItem[ItemIndex].SetSupported)
80 
82  {
83  /* get output buffer */
85 
86  /* store result */
87  Description->DescriptionSize = sizeof(KSPROPERTY_DESCRIPTION);
88  Description->PropTypeSet.Set = KSPROPTYPESETID_General;
89  Description->PropTypeSet.Id = 0;
90  Description->PropTypeSet.Flags = 0;
91  Description->MembersListCount = 0;
92  Description->Reserved = 0;
93 
94  IoStatus->Information = sizeof(KSPROPERTY_DESCRIPTION);
95  }
96  return STATUS_SUCCESS;
97  }
98 
99  if (PropertySet[Index].PropertyItem[ItemIndex].MinProperty > InputBufferLength)
100  {
101  /* too small input buffer */
102  IoStatus->Information = PropertySet[Index].PropertyItem[ItemIndex].MinProperty;
104  }
105 
106  if (PropertySet[Index].PropertyItem[ItemIndex].MinData > OutputBufferLength)
107  {
108  /* too small output buffer */
109  IoStatus->Information = PropertySet[Index].PropertyItem[ItemIndex].MinData;
110  return STATUS_MORE_ENTRIES;
111  }
112 
113 
114  if (Property->Flags & KSPROPERTY_TYPE_SET)
115  {
116  /* store property handler */
117  *PropertyHandler = PropertySet[Index].PropertyItem[ItemIndex].SetPropertyHandler;
118  return STATUS_SUCCESS;
119  }
120 
121  if (Property->Flags & KSPROPERTY_TYPE_GET)
122  {
123  /* store property handler */
124  *PropertyHandler = PropertySet[Index].PropertyItem[ItemIndex].GetPropertyHandler;
125  return STATUS_SUCCESS;
126  }
127 
128 
129  }
130  }
131  }
132  }
133  return STATUS_NOT_FOUND;
134 }
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: classpnp.h:966
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
const GUID KSPROPTYPESETID_General
Definition: property.c:17
static const WCHAR Description[]
Definition: oid.c:1266
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
static BOOL Set
Definition: pageheap.c:10
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
#define KSPROPERTY_TYPE_BASICSUPPORT
Definition: dmksctrl.h:45
#define STATUS_NOT_FOUND
Definition: shellext.h:67
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_MORE_ENTRIES
Definition: udferr_usr.h:124
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
struct KSPROPERTY_DESCRIPTION * PKSPROPERTY_DESCRIPTION

Referenced by KspPropertyHandler().

◆ KsDispatchSpecificProperty()

KSDDKAPI NTSTATUS NTAPI KsDispatchSpecificProperty ( IN PIRP  Irp,
IN PFNKSHANDLER  Handler 
)

Definition at line 511 of file property.c.

514 {
515  PIO_STACK_LOCATION IoStack;
516 
517  /* get current irp stack location */
519 
520  return Handler(Irp, IoStack->Parameters.DeviceIoControl.Type3InputBuffer, Irp->UserBuffer);
521 }
_In_ PIRP Irp
Definition: csq.h:116
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER Handler
Definition: acpixf.h:656
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771

◆ KsFastPropertyHandler()

KSDDKAPI BOOLEAN NTAPI KsFastPropertyHandler ( IN PFILE_OBJECT  FileObject,
IN PKSPROPERTY UNALIGNED  Property,
IN ULONG  PropertyLength,
IN OUT PVOID UNALIGNED  Data,
IN ULONG  DataLength,
OUT PIO_STATUS_BLOCK  IoStatus,
IN ULONG  PropertySetsCount,
IN const KSPROPERTY_SET *  PropertySet 
)

Definition at line 429 of file property.c.

438 {
439  KSPROPERTY PropRequest;
442  ULONG Index;
443  PFNKSFASTHANDLER FastPropertyHandler;
444 
445  if (PropertyLength < sizeof(KSPROPERTY))
446  {
447  /* invalid request */
448  return FALSE;
449  }
450 
451  /* get previous mode */
453 
454  if (Mode == KernelMode)
455  {
456  /* just copy it */
457  RtlMoveMemory(&PropRequest, Property, sizeof(KSPROPERTY));
458  }
459  else
460  {
461  /* need to probe the buffer */
462  _SEH2_TRY
463  {
464  ProbeForRead(Property, sizeof(KSPROPERTY), sizeof(UCHAR));
465  RtlMoveMemory(&PropRequest, Property, sizeof(KSPROPERTY));
466  }
468  {
469  /* Exception, get the error code */
471  }_SEH2_END;
472 
473  if (!NT_SUCCESS(Status))
474  return FALSE;
475  }
476 
477  /* are there any property sets provided */
478  if (PropertySetsCount)
479  {
480  /* iterate through all property sets count */
481  Index = 0;
482  do
483  {
484  /* does the property id match */
485  if (IsEqualGUIDAligned(PropertySet[Index].Set, &PropRequest.Set))
486  {
487  /* try to find a fast property handler */
488  Status = FindFastPropertyHandler(PropertySet[Index].FastIoCount, PropertySet[Index].FastIoTable, &PropRequest, &FastPropertyHandler);
489 
490  if (NT_SUCCESS(Status))
491  {
492  /* call fast property handler */
493  ASSERT(PropertyLength == sizeof(KSPROPERTY)); /* FIXME check if property length is bigger -> copy params */
494  ASSERT(Mode == KernelMode); /* FIXME need to probe usermode output buffer */
495  return FastPropertyHandler(FileObject, &PropRequest, sizeof(KSPROPERTY), Data, DataLength, IoStatus);
496  }
497  }
498  /* move to next item */
499  Index++;
500  }while(Index < PropertySetsCount);
501  }
502  return FALSE;
503 }
NTSTATUS FindFastPropertyHandler(IN ULONG FastIoCount, IN const KSFASTPROPERTY_ITEM *FastIoTable, IN PKSPROPERTY PropertyId, OUT PFNKSFASTHANDLER *FastPropertyHandler)
Definition: property.c:385
_In_ ULONG Mode
Definition: hubbusif.h:303
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
LONG NTSTATUS
Definition: precomp.h:26
KPROCESSOR_MODE NTAPI ExGetPreviousMode(VOID)
Definition: sysinfo.c:2982
GUID Set
Definition: dmksctrl.h:76
static BOOL Set
Definition: pageheap.c:10
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
_SEH2_TRY
Definition: create.c:4250
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static const UCHAR Index[8]
Definition: usbohci.c:18
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
Status
Definition: gdiplustypes.h:24
_SEH2_END
Definition: create.c:4424
unsigned int ULONG
Definition: retypes.h:1
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG DataLength
Definition: hidpi.h:333
return STATUS_SUCCESS
Definition: btrfs.c:2777

◆ KspPropertyHandler()

NTSTATUS KspPropertyHandler ( IN PIRP  Irp,
IN ULONG  PropertySetsCount,
IN const KSPROPERTY_SET *  PropertySet,
IN PFNKSALLOCATOR Allocator  OPTIONAL,
IN ULONG PropertyItemSize  OPTIONAL 
)

Definition at line 138 of file property.c.

144 {
146  PKSPROPERTY_ITEM PropertyItem;
147  PKSPROPERTY_SET Set;
148  PIO_STACK_LOCATION IoStack;
150  PFNKSHANDLER PropertyHandler = NULL;
152  LPGUID Guid;
153  //UNICODE_STRING GuidBuffer;
154 
155  /* get current irp stack */
157 
158  /* get parameters */
159  OutputBufferLength = (IoStack->Parameters.DeviceIoControl.OutputBufferLength + 7) & ~7;
160  InputBufferLength = IoStack->Parameters.DeviceIoControl.InputBufferLength;
161 
162  /* check for invalid buffer length size */
163  if (OutputBufferLength < IoStack->Parameters.DeviceIoControl.OutputBufferLength)
164  {
165  /* unsigned overflow */
167  }
168 
169  /* check for integer overflow */
170  if (InputBufferLength + OutputBufferLength < IoStack->Parameters.DeviceIoControl.OutputBufferLength)
171  {
172  /* overflow */
174  }
175 
176  /* check if inputbuffer at least holds KSPROPERTY item */
177  if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSPROPERTY))
178  {
179  /* invalid parameter */
181  }
182 
183  /* get total size */
185 
186  /* get input property request */
187  Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
188 
189  /* have the parameters been checked yet */
190  if (!Irp->AssociatedIrp.SystemBuffer)
191  {
192  /* is it from user mode */
193  if (Irp->RequestorMode == UserMode)
194  {
195  /* probe user buffer */
196  ProbeForRead(IoStack->Parameters.DeviceIoControl.Type3InputBuffer, InputBufferLength, 1);
197  }
198 
199  /* do we have an allocator */
200  if ((Allocator) && (Property->Flags & (KSPROPERTY_TYPE_GET | KSPROPERTY_TYPE_SET)))
201  {
202  /* call allocator */
203  Status = Allocator(Irp, TotalSize, (Property->Flags & KSPROPERTY_TYPE_GET));
204 
205  /* check for success */
206  if (!NT_SUCCESS(Status))
207  return Status;
208  }
209  else
210  {
211  /* allocate buffer */
212  Irp->AssociatedIrp.SystemBuffer = AllocateItem(NonPagedPool, TotalSize);
213 
214  /* sanity check */
215  ASSERT(Irp->AssociatedIrp.SystemBuffer != NULL);
216 
217  /* mark irp as buffered so that changes the stream headers are propagated back */
219  }
220 
221  /* now copy the buffer */
222  RtlCopyMemory((PVOID)((ULONG_PTR)Irp->AssociatedIrp.SystemBuffer + OutputBufferLength), IoStack->Parameters.DeviceIoControl.Type3InputBuffer, InputBufferLength);
223 
224  /* use new property buffer */
225  Property = (PKSPROPERTY)((ULONG_PTR)Irp->AssociatedIrp.SystemBuffer + OutputBufferLength);
226 
227  /* is it a set operation */
228  if (Property->Flags & KSPROPERTY_TYPE_SET)
229  {
230  /* for set operations, the output parameters need to be copied */
231  if (Irp->RequestorMode == UserMode)
232  {
233  /* probe user parameter */
234  ProbeForRead(Irp->UserBuffer, IoStack->Parameters.DeviceIoControl.OutputBufferLength, 1);
235  }
236 
237  /* copy parameters, needs un-aligned parameter length */
238  RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, Irp->UserBuffer, IoStack->Parameters.DeviceIoControl.OutputBufferLength);
239  }
240 
241  /* is there an output buffer */
242  if (IoStack->Parameters.DeviceIoControl.OutputBufferLength)
243  {
244  /* is it from user mode */
245  if (Irp->RequestorMode == UserMode)
246  {
247  /* probe buffer for writing */
248  ProbeForWrite(Irp->UserBuffer, IoStack->Parameters.DeviceIoControl.OutputBufferLength, 1);
249  }
250 
251  if (!Allocator || !(Property->Flags & KSPROPERTY_TYPE_GET))
252  {
253  /* it is an input operation */
254  Irp->Flags |= IRP_INPUT_OPERATION;
255  }
256  }
257  }
258  else
259  {
260  /* use new property buffer */
261  Property = (PKSPROPERTY)((ULONG_PTR)Irp->AssociatedIrp.SystemBuffer + OutputBufferLength);
262  }
263 
264  //RtlStringFromGUID(&Property->Set, &GuidBuffer);
265 
266  //DPRINT("KspPropertyHandler Irp %p PropertySetsCount %u PropertySet %p Allocator %p PropertyItemSize %u ExpectedPropertyItemSize %u\n", Irp, PropertySetsCount, PropertySet, Allocator, PropertyItemSize, sizeof(KSPROPERTY_ITEM));
267  //DPRINT("PropertyId %lu PropertyFlags %x Guid %S\n", Property->Id, Property->Flags, GuidBuffer.Buffer);
268 
269  //RtlFreeUnicodeString(&GuidBuffer);
270 
271  /* sanity check */
272  ASSERT(PropertyItemSize == 0 || PropertyItemSize == sizeof(KSPROPERTY_ITEM));
273 
274  /* find the property handler */
275  Status = FindPropertyHandler(&Irp->IoStatus, PropertySet, PropertySetsCount, Property, InputBufferLength, OutputBufferLength, Irp->AssociatedIrp.SystemBuffer, &PropertyHandler, &Set, &PropertyItem);
276 
277  if (NT_SUCCESS(Status) && PropertyHandler)
278  {
279  /* store set */
280  KSPROPERTY_SET_IRP_STORAGE(Irp) = Set;
281 
282  /* are any custom property item sizes used */
283  if (PropertyItemSize)
284  {
285  /* store custom property item */
286  KSPROPERTY_ITEM_IRP_STORAGE(Irp) = PropertyItem;
287  }
288 
289  _SEH2_TRY
290  {
291  /* call property handler */
292  Status = PropertyHandler(Irp, Property, (OutputBufferLength > 0 ? Irp->AssociatedIrp.SystemBuffer : NULL));
293  }
295  {
297  }
298  _SEH2_END;
299 
301  {
302  /* output buffer is too small */
303  if (Allocator)
304  {
305  /* allocate the requested amount */
306  Status = Allocator(Irp, (ULONG)Irp->IoStatus.Information, FALSE);
307 
308  /* check if the block was allocated */
309  if (!NT_SUCCESS(Status))
310  {
311  /* no memory */
313  }
314  _SEH2_TRY
315  {
316  /* re-call property handler */
317  Status = PropertyHandler(Irp, Property, Irp->AssociatedIrp.SystemBuffer);
318  }
320  {
322  }
323  _SEH2_END;
324  }
325  }
326  }
328  {
329  // store output size
330  Irp->IoStatus.Information = sizeof(GUID) * PropertySetsCount;
331  if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(GUID) * PropertySetsCount)
332  {
333  // buffer too small
334  return STATUS_MORE_ENTRIES;
335  }
336 
337  // get output buffer
338  Guid = (LPGUID)Irp->AssociatedIrp.SystemBuffer;
339 
340  // copy property guids from property sets
341  for(Index = 0; Index < PropertySetsCount; Index++)
342  {
343  RtlMoveMemory(&Guid[Index], PropertySet[Index].Set, sizeof(GUID));
344  }
346  }
347 
348  /* done */
349  return Status;
350 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PIRP Irp
Definition: csq.h:116
#define KSPROPERTY_TYPE_SETSUPPORT
Definition: dmksctrl.h:44
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:30
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
static BOOL Set
Definition: pageheap.c:10
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
_SEH2_TRY
Definition: create.c:4250
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static GUID * Guid
Definition: apphelp.c:93
smooth NULL
Definition: ftsmooth.c:416
#define STATUS_INVALID_BUFFER_SIZE
Definition: ntstatus.h:636
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSTATUS FindPropertyHandler(IN PIO_STATUS_BLOCK IoStatus, IN const KSPROPERTY_SET *PropertySet, IN ULONG PropertySetCount, IN PKSPROPERTY Property, IN ULONG InputBufferLength, IN ULONG OutputBufferLength, OUT PVOID OutputBuffer, OUT PFNKSHANDLER *PropertyHandler, OUT PKSPROPERTY_SET *Set, OUT PKSPROPERTY_ITEM *PropertyItem)
Definition: property.c:20
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters
Definition: iotypes.h:871
struct PropertyItem PropertyItem
#define GUID_NULL
Definition: ks.h:106
#define STATUS_MORE_ENTRIES
Definition: udferr_usr.h:124
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
Status
Definition: gdiplustypes.h:24
_In_ DWORD Property
Definition: setupapi.h:1545
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
struct _GUID GUID
_SEH2_END
Definition: create.c:4424
#define IRP_INPUT_OPERATION
#define IRP_BUFFERED_IO
#define IRP_DEALLOCATE_BUFFER
unsigned int ULONG
Definition: retypes.h:1
struct KSIDENTIFIER * PKSPROPERTY
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2771
return STATUS_SUCCESS
Definition: btrfs.c:2777
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
GUID * LPGUID
Definition: guiddef.h:76

Referenced by _IRQL_requires_max_(), IKsFilter_DispatchDeviceIoControl(), IKsPin_DispatchDeviceIoControl(), and KsPropertyHandler().

◆ KsPropertyHandler()

KSDDKAPI NTSTATUS NTAPI KsPropertyHandler ( IN PIRP  Irp,
IN ULONG  PropertySetsCount,
IN const KSPROPERTY_SET *  PropertySet 
)

Definition at line 358 of file property.c.

362 {
363  return KspPropertyHandler(Irp, PropertySetsCount, PropertySet, NULL, 0);
364 }
_In_ PIRP Irp
Definition: csq.h:116
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS KspPropertyHandler(IN PIRP Irp, IN ULONG PropertySetsCount, IN const KSPROPERTY_SET *PropertySet, IN PFNKSALLOCATOR Allocator OPTIONAL, IN ULONG PropertyItemSize OPTIONAL)
Definition: property.c:138

Referenced by IKsClock_DispatchDeviceIoControl(), and PcHandlePropertyWithTable().

Variable Documentation

◆ KSPROPTYPESETID_General

const GUID KSPROPTYPESETID_General = {0x97E99BA0L, 0xBDEA, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}