ReactOS 0.4.15-dev-8227-g32d615f
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
14typedef enum
15{
20
21typedef enum
22{
27
29
32
35
38
39typedef struct
40{
41 IKsAllocatorVtbl *lpVtbl;
45
47
48 union
49 {
53 }u;
54
55 union
56 {
57 PFNKSDEFAULTALLOCATE DefaultAllocate;
61
62 union
63 {
64 PFNKSDEFAULTFREE DefaultFree;
68
69 union
70 {
71 PFNKSDELETEALLOCATOR DefaultDelete;
75
77
78/* use KSNAME_Allocator for IID_IKsAllocator */
79const GUID IID_IKsAllocator = {0x642F5D00L, 0x4791, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
80const GUID KSPROPSETID_StreamAllocator = {0x0cf6e4342, 0xec87, 0x11cf, {0xa1, 0x30, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}};
81
82
87 PVOID *Frame);
88
89VOID
93 PVOID Frame);
94
95
99 IKsAllocator * iface,
100 IN REFIID refiid,
102{
104
105 if (IsEqualGUIDAligned(refiid, &IID_IUnknown) ||
107 {
108 *Output = &This->lpVtbl;
110 return STATUS_SUCCESS;
111 }
112 return STATUS_UNSUCCESSFUL;
113}
114
115ULONG
116NTAPI
118 IKsAllocator * iface)
119{
121
122 return InterlockedIncrement(&This->ref);
123}
124
125ULONG
126NTAPI
128 IKsAllocator * iface)
129{
131
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
144NTAPI
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
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 */
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
261}
262
264NTAPI
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
293NTAPI
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
327VOID
328NTAPI
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
351static IKsAllocatorVtbl vt_IKsAllocator =
352{
360};
361
362
363/*
364 @implemented
365*/
371{
375 sizeof(KSALLOCATOR_FRAMING),
378}
379
380/*
381 @implemented
382*/
385 IN PIRP Irp)
386{
388}
389
390/*
391 @implemented
392*/
395NTAPI
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
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 }
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
490NTAPI
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
512NTAPI
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
534NTAPI
537 PVOID *Frame)
538{
540
541 /* dispatch request */
543
544 return Status;
545}
546
547VOID
548NTAPI
551 PVOID Frame)
552{
553 /* dispatch request */
555}
556
557
558static 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 }
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*/
674 IN const KSALLOCATOR_FRAMING_EX* PinFraming)
675{
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}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define VOID
Definition: acefi.h:82
VOID(NTAPI * PFNKSPAGEDPOOLDELETE)(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: allocators.c:37
VOID NTAPI IKsAllocator_FreeFrame(IN PFILE_OBJECT FileObject, PVOID Frame)
Definition: allocators.c:549
PVOID(* PFNKSNPAGEDPOOLALLOCATE)(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: allocators.c:31
NTSTATUS NTAPI IKsAllocator_fnAllocateFrame(IKsAllocator *iface, IN PVOID *OutFrame)
Definition: allocators.c:294
NTSTATUS NTAPI IKsAllocator_Allocate(IN PFILE_OBJECT FileObject, PVOID *Frame)
Definition: allocators.c:535
NTSTATUS NTAPI IKsAllocator_fnQueryInterface(IKsAllocator *iface, IN REFIID refiid, OUT PVOID *Output)
Definition: allocators.c:98
VOID NTAPI IKsAllocator_fnFreeFrame(IKsAllocator *iface, IN PVOID Frame)
Definition: allocators.c:329
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
static IKsAllocatorVtbl vt_IKsAllocator
Definition: allocators.c:351
KSDDKAPI NTSTATUS NTAPI KsCreateDefaultAllocator(IN PIRP Irp)
Definition: allocators.c:384
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
KSDDKAPI NTSTATUS NTAPI KsCreateAllocator(IN HANDLE ConnectionHandle, IN PKSALLOCATOR_FRAMING AllocatorFraming, OUT PHANDLE AllocatorHandle)
Definition: allocators.c:367
NTSTATUS NTAPI IKsAllocator_DispatchClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: allocators.c:513
ULONG NTAPI IKsAllocator_fnAddRef(IKsAllocator *iface)
Definition: allocators.c:117
ALLOC_REQUEST
Definition: allocators.c:22
@ ALLOCATOR_ALLOCATE
Definition: allocators.c:25
@ ALLOCATOR_FREE
Definition: allocators.c:26
@ ALLOCATOR_DEVICE_CONTROL
Definition: allocators.c:23
@ ALLOCATOR_DEVICE_CLOSE
Definition: allocators.c:24
NTSTATUS NTAPI IKsAllocator_fnDeviceIoControl(IKsAllocator *iface, IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: allocators.c:145
VOID(NTAPI * PFNKSNPAGEDPOOLDELETE)(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: allocators.c:36
VOID(* PFNKSNPAGEDPOOLFREE)(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PVOID Entry)
Definition: allocators.c:34
KSDDKAPI NTSTATUS NTAPI KsValidateAllocatorFramingEx(IN PKSALLOCATOR_FRAMING_EX Framing, IN ULONG BufferSize, IN const KSALLOCATOR_FRAMING_EX *PinFraming)
Definition: allocators.c:671
KSDDKAPI NTSTATUS NTAPI KsValidateAllocatorCreateRequest(IN PIRP Irp, OUT PKSALLOCATOR_FRAMING *OutAllocatorFraming)
Definition: allocators.c:396
const GUID KSPROPSETID_StreamAllocator
Definition: allocators.c:80
ALLOCATOR_TYPE
Definition: allocators.c:15
@ ALLOCATOR_CUSTOM
Definition: allocators.c:18
@ ALLOCATOR_PAGED_LOOKASIDE
Definition: allocators.c:17
@ ALLOCATOR_NPAGED_LOOKASIDE
Definition: allocators.c:16
NTSTATUS NTAPI IKsAllocator_DispatchDeviceIoControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: allocators.c:491
PVOID(* PFNKSPAGEDPOOLALLOCATE)(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: allocators.c:30
NTSTATUS NTAPI IKsAllocator_fnClose(IKsAllocator *iface)
Definition: allocators.c:265
struct ALLOCATOR * PALLOCATOR
ULONG NTAPI IKsAllocator_fnRelease(IKsAllocator *iface)
Definition: allocators.c:127
VOID(* PFNKSPAGEDPOOLFREE)(IN PPAGED_LOOKASIDE_LIST Lookaside, IN PVOID Entry)
Definition: allocators.c:33
const GUID IID_IKsAllocator
Definition: allocators.c:79
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
LONG NTSTATUS
Definition: precomp.h:26
BOOL Delete(LPCTSTR ServiceName)
Definition: delete.c:12
const GUID IID_IUnknown
#define UNIMPLEMENTED
Definition: debug.h:118
Definition: Header.h:9
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define GENERIC_READ
Definition: compat.h:135
NTSTATUS NTAPI CompleteRequest(IN PIRP Irp, IN NTSTATUS Status, IN ULONG_PTR Information)
Definition: dispatch.c:19
KSDDKAPI VOID NTAPI KsFreeObjectHeader(IN PVOID Header)
Definition: api.c:720
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
KSDDKAPI NTSTATUS NTAPI KsDispatchInvalidDeviceRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1189
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:1271
KSDDKAPI NTSTATUS NTAPI KsDispatchSetSecurity(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:67
KSDDKAPI NTSTATUS NTAPI KsDispatchQuerySecurity(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:22
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:1251
struct KSIDENTIFIER * PKSPROPERTY
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define NonPagedPool
Definition: env_spec_w32.h:307
#define PagedPool
Definition: env_spec_w32.h:308
Status
Definition: gdiplustypes.h:25
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
long __cdecl _InterlockedIncrement(_Interlocked_operand_ long volatile *_Addend)
#define KSSTRING_Allocator
Definition: ks.h:50
@ KSPROPERTY_STREAMALLOCATOR_FUNCTIONTABLE
Definition: ks.h:803
@ KSPROPERTY_STREAMALLOCATOR_STATUS
Definition: ks.h:804
_In_ PKSALLOCATOR_FRAMING AllocatorFraming
Definition: ks.h:4518
#define KSALLOCATOR_REQUIREMENTF_INPLACE_MODIFIER
Definition: ks.h:1684
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY
Definition: ks.h:1685
#define KSALLOCATOR_OPTIONF_SYSTEM_MEMORY
Definition: ks.h:1691
#define KSALLOCATOR_FLAG_PARTIAL_READ_SUPPORT
Definition: ks.h:1694
#define KSALLOCATOR_OPTIONF_COMPATIBLE
Definition: ks.h:1690
#define KSALLOCATOR_REQUIREMENTF_FRAME_INTEGRITY
Definition: ks.h:1686
PVOID(NTAPI * PFNKSINITIALIZEALLOCATOR)(_In_ PVOID InitialContext, _In_ PKSALLOCATOR_FRAMING AllocatorFraming, _Outptr_ PVOID *Context)
Definition: ks.h:2679
struct KSSTREAMALLOCATOR_STATUS * PKSSTREAMALLOCATOR_STATUS
#define KSDDKAPI
Definition: ks.h:40
_In_ PKSPIN_CONNECT _In_ ACCESS_MASK _Out_ PHANDLE ConnectionHandle
Definition: ks.h:4538
_In_ PKSALLOCATOR_FRAMING _Out_ PHANDLE AllocatorHandle
Definition: ks.h:4519
#define KSALLOCATOR_REQUIREMENTF_MUST_ALLOCATE
Definition: ks.h:1687
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
Definition: misc.c:29
NTSTATUS NTAPI KspCreateObjectType(IN HANDLE ParentHandle, IN LPWSTR ObjectType, PVOID CreateParameters, UINT CreateParametersSize, IN ACCESS_MASK DesiredAccess, OUT PHANDLE NodeHandle)
Definition: topology.c:16
NTSTATUS KspCopyCreateRequest(IN PIRP Irp, IN LPWSTR ObjectClass, IN OUT PULONG Size, OUT PVOID *Result)
Definition: misc.c:44
VOID FreeItem(IN PVOID Item)
Definition: misc.c:37
struct KSIOBJECT_HEADER * PKSIOBJECT_HEADER
if(dx< 0)
Definition: linetemp.h:194
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:270
VOID NTAPI ExDeletePagedLookasideList(IN PPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:194
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:170
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:218
#define ASSERT(a)
Definition: mode.c:44
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
long LONG
Definition: pedump.c:60
#define REFIID
Definition: guiddef.h:118
@ Output
Definition: arc.h:85
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
union ALLOCATOR::@977 Allocate
PFNKSDEFAULTFREE DefaultFree
Definition: allocators.c:64
PFNKSNPAGEDPOOLFREE NPagedPool
Definition: allocators.c:66
union ALLOCATOR::@978 Free
PFNKSNPAGEDPOOLALLOCATE NPagedPool
Definition: allocators.c:59
union ALLOCATOR::@979 Delete
KSSTREAMALLOCATOR_STATUS Status
Definition: allocators.c:46
LONG ref
Definition: allocators.c:42
PVOID CustomList
Definition: allocators.c:52
PFNKSDELETEALLOCATOR DefaultDelete
Definition: allocators.c:71
PAGED_LOOKASIDE_LIST PagedList
Definition: allocators.c:51
PFNKSNPAGEDPOOLDELETE NPagedPool
Definition: allocators.c:72
PFNKSPAGEDPOOLDELETE PagedPool
Definition: allocators.c:73
PFNKSDEFAULTALLOCATE DefaultAllocate
Definition: allocators.c:57
PFNKSPAGEDPOOLALLOCATE PagedPool
Definition: allocators.c:58
ALLOCATOR_TYPE Type
Definition: allocators.c:44
PKSIOBJECT_HEADER Header
Definition: allocators.c:43
PFNKSPAGEDPOOLFREE PagedPool
Definition: allocators.c:65
IKsAllocatorVtbl * lpVtbl
Definition: allocators.c:41
NPAGED_LOOKASIDE_LIST NPagedList
Definition: allocators.c:50
union ALLOCATOR::@976 u
base of all file and directory entries
Definition: entries.h:83
ULONG PoolType
Definition: ks.h:1668
ULONG OptionsFlags
Definition: ks.h:1662
ULONG FileAlignment
Definition: ks.h:1672
ULONG FrameSize
Definition: ks.h:1671
PUNKNOWN Unknown
Definition: kstypes.h:29
KSALLOCATOR_FRAMING Framing
Definition: ks.h:2724
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
union _IO_STACK_LOCATION::@1573 Parameters
struct _IO_STACK_LOCATION::@1573::@1574 DeviceIoControl
VOID InitializeContext(IN PCALLBACK16 Context, IN USHORT Segment, IN USHORT Offset)
Definition: callback.c:60
#define MAXULONG
Definition: typedefs.h:251
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
#define IN
Definition: typedefs.h:39
int32_t * PLONG
Definition: typedefs.h:58
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _In_ _Strict_type_match_ POOL_TYPE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_opt_ ULONG _Out_ WDFLOOKASIDE * Lookaside
Definition: wdfmemory.h:414
_In_ PWDFDEVICE_INIT _In_ PWDF_PDO_EVENT_CALLBACKS DispatchTable
Definition: wdfpdo.h:248
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
static WLX_DISPATCH_VERSION_1_4 FunctionTable
Definition: wlx.c:722
_In_opt_ PALLOCATE_FUNCTION Allocate
Definition: exfuncs.h:814
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST PAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST * PNPAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST NPAGED_LOOKASIDE_LIST
struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST * PPAGED_LOOKASIDE_LIST
#define IO_NO_INCREMENT
Definition: iotypes.h:598
* PFILE_OBJECT
Definition: iotypes.h:1998