ReactOS 0.4.15-dev-7654-g6bc40d3
channel.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/channel.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/* FUNCTIONS ******************************************************************/
14
18{
19 /* Check if the type is valid */
20 return ((ChannelType >= VtUtf8) && (ChannelType <= Raw));
21}
22
26 IN PSAC_CHANNEL_ID ChannelId)
27{
28 /* Check if the GUIDs match */
29 return IsEqualGUIDAligned(&Channel->ChannelId.ChannelGuid,
30 &ChannelId->ChannelGuid);
31}
32
36{
37 CHECK_PARAMETER(Channel);
38
39 /* Clear the data event */
40 if (Channel->HasNewDataEvent)
41 {
43 HasNewDataEvent,
45 }
46
47 /* Clear the close event */
48 if (Channel->CloseEvent)
49 {
51 CloseEvent,
53 }
54
55 /* Clear the lock event */
56 if (Channel->LockEvent)
57 {
59 LockEvent,
61 }
62
63 /* Clear the redraw event */
64 if (Channel->RedrawEvent)
65 {
67 RedrawEvent,
69 }
70
71 /* All done */
72 return STATUS_SUCCESS;
73}
74
78{
79 CHECK_PARAMETER(Channel);
80
81 /* Same thing as dereferencing all the handles */
82 return ChannelDereferenceHandles(Channel);
83}
84
90{
93
94 /* While holding the output lock, write to the output buffer */
95 ChannelLockOBuffer(Channel);
96 Status = Channel->ChannelOutputWrite(Channel, Buffer, BufferSize);
97 ChannelUnlockOBuffer(Channel);
98 return Status;
99}
100
102NTAPI
104{
106
107 /* While holding the output lock, flush to the output buffer */
108 ChannelLockOBuffer(Channel);
109 Status = Channel->ChannelOutputFlush(Channel);
110 ChannelUnlockOBuffer(Channel);
111 return Status;
112}
113
115NTAPI
119{
121
122 /* Write into the input buffer while holding the lock */
123 ChannelLockIBuffer(Channel);
124 Status = Channel->ChannelInputWrite(Channel, Buffer, BufferSize);
125 ChannelUnlockIBuffer(Channel);
126 return Status;
127}
128
130NTAPI
134 IN OUT PULONG ResultBufferSize)
135{
137
138 /* Read the input buffer while holding the lock */
139 ChannelLockIBuffer(Channel);
140 Status = Channel->ChannelInputRead(Channel,
141 Buffer,
143 ResultBufferSize);
144 ChannelUnlockIBuffer(Channel);
145 return Status;
146}
147
148WCHAR
149NTAPI
151{
152 WCHAR LastChar;
153
154 /* Read the last character while holding the lock */
155 ChannelLockIBuffer(Channel);
156 LastChar = Channel->ChannelInputReadLast(Channel);
157 ChannelUnlockIBuffer(Channel);
158 return LastChar;
159}
160
161ULONG
162NTAPI
164{
166
167 /* Get the input buffer length while holding the lock */
168 ChannelLockOBuffer(Channel);
169 Length = Channel->ChannelInputBufferLength(Channel);
170 ChannelUnlockOBuffer(Channel);
171 return Length;
172}
173
175NTAPI
177{
179
180 /* Set the event */
181 ChannelSetEvent(Channel, RedrawEvent);
182 return Status;
183}
184
186NTAPI
188{
190
191 /* Set the event */
192 ChannelSetEvent(Channel, LockEvent);
193 return Status;
194}
195
197NTAPI
199{
201
202 /* Clear the event */
203 ChannelClearEvent(Channel, RedrawEvent);
204 return Status;
205}
206
208NTAPI
210 OUT PBOOLEAN Present)
211{
212 CHECK_PARAMETER1(Channel);
213 CHECK_PARAMETER2(Present);
214
215 /* Return if the flag is set */
216 *Present = Channel->Flags & SAC_CHANNEL_FLAG_REDRAW_EVENT;
217 return STATUS_SUCCESS;
218}
219
221NTAPI
223 OUT PSAC_CHANNEL_STATUS ChannelStatus)
224{
225 CHECK_PARAMETER1(Channel);
226
227 /* Read the status while holding the attribute lock */
228 ChannelLockAttributes(Channel);
229 *ChannelStatus = Channel->ChannelStatus;
231 return STATUS_SUCCESS;
232}
233
235NTAPI
237 IN SAC_CHANNEL_STATUS ChannelStatus)
238{
239 CHECK_PARAMETER1(Channel);
240
241 /* Read the status while holding the attribute lock */
242 ChannelLockAttributes(Channel);
243 Channel->ChannelStatus = ChannelStatus;
245 return STATUS_SUCCESS;
246}
247
249NTAPI
251{
252 SAC_CHANNEL_STATUS ChannelStatus;
254
255 /* Get the status */
256 if (!NT_SUCCESS(ChannelGetStatus(Channel, &ChannelStatus)))
257 {
258 /* We couldn't even do that, assume it's inactive */
259 IsActive = FALSE;
260 }
261 else
262 {
263 /* Check if the status shows activity */
264 IsActive = (ChannelStatus == Active);
265 }
266
267 /* Return the state */
268 return IsActive;
269}
270
272NTAPI
274{
275 SAC_CHANNEL_STATUS ChannelStatus;
276 BOOLEAN IsClosed;
277
278 /* Get the status */
279 if (!NT_SUCCESS(ChannelGetStatus(Channel, &ChannelStatus)))
280 {
281 /* We couldn't even do that, assume it's inactive */
282 IsClosed = FALSE;
283 }
284 else
285 {
286 /* Check if the status shows activity */
287 IsClosed = ((ChannelStatus == Inactive) &&
288 (Channel->ChannelHasNewOBufferData));
289 }
290
291 /* Return the state */
292 return IsClosed;
293}
294
296NTAPI
298 OUT PWCHAR *Name)
299{
300 CHECK_PARAMETER1(Channel);
302
303 /* Allocate space to hold the name */
304 *Name = SacAllocatePool(sizeof(Channel->NameBuffer), GLOBAL_BLOCK_TAG);
306
307 /* Lock the attributes while we copy the name */
308 ChannelLockAttributes(Channel);
309
310 /* Copy the name and null-terminate it */
311 ASSERT(((wcslen(Channel->NameBuffer) + 1) * sizeof(WCHAR)) <= ((SAC_CHANNEL_NAME_SIZE + 1) * sizeof(WCHAR)));
312 wcsncpy(*Name, Channel->NameBuffer, RTL_NUMBER_OF(Channel->NameBuffer)); // bug
314
315 /* Release the lock and return */
317 return STATUS_SUCCESS;
318}
319
321NTAPI
323 IN PWCHAR Name)
324{
325 CHECK_PARAMETER1(Channel);
327
328 /* Lock the attributes while we copy the name */
329 ChannelLockAttributes(Channel);
330
331 /* Copy the name and null-terminate it */
332 ASSERT(((wcslen(Name) + 1) * sizeof(WCHAR)) <= ((SAC_CHANNEL_NAME_SIZE + 1) * sizeof(WCHAR)));
333 wcsncpy(Channel->NameBuffer, Name, RTL_NUMBER_OF(Channel->NameBuffer)); // bug
334 Channel->NameBuffer[SAC_CHANNEL_NAME_SIZE] = UNICODE_NULL;
335
336 /* Release the lock and return */
338 return STATUS_SUCCESS;
339}
340
342NTAPI
345{
346 CHECK_PARAMETER1(Channel);
348
349 /* Allocate space to hold the description */
350 *Description = SacAllocatePool(sizeof(Channel->DescriptionBuffer), GLOBAL_BLOCK_TAG);
352
353 /* Lock the attributes while we copy the name */
354 ChannelLockAttributes(Channel);
355
356 /* Copy the name and null-terminate it */
357 ASSERT(((wcslen(Channel->DescriptionBuffer) + 1) * sizeof(WCHAR)) <= ((SAC_CHANNEL_DESCRIPTION_SIZE + 1) * sizeof(WCHAR)));
358 wcsncpy(*Description, Channel->DescriptionBuffer, RTL_NUMBER_OF(Channel->DescriptionBuffer)); // bug
360
361 /* Release the lock and return */
363 return STATUS_SUCCESS;
364}
365
367NTAPI
370{
371 CHECK_PARAMETER1(Channel);
373
374 /* Lock the attributes while we copy the name */
375 ChannelLockAttributes(Channel);
376
377 /* Copy the name and null-terminate it */
378 ASSERT(((wcslen(Description) + 1) * sizeof(WCHAR)) <= ((SAC_CHANNEL_NAME_SIZE + 1) * sizeof(WCHAR)));
379 wcsncpy(Channel->DescriptionBuffer, Description, RTL_NUMBER_OF(Channel->DescriptionBuffer)); // bug
380 Channel->DescriptionBuffer[SAC_CHANNEL_DESCRIPTION_SIZE] = UNICODE_NULL;
381
382 /* Release the lock and return */
384 return STATUS_SUCCESS;
385}
386
388NTAPI
390 OUT PGUID ApplicationType)
391{
392 CHECK_PARAMETER1(Channel);
393
394 /* Read the application type GUID */
395 ChannelLockAttributes(Channel);
396 *ApplicationType = Channel->ApplicationType;
398
399 /* Always return success */
400 return STATUS_SUCCESS;
401}
402
404NTAPI
406{
407 /* What kind of channel is this? */
408 switch (Channel->ChannelType)
409 {
410 case VtUtf8:
411 /* Setup the calls for a VT-UTF8 channel */
412 Channel->ChannelCreate = VTUTF8ChannelCreate;
413 Channel->ChannelDestroy = VTUTF8ChannelDestroy;
414 Channel->ChannelOutputFlush = VTUTF8ChannelOFlush;
415 Channel->ChannelOutputEcho = VTUTF8ChannelOEcho;
416 Channel->ChannelOutputWrite = VTUTF8ChannelOWrite;
417 Channel->ChannelOutputRead = VTUTF8ChannelORead;
418 Channel->ChannelInputWrite = VTUTF8ChannelIWrite;
419 Channel->ChannelInputRead = VTUTF8ChannelIRead;
420 Channel->ChannelInputReadLast = VTUTF8ChannelIReadLast;
421 Channel->ChannelInputBufferIsFull = VTUTF8ChannelIBufferIsFull;
422 Channel->ChannelInputBufferLength = VTUTF8ChannelIBufferLength;
423 break;
424
425 case Cmd:
426 /* FIXME: TODO */
427 ASSERT(FALSE);
429
430 case Raw:
431
432 /* Setup the calls for a raw channel */
433 Channel->ChannelCreate = RawChannelCreate;
434 Channel->ChannelDestroy = RawChannelDestroy;
435 Channel->ChannelOutputFlush = RawChannelOFlush;
436 Channel->ChannelOutputEcho = RawChannelOEcho;
437 Channel->ChannelOutputWrite = RawChannelOWrite;
438 Channel->ChannelOutputRead = RawChannelORead;
439 Channel->ChannelInputWrite = RawChannelIWrite;
440 Channel->ChannelInputRead = RawChannelIRead;
441 Channel->ChannelInputReadLast = RawChannelIReadLast;
442 Channel->ChannelInputBufferIsFull = RawChannelIBufferIsFull;
443 Channel->ChannelInputBufferLength = RawChannelIBufferLength;
444 break;
445
446 default:
447 /* Unsupported channel type */
449 }
450
451 /* If we got here, the channel was supported */
452 return STATUS_SUCCESS;
453}
454
456NTAPI
459 IN SAC_CHANNEL_ID ChannelId)
460{
462 CHECK_PARAMETER1(Channel);
464
465 /* If a close event is being passed in, it must exist, and vice-versa */
467 {
468 CHECK_PARAMETER(Attributes->CloseEvent != NULL);
469 }
470 else
471 {
472 CHECK_PARAMETER(Attributes->CloseEvent == NULL);
473 }
474
475 /* If a new data event is being passed in, it must exist, and vice-versa */
477 {
478 CHECK_PARAMETER(Attributes->HasNewDataEvent != NULL);
479 }
480 else
481 {
482 CHECK_PARAMETER(Attributes->HasNewDataEvent == NULL);
483 }
484
485 /* If a lock event is being passed in, it must exist, and vice-versa */
487 {
488 CHECK_PARAMETER(Attributes->LockEvent != NULL);
489 }
490 else
491 {
492 CHECK_PARAMETER(Attributes->LockEvent == NULL);
493 }
494
495 /* If a redraw event is being passed in, it must exist, and vice-versa */
497 {
498 CHECK_PARAMETER(Attributes->RedrawEvent != NULL);
499 }
500 else
501 {
502 CHECK_PARAMETER(Attributes->RedrawEvent == NULL);
503 }
504
505 /* Initialize the channel structure */
506 RtlZeroMemory(Channel, sizeof(SAC_CHANNEL));
507 Channel->ChannelId = ChannelId;
508 Channel->ChannelType = Attributes->ChannelType;
509 Channel->Flags = Attributes->Flag;
511 {
512 Channel->ApplicationType = Attributes->ChannelId;
513 }
514
515 /* Initialize all the locks and events */
516 SacInitializeLock(&Channel->ChannelAttributeLock);
517 SacInitializeLock(&Channel->ChannelOBufferLock);
518 SacInitializeLock(&Channel->ChannelIBufferLock);
519 ChannelInitializeEvent(Channel, Attributes, CloseEvent);
520 ChannelInitializeEvent(Channel, Attributes, HasNewDataEvent);
521 ChannelInitializeEvent(Channel, Attributes, LockEvent);
522 ChannelInitializeEvent(Channel, Attributes, RedrawEvent);
523
524 /* Set the name and description */
525 ChannelSetName(Channel, Attributes->NameBuffer);
526 ChannelSetDescription(Channel, Attributes->DescriptionBuffer);
527
528 /* Initialize the function table for the type of channel this is */
530 if (!NT_SUCCESS(Status))
531 {
532 /* This is critical */
533 SAC_DBG(SAC_DBG_INIT, "SAC Create Channel :: Failed to initialize vtable\n");
534 goto FailChannel;
535 }
536
537 /* Now call the channel specific type constructor */
538 Status = Channel->ChannelCreate(Channel);
539 if (!NT_SUCCESS(Status))
540 {
541 /* This is critical */
542 SAC_DBG(SAC_DBG_INIT, "SAC Create Channel :: Failed channel specific initialization\n");
543 goto FailChannel;
544 }
545
546 /* Finally, mark the channel as active */
547 ChannelSetStatus(Channel, Active);
548 return STATUS_SUCCESS;
549
550FailChannel:
551 /* Destroy the channel and return the failure code */
552 Channel->ChannelDestroy(Channel);
553 return Status;
554}
555
557NTAPI
559{
561 CHECK_PARAMETER(Channel);
562
563 /* Set the channel inactive */
564 ChannelSetStatus(Channel, Inactive);
565
566 /* Set the close event */
567 if (Channel->Flags & SAC_CHANNEL_FLAG_CLOSE_EVENT)
568 {
569 ChannelSetEvent(Channel, CloseEvent);
570 }
571
572 /* Close all the handles */
574 return Status;
575}
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
LONG NTSTATUS
Definition: precomp.h:26
_In_ BOOLEAN IsActive
Definition: cdrom.h:1427
NTSTATUS NTAPI ChannelClose(IN PSAC_CHANNEL Channel)
Definition: channel.c:558
BOOLEAN NTAPI ChannelIsClosed(IN PSAC_CHANNEL Channel)
Definition: channel.c:273
ULONG NTAPI ChannelIBufferLength(IN PSAC_CHANNEL Channel)
Definition: channel.c:163
NTSTATUS NTAPI ChannelSetLockEvent(IN PSAC_CHANNEL Channel)
Definition: channel.c:187
NTSTATUS NTAPI ChannelGetName(IN PSAC_CHANNEL Channel, OUT PWCHAR *Name)
Definition: channel.c:297
NTSTATUS NTAPI ChannelSetName(IN PSAC_CHANNEL Channel, IN PWCHAR Name)
Definition: channel.c:322
NTSTATUS NTAPI ChannelIRead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, IN OUT PULONG ResultBufferSize)
Definition: channel.c:131
BOOLEAN NTAPI ChannelIsValidType(IN SAC_CHANNEL_TYPE ChannelType)
Definition: channel.c:17
NTSTATUS NTAPI ChannelSetDescription(IN PSAC_CHANNEL Channel, IN PWCHAR Description)
Definition: channel.c:368
NTSTATUS NTAPI ChannelIWrite(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize)
Definition: channel.c:116
NTSTATUS NTAPI ChannelDestroy(IN PSAC_CHANNEL Channel)
Definition: channel.c:77
NTSTATUS NTAPI ChannelGetDescription(IN PSAC_CHANNEL Channel, IN PWCHAR *Description)
Definition: channel.c:343
NTSTATUS NTAPI ChannelGetStatus(IN PSAC_CHANNEL Channel, OUT PSAC_CHANNEL_STATUS ChannelStatus)
Definition: channel.c:222
NTSTATUS NTAPI ChannelOFlush(IN PSAC_CHANNEL Channel)
Definition: channel.c:103
BOOLEAN NTAPI ChannelIsEqual(IN PSAC_CHANNEL Channel, IN PSAC_CHANNEL_ID ChannelId)
Definition: channel.c:25
NTSTATUS NTAPI ChannelDereferenceHandles(IN PSAC_CHANNEL Channel)
Definition: channel.c:35
NTSTATUS NTAPI ChannelCreate(IN PSAC_CHANNEL Channel, IN PSAC_CHANNEL_ATTRIBUTES Attributes, IN SAC_CHANNEL_ID ChannelId)
Definition: channel.c:457
NTSTATUS NTAPI ChannelHasRedrawEvent(IN PSAC_CHANNEL Channel, OUT PBOOLEAN Present)
Definition: channel.c:209
NTSTATUS NTAPI ChannelGetApplicationType(IN PSAC_CHANNEL Channel, OUT PGUID ApplicationType)
Definition: channel.c:389
NTSTATUS NTAPI ChannelClearRedrawEvent(IN PSAC_CHANNEL Channel)
Definition: channel.c:198
NTSTATUS NTAPI ChannelOWrite(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize)
Definition: channel.c:87
WCHAR NTAPI ChannelIReadLast(IN PSAC_CHANNEL Channel)
Definition: channel.c:150
NTSTATUS NTAPI ChannelSetStatus(IN PSAC_CHANNEL Channel, IN SAC_CHANNEL_STATUS ChannelStatus)
Definition: channel.c:236
BOOLEAN NTAPI ChannelIsActive(IN PSAC_CHANNEL Channel)
Definition: channel.c:250
NTSTATUS NTAPI ChannelInitializeVTable(IN PSAC_CHANNEL Channel)
Definition: channel.c:405
NTSTATUS NTAPI ChannelSetRedrawEvent(IN PSAC_CHANNEL Channel)
Definition: channel.c:176
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static const WCHAR Description[]
Definition: oid.c:1266
Status
Definition: gdiplustypes.h:25
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define ASSERT(a)
Definition: mode.c:44
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
ULONG NTAPI RawChannelIBufferLength(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:310
NTSTATUS NTAPI RawChannelIRead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, IN PULONG ReturnBufferSize)
Definition: rawchan.c:246
NTSTATUS NTAPI RawChannelOWrite(IN PSAC_CHANNEL Channel, IN PCHAR String, IN ULONG Length)
Definition: rawchan.c:195
NTSTATUS NTAPI RawChannelDestroy(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:39
NTSTATUS NTAPI RawChannelOEcho(IN PSAC_CHANNEL Channel, IN PCHAR String, IN ULONG Length)
Definition: rawchan.c:115
WCHAR NTAPI RawChannelIReadLast(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:320
NTSTATUS NTAPI RawChannelCreate(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:17
NTSTATUS NTAPI RawChannelIWrite(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize)
Definition: rawchan.c:343
NTSTATUS NTAPI RawChannelIBufferIsFull(IN PSAC_CHANNEL Channel, OUT PBOOLEAN BufferStatus)
Definition: rawchan.c:297
NTSTATUS NTAPI RawChannelORead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, OUT PULONG ByteCount)
Definition: rawchan.c:58
NTSTATUS NTAPI RawChannelOFlush(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:172
#define SAC_CHANNEL_DESCRIPTION_SIZE
Definition: sacdrv.h:153
NTSTATUS NTAPI VTUTF8ChannelOEcho(IN PSAC_CHANNEL Channel, IN PCHAR String, IN ULONG Length)
Definition: vtutf8chan.c:1077
#define ChannelLockOBuffer(x)
Definition: sacdrv.h:1332
#define SAC_DBG(x,...)
Definition: sacdrv.h:37
#define CHECK_PARAMETER2(x)
Definition: sacdrv.h:58
NTSTATUS NTAPI VTUTF8ChannelOFlush(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:725
#define SacAllocatePool(Length, Tag)
Definition: sacdrv.h:24
#define SAC_CHANNEL_FLAG_LOCK_EVENT
Definition: sacdrv.h:172
#define SAC_CHANNEL_FLAG_REDRAW_EVENT
Definition: sacdrv.h:173
#define SAC_OBUFFER_SIZE
Definition: sacdrv.h:151
enum _SAC_CHANNEL_STATUS * PSAC_CHANNEL_STATUS
#define CHECK_PARAMETER3(x)
Definition: sacdrv.h:60
#define CHECK_PARAMETER1(x)
Definition: sacdrv.h:56
#define SAC_CHANNEL_FLAG_CLOSE_EVENT
Definition: sacdrv.h:170
FORCEINLINE VOID SacInitializeLock(IN PSAC_CHANNEL_LOCK Lock)
Definition: sacdrv.h:1252
#define CHECK_ALLOCATION(x)
Definition: sacdrv.h:64
NTSTATUS NTAPI VTUTF8ChannelIWrite(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize)
Definition: vtutf8chan.c:1339
#define ChannelSetEvent(Channel, x)
Definition: sacdrv.h:99
NTSTATUS NTAPI VTUTF8ChannelORead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, OUT PULONG ByteCount)
Definition: vtutf8chan.c:714
#define ChannelLockAttributes(x)
Definition: sacdrv.h:1336
#define ChannelClearEvent(Channel, x)
Definition: sacdrv.h:114
enum _SAC_CHANNEL_TYPE SAC_CHANNEL_TYPE
#define SAC_CHANNEL_NAME_SIZE
Definition: sacdrv.h:152
NTSTATUS NTAPI VTUTF8ChannelCreate(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:677
#define ChannelLockIBuffer(x)
Definition: sacdrv.h:1334
@ Cmd
Definition: sacdrv.h:278
@ Raw
Definition: sacdrv.h:279
@ VtUtf8
Definition: sacdrv.h:277
#define ChannelUnlockAttributes(x)
Definition: sacdrv.h:1337
NTSTATUS NTAPI VTUTF8ChannelIBufferIsFull(IN PSAC_CHANNEL Channel, OUT PBOOLEAN BufferStatus)
Definition: vtutf8chan.c:1291
ULONG NTAPI VTUTF8ChannelIBufferLength(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:1303
#define CHECK_PARAMETER(x)
Definition: sacdrv.h:54
#define SAC_DBG_INIT
Definition: sacdrv.h:34
enum _SAC_CHANNEL_STATUS SAC_CHANNEL_STATUS
#define GLOBAL_BLOCK_TAG
Definition: sacdrv.h:142
NTSTATUS NTAPI VTUTF8ChannelOWrite(IN PSAC_CHANNEL Channel, IN PCHAR String, IN ULONG Length)
Definition: vtutf8chan.c:1167
NTSTATUS NTAPI VTUTF8ChannelIRead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, IN PULONG ReturnBufferSize)
Definition: vtutf8chan.c:1234
#define SAC_CHANNEL_FLAG_HAS_NEW_DATA_EVENT
Definition: sacdrv.h:171
#define ChannelUninitializeEvent(Channel, x, f)
Definition: sacdrv.h:85
#define ChannelUnlockIBuffer(x)
Definition: sacdrv.h:1335
WCHAR NTAPI VTUTF8ChannelIReadLast(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:1313
@ Inactive
Definition: sacdrv.h:287
#define ChannelUnlockOBuffer(x)
Definition: sacdrv.h:1333
#define ChannelInitializeEvent(Channel, Attributes, x)
Definition: sacdrv.h:70
#define SAC_CHANNEL_FLAG_APPLICATION
Definition: sacdrv.h:174
NTSTATUS NTAPI VTUTF8ChannelDestroy(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:702
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
#define STATUS_SUCCESS
Definition: shellext.h:65
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
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
_In_ ULONG _In_ BOOLEAN Active
Definition: potypes.h:561
__wchar_t WCHAR
Definition: xmlstorage.h:180