OUT PKSPROPERTY_ITEM *PropertyItem)
{
ULONG Index, ItemIndex;
+ PULONG Flags;
+ PKSPROPERTY_DESCRIPTION Description;
for(Index = 0; Index < PropertySetCount; Index++)
{
{
for(ItemIndex = 0; ItemIndex < PropertySet[Index].PropertiesCount; ItemIndex++)
{
- if (PropertySet[Index].PropertyItem[ItemIndex].PropertyId == Property->Id)
- {
- if (PropertySet[Index].PropertyItem[ItemIndex].MinProperty > InputBufferLength)
- {
- /* too small input buffer */
- IoStatus->Information = PropertySet[Index].PropertyItem[ItemIndex].MinProperty;
- return STATUS_INVALID_PARAMETER;
- }
-
- if (PropertySet[Index].PropertyItem[ItemIndex].MinData > OutputBufferLength)
- {
- /* too small output buffer */
- IoStatus->Information = PropertySet[Index].PropertyItem[ItemIndex].MinData;
- return STATUS_MORE_ENTRIES;
- }
-
- /* store property set */
- *Set = (PKSPROPERTY_SET)&PropertySet[Index];
- *PropertyItem = (PKSPROPERTY_ITEM)&PropertySet[Index].PropertyItem[ItemIndex];
-
- if (Property->Flags & KSPROPERTY_TYPE_SET)
- {
- /* store property handler */
- *PropertyHandler = PropertySet[Index].PropertyItem[ItemIndex].SetPropertyHandler;
- return STATUS_SUCCESS;
- }
- if (Property->Flags & KSPROPERTY_TYPE_GET)
- {
- /* store property handler */
- *PropertyHandler = PropertySet[Index].PropertyItem[ItemIndex].GetPropertyHandler;
- return STATUS_SUCCESS;
- }
+ /* store property set */
+ *Set = (PKSPROPERTY_SET)&PropertySet[Index];
+ *PropertyItem = (PKSPROPERTY_ITEM)&PropertySet[Index].PropertyItem[ItemIndex];
+ if (PropertySet[Index].PropertyItem[ItemIndex].PropertyId == Property->Id)
+ {
if (Property->Flags & KSPROPERTY_TYPE_BASICSUPPORT)
{
- PULONG Flags;
- PKSPROPERTY_DESCRIPTION Description;
-
if (sizeof(ULONG) > OutputBufferLength)
{
/* too small buffer */
}
return STATUS_SUCCESS;
}
+
+ if (PropertySet[Index].PropertyItem[ItemIndex].MinProperty > InputBufferLength)
+ {
+ /* too small input buffer */
+ IoStatus->Information = PropertySet[Index].PropertyItem[ItemIndex].MinProperty;
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ if (PropertySet[Index].PropertyItem[ItemIndex].MinData > OutputBufferLength)
+ {
+ /* too small output buffer */
+ IoStatus->Information = PropertySet[Index].PropertyItem[ItemIndex].MinData;
+ return STATUS_MORE_ENTRIES;
+ }
+
+
+ if (Property->Flags & KSPROPERTY_TYPE_SET)
+ {
+ /* store property handler */
+ *PropertyHandler = PropertySet[Index].PropertyItem[ItemIndex].SetPropertyHandler;
+ return STATUS_SUCCESS;
+ }
+
+ if (Property->Flags & KSPROPERTY_TYPE_GET)
+ {
+ /* store property handler */
+ *PropertyHandler = PropertySet[Index].PropertyItem[ItemIndex].GetPropertyHandler;
+ return STATUS_SUCCESS;
+ }
+
+
}
}
}
if (Allocator)
{
/* allocate the requested amount */
- Status = Allocator(Irp, Irp->IoStatus.Information, FALSE);
+ Status = Allocator(Irp, (ULONG)Irp->IoStatus.Information, FALSE);
/* check if the block was allocated */
if (!NT_SUCCESS(Status))
/*
@implemented
*/
+_IRQL_requires_max_(PASSIVE_LEVEL)
KSDDKAPI
NTSTATUS
NTAPI
KsPropertyHandlerWithAllocator(
- IN PIRP Irp,
- IN ULONG PropertySetsCount,
- IN PKSPROPERTY_SET PropertySet,
- IN PFNKSALLOCATOR Allocator OPTIONAL,
- IN ULONG PropertyItemSize OPTIONAL)
+ _In_ PIRP Irp,
+ _In_ ULONG PropertySetsCount,
+ _In_reads_(PropertySetsCount) const KSPROPERTY_SET* PropertySet,
+ _In_opt_ PFNKSALLOCATOR Allocator,
+ _In_opt_ ULONG PropertyItemSize)
{
return KspPropertyHandler(Irp, PropertySetsCount, PropertySet, Allocator, PropertyItemSize);
}