ReactOS  0.4.14-dev-376-gaedba84
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 
15 BOOLEAN
16 NTAPI
18 {
19  /* Check if the type is valid */
20  return ((ChannelType >= VtUtf8) && (ChannelType <= Raw));
21 }
22 
23 BOOLEAN
24 NTAPI
26  IN PSAC_CHANNEL_ID ChannelId)
27 {
28  /* Check if the GUIDs match */
29  return IsEqualGUIDAligned(&Channel->ChannelId.ChannelGuid,
30  &ChannelId->ChannelGuid);
31 }
32 
34 NTAPI
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 
76 NTAPI
78 {
79  CHECK_PARAMETER(Channel);
80 
81  /* Same thing as dereferencing all the handles */
82  return ChannelDereferenceHandles(Channel);
83 }
84 
86 NTAPI
88  IN PCHAR Buffer,
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 
101 NTSTATUS
102 NTAPI
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 
114 NTSTATUS
115 NTAPI
117  IN PCHAR Buffer,
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 
129 NTSTATUS
130 NTAPI
132  IN PCHAR Buffer,
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,
142  BufferSize,
143  ResultBufferSize);
144  ChannelUnlockIBuffer(Channel);
145  return Status;
146 }
147 
148 WCHAR
149 NTAPI
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 
161 ULONG
162 NTAPI
164 {
165  ULONG Length;
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 
174 NTSTATUS
175 NTAPI
177 {
179 
180  /* Set the event */
181  ChannelSetEvent(Channel, RedrawEvent);
182  return Status;
183 }
184 
185 NTSTATUS
186 NTAPI
188 {
190 
191  /* Set the event */
192  ChannelSetEvent(Channel, LockEvent);
193  return Status;
194 }
195 
196 NTSTATUS
197 NTAPI
199 {
201 
202  /* Clear the event */
203  ChannelClearEvent(Channel, RedrawEvent);
204  return Status;
205 }
206 
207 NTSTATUS
208 NTAPI
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 
220 NTSTATUS
221 NTAPI
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;
230  ChannelUnlockAttributes(Channel);
231  return STATUS_SUCCESS;
232 }
233 
234 NTSTATUS
235 NTAPI
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;
244  ChannelUnlockAttributes(Channel);
245  return STATUS_SUCCESS;
246 }
247 
248 BOOLEAN
249 NTAPI
251 {
252  SAC_CHANNEL_STATUS ChannelStatus;
253  BOOLEAN IsActive;
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 
271 BOOLEAN
272 NTAPI
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 
295 NTSTATUS
296 NTAPI
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 */
316  ChannelUnlockAttributes(Channel);
317  return STATUS_SUCCESS;
318 }
319 
320 NTSTATUS
321 NTAPI
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 */
337  ChannelUnlockAttributes(Channel);
338  return STATUS_SUCCESS;
339 }
340 
341 NTSTATUS
342 NTAPI
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
359  (*Description)[SAC_CHANNEL_DESCRIPTION_SIZE] = UNICODE_NULL;
360 
361  /* Release the lock and return */
362  ChannelUnlockAttributes(Channel);
363  return STATUS_SUCCESS;
364 }
365 
366 NTSTATUS
367 NTAPI
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 */
383  ChannelUnlockAttributes(Channel);
384  return STATUS_SUCCESS;
385 }
386 
387 NTSTATUS
388 NTAPI
390  OUT PGUID ApplicationType)
391 {
392  CHECK_PARAMETER1(Channel);
393 
394  /* Read the application type GUID */
395  ChannelLockAttributes(Channel);
396  *ApplicationType = Channel->ApplicationType;
397  ChannelUnlockAttributes(Channel);
398 
399  /* Always return success */
400  return STATUS_SUCCESS;
401 }
402 
403 NTSTATUS
404 NTAPI
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);
428  return STATUS_NOT_IMPLEMENTED;
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 
455 NTSTATUS
456 NTAPI
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 */
529  Status = ChannelInitializeVTable(Channel);
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 
550 FailChannel:
551  /* Destroy the channel and return the failure code */
552  Channel->ChannelDestroy(Channel);
553  return Status;
554 }
555 
556 NTSTATUS
557 NTAPI
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 }
NTSTATUS NTAPI ChannelIWrite(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize)
Definition: channel.c:116
signed char * PCHAR
Definition: retypes.h:7
#define IN
Definition: typedefs.h:38
NTSTATUS NTAPI ChannelInitializeVTable(IN PSAC_CHANNEL Channel)
Definition: channel.c:405
#define CHECK_ALLOCATION(x)
Definition: sacdrv.h:64
NTSTATUS NTAPI VTUTF8ChannelORead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, OUT PULONG ByteCount)
Definition: vtutf8chan.c:714
#define ChannelLockIBuffer(x)
Definition: sacdrv.h:1333
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
enum _SAC_CHANNEL_STATUS * PSAC_CHANNEL_STATUS
WCHAR NTAPI RawChannelIReadLast(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:320
NTSTATUS NTAPI VTUTF8ChannelDestroy(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:702
Definition: sacdrv.h:276
WCHAR NTAPI ChannelIReadLast(IN PSAC_CHANNEL Channel)
Definition: channel.c:150
NTSTATUS NTAPI ChannelIRead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, IN OUT PULONG ResultBufferSize)
Definition: channel.c:131
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define ChannelUnlockAttributes(x)
Definition: sacdrv.h:1336
NTSTATUS NTAPI ChannelGetStatus(IN PSAC_CHANNEL Channel, OUT PSAC_CHANNEL_STATUS ChannelStatus)
Definition: channel.c:222
#define SAC_CHANNEL_FLAG_CLOSE_EVENT
Definition: sacdrv.h:169
ULONG NTAPI RawChannelIBufferLength(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:310
NTSTATUS NTAPI ChannelSetDescription(IN PSAC_CHANNEL Channel, IN PWCHAR Description)
Definition: channel.c:368
NTSTATUS NTAPI VTUTF8ChannelIWrite(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize)
Definition: vtutf8chan.c:1339
BOOLEAN NTAPI ChannelIsEqual(IN PSAC_CHANNEL Channel, IN PSAC_CHANNEL_ID ChannelId)
Definition: channel.c:25
static const WCHAR Description[]
Definition: oid.c:1266
uint16_t * PWCHAR
Definition: typedefs.h:54
#define SAC_CHANNEL_DESCRIPTION_SIZE
Definition: sacdrv.h:152
NTSTATUS NTAPI ChannelGetApplicationType(IN PSAC_CHANNEL Channel, OUT PGUID ApplicationType)
Definition: channel.c:389
BOOLEAN NTAPI ChannelIsValidType(IN SAC_CHANNEL_TYPE ChannelType)
Definition: channel.c:17
#define GLOBAL_BLOCK_TAG
Definition: sacdrv.h:141
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
NTSTATUS NTAPI ChannelDestroy(IN PSAC_CHANNEL Channel)
Definition: channel.c:77
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSTATUS NTAPI ChannelHasRedrawEvent(IN PSAC_CHANNEL Channel, OUT PBOOLEAN Present)
Definition: channel.c:209
#define UNICODE_NULL
NTSTATUS NTAPI ChannelSetRedrawEvent(IN PSAC_CHANNEL Channel)
Definition: channel.c:176
enum _SAC_CHANNEL_TYPE SAC_CHANNEL_TYPE
NTSTATUS NTAPI VTUTF8ChannelCreate(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:677
NTSTATUS NTAPI VTUTF8ChannelIBufferIsFull(IN PSAC_CHANNEL Channel, OUT PBOOLEAN BufferStatus)
Definition: vtutf8chan.c:1291
FORCEINLINE VOID SacInitializeLock(IN PSAC_CHANNEL_LOCK Lock)
Definition: sacdrv.h:1251
unsigned char BOOLEAN
NTSTATUS NTAPI ChannelSetStatus(IN PSAC_CHANNEL Channel, IN SAC_CHANNEL_STATUS ChannelStatus)
Definition: channel.c:236
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI VTUTF8ChannelOFlush(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:725
Definition: bufpool.h:45
NTSTATUS NTAPI RawChannelOEcho(IN PSAC_CHANNEL Channel, IN PCHAR String, IN ULONG Length)
Definition: rawchan.c:115
#define CHECK_PARAMETER(x)
Definition: sacdrv.h:54
#define SacAllocatePool(Length, Tag)
Definition: sacdrv.h:24
Definition: sacdrv.h:287
#define ChannelSetEvent(Channel, x)
Definition: sacdrv.h:98
NTSTATUS NTAPI ChannelOWrite(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize)
Definition: channel.c:87
NTSTATUS NTAPI RawChannelORead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, OUT PULONG ByteCount)
Definition: rawchan.c:58
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SAC_CHANNEL_FLAG_HAS_NEW_DATA_EVENT
Definition: sacdrv.h:170
NTSTATUS NTAPI RawChannelDestroy(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:39
NTSTATUS NTAPI RawChannelIRead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, IN PULONG ReturnBufferSize)
Definition: rawchan.c:246
ULONG NTAPI ChannelIBufferLength(IN PSAC_CHANNEL Channel)
Definition: channel.c:163
#define SAC_CHANNEL_FLAG_APPLICATION
Definition: sacdrv.h:173
#define BufferSize
Definition: classpnp.h:419
#define ChannelLockAttributes(x)
Definition: sacdrv.h:1335
enum _SAC_CHANNEL_STATUS SAC_CHANNEL_STATUS
#define CHECK_PARAMETER1(x)
Definition: sacdrv.h:56
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
WCHAR NTAPI VTUTF8ChannelIReadLast(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:1313
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
NTSTATUS NTAPI ChannelClose(IN PSAC_CHANNEL Channel)
Definition: channel.c:558
BOOLEAN NTAPI ChannelIsClosed(IN PSAC_CHANNEL Channel)
Definition: channel.c:273
#define ChannelUnlockIBuffer(x)
Definition: sacdrv.h:1334
char * PBOOLEAN
Definition: retypes.h:11
NTSTATUS NTAPI ChannelDereferenceHandles(IN PSAC_CHANNEL Channel)
Definition: channel.c:35
NTSTATUS NTAPI ChannelSetLockEvent(IN PSAC_CHANNEL Channel)
Definition: channel.c:187
#define SAC_DBG_INIT
Definition: sacdrv.h:34
Definition: sacdrv.h:277
#define SAC_DBG(x,...)
Definition: sacdrv.h:37
#define ChannelLockOBuffer(x)
Definition: sacdrv.h:1331
NTSTATUS NTAPI ChannelSetName(IN PSAC_CHANNEL Channel, IN PWCHAR Name)
Definition: channel.c:322
NTSTATUS NTAPI ChannelOFlush(IN PSAC_CHANNEL Channel)
Definition: channel.c:103
#define ChannelInitializeEvent(Channel, Attributes, x)
Definition: sacdrv.h:70
NTSTATUS NTAPI VTUTF8ChannelIRead(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize, IN PULONG ReturnBufferSize)
Definition: vtutf8chan.c:1234
NTSTATUS NTAPI ChannelCreate(IN PSAC_CHANNEL Channel, IN PSAC_CHANNEL_ATTRIBUTES Attributes, IN SAC_CHANNEL_ID ChannelId)
Definition: channel.c:457
ULONG NTAPI VTUTF8ChannelIBufferLength(IN PSAC_CHANNEL Channel)
Definition: vtutf8chan.c:1303
NTSTATUS NTAPI ChannelClearRedrawEvent(IN PSAC_CHANNEL Channel)
Definition: channel.c:198
#define ChannelClearEvent(Channel, x)
Definition: sacdrv.h:113
NTSTATUS NTAPI ChannelGetDescription(IN PSAC_CHANNEL Channel, IN PWCHAR *Description)
Definition: channel.c:343
Status
Definition: gdiplustypes.h:24
#define CHECK_PARAMETER3(x)
Definition: sacdrv.h:60
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
NTSTATUS NTAPI ChannelGetName(IN PSAC_CHANNEL Channel, OUT PWCHAR *Name)
Definition: channel.c:297
NTSTATUS NTAPI RawChannelOWrite(IN PSAC_CHANNEL Channel, IN PCHAR String, IN ULONG Length)
Definition: rawchan.c:195
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
NTSTATUS NTAPI RawChannelOFlush(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:172
#define SAC_OBUFFER_SIZE
Definition: sacdrv.h:150
#define SAC_CHANNEL_FLAG_REDRAW_EVENT
Definition: sacdrv.h:172
unsigned int * PULONG
Definition: retypes.h:1
BOOLEAN NTAPI ChannelIsActive(IN PSAC_CHANNEL Channel)
Definition: channel.c:250
#define CHECK_PARAMETER2(x)
Definition: sacdrv.h:58
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
#define ChannelUnlockOBuffer(x)
Definition: sacdrv.h:1332
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
Definition: sacdrv.h:278
NTSTATUS NTAPI VTUTF8ChannelOWrite(IN PSAC_CHANNEL Channel, IN PCHAR String, IN ULONG Length)
Definition: vtutf8chan.c:1167
NTSTATUS NTAPI RawChannelIWrite(IN PSAC_CHANNEL Channel, IN PCHAR Buffer, IN ULONG BufferSize)
Definition: rawchan.c:343
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define ChannelUninitializeEvent(Channel, x, f)
Definition: sacdrv.h:84
NTSTATUS NTAPI VTUTF8ChannelOEcho(IN PSAC_CHANNEL Channel, IN PCHAR String, IN ULONG Length)
Definition: vtutf8chan.c:1077
NTSTATUS NTAPI RawChannelCreate(IN PSAC_CHANNEL Channel)
Definition: rawchan.c:17
#define SAC_CHANNEL_NAME_SIZE
Definition: sacdrv.h:151
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SAC_CHANNEL_FLAG_LOCK_EVENT
Definition: sacdrv.h:171
NTSTATUS NTAPI RawChannelIBufferIsFull(IN PSAC_CHANNEL Channel, OUT PBOOLEAN BufferStatus)
Definition: rawchan.c:297