ReactOS  0.4.14-dev-52-g6116262
allocators.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Kernel Streaming
4  * FILE: drivers/ksfilter/ks/allocators.c
5  * PURPOSE: KS Allocator functions
6  * PROGRAMMER: Johannes Anderwald
7  */
8 
9 #include "precomp.h"
10 
11 #define NDEBUG
12 #include <debug.h>
13 
14 typedef enum
15 {
20 
21 typedef enum
22 {
27 
29 
32 
35 
38 
39 typedef struct
40 {
41  IKsAllocatorVtbl *lpVtbl;
45 
47 
48  union
49  {
53  }u;
54 
55  union
56  {
57  PFNKSDEFAULTALLOCATE DefaultAllocate;
60  }Allocate;
61 
62  union
63  {
64  PFNKSDEFAULTFREE DefaultFree;
67  }Free;
68 
69  union
70  {
71  PFNKSDELETEALLOCATOR DefaultDelete;
74  }Delete;
75 
77 
78 /* use KSNAME_Allocator for IID_IKsAllocator */
79 const GUID IID_IKsAllocator = {0x642F5D00L, 0x4791, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
80 const GUID KSPROPSETID_StreamAllocator = {0x0cf6e4342, 0xec87, 0x11cf, {0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}};
81 
82 
84 NTAPI
87  PVOID *Frame);
88 
89 VOID
90 NTAPI
93  PVOID Frame);
94 
95 
97 NTAPI
99  IKsAllocator * iface,
100  IN REFIID refiid,
101  OUT PVOID* Output)
102 {
104 
105  if (IsEqualGUIDAligned(refiid, &IID_IUnknown) ||
107  {
108  *Output = &This->lpVtbl;
110  return STATUS_SUCCESS;
111  }
112  return STATUS_UNSUCCESSFUL;
113 }
114 
115 ULONG
116 NTAPI
118  IKsAllocator * iface)
119 {
121 
122  return InterlockedIncrement(&This->ref);
123 }
124 
125 ULONG
126 NTAPI
128  IKsAllocator * iface)
129 {
131 
132  InterlockedDecrement(&This->ref);
133 
134  if (This->ref == 0)
135  {
136  FreeItem(This);
137  return 0;
138  }
139  /* Return new reference count */
140  return This->ref;
141 }
142 
143 NTSTATUS
144 NTAPI
146  IKsAllocator *iface,
148  IN PIRP Irp)
149 {
151  PIO_STACK_LOCATION IoStack;
152  PKSSTREAMALLOCATOR_FUNCTIONTABLE FunctionTable;
155 
156  /* FIXME locks */
157 
158  /* get current irp stack */
160 
161  if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
162  {
163  /* only KSPROPERTY requests are supported */
165 
166  /* complete and forget irps */
167  Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
169 
170  return STATUS_NOT_IMPLEMENTED;
171  }
172 
173  if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(KSPROPERTY))
174  {
175  /* invalid request */
176  Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
178 
180  }
181 
182  /* check the request */
183  Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer;
184 
186  {
188  {
189  if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSSTREAMALLOCATOR_FUNCTIONTABLE))
190  {
191  /* buffer too small */
192  Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
193  Irp->IoStatus.Information = sizeof(KSSTREAMALLOCATOR_FUNCTIONTABLE);
194  /* complete and forget irp */
197  }
198  if (!(Property->Flags & KSPROPERTY_TYPE_GET))
199  {
200  /* only support retrieving the property */
201  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
202  /* complete and forget irp */
204  return STATUS_UNSUCCESSFUL;
205  }
206 
207  /* get output buffer */
208  FunctionTable = (PKSSTREAMALLOCATOR_FUNCTIONTABLE)Irp->UserBuffer;
209 
210  FunctionTable->AllocateFrame = IKsAllocator_Allocate;
212 
213  /* save result */
214  Irp->IoStatus.Status = STATUS_SUCCESS;
215  Irp->IoStatus.Information = sizeof(KSSTREAMALLOCATOR_FUNCTIONTABLE);
216  /* complete request */
218  return STATUS_SUCCESS;
219  }
221  {
222  if (IoStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(KSPROPERTY_STREAMALLOCATOR_STATUS))
223  {
224  /* buffer too small */
225  Irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
226  Irp->IoStatus.Information = sizeof(KSPROPERTY_STREAMALLOCATOR_STATUS);
227  /* complete and forget irp */
230  }
231  if (!(Property->Flags & KSPROPERTY_TYPE_GET))
232  {
233  /* only support retrieving the property */
234  Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
235  /* complete and forget irp */
237  return STATUS_UNSUCCESSFUL;
238  }
239 
240  /* get output buffer */
241  State = (PKSSTREAMALLOCATOR_STATUS)Irp->UserBuffer;
242 
243  /* copy allocator status */
244  RtlMoveMemory(State, &This->Status, sizeof(KSSTREAMALLOCATOR_STATUS));
245 
246  /* save result */
247  Irp->IoStatus.Status = STATUS_SUCCESS;
248  Irp->IoStatus.Information = sizeof(KSSTREAMALLOCATOR_STATUS);
249 
250  /* complete request */
252  return STATUS_SUCCESS;
253  }
254  }
255 
256  /* unhandled request */
257  Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
259 
260  return STATUS_NOT_SUPPORTED;
261 }
262 
263 NTSTATUS
264 NTAPI
266  IKsAllocator *iface)
267 {
269 
270  /* FIXME locks */
271 
272  /* now close allocator */
273  if (This->Type == ALLOCATOR_CUSTOM)
274  {
275  This->Delete.DefaultDelete(This->u.CustomList);
276  }
277  else if (This->Type == ALLOCATOR_NPAGED_LOOKASIDE)
278  {
279  This->Delete.NPagedPool(&This->u.NPagedList);
280  }
281  else if (This->Type == ALLOCATOR_PAGED_LOOKASIDE)
282  {
283  This->Delete.PagedPool(&This->u.PagedList);
284  }
285 
286  /* free object header */
287  KsFreeObjectHeader(&This->Header);
288 
289  return STATUS_SUCCESS;
290 }
291 
292 NTSTATUS
293 NTAPI
295  IKsAllocator *iface,
296  IN PVOID * OutFrame)
297 {
298  PVOID Frame = NULL;
300 
301  /* FIXME locks */
302 
303  /* now allocate frame */
304  if (This->Type == ALLOCATOR_CUSTOM)
305  {
306  Frame = This->Allocate.DefaultAllocate(This->u.CustomList);
307  }
308  else if (This->Type == ALLOCATOR_NPAGED_LOOKASIDE)
309  {
310  Frame = This->Allocate.NPagedPool(&This->u.NPagedList);
311  }
312  else if (This->Type == ALLOCATOR_PAGED_LOOKASIDE)
313  {
314  Frame = This->Allocate.PagedPool(&This->u.PagedList);
315  }
316 
317  if (Frame)
318  {
319  *OutFrame = Frame;
320  InterlockedIncrement((PLONG)&This->Status.AllocatedFrames);
321  return STATUS_SUCCESS;
322  }
323 
324  return STATUS_UNSUCCESSFUL;
325 }
326 
327 VOID
328 NTAPI
330  IKsAllocator *iface,
331  IN PVOID Frame)
332 {
334 
335  /* now allocate frame */
336  if (This->Type == ALLOCATOR_CUSTOM)
337  {
338  This->Free.DefaultFree(This->u.CustomList, Frame);
339  }
340  else if (This->Type == ALLOCATOR_NPAGED_LOOKASIDE)
341  {
342  This->Free.NPagedPool(&This->u.NPagedList, Frame);
343  }
344  else if (This->Type == ALLOCATOR_PAGED_LOOKASIDE)
345  {
346  This->Free.PagedPool(&This->u.PagedList, Frame);
347  }
348 }
349 
350 
351 static IKsAllocatorVtbl vt_IKsAllocator =
352 {
360 };
361 
362 
363 /*
364  @implemented
365 */
371 {
375  sizeof(KSALLOCATOR_FRAMING),
376  GENERIC_READ,
378 }
379 
380 /*
381  @implemented
382 */
385  IN PIRP Irp)
386 {
388 }
389 
390 /*
391  @implemented
392 */
393 KSDDKAPI
394 NTSTATUS
395 NTAPI
397  IN PIRP Irp,
398  OUT PKSALLOCATOR_FRAMING* OutAllocatorFraming)
399 {
401  ULONG Size;
403  ULONG SupportedFlags;
404 
405  /* set minimum request size */
406  Size = sizeof(KSALLOCATOR_FRAMING);
407 
410  &Size,
412 
413  if (!NT_SUCCESS(Status))
414  return Status;
415 
416  /* allowed supported flags */
420 
421 
422  if (!AllocatorFraming->FrameSize || (AllocatorFraming->OptionsFlags & (~SupportedFlags)))
423  {
426  }
427 
428  /* store result */
429  *OutAllocatorFraming = AllocatorFraming;
430 
431  return Status;
432 }
433 
434 NTSTATUS
438  IN PIRP Irp,
439  IN PVOID Frame,
441 {
444  IKsAllocator * Allocator;
445 
446  /* sanity check */
448 
449  /* get object header */
450  Header = (PKSIOBJECT_HEADER)FileObject->FsContext2;
451 
452  /* get real allocator */
453  Status = Header->Unknown->lpVtbl->QueryInterface(Header->Unknown, &IID_IKsAllocator, (PVOID*)&Allocator);
454 
455  if (!NT_SUCCESS(Status))
456  {
457  /* misbehaving object */
458  return STATUS_UNSUCCESSFUL;
459  }
460 
462  {
463  /* dispatch request allocator */
464  Status = Allocator->lpVtbl->DispatchDeviceIoControl(Allocator, DeviceObject, Irp);
465  }
466  else if (Request == ALLOCATOR_DEVICE_CLOSE)
467  {
468  /* delete allocator */
469  Status = Allocator->lpVtbl->Close(Allocator);
470  }
471  else if (Request == ALLOCATOR_ALLOCATE)
472  {
473  /* allocate frame */
474  Status = Allocator->lpVtbl->AllocateFrame(Allocator, (PVOID*)Frame);
475 
476  }else if (Request == ALLOCATOR_FREE)
477  {
478  /* allocate frame */
479  Allocator->lpVtbl->FreeFrame(Allocator, Frame);
481  }
482 
483  /* release interface */
484  Allocator->lpVtbl->Release(Allocator);
485 
486  return Status;
487 }
488 
489 NTSTATUS
490 NTAPI
493  IN PIRP Irp)
494 {
495  PIO_STACK_LOCATION IoStack;
497 
498  /* get current irp stack */
500 
501  /* dispatch request */
503 
504  /* complete request */
505  Irp->IoStatus.Status = Status;
507 
508  return Status;
509 }
510 
511 NTSTATUS
512 NTAPI
515  IN PIRP Irp)
516 {
517  PIO_STACK_LOCATION IoStack;
519 
520  /* get current irp stack */
522 
523  /* dispatch request */
525 
526  /* complete request */
527  Irp->IoStatus.Status = Status;
529 
530  return Status;
531 }
532 
533 NTSTATUS
534 NTAPI
537  PVOID *Frame)
538 {
540 
541  /* dispatch request */
543 
544  return Status;
545 }
546 
547 VOID
548 NTAPI
551  PVOID Frame)
552 {
553  /* dispatch request */
555 }
556 
557 
558 static KSDISPATCH_TABLE DispatchTable =
559 {
570 };
571 
572 /*
573  @implemented
574 */
577  IN PIRP Irp,
579  IN PFNKSDEFAULTALLOCATE DefaultAllocate OPTIONAL,
580  IN PFNKSDEFAULTFREE DefaultFree OPTIONAL,
581  IN PFNKSINITIALIZEALLOCATOR InitializeAllocator OPTIONAL,
582  IN PFNKSDELETEALLOCATOR DeleteAllocator OPTIONAL)
583 {
586  PALLOCATOR Allocator;
587  PVOID Ctx;
588 
589  /* first validate connect request */
591  if (!NT_SUCCESS(Status))
593 
594  /* check the valid file alignment */
596  {
599  }
600 
601  /* allocate allocator struct */
602  Allocator = AllocateItem(NonPagedPool, sizeof(ALLOCATOR));
603  if (!Allocator)
604  {
607  }
608 
609  /* allocate object header */
610 
612  if (!NT_SUCCESS(Status))
613  {
615  FreeItem(Allocator);
616  return Status;
617  }
618 
619  /* set allocator type in object header */
620  Allocator->lpVtbl = &vt_IKsAllocator;
621  Allocator->Header->Unknown = (PUNKNOWN)&Allocator->lpVtbl;
622  Allocator->ref = 1;
623 
624  if (DefaultAllocate)
625  {
626  /* use external allocator */
627  Allocator->Type = ALLOCATOR_CUSTOM;
628  Allocator->Allocate.DefaultAllocate = DefaultAllocate;
629  Allocator->Free.DefaultFree = DefaultFree;
630  Allocator->Delete.DefaultDelete = DeleteAllocator;
631  Ctx = InitializeAllocator(InitializeContext, AllocatorFraming, &Allocator->u.CustomList);
632  /* check for success */
633  if (!Ctx)
634  {
635  KsFreeObjectHeader(Allocator->Header);
636  FreeItem(Allocator);
637  return Status;
638  }
639  }
641  {
642  /* use non-paged pool allocator */
643  Allocator->Type = ALLOCATOR_NPAGED_LOOKASIDE;
644  Allocator->Allocate.NPagedPool = ExAllocateFromNPagedLookasideList;
645  Allocator->Free.NPagedPool = ExFreeToNPagedLookasideList;
648  }
649  else if (AllocatorFraming->PoolType == PagedPool)
650  {
651  /* use paged pool allocator */
652  Allocator->Allocate.PagedPool = ExAllocateFromPagedLookasideList;
653  Allocator->Free.PagedPool = ExFreeToPagedLookasideList;
655  Allocator->Type = ALLOCATOR_PAGED_LOOKASIDE;
657 
658  }
659 
660  /* backup allocator framing */
663 
664  return Status;
665 }
666 
667 /*
668  @implemented
669 */
672  IN PKSALLOCATOR_FRAMING_EX Framing,
674  IN const KSALLOCATOR_FRAMING_EX* PinFraming)
675 {
676  if (BufferSize < sizeof(KSALLOCATOR_FRAMING_EX))
678 
679  /* verify framing */
680  if ((Framing->FramingItem[0].Flags & KSALLOCATOR_FLAG_PARTIAL_READ_SUPPORT) &&
681  Framing->OutputCompression.RatioNumerator != MAXULONG &&
682  Framing->OutputCompression.RatioDenominator != 0 &&
683  Framing->OutputCompression.RatioDenominator < Framing->OutputCompression.RatioNumerator)
684  {
685  /* framing request is ok */
686  return STATUS_SUCCESS;
687  }
688 
690 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
KSDDKAPI NTSTATUS NTAPI KsValidateAllocatorCreateRequest(IN PIRP Irp, OUT PKSALLOCATOR_FRAMING *OutAllocatorFraming)
Definition: allocators.c:396
NTSTATUS NTAPI IKsAllocator_fnQueryInterface(IKsAllocator *iface, IN REFIID refiid, OUT PVOID *Output)
Definition: allocators.c:98
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
NTSTATUS NTAPI IKsAllocator_fnDeviceIoControl(IKsAllocator *iface, IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: allocators.c:145
#define IN
Definition: typedefs.h:38
KSALLOCATOR_FRAMING Framing
Definition: ks.h:2724
PUNKNOWN Unknown
Definition: kstypes.h:29
#define REFIID
Definition: guiddef.h:118
KSDDKAPI NTSTATUS NTAPI KsDispatchSetSecurity(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:67
VOID NTAPI ExInitializePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:274
#define KSSTRING_Allocator
Definition: ks.h:50
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
KSDDKAPI NTSTATUS NTAPI KsDispatchQuerySecurity(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:22
struct _Entry Entry
Definition: kefuncs.h:640
NTSTATUS NTAPI IKsAllocator_Allocate(IN PFILE_OBJECT FileObject, PVOID *Frame)
Definition: allocators.c:535
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
ALLOCATOR_TYPE
Definition: allocators.c:14
union ALLOCATOR::@960 Free
NTSTATUS NTAPI KspCreateObjectType(IN HANDLE ParentHandle, IN LPWSTR ObjectType, PVOID CreateParameters, UINT CreateParametersSize, IN ACCESS_MASK DesiredAccess, OUT PHANDLE NodeHandle)
Definition: topology.c:16
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
PFNKSPAGEDPOOLDELETE PagedPool
Definition: allocators.c:73
struct KSIOBJECT_HEADER * PKSIOBJECT_HEADER
KSDDKAPI NTSTATUS NTAPI KsCreateDefaultAllocator(IN PIRP Irp)
Definition: allocators.c:384
VOID InitializeContext(IN PCALLBACK16 Context, IN USHORT Segment, IN USHORT Offset)
Definition: callback.c:60
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:30
LONG NTSTATUS
Definition: precomp.h:26
_In_ PKSALLOCATOR_FRAMING AllocatorFraming
Definition: ks.h:4518
KSDDKAPI BOOLEAN NTAPI KsDispatchFastIoDeviceControlFailure(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferLength, OUT PVOID OutputBuffer OPTIONAL, IN ULONG OutputBufferLength, IN ULONG IoControlCode, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: irp.c:1218
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
PFNKSPAGEDPOOLFREE PagedPool
Definition: allocators.c:65
VOID(NTAPI * PFNKSPAGEDPOOLDELETE)(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: allocators.c:37
#define KSDDKAPI
Definition: ks.h:40
#define KSALLOCATOR_FLAG_PARTIAL_READ_SUPPORT
Definition: ks.h:1694
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
NTSTATUS KspCopyCreateRequest(IN PIRP Irp, IN LPWSTR ObjectClass, IN OUT PULONG Size, OUT PVOID *Result)
Definition: misc.c:101
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:656
NPAGED_LOOKASIDE_LIST NPagedList
Definition: allocators.c:50
struct ALLOCATOR * PALLOCATOR
KSDDKAPI VOID NTAPI KsFreeObjectHeader(IN PVOID Header)
Definition: api.c:720
static KSDISPATCH_TABLE DispatchTable
Definition: allocators.c:558
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:656
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
NTSTATUS NTAPI IKsAllocator_fnAllocateFrame(IKsAllocator *iface, IN PVOID *OutFrame)
Definition: allocators.c:294
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
PAGED_LOOKASIDE_LIST PagedList
Definition: allocators.c:51
#define KSALLOCATOR_OPTIONF_SYSTEM_MEMORY
Definition: ks.h:1691
long __cdecl _InterlockedIncrement(_Interlocked_operand_ long volatile *_Addend)
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
KSDDKAPI NTSTATUS NTAPI KsCreateAllocator(IN HANDLE ConnectionHandle, IN PKSALLOCATOR_FRAMING AllocatorFraming, OUT PHANDLE AllocatorHandle)
Definition: allocators.c:367
PFNKSDEFAULTFREE DefaultFree
Definition: allocators.c:64
#define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY
Definition: ks.h:1685
Definition: Header.h:8
#define KSALLOCATOR_OPTIONF_COMPATIBLE
Definition: ks.h:1690
long LONG
Definition: pedump.c:60
ULONG NTAPI IKsAllocator_fnAddRef(IKsAllocator *iface)
Definition: allocators.c:117
#define KSALLOCATOR_REQUIREMENTF_INPLACE_MODIFIER
Definition: ks.h:1684
PVOID(* PFNKSNPAGEDPOOLALLOCATE)(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: allocators.c:31
KSDDKAPI NTSTATUS NTAPI KsValidateAllocatorFramingEx(IN PKSALLOCATOR_FRAMING_EX Framing, IN ULONG BufferSize, IN const KSALLOCATOR_FRAMING_EX *PinFraming)
Definition: allocators.c:671
NTSTATUS NTAPI IKsAllocator_DispatchDeviceIoControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: allocators.c:491
VOID(NTAPI * PFNKSNPAGEDPOOLDELETE)(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: allocators.c:36
smooth NULL
Definition: ftsmooth.c:416
union ALLOCATOR::@958 u
const GUID IID_IKsAllocator
Definition: allocators.c:79
VOID NTAPI ExDeletePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:198
struct KSSTREAMALLOCATOR_STATUS * PKSSTREAMALLOCATOR_STATUS
LONG ref
Definition: allocators.c:42
void * PVOID
Definition: retypes.h:9
NTSTATUS NTAPI IKsAllocator_DispatchClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: allocators.c:513
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
ULONG NTAPI IKsAllocator_fnRelease(IKsAllocator *iface)
Definition: allocators.c:127
IKsAllocatorVtbl * lpVtbl
Definition: allocators.c:41
NTSTATUS NTAPI IKsAllocator_fnClose(IKsAllocator *iface)
Definition: allocators.c:265
PFNKSNPAGEDPOOLDELETE NPagedPool
Definition: allocators.c:72
PFNKSNPAGEDPOOLFREE NPagedPool
Definition: allocators.c:66
KSDDKAPI NTSTATUS NTAPI KsDispatchInvalidDeviceRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1156
static IKsAllocatorVtbl vt_IKsAllocator
Definition: allocators.c:351
VOID(* PFNKSPAGEDPOOLFREE)(IN PPAGED_LOOKASIDE_LIST Lookaside, IN PVOID Entry)
Definition: allocators.c:33
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:222
_Inout_ PVOID Lookaside
Definition: fltkernel.h:2532
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PFNKSDEFAULTALLOCATE DefaultAllocate
Definition: allocators.c:57
const GUID IID_IUnknown
VOID(* PFNKSNPAGEDPOOLFREE)(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PVOID Entry)
Definition: allocators.c:34
#define BufferSize
Definition: classpnp.h:419
nsrefcnt Release()
PKSIOBJECT_HEADER Header
Definition: allocators.c:43
KSDDKAPI NTSTATUS NTAPI KsCreateDefaultAllocatorEx(IN PIRP Irp, IN PVOID InitializeContext OPTIONAL, IN PFNKSDEFAULTALLOCATE DefaultAllocate OPTIONAL, IN PFNKSDEFAULTFREE DefaultFree OPTIONAL, IN PFNKSINITIALIZEALLOCATOR InitializeAllocator OPTIONAL, IN PFNKSDELETEALLOCATOR DeleteAllocator OPTIONAL)
Definition: allocators.c:576
* PFILE_OBJECT
Definition: iotypes.h:1955
NTSTATUS NTAPI CompleteRequest(IN PIRP Irp, IN NTSTATUS Status, IN ULONG_PTR Information)
Definition: dispatch.c:19
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
VOID NTAPI IKsAllocator_FreeFrame(IN PFILE_OBJECT FileObject, PVOID Frame)
Definition: allocators.c:549
ALLOCATOR_TYPE Type
Definition: allocators.c:44
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedDecrement
Definition: armddk.h:52
Definition: arc.h:85
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
#define KSALLOCATOR_REQUIREMENTF_MUST_ALLOCATE
Definition: ks.h:1687
#define VOID
Definition: acefi.h:82
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define GENERIC_READ
Definition: compat.h:124
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
PFNKSNPAGEDPOOLALLOCATE NPagedPool
Definition: allocators.c:59
NTSTATUS IKsAllocator_DispatchRequest(IN PDEVICE_OBJECT DeviceObject, IN PFILE_OBJECT FileObject, IN PIRP Irp, IN PVOID Frame, IN ALLOC_REQUEST Request)
Definition: allocators.c:435
VOID NTAPI IKsAllocator_fnFreeFrame(IKsAllocator *iface, IN PVOID Frame)
Definition: allocators.c:329
Status
Definition: gdiplustypes.h:24
ULONG PoolType
Definition: ks.h:1668
#define MAXULONG
Definition: typedefs.h:250
_In_ DWORD Property
Definition: setupapi.h:1545
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
_In_ PKSALLOCATOR_FRAMING _Out_ PHANDLE AllocatorHandle
Definition: ks.h:4518
PFILE_OBJECT FileObject
Definition: iotypes.h:2813
enum State_ State
Definition: pofuncs.h:54
#define InterlockedIncrement
Definition: armddk.h:53
PFNKSPAGEDPOOLALLOCATE PagedPool
Definition: allocators.c:58
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
KSDDKAPI BOOLEAN NTAPI KsDispatchFastReadFailure(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: irp.c:1238
union ALLOCATOR::@961 Delete
ALLOC_REQUEST
Definition: allocators.c:21
KSSTREAMALLOCATOR_STATUS Status
Definition: allocators.c:46
const GUID KSPROPSETID_StreamAllocator
Definition: allocators.c:80
#define OUT
Definition: typedefs.h:39
KSDDKAPI NTSTATUS NTAPI KsAllocateObjectHeader(OUT KSOBJECT_HEADER *Header, IN ULONG ItemsCount, IN PKSOBJECT_CREATE_ITEM ItemsList OPTIONAL, IN PIRP Irp, IN KSDISPATCH_TABLE *Table)
Definition: api.c:610
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:566
#define UNIMPLEMENTED
Definition: debug.h:114
PVOID CustomList
Definition: allocators.c:52
static WLX_DISPATCH_VERSION_1_4 FunctionTable
Definition: wlx.c:736
struct KSIDENTIFIER * PKSPROPERTY
PFNKSDELETEALLOCATOR DefaultDelete
Definition: allocators.c:71
union ALLOCATOR::@959 Allocate
_In_ PKSPIN_CONNECT _In_ ACCESS_MASK _Out_ PHANDLE ConnectionHandle
Definition: ks.h:4536
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
ULONG FileAlignment
Definition: ks.h:1672
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST
return STATUS_SUCCESS
Definition: btrfs.c:2966
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:174
signed int * PLONG
Definition: retypes.h:5
BOOL Delete(LPCTSTR ServiceName)
Definition: delete.c:12
#define KSALLOCATOR_REQUIREMENTF_FRAME_INTEGRITY
Definition: ks.h:1686
ULONG FrameSize
Definition: ks.h:1671
PVOID(NTAPI * PFNKSINITIALIZEALLOCATOR)(_In_ PVOID InitialContext, _In_ PKSALLOCATOR_FRAMING AllocatorFraming, _Outptr_ PVOID *Context)
Definition: ks.h:2679
ULONG OptionsFlags
Definition: ks.h:1662
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
PVOID(* PFNKSPAGEDPOOLALLOCATE)(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: allocators.c:30