ReactOS 0.4.15-dev-5895-g2687c1b
chanmgr.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Drivers
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/sac/driver/chanmgr.c
5 * PURPOSE: Driver for the Server Administration Console (SAC) for EMS
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include "sacdrv.h"
12
13/* GLOBALS ********************************************************************/
14
21
22/* FUNCTIONS ******************************************************************/
23
24#define MAX_REF_COUNT 100
25
26#define CHANNEL_SLOT_IS_IN_USE(x) (ChannelRefCount[(x)] > 0)
27
31{
32 return ChannelArray[Index];
33}
34
36LONG
38{
39 return ChannelRefCount[Index];
40}
41
43LONG
45{
47 {
53 }
54
56}
57
59LONG
61{
62 LONG RefCount;
63
67 return RefCount;
68}
69
71LONG
73{
79}
80
82VOID
84{
88}
89
91VOID
93{
97}
98
100VOID
102{
105}
106
108VOID
110{
114}
115
117NTAPI
119{
120 ULONG i;
121
122 /* Initialize the channel lock */
125
126 /* Loop through the channel arrays */
127 for (i = 0; i < SAC_MAX_CHANNELS; i++)
128 {
129 /* Clear and initialize their locks */
132
133 /* Clear their statuses and reference counts */
136 }
137
138 /* All good */
139 return STATUS_SUCCESS;
140}
141
143NTAPI
145{
146 /* FIXME: TODO */
148}
149
151NTAPI
153 OUT PSAC_CHANNEL* Channel)
154{
155 NTSTATUS Status, Status1;
156 ULONG i;
158 PWCHAR ChannelName;
161 CHECK_PARAMETER2(Channel);
162
163 /* Assume failure */
164 *Channel = NULL;
166
167 /* Loop through all channels */
168 for (i = 0; i < SAC_MAX_CHANNELS; i++)
169 {
170 /* Reference this one and check if it's valid */
172 {
173 /* All good, grab it */
176
177 /* Get its name */
178 Status1 = ChannelGetName(CurrentChannel, &ChannelName);
179 ASSERT(NT_SUCCESS(Status1));
180
181 /* Check if this is the name that was passed in */
182 Found = wcsicmp(Name, ChannelName);
183 SacFreePool(ChannelName);
184 if (Found)
185 {
186 /* We found it, return it (with a reference held) */
187 *Channel = CurrentChannel;
188 return STATUS_SUCCESS;
189 }
190
191 /* Not the one we want, dereference this one and keep going */
193 }
194 }
195
196 /* No channels with this name were found */
197 return Status;
198}
199
201NTAPI
203 OUT PSAC_CHANNEL* TargetChannel)
204{
206 ULONG i;
207 PSAC_CHANNEL Channel;
208 CHECK_PARAMETER2(TargetChannel);
209
210 /* Assume failure */
211 *TargetChannel = NULL;
213
214 /* Loop through all channels */
215 for (i = 0; i < SAC_MAX_CHANNELS; i++)
216 {
217 /* Reference this one and check if it's valid */
219 {
220 /* All good, grab it */
221 Channel = ChannelFromIndex(i);
222 ASSERT(Channel != NULL);
223
224 /* Check if the channel ID matches */
225 if (ChannelIsEqual(Channel, &ChannelId))
226 {
227 /* We found it, return it (with a reference held) */
228 *TargetChannel = Channel;
229 return STATUS_SUCCESS;
230 }
231
232 /* Not the one we want, dereference this one and keep going */
234 }
235 }
236
237 /* No channels with this ID were found */
238 return Status;
239}
240
242NTAPI
244{
245 LONG Index;
246 ULONG RefCount;
247 PSAC_CHANNEL ThisChannel;
248 CHECK_PARAMETER(Channel);
249
250 /* Get the index of the channel */
251 Index = ChannelGetIndex(Channel);
252
253 /* Drop a reference -- there should still be at least the keepalive left */
256 ASSERT(RefCount > 0);
257
258 /* Do we only have the keep-alive left, and the channel is dead? */
259 if ((RefCount == 1) && !(ChannelIsActive(Channel)))
260 {
261 /* Check if the ??? flag is set, or if there's no output data */
262 ThisChannel = ChannelFromIndex(Index);
263 if (!(ThisChannel->Flags & 1))
264 {
265 /* Nope, we can wipe the references and get rid of it */
267 }
268 else if (!ThisChannel->ChannelHasNewOBufferData)
269 {
270 /* No data, we can wipe the references and get rid of it */
272 }
273 }
274
275 /* We're done, we can unlock the slot now */
277 return STATUS_SUCCESS;
278}
279
281NTAPI
283{
285 BOOLEAN IsUnique = FALSE;
286 PSAC_CHANNEL Channel;
287
288 /* Check if a channel with this name already exists */
289 Status = ChanMgrGetChannelByName(ChannelName, &Channel);
290 if (Status == STATUS_NOT_FOUND) IsUnique = TRUE;
291
292 /* If one did, dereference it, all we wanted was to check uniqueness */
294
295 /* Return if one was found or not */
296 return IsUnique;
297}
298
300NTAPI
302{
303 /* FIXME: TODO */
305}
306
308NTAPI
310{
311 ULONG i;
313
314 /* Loop all the channels */
315 for (i = 0; i < SAC_MAX_CHANNELS; i++)
316 {
317 /* Lock this index and see if the channel was reaped */
319 if (!ChannelReaped[i])
320 {
321 /* It was not reaped yet, so a channel should still be here */
323 if (ChannelGetReferenceCount(i) <= 0)
324 {
325 /* The channel has no more references, so clear the buffer flags */
328
329 /* And reap it */
331 }
332 }
333
334 /* Release the lock, and move on unless reaping failed */
336 if (!NT_SUCCESS(Status)) break;
337 }
338
339 /* Return reaping status */
340 return Status;
341}
342
344NTAPI
347{
349 PSAC_CHANNEL NewChannel;
350 SAC_CHANNEL_ID ChanId;
351 ULONG i;
352 CHECK_PARAMETER(Channel);
354
355 /* No other channel create attempts can happen */
357
358 /* Is the channel manager initialized? */
360 {
361 /* Nope, bail out */
363 goto ReturnStatus;
364 }
365
366 /* Reap any zombie channels */
368 if (!NT_SUCCESS(Status))
369 {
370 /* Bail out on error */
372 goto ReturnStatus;
373 }
374
375 /* Check if we already have a channel with this name */
376 if (!ChanMgrIsUniqueName(Attributes->NameBuffer))
377 {
378 /* We do, fail */
380 goto ReturnStatus;
381 }
382
383 /* Allocate this channel */
384 NewChannel = SacAllocatePool(sizeof(SAC_CHANNEL), CHANNEL_BLOCK_TAG);
386 RtlZeroMemory(NewChannel, sizeof(SAC_CHANNEL));
387
388 /* Loop channel slots */
389 for (i = 0; i < SAC_MAX_CHANNELS; i++)
390 {
391 /* Find a free spot for it */
392 if (ChannelReaped[i])
393 {
394 /* Free slot found, attempt to use it */
397 if (ChannelArray[i] == NewChannel) break;
398 }
399 }
400
401 /* Did we not find a single free slot? */
402 if (i == SAC_MAX_CHANNELS)
403 {
404 /* Bail out */
405 goto ReturnStatus;
406 }
407
408 /* Create an ID for this channel */
409 RtlZeroMemory(&ChanId, sizeof(ChanId));
411 if (!NT_SUCCESS(Status))
412 {
413 /* Bail out if we couldn't */
414 SAC_DBG(SAC_DBG_INIT, "SAC Create Channel :: Failed to get GUID\n");
415 goto ReturnStatus;
416 }
417
418 /* Now create the channel proper */
419 Status = ChannelCreate(NewChannel, Attributes, ChanId);
420 if (NT_SUCCESS(Status))
421 {
422 /* Set the channel index */
423 _InterlockedExchange(&NewChannel->Index, i);
424
425 /* Add the initial reference to the channel */
427
428 /* Return it to the caller */
429 *Channel = NewChannel;
430
431 /* This slot is now occupied */
432 ASSERT(ChannelReaped[i] == 1);
434 }
435 else
436 {
437 /* We couldn't create it, free the buffer */
438 SacFreePool(NewChannel);
439 }
440
441ReturnStatus:
442 /* Return whatever the operation status was */
444 return Status;
445}
446
448NTAPI
451 OUT PSAC_CHANNEL* TargetChannel)
452{
454 PSAC_CHANNEL FoundChannel;
455
456 /* Lookup the channel by ID first */
457 Status = ChanMgrGetByHandle(ChannelId, &FoundChannel);
458 if (NT_SUCCESS(Status))
459 {
460 /* We found it, now check if the file object matches */
461 if (FoundChannel->FileObject == FileObject)
462 {
463 /* Yep, return success */
464 *TargetChannel = FoundChannel;
465 }
466 else
467 {
468 /* Nope, drop the reference on the channel */
469 ChanMgrReleaseChannel(FoundChannel);
470
471 /* And return failure */
472 *TargetChannel = NULL;
474 }
475 }
476
477 /* Return if we found it or not */
478 return Status;
479}
480
482NTAPI
484 IN PLONG ChannelIndex)
485{
486 CHECK_PARAMETER1(Channel);
487 CHECK_PARAMETER2(ChannelIndex);
488
489 /* Just return the index of the channel */
490 *ChannelIndex = ChannelGetIndex(Channel);
491 return STATUS_SUCCESS;
492}
493
495NTAPI
497 IN PSAC_CHANNEL* TargetChannel)
498{
500 CHECK_PARAMETER1(TargetIndex < SAC_MAX_CHANNELS);
501 CHECK_PARAMETER2(TargetChannel);
502
503 /* Assume failure */
504 *TargetChannel = NULL;
506
507 /* Reference this one and check if it's valid */
508 if (ChannelReferenceByIndexWithLock(TargetIndex) > 0)
509 {
510 /* We found it, return it (with a reference held) */
511 *TargetChannel = ChannelFromIndex(TargetIndex);
512 return STATUS_SUCCESS;
513 }
514
515 /* No channels with this ID were found */
516 return Status;
517}
518
520NTAPI
522 IN PULONG TargetIndex,
523 OUT PSAC_CHANNEL *TargetChannel)
524{
526 ULONG i;
527 LONG ChannelIndex, StartIndex;
528 PSAC_CHANNEL FoundChannel;
529 BOOLEAN ChannelFound;
531 CHECK_PARAMETER2(TargetIndex);
532 CHECK_PARAMETER3(TargetChannel);
533
534 /* Get the current channel index */
536 if (!NT_SUCCESS(Status)) return Status;
537
538 /* Assume failure */
539 ChannelFound = FALSE;
540
541 /* Loop through all the possible active channels */
542 StartIndex = (ChannelIndex + 1) % SAC_MAX_CHANNELS;
543 for (i = StartIndex; i != StartIndex; i = (i + 1) % SAC_MAX_CHANNELS)
544 {
545 /* Get the channel and see if it exists*/
546 Status = ChanMgrGetByIndex(i, &FoundChannel);
548 {
549 /* Bail out if we failed for some reason */
550 if (!NT_SUCCESS(Status)) return Status;
551
552 /* It exists -- is it active? Or, does it have output data? */
553 if ((ChannelIsActive(FoundChannel)) ||
554 (!(ChannelIsActive(FoundChannel)) &&
555 (FoundChannel->ChannelHasNewOBufferData)))
556 {
557 /* It's active or has output data, return with it */
558 ChannelFound = TRUE;
559 break;
560 }
561
562 /* Drop the reference on this channel and try the next one */
563 Status = ChanMgrReleaseChannel(FoundChannel);
564 if (!NT_SUCCESS(Status)) return Status;
565 }
566 }
567
568 /* Check if we successfully found a channel */
569 if ((NT_SUCCESS(Status)) && (ChannelFound))
570 {
571 /* Return it and its indexed. Remember we still hold the reference */
572 *TargetIndex = i;
573 *TargetChannel = FoundChannel;
574 }
575
576 /* All done */
577 return Status;
578}
579
581NTAPI
583{
584 CHECK_PARAMETER1(Channel);
585 CHECK_PARAMETER(ChannelGetReferenceCount(Channel->Index) > 0);
586
587 /* Destroy the channel */
588 return Channel->ChannelDestroy(Channel);
589}
590
592NTAPI
594{
596 CHECK_PARAMETER(Channel);
597
598 /* Check if the channel is active */
599 if (ChannelIsActive(Channel))
600 {
601 /* Yep, close it */
602 Status = ChannelClose(Channel);
603 }
604 else
605 {
606 /* Nothing to do */
608 }
609
610 /* Handle the channel close */
611 ConMgrHandleEvent(TRUE, Channel, &Status);
612 return Status;
613}
614
616NTAPI
618{
619 ULONG i;
620 PSAC_CHANNEL Channel;
622 CHECK_PARAMETER(ChannelCount);
623
624 /* Assume no channels */
625 *ChannelCount = 0;
626
627 /* Loop every channel */
628 for (i = 0; i < SAC_MAX_CHANNELS; i++)
629 {
630 /* See if this one exists */
631 Status = ChanMgrGetByIndex(i, &Channel);
633 {
634 /* Sanity checks*/
636 ASSERT(Channel != NULL);
637
638 /* It exists -- is it active? Or, does it have output data? */
639 if ((ChannelIsActive(Channel)) ||
640 (!(ChannelIsActive(Channel)) &&
641 (Channel->ChannelHasNewOBufferData)))
642 {
643 /* It's active or has output data, increase the count */
644 ++*ChannelCount;
645 break;
646 }
647
648 /* Drop the reference on this channel and try the next one */
649 Status = ChanMgrReleaseChannel(Channel);
650 if (!NT_SUCCESS(Status)) return Status;
651 }
652 else
653 {
654 /* Channel doesn't exist, nothing wrong with that, keep going */
656 }
657 }
658
659 /* We should always succeed if we get here */
661 return Status;
662}
663
665NTAPI
667{
669 ULONG Count;
670
671 /* Count the channels */
674
675 /* Return if we hit the limit */
676 *IsFull = (Count == SAC_MAX_CHANNELS);
677 return Status;
678}
679
681NTAPI
683{
684 PSAC_CHANNEL Channel;
685 ULONG i;
688
689 /* Loop all channels */
690 for (i = 0; i < SAC_MAX_CHANNELS; i++)
691 {
692 /* Try to get this one */
693 Status = ChanMgrGetByIndex(i, &Channel);
694 if (!NT_SUCCESS(Status)) break;
695
696 /* Check if the FO matches, if so, close the channel */
697 if (Channel->FileObject == FileObject) ChanMgrCloseChannel(Channel);
698
699 /* Drop the reference and try the next channel(s) */
700 Status = ChanMgrReleaseChannel(Channel);
701 if (!NT_SUCCESS(Status)) break;
702 }
703
704 /* All done */
705 return Status;
706}
707
709NTAPI
711{
713}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
return Found
Definition: dirsup.c:1270
NTSTATUS NTAPI ChanMgrGetByIndex(IN LONG TargetIndex, IN PSAC_CHANNEL *TargetChannel)
Definition: chanmgr.c:496
NTSTATUS NTAPI ChanMgrGetChannelIndex(IN PSAC_CHANNEL Channel, IN PLONG ChannelIndex)
Definition: chanmgr.c:483
NTSTATUS NTAPI ChanMgrGetNextActiveChannel(IN PSAC_CHANNEL CurrentChannel, IN PULONG TargetIndex, OUT PSAC_CHANNEL *TargetChannel)
Definition: chanmgr.c:521
PSAC_CHANNEL ChannelArray[SAC_MAX_CHANNELS]
Definition: chanmgr.c:17
FORCEINLINE VOID ChannelDereferenceToZeroByIndex(IN LONG Index)
Definition: chanmgr.c:92
NTSTATUS NTAPI ChanMgrGetChannelCount(OUT PULONG ChannelCount)
Definition: chanmgr.c:617
FORCEINLINE LONG ChannelGetReferenceCount(IN LONG Index)
Definition: chanmgr.c:37
FORCEINLINE LONG ChannelDereferenceByIndex(IN LONG Index)
Definition: chanmgr.c:72
NTSTATUS NTAPI ChanMgrReapChannel(IN ULONG ChannelIndex)
Definition: chanmgr.c:301
NTSTATUS NTAPI ChanMgrGetChannelByName(IN PWCHAR Name, OUT PSAC_CHANNEL *Channel)
Definition: chanmgr.c:152
NTSTATUS NTAPI ChanMgrChannelDestroy(IN PSAC_CHANNEL Channel)
Definition: chanmgr.c:582
NTSTATUS NTAPI ChanMgrReleaseChannel(IN PSAC_CHANNEL Channel)
Definition: chanmgr.c:243
NTSTATUS NTAPI ChanMgrIsFull(OUT PBOOLEAN IsFull)
Definition: chanmgr.c:666
BOOLEAN NTAPI ChanMgrIsUniqueName(IN PWCHAR ChannelName)
Definition: chanmgr.c:282
NTSTATUS NTAPI ChanMgrGetByHandleAndFileObject(IN SAC_CHANNEL_ID ChannelId, IN PFILE_OBJECT FileObject, OUT PSAC_CHANNEL *TargetChannel)
Definition: chanmgr.c:449
#define MAX_REF_COUNT
Definition: chanmgr.c:24
FORCEINLINE VOID ChannelReferenceToOneByIndex(IN LONG Index)
Definition: chanmgr.c:101
FORCEINLINE LONG ChannelReferenceByIndex(IN LONG Index)
Definition: chanmgr.c:44
NTSTATUS NTAPI ChanMgrInitialize(VOID)
Definition: chanmgr.c:118
NTSTATUS NTAPI ChanMgrCreateChannel(OUT PSAC_CHANNEL *Channel, IN PSAC_CHANNEL_ATTRIBUTES Attributes)
Definition: chanmgr.c:345
NTSTATUS NTAPI ChanMgrShutdown(VOID)
Definition: chanmgr.c:144
FORCEINLINE VOID ChannelReferenceToOneByIndexWithLock(IN LONG Index)
Definition: chanmgr.c:109
#define CHANNEL_SLOT_IS_IN_USE(x)
Definition: chanmgr.c:26
NTSTATUS NTAPI ChanMgrCloseChannel(IN PSAC_CHANNEL Channel)
Definition: chanmgr.c:593
NTSTATUS NTAPI ChanMgrReapChannels(VOID)
Definition: chanmgr.c:309
SAC_CHANNEL_LOCK ChannelSlotLock[SAC_MAX_CHANNELS]
Definition: chanmgr.c:20
NTSTATUS NTAPI ChanMgrCloseChannelsWithFileObject(IN PFILE_OBJECT FileObject)
Definition: chanmgr.c:682
NTSTATUS NTAPI ChanMgrGenerateUniqueCmdName(IN PWCHAR ChannelName)
Definition: chanmgr.c:710
SAC_CHANNEL_LOCK ChannelCreateLock
Definition: chanmgr.c:15
LONG ChannelReaped[SAC_MAX_CHANNELS]
Definition: chanmgr.c:19
FORCEINLINE LONG ChannelReferenceByIndexWithLock(IN LONG Index)
Definition: chanmgr.c:60
LONG ChannelRefCount[SAC_MAX_CHANNELS]
Definition: chanmgr.c:18
FORCEINLINE VOID ChannelDereferenceByIndexWithLock(IN LONG Index)
Definition: chanmgr.c:83
BOOLEAN ChannelCreateEnabled
Definition: chanmgr.c:16
NTSTATUS NTAPI ChanMgrGetByHandle(IN SAC_CHANNEL_ID ChannelId, OUT PSAC_CHANNEL *TargetChannel)
Definition: chanmgr.c:202
FORCEINLINE PSAC_CHANNEL ChannelFromIndex(IN ULONG Index)
Definition: chanmgr.c:30
NTSTATUS NTAPI ChannelClose(IN PSAC_CHANNEL Channel)
Definition: channel.c:558
NTSTATUS NTAPI ChannelGetName(IN PSAC_CHANNEL Channel, OUT PWCHAR *Name)
Definition: channel.c:297
BOOLEAN NTAPI ChannelIsEqual(IN PSAC_CHANNEL Channel, IN PSAC_CHANNEL_ID ChannelId)
Definition: channel.c:25
NTSTATUS NTAPI ChannelCreate(IN PSAC_CHANNEL Channel, IN PSAC_CHANNEL_ATTRIBUTES Attributes, IN SAC_CHANNEL_ID ChannelId)
Definition: channel.c:457
BOOLEAN NTAPI ChannelIsActive(IN PSAC_CHANNEL Channel)
Definition: channel.c:250
PSAC_CHANNEL CurrentChannel
Definition: conmgr.c:26
NTSTATUS NTAPI ConMgrHandleEvent(IN ULONG EventCode, IN PSAC_CHANNEL Channel, OUT PVOID Data)
Definition: conmgr.c:888
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define wcsicmp
Definition: compat.h:15
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 const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
long __cdecl _InterlockedIncrement(_Interlocked_operand_ long volatile *_Addend)
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
long __cdecl _InterlockedDecrement(_Interlocked_operand_ long volatile *_Addend)
#define ASSERT(a)
Definition: mode.c:44
NTKERNELAPI NTSTATUS ExUuidCreate(OUT UUID *Uuid)
Definition: uuid.c:380
int Count
Definition: noreturn.cpp:7
#define STATUS_DUPLICATE_NAME
Definition: ntstatus.h:425
#define STATUS_ALREADY_DISCONNECTED
Definition: ntstatus.h:216
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
long LONG
Definition: pedump.c:60
FORCEINLINE BOOLEAN ChannelHasNewOBufferData(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:51
#define SAC_DBG(x,...)
Definition: sacdrv.h:37
#define CHECK_PARAMETER2(x)
Definition: sacdrv.h:58
#define SacAllocatePool(Length, Tag)
Definition: sacdrv.h:24
#define CHECK_PARAMETER3(x)
Definition: sacdrv.h:60
#define ChannelSlotUnlock(x)
Definition: sacdrv.h:1339
#define CHECK_PARAMETER1(x)
Definition: sacdrv.h:56
#define CHECK_PARAMETER_WITH_STATUS(Condition, Status)
Definition: sacdrv.h:47
#define ChannelLockCreates()
Definition: sacdrv.h:1330
#define SAC_MAX_CHANNELS
Definition: sacdrv.h:154
FORCEINLINE VOID SacInitializeLock(IN PSAC_CHANNEL_LOCK Lock)
Definition: sacdrv.h:1252
FORCEINLINE BOOLEAN ChannelHasNewIBufferData(IN PSAC_CHANNEL Channel)
Definition: sacdrv.h:1361
#define CHECK_PARAMETER(x)
Definition: sacdrv.h:54
#define ChannelUnlockCreates()
Definition: sacdrv.h:1331
#define SAC_DBG_INIT
Definition: sacdrv.h:34
#define CHANNEL_BLOCK_TAG
Definition: sacdrv.h:143
FORCEINLINE LONG ChannelGetIndex(IN PSAC_CHANNEL Channel)
Definition: sacdrv.h:1353
#define SacFreePool(Pointer)
Definition: sacdrv.h:26
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_NOT_FOUND
Definition: shellext.h:72
GUID ChannelGuid
Definition: sacdrv.h:296
PFILE_OBJECT FileObject
Definition: sacdrv.h:440
LONG Index
Definition: sacdrv.h:426
ULONG Flags
Definition: sacdrv.h:445
LONG ChannelHasNewOBufferData
Definition: sacdrv.h:459
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
int32_t * PLONG
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
#define FORCEINLINE
Definition: wdftypes.h:67
* PFILE_OBJECT
Definition: iotypes.h:1998