forked from eiz/SynchronousAudioRouter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsar.h
More file actions
525 lines (462 loc) · 16.4 KB
/
sar.h
File metadata and controls
525 lines (462 loc) · 16.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
// SynchronousAudioRouter
// Copyright (C) 2015 Mackenzie Straight
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with SynchronousAudioRouter. If not, see <http://www.gnu.org/licenses/>.
#ifndef _SAR_H
#define _SAR_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(KERNEL)
#include <ntifs.h>
#include <ntddk.h>
#include <ntstrsafe.h>
#include <windef.h>
#include <ks.h>
#define NOBITMAP
#include <mmreg.h>
#include <ksmedia.h>
#include <ksproxy.h>
#define NDIS630
#include <ndis.h>
#include "SarWaveFilterDescriptor.h"
#include "SarTopologyFilterDescriptor.h"
#else
#include <windows.h>
#endif
#pragma warning(push)
#pragma warning(disable:4200)
// {C16E8D6C-C4CC-4C76-B11C-79B8414EA968}
DEFINE_GUID(GUID_DEVINTERFACE_SYNCHRONOUSAUDIOROUTER,
0xc16e8d6c, 0xc4cc, 0x4c76, 0xb1, 0x1c, 0x79, 0xb8, 0x41, 0x4e, 0xa9, 0x68);
#define MAX_ENDPOINT_NAME_LENGTH 63
#define SAR_ENDPOINT_TYPE_RECORDING 1
#define SAR_ENDPOINT_TYPE_PLAYBACK 2
// SAR control interface ioctls
#define SAR_SET_BUFFER_LAYOUT CTL_CODE( \
FILE_DEVICE_UNKNOWN, 1, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
#define SAR_CREATE_ENDPOINT CTL_CODE( \
FILE_DEVICE_UNKNOWN, 2, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
#define SAR_WAIT_HANDLE_QUEUE CTL_CODE( \
FILE_DEVICE_UNKNOWN, 3, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
#define SAR_START_REGISTRY_FILTER CTL_CODE( \
FILE_DEVICE_UNKNOWN, 4, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
#define SAR_SEND_FORMAT_CHANGE_EVENT CTL_CODE( \
FILE_DEVICE_UNKNOWN, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
// SarNdis ioctls
#define SARNDIS_IOCTL_CODE(i) CTL_CODE( \
FILE_DEVICE_PHYSICAL_NETCARD, i, METHOD_NEITHER, \
FILE_READ_DATA | FILE_WRITE_DATA)
#define SARNDIS_ENUMERATE SARNDIS_IOCTL_CODE(1)
#define SARNDIS_ENABLE SARNDIS_IOCTL_CODE(2)
#define SARNDIS_SYNC SARNDIS_IOCTL_CODE(3)
#define SAR_MAX_BUFFER_SIZE 1024 * 1024 * 128
#define SAR_MIN_SAMPLE_SIZE 1
#define SAR_MAX_SAMPLE_SIZE 4
#define SAR_MIN_SAMPLE_RATE 8000
#define SAR_MAX_SAMPLE_RATE 192000
#define SAR_MAX_CHANNEL_COUNT 32
#define SAR_BUFFER_CELL_SIZE 65536
#define SAR_MAX_ENDPOINT_COUNT \
(SAR_BUFFER_CELL_SIZE / sizeof(SarEndpointRegisters))
typedef struct SarCreateEndpointRequest
{
DWORD type;
DWORD index;
DWORD channelCount;
WCHAR id[MAX_ENDPOINT_NAME_LENGTH+1];
WCHAR name[MAX_ENDPOINT_NAME_LENGTH+1];
} SarCreateEndpointRequest;
typedef struct SarSetBufferLayoutRequest
{
DWORD bufferSize;
DWORD periodSizeBytes;
DWORD sampleRate;
DWORD sampleSize;
DWORD minimumFrameCount;
} SarSetBufferLayoutRequest;
typedef struct SarSetBufferLayoutResponse
{
PVOID64 virtualAddress;
DWORD actualSize;
DWORD registerBase;
} SarSetBufferLayoutResponse;
typedef struct SarHandleQueueResponse
{
PVOID64 handle;
ULONG64 associatedData;
} SarHandleQueueResponse;
#define GENERATION_IS_ACTIVE(gen) ((gen) & 1)
#define MAKE_GENERATION(gen, active) (((gen) << 1) | (active))
#define GENERATION_NUMBER(gen) ((gen) >> 1)
typedef struct SarEndpointRegisters
{
ULONG generation;
DWORD positionRegister;
DWORD reserved; //clockRegister;
DWORD bufferOffset;
DWORD bufferSize;
DWORD notificationCount;
DWORD activeChannelCount;
} SarEndpointRegisters;
typedef struct SarNdisEnumerateResponseItem
{
ULONG32 nameOffset;
ULONG32 nameLength;
} SarNdisEnumerateResponseItem;
typedef struct SarNdisEnumerateResponse
{
ULONG itemCount;
SarNdisEnumerateResponseItem items[0];
} SarNdisEnumerateResponse;
#if defined(KERNEL)
#define SAR_CONTROL_REFERENCE_STRING L"\\{0EB287D4-6C04-4926-AE19-3C066A4C3F3A}"
#define SAR_TAG '1RAS'
#ifdef NO_LOGGING
#define SAR_INFO(fmt, ...)
#define SAR_ERROR(fmt, ...)
#define SAR_WARNING(fmt, ...)
#define SAR_DEBUG(fmt, ...)
#define SAR_TRACE(fmt, ...)
#else
#define SAR_INFO(fmt, ...) \
DbgPrintEx(DPFLTR_DEFAULT_ID, DPFLTR_INFO_LEVEL, __FUNCTION__ " (SAR) " fmt "\n", __VA_ARGS__)
#define SAR_ERROR(fmt, ...) \
DbgPrintEx(DPFLTR_DEFAULT_ID, DPFLTR_ERROR_LEVEL, "ERROR: " __FUNCTION__ " (SAR) " fmt "\n", __VA_ARGS__)
#define SAR_WARNING(fmt, ...) \
DbgPrintEx(DPFLTR_DEFAULT_ID, DPFLTR_WARNING_LEVEL, "WARNING: " __FUNCTION__ " (SAR) " fmt "\n", __VA_ARGS__)
#define SAR_DEBUG(fmt, ...) \
DbgPrintEx(DPFLTR_DEFAULT_ID, DPFLTR_TRACE_LEVEL, __FUNCTION__ " (SAR) " fmt "\n", __VA_ARGS__)
#define SAR_TRACE(fmt, ...) \
DbgPrintEx(DPFLTR_DEFAULT_ID, DPFLTR_TRACE_LEVEL, __FUNCTION__ " (SAR) " fmt "\n", __VA_ARGS__)
#endif
typedef struct SarHandleQueue
{
KSPIN_LOCK lock;
LIST_ENTRY pendingItems;
LIST_ENTRY pendingIrps;
} SarHandleQueue;
typedef struct SarHandleQueueItem
{
LIST_ENTRY listEntry;
HANDLE kernelProcessHandle;
HANDLE userHandle;
ULONG64 associatedData;
} SarHandleQueueItem;
typedef struct SarHandleQueueIrp
{
LIST_ENTRY listEntry;
HANDLE kernelProcessHandle;
PIRP irp;
} SarHandleQueueIrp;
typedef struct SarTableEntry
{
PVOID key;
PVOID value;
} SarTableEntry;
typedef struct SarStringTableEntry
{
UNICODE_STRING key;
PVOID value;
} SarStringTableEntry;
typedef struct SarDriverExtension
{
PDRIVER_DISPATCH ksDispatchCreate;
PDRIVER_DISPATCH ksDispatchClose;
PDRIVER_DISPATCH ksDispatchCleanup;
PDRIVER_DISPATCH ksDispatchDeviceControl;
PKSDEVICE ksDevice;
UNICODE_STRING sarInterfaceName;
FAST_MUTEX mutex;
RTL_GENERIC_TABLE controlContextTable; // table<PFILE_OBJECT, SarControlContext*>
// This shouldn't really be needed as long as CmUnRegisterCallback can't
// complete while one of our callback routines is still running, but there
// is no explicit documentation of that, so we protect the registry redirect
// tables with a reader writer spinlock "just in case." Note that
// RTL_AVL_TABLE is used here instead of RTL_GENERIC_TABLE to avoid
// splaying which would be unsafe with a read-only lock. All related
// structures must be in nonpaged memory.
EX_SPIN_LOCK registryRedirectLock;
RTL_AVL_TABLE registryRedirectTableWow64;
RTL_AVL_TABLE registryRedirectTable;
LARGE_INTEGER filterCookie;
PTOKEN_USER filterUser;
} SarDriverExtension;
typedef struct SarControlContext
{
LONG refs;
FAST_MUTEX mutex;
BOOLEAN orphan;
PFILE_OBJECT fileObject;
PIO_WORKITEM workItem;
LIST_ENTRY endpointList; // List<SarEndpoint>
LIST_ENTRY pendingEndpointList; // List<SarEndpoint> Endpoints created but not configured
HANDLE bufferSection;
PVOID sectionViewBaseAddress;
SarHandleQueue handleQueue;
RTL_BITMAP bufferMap;
PULONG bufferMapStorage;
DWORD bufferSize;
DWORD periodSizeBytes;
DWORD sampleRate;
DWORD sampleSize;
DWORD minimumFrameCount;
} SarControlContext;
#define SarBufferMapEntryCount(bufferSize) \
((bufferSize) / SAR_BUFFER_CELL_SIZE)
#define SarBufferMapSize(bufferSize) (sizeof(DWORD) * ( \
SarBufferMapEntryCount(bufferSize) / sizeof(DWORD) + \
(((SarBufferMapEntryCount(bufferSize) % sizeof(DWORD)) != 0) ? 1 : 0)))
typedef struct SarEndpointProcessContext
{
LIST_ENTRY listEntry;
PEPROCESS process;
HANDLE processHandle;
SarEndpointRegisters *registerFileUVA;
PVOID bufferUVA;
} SarEndpointProcessContext;
typedef struct SarEndpoint
{
LONG refs;
LIST_ENTRY listEntry;
PIRP pendingIrp;
UNICODE_STRING deviceName;
UNICODE_STRING deviceId;
UNICODE_STRING deviceIdMangled;
UNICODE_STRING topologyFilterRefId;
SarControlContext *owner;
PKSFILTERFACTORY filterFactory;
PKSFILTERFACTORY topologyFilterFactory;
SarWaveFilterDescriptor filterDescriptor;
SarTopologyFilterDescriptor topologyDescriptor;
DWORD type;
DWORD index;
DWORD channelCount;
ULONG channelMask;
DWORD activeChannelCount;
FAST_MUTEX mutex;
BOOLEAN orphan;
PKSPIN activePin;
DWORD activeCellIndex;
SIZE_T activeViewSize;
ULONG activeBufferSize;
LIST_ENTRY activeProcessList;
} SarEndpoint;
typedef struct SarNdisDriverState
{
NDIS_HANDLE filterDriverHandle;
NDIS_HANDLE deviceHandle;
PDEVICE_OBJECT deviceObject;
FAST_MUTEX mutex;
LIST_ENTRY runningFilters;
} SarNdisDriverState;
typedef struct SarNdisFilterModuleContext
{
LONG refs;
LIST_ENTRY runningFiltersEntry;
NDIS_HANDLE filterHandle;
UNICODE_STRING instanceName;
bool running;
bool enabled;
} SarNdisFilterModuleContext;
// Control
NTSTATUS SarSetBufferLayout(
SarControlContext *controlContext,
SarSetBufferLayoutRequest *request,
SarSetBufferLayoutResponse *response);
NTSTATUS SarCreateEndpoint(
PDEVICE_OBJECT device,
PIRP irp,
SarControlContext *controlContext,
SarCreateEndpointRequest *request);
VOID SarOrphanEndpoint(SarEndpoint *endpoint);
VOID SarDeleteEndpoint(SarEndpoint *endpoint);
NTSTATUS SarSendFormatChangeEvent(
PDEVICE_OBJECT deviceObject,
SarDriverExtension *extension);
FORCEINLINE VOID SarRetainEndpoint(SarEndpoint *endpoint)
{
SAR_TRACE("endpoint %p refs++", endpoint);
InterlockedIncrement(&endpoint->refs);
}
FORCEINLINE BOOLEAN SarReleaseEndpoint(SarEndpoint *endpoint)
{
SAR_TRACE("endpoint %p refs--", endpoint);
if (InterlockedDecrement(&endpoint->refs) == 0) {
SarDeleteEndpoint(endpoint);
return TRUE;
}
return FALSE;
}
// Device
NTSTATUS SarKsDeviceAdd(IN PKSDEVICE device);
NTSTATUS SarKsDevicePostStart(IN PKSDEVICE device);
// Pin/Filter
NTSTATUS SarKsFilterCreate(PKSFILTER filter, PIRP irp);
NTSTATUS SarKsFilterClose(PKSFILTER filter, PIRP irp);
NTSTATUS SarKsPinCreate(PKSPIN pin, PIRP irp);
NTSTATUS SarKsPinClose(PKSPIN pin, PIRP irp);
VOID SarKsPinReset(PKSPIN pin);
NTSTATUS SarKsPinProcess(PKSPIN pin);
NTSTATUS SarKsPinConnect(PKSPIN pin);
VOID SarKsPinDisconnect(PKSPIN pin);
NTSTATUS SarKsPinSetDataFormat(
PKSPIN pin,
PKSDATAFORMAT oldFormat,
PKSMULTIPLE_ITEM oldAttributeList,
const KSDATARANGE *dataRange,
const KSATTRIBUTE_LIST *attributeRange);
NTSTATUS SarKsPinSetDeviceState(PKSPIN pin, KSSTATE toState, KSSTATE fromState);
NTSTATUS SarKsPinIntersectHandler(
PVOID context, PIRP irp, PKSP_PIN pin,
PKSDATARANGE dataRange, PKSDATARANGE matchingDataRange, ULONG dataBufferSize,
PVOID data, PULONG dataSize);
NTSTATUS SarKsPinGetName(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinGetGlobalInstancesCount(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinGetDefaultDataFormat(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinProposeDataFormat(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtGetBuffer(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtGetBufferWithNotification(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtGetClockRegister(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtGetHwLatency(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtGetPacketCount(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtGetPositionRegister(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtGetPresentationPosition(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtQueryNotificationSupport(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtRegisterNotificationEvent(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsPinRtUnregisterNotificationEvent(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsNodeGetAudioChannelConfig(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarKsNodeSetAudioChannelConfig(
PIRP irp, PKSIDENTIFIER request, PVOID data);
NTSTATUS SarGetOrCreateEndpointProcessContext(
SarEndpoint *endpoint,
PEPROCESS process,
SarEndpointProcessContext **outContext);
NTSTATUS SarDeleteEndpointProcessContext(SarEndpointProcessContext *context);
// Entry
DRIVER_INITIALIZE DriverEntry;
SarControlContext *SarCreateControlContext(PFILE_OBJECT fileObject);
VOID SarDeleteControlContext(SarControlContext *controlContext);
BOOLEAN SarOrphanControlContext(SarDriverExtension *extension, PIRP irp);
FORCEINLINE VOID SarRetainControlContext(SarControlContext *controlContext)
{
SAR_TRACE("controlContext %p refs++", controlContext);
InterlockedIncrement(&controlContext->refs);
}
FORCEINLINE BOOLEAN SarReleaseControlContext(SarControlContext *controlContext)
{
SAR_TRACE("controlContext %p refs--", controlContext);
if (InterlockedDecrement(&controlContext->refs) == 0) {
SarDeleteControlContext(controlContext);
return TRUE;
}
return FALSE;
}
FORCEINLINE VOID SarReleaseEndpointAndContext(SarEndpoint *endpoint)
{
SarControlContext *controlContext = endpoint->owner;
SarReleaseEndpoint(endpoint);
SarReleaseControlContext(controlContext);
}
// NDIS
VOID SarNdisDeleteFilterModuleContext(SarNdisFilterModuleContext *context);
FORCEINLINE VOID SarNdisRetainFilterModuleContext(
SarNdisFilterModuleContext *context)
{
InterlockedIncrement(&context->refs);
}
FORCEINLINE BOOLEAN SarNdisReleaseFilterModuleContext(
SarNdisFilterModuleContext *context)
{
if (InterlockedDecrement(&context->refs) == 0) {
SarNdisDeleteFilterModuleContext(context);
return TRUE;
}
return FALSE;
}
// Utility
#define FOR_EACH_GENERIC(table, objType, obj, restartKey) \
for (objType *obj = (objType *)RtlEnumerateGenericTableWithoutSplaying( \
(table), &(restartKey)); \
obj; \
obj = (objType *)RtlEnumerateGenericTableWithoutSplaying( \
(table), &(restartKey)))
#define GUID_FORMAT "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"
#define GUID_VALUES(g) (g).Data1, (g).Data2, (g).Data3, \
(g).Data4[0], \
(g).Data4[1], \
(g).Data4[2], \
(g).Data4[3], \
(g).Data4[4], \
(g).Data4[5], \
(g).Data4[6], \
(g).Data4[7]
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
NTSTATUS SarReadUserBuffer(PVOID src, PIRP irp, ULONG size);
NTSTATUS SarWriteUserBuffer(PVOID src, PIRP irp, ULONG size);
SarDriverExtension *SarGetDriverExtension(PDRIVER_OBJECT driverObject);
SarDriverExtension *SarGetDriverExtensionFromIrp(PIRP irp);
SarControlContext *SarGetControlContextFromFileObject(
SarDriverExtension *extension, PFILE_OBJECT fileObject);
// Gets the endpoint associated with an IRP for a KS pin or filter. If retain
// is TRUE, both the endpoint and its control context are retained and must be
// released using SarReleaseEndpointAndContext.
SarEndpoint *SarGetEndpointFromIrp(PIRP irp, BOOLEAN retain);
NTSTATUS SarReadEndpointRegisters(
SarEndpointRegisters *regs, SarEndpoint *endpoint);
NTSTATUS SarWriteEndpointRegisters(
SarEndpointRegisters *regs, SarEndpoint *endpoint);
NTSTATUS SarStringDuplicate(PUNICODE_STRING str, PCUNICODE_STRING src);
void SarInitializeHandleQueue(SarHandleQueue *queue);
NTSTATUS SarTransferQueuedHandle(
PIRP irp, HANDLE kernelTargetProcessHandle, ULONG responseIndex,
HANDLE kernelProcessHandle, HANDLE userHandle, ULONG64 associatedData);
void SarCancelAllHandleQueueIrps(SarHandleQueue *handleQueue);
NTSTATUS SarPostHandleQueue(
SarHandleQueue *queue, HANDLE userHandle, ULONG64 associatedData);
NTSTATUS SarWaitHandleQueue(SarHandleQueue *queue, PIRP irp);
VOID SarStringFree(PUNICODE_STRING str);
NTSTATUS SarInsertTableEntry(PRTL_GENERIC_TABLE table, PVOID key, PVOID value);
BOOLEAN SarRemoveTableEntry(PRTL_GENERIC_TABLE table, PVOID key);
PVOID SarGetTableEntry(PRTL_GENERIC_TABLE table, PVOID key);
VOID SarInitializeTable(PRTL_GENERIC_TABLE table);
NTSTATUS SarInsertStringTableEntry(
PRTL_AVL_TABLE table, PUNICODE_STRING key, PVOID value);
BOOLEAN SarRemoveStringTableEntry(
PRTL_AVL_TABLE table, PUNICODE_STRING key);
PVOID SarGetStringTableEntry(PRTL_AVL_TABLE table, PCUNICODE_STRING key);
VOID SarInitializeStringTable(PRTL_AVL_TABLE table);
VOID SarClearStringTable(PRTL_AVL_TABLE table, VOID (*freeCb)(PVOID));
NTSTATUS SarCopyProcessUser(PEPROCESS process, PTOKEN_USER *outTokenUser);
#endif // KERNEL
#pragma warning(pop)
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _SAR_H