WDK Mini Filter Example
nc.h
Go to the documentation of this file.
1 #ifndef __NC_H__
2 #define __NC_H__
3 
4 #pragma warning( disable: 4701 ) // 'Potentially' uninitialized local variable.
5  // Hopefully one day the compiler will be a little
6  // more factual about this and we can use it. It
7  // would make a great warning.
8 
9 //
10 // Allocation Tags
11 //
12 
13 #define NC_TAG 'NC__' // Generic NameChanger Tag
14 #define NC_MAPPING_TAG 'NCMP' // Mapping Buffer Tag
15 #define NC_INSTANCE_CONTEXT_TAG 'NCin' // Instance Context Tag
16 #define NC_LOCK_TAG 'NClk' // Tag for nonpaged locks
17 #define NC_GENERATE_NAME_TAG 'NCgn' // Tag for strings which are allocated for name generation
18 #define NC_NORMALIZE_NAME_TAG 'NCnn' // Tag for strings which are allocated for name normalization
19 #define NC_FILE_NAME_TAG 'NCfn' // Tag for strings which are allocated for file names in file objects
20 #define NC_DIR_QRY_CACHE_TAG 'NCqc' // Tag for buffers which are allocated for directory enumeration cache and injection entries
21 #define NC_DIR_QRY_SEARCH_STRING 'NCqs' // Tag for strings which are allocated for directory search strings
22 #define NC_SET_LINK_BUFFER_TAG 'NCsl' // Tag for munge buffer in Set Link operations
23 #define NC_RENAME_BUFFER_TAG 'NCrn' // Tag for munge buffer in Rename operations
24 
25 
26 #define NC_STREAM_HANDLE__CONTEXT_TAG 'NCsh'
27 
28 //
29 // Macros to make math easier.
30 //
31 
32 #define NC_SEPARATOR ((WCHAR) L'\\')
33 #define EMPTY_UNICODE_STRING {0, 0, NULL}
34 
35 #define AlignToSize(_length, _alignment) \
36  (((_length) + ((_alignment) - 1)) & ~((_alignment) - 1))
37 
38 #define Max(a,b) ((a) >= (b) ? (a) : (b))
39 
40 #define NcFreeUnicodeString( UCS ) \
41  ExFreePoolWithTag( (UCS)->Buffer, NC_TAG ); \
42  (UCS)->Buffer = NULL; \
43  (UCS)->MaximumLength = \
44  (UCS)->Length = 0;
45 
46 //
47 // We need to supress a few warnings in order to enable compilation with
48 // the 2003 IFS Kit. WDK does not require this.
49 //
50 
51 #pragma warning( push )
52 #pragma warning( disable: 4201 4214 )
53 #include <fltkernel.h>
54 #pragma warning( pop )
55 
56 #include <ntintsafe.h>
57 
58 #define INVALID_HANDLE_VALUE ((HANDLE) -1)
59 
60 //
61 // Typedefs for dynamically imported routines
62 //
63 
64 typedef
65 NTSTATUS
67  _In_ PFILE_OBJECT FileObject,
68  _In_reads_bytes_(FileNameLength) PWSTR NewFileName,
69  _In_ USHORT FileNameLength
70  );
71 
72 typedef
73 NTSTATUS
75  _In_ PFLT_INSTANCE Instance,
76  _In_ PFILE_OBJECT FileObject,
77  _Out_writes_bytes_(Length) PVOID FileInformation,
78  _In_ ULONG Length,
79  _In_ FILE_INFORMATION_CLASS FileInformationClass,
80  _In_ BOOLEAN ReturnSingleEntry,
81  _In_opt_ PUNICODE_STRING FileName,
82  _In_ BOOLEAN RestartScan,
83  _Out_opt_ PULONG LengthReturned
84  );
85 
86 typedef
87 NTSTATUS
89  _In_ PFLT_FILTER Filter,
90  _In_opt_ PFLT_INSTANCE Instance,
91  _Out_ PHANDLE FileHandle,
92  _Outptr_opt_ PFILE_OBJECT *FileObject,
93  _In_ ACCESS_MASK DesiredAccess,
94  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
95  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
96  _In_opt_ PLARGE_INTEGER AllocationSize,
97  _In_ ULONG FileAttributes,
98  _In_ ULONG ShareAccess,
99  _In_ ULONG CreateDisposition,
100  _In_ ULONG CreateOptions,
101  _In_reads_bytes_opt_(EaLength) PVOID EaBuffer,
102  _In_ ULONG EaLength,
103  _In_ ULONG Flags
104  );
105 
106 typedef
107 NTSTATUS
109  _In_ PFLT_FILTER Filter,
110  _In_opt_ PFLT_INSTANCE Instance,
111  _Out_ PHANDLE FileHandle,
112  _Outptr_opt_ PFILE_OBJECT *FileObject,
113  _In_ ACCESS_MASK DesiredAccess,
114  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
115  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
116  _In_opt_ PLARGE_INTEGER AllocationSize,
117  _In_ ULONG FileAttributes,
118  _In_ ULONG ShareAccess,
119  _In_ ULONG CreateDisposition,
120  _In_ ULONG CreateOptions,
121  _In_reads_bytes_opt_(EaLength) PVOID EaBuffer,
122  _In_ ULONG EaLength,
123  _In_ ULONG Flags,
124  _In_opt_ PIO_DRIVER_CREATE_CONTEXT DriverContext
125  );
126 
127 typedef
128 PVOID
130  _In_ PFLT_CALLBACK_DATA Data
131  );
132 
133 //
134 // Common Structures
135 //
136 
137 //
138 // Struct which provides a single buffer and offset for data caching.
139 //
140 
141 typedef struct __NC_CACHE_ENTRY {
142 
143  char *Buffer;
145 
147 
148 //
149 // Structure which manages a single path. These are used to precompute
150 // various paths for the mapping for easy comparison. We do not use
151 // this structure for user-supplied paths (eg. on open.)
152 //
153 
154 typedef struct _NC_MAPPING_PATH {
155 
156  UNICODE_STRING FullPath; // \volume_name\parent_path\final_component
157  UNICODE_STRING VolumePath; // \volume_name
158  UNICODE_STRING ParentPath; // \volume_name\parent_name
159  UNICODE_STRING FinalComponentName; // final_component or \ (for volume root open)
160  UNICODE_STRING VolumelessName; // \parent_name\final_component
161  USHORT NumberComponentsInFullPath; // \volume_name\parent_name\final_component == 3
162  USHORT NumberComponentsInVolumePath; // \volume_name == 1
163 
165 
166 //
167 // Structure which manages a long and short name pairing.
168 //
169 
170 typedef struct _NC_MAPPING_ENTRY {
171 
172  //Strings which manage the long name.
174 
175  //Strings which manage the short name.
177 
179 
180 //
181 // Structure which manages with user and real mapping.
182 //
183 
184 typedef struct _NC_MAPPING {
185 
188 
190 
191 //
192 // NC_PATH_OVERLAP is a series of flags which determine a name's relation to a mapping.
193 //
194 // Ancestor means that the path is a directory along the mapping path.
195 // For example \a\b is an ancestor of \a\b\c, but \a\b\x is not an ancestor of \a\b\c.
196 //
197 // Parent means that the path is the parent directory of the mapping path.
198 //
199 // Match means that the path and the mapping are equal.
200 //
201 // InMapping means that the path is either the mapping itself, or a decendent of the mapping.
202 //
203 // Peer means that the object is directly next to the mapping (a\b\x is a peer of a\b\y.)
204 //
205 // If no flags are set, the path is entirely outside the mapping.
206 //
207 
208 //
209 // TODO: Should we use a different representation of this structure which
210 // does not require warning suppressions?
211 //
212 #pragma warning( push )
213 #pragma warning( disable: 4201 )
214 typedef union {
215  ULONG EntireFlags;
216  struct {
217  int Ancestor:1;
218  int Parent:1;
219  int Match:1;
220  int InMapping:1;
221  int Peer:1;
222  };
224 #pragma warning( pop )
225 
226 //
227 // Instance Context Defines
228 //
229 
230 typedef struct _NC_INSTANCE_CONTEXT {
231 
232  // The mapping is defined as a property of the instance.
234 
235  // The file system we're attached to
236  FLT_FILESYSTEM_TYPE VolumeFilesystemType;
237 
239 
240 
241 //
242 // This context is used when a file is enumerating
243 // a directory and we need to cache entries in our context.
244 //
245 
246 typedef struct _NC_DIR_QRY_CONTEXT {
247 
249 
250  // Determines if the structure is in use. If it is,
251  // then there is no need to initialize the cache or injection entry.
252  BOOLEAN InUse;
253 
254  // Pointer to list of entries which we must drain from.
256 
257  // Pointer to entry which we want to inject.
259 
260  // The user provided search string which can only be set up on
261  // the first query.
262  UNICODE_STRING SearchString;
263 
264  // The information class which the user requested.
265  FILE_INFORMATION_CLASS InformationClass;
266 
268 
269 //
270 // This context is used when a file is being used for
271 // directory notification forwarding.
272 //
273 
274 typedef struct _NC_DIR_NOT_IO_CACHE {
275 
276  //
277  // Stores the state of the cache.
278  // If the pointer is NULL, there is nothing in cache.
279  //
280 
282 
283  //
284  // If ReadyToIssue is TRUE, then its safe to fire off the request.
285  //
286 
287  BOOLEAN ReadyToIssue;
288 
289  //
290  // Io is a pointer to the callback data.
291  // When ReadyToUse new io can be issued.
292  //
293 
294  PFLT_CALLBACK_DATA Io;
295 
296  //
297  // SystemBuffer is a pointer to a system buffer which will
298  // be used to issue the IO.
299  //
300 
301  char * SystemBuffer;
303 
305 
306 typedef struct _NC_DIR_NOT_CONTEXT {
307 
308  //
309  // We save off some parameters used to send down the user
310  // request so we can look them up in our completion callback.
311  // In some cases, this is an optimization. In others, it's
312  // because we need access to state when the user request may
313  // be completed.
314  //
315 
316  enum {
320  Merge
321  } Mode;
322  BOOLEAN CancelSeen;
323  BOOLEAN CleanupSeen;
324  BOOLEAN IgnoreCase;
326  BOOLEAN WatchTree;
329 
330  //
331  // These names allow us to re-build full path names for each
332  // notification. We need two strings to represent paths to
333  // the handle the user opened, or the handle we opened to
334  // the mapping parent when merging notifications. After
335  // building the full name, we'll need to re-translate back
336  // to the user's path for returning. These names are saved
337  // so we don't need to construct them again in our completion
338  // routine.
339  //
340 
341  UNICODE_STRING UserRequestName;
342  UNICODE_STRING MappingParentName;
343 
344  //
345  // Our three potential requests.
346  //
347  // UserRequest - the request the user sent to us on this handle.
348  // We may have sent this to the filesystem (Munge case), or we
349  // may hang on to it ourselves (Filter and Merge cases.)
350  //
351  // ShadowRequest - the request sent to the filesystem on the
352  // user's handle. This is used in the Filter and Merge cases.
353  // In the Filter case, we do this to allow us to reissue
354  // the IO if we have filtered out all events so have nothing
355  // to return to the user. In the merge case, we require two
356  // requests that we control, and will complete the user's
357  // request when either of our requests complete.
358  //
359  // MappingRequest - the request sent to the filesystem on the
360  // handle we opened to the parent of the mapping. Only valid
361  // when in Merge mode. We use the parent so as to capture
362  // notifications about changes to the mapping itself.
363  //
364 
365  PFLT_CALLBACK_DATA UserRequest;
366  PFLT_CALLBACK_DATA ShadowRequest;
367  PFLT_CALLBACK_DATA MappingRequest;
368 
369  PNC_INSTANCE_CONTEXT InstanceContext;
370 
371  //
372  // Specifies a handle to the parent of the real mapping.
373  // This can be NULL, and is only used if Mode == Merge.
374  // This occurs when we are watching the parent of the
375  // mapping, or if we are watching the subtree of the user
376  // mapping but not the subtree of the real mapping. Keep
377  // a workitem so that we can reliably clean up this object,
378  // which we can't do inline at APC level.
379  //
380 
382  PFILE_OBJECT RealParentFileObject;
383  PFLT_GENERIC_WORKITEM RealParentCloseWorkItem;
384 
385  PFILE_NOTIFY_INFORMATION BufferToFree;
387 
389 
390 typedef struct _NC_FIND_BY_SID_CONTEXT {
391 
392  //
393  // Specifies a handle to the real mapping. This can
394  // be NULL, and is only required if finding objects
395  // under an ancestor of the user mapping which is not
396  // an ancestor of the real mapping (so we need to
397  // inject entries.)
398  //
399 
400  HANDLE RealHandle;
401  PFILE_OBJECT RealFileObject;
402 
403  //
404  // If the filesystem returns more results than can
405  // be returned in the current call, we need to buffer
406  // them and return them on a subsequent call.
407  // BufferToFree refers to the beginning of the allocation,
408  // which we can tear down when all entries are consumed.
409  // BufferSize is the size of this buffer, in bytes.
410  // CurrentEntry is the offset into this buffer where
411  // we should begin returning result on the subsequent
412  // call.
413  //
414 
415  PFILE_NAME_INFORMATION BufferToFree;
416  ULONG BufferSize;
418 
419  //
420  // Count of the number of outstanding requests. We need
421  // to know this to ensure we only tear down state when
422  // a) holding the lock and b) no other requests are
423  // outstanding.
424  //
425 
427 
429 
430 //
431 // Stream Handle Context
432 //
433 
435 
436  PERESOURCE Lock;
437 
441 
443 
444 #define NcLockStreamHandleContext( C ) \
445  FltAcquireResourceExclusive( (C)->Lock );
446 
447 #define NcUnlockStreamHandleContext( C ) \
448  FltReleaseResource( (C)->Lock );
449 
450 //
451 // Structure which gives us offsets to find values within directory
452 // query buffers.
453 //
454 
456 
460 
464 
466 
467 typedef struct _NC_GLOBAL_DATA {
468  UNICODE_STRING UserMappingPath;
471 
472  UNICODE_STRING RealMappingPath;
474 
475  PFLT_FILTER FilterHandle;
477 
479 
480 //
481 // Function declarations
482 //
483 
484 //
485 // The following functions exist in nchelper.c
486 //
487 
488 _When_(Data == NULL, _Pre_satisfies_(FileObject != NULL && Instance != NULL))
489 _When_(FileObject == NULL || Instance == NULL, _Pre_satisfies_(Data != NULL))
490 NTSTATUS
491 NcGetFileNameInformation(
492  _In_opt_ PFLT_CALLBACK_DATA Data,
493  _In_opt_ PFILE_OBJECT FileObject,
494  _In_opt_ PFLT_INSTANCE Instance,
495  _In_ FLT_FILE_NAME_OPTIONS NameOptions,
496  _Outptr_ PFLT_FILE_NAME_INFORMATION *FileNameInformation
497  );
498 
499 NTSTATUS
501  _Out_ PERESOURCE * OutputLock
502  );
503 
504 VOID
506  _In_ PERESOURCE Lock
507  );
508 
509 NTSTATUS
511  _In_ PFLT_FILTER Filter,
512  _In_opt_ PFLT_INSTANCE Instance,
513  _Out_ PHANDLE FileHandle,
514  _Outptr_opt_ PFILE_OBJECT *FileObject,
515  _In_ ACCESS_MASK DesiredAccess,
516  _In_ POBJECT_ATTRIBUTES ObjectAttributes,
517  _Out_ PIO_STATUS_BLOCK IoStatusBlock,
518  _In_opt_ PLARGE_INTEGER AllocationSize,
519  _In_ ULONG FileAttributes,
520  _In_ ULONG ShareAccess,
521  _In_ ULONG CreateDisposition,
522  _In_ ULONG CreateOptions,
523  _In_reads_bytes_opt_(EaLength) PVOID EaBuffer,
524  _In_ ULONG EaLength,
525  _In_ ULONG Flags,
526  _In_opt_ PFILE_OBJECT ParentFileObject
527  );
528 
529 NTSTATUS
531  _In_ PFLT_CALLBACK_DATA Data,
532  _In_ PFLT_COMPLETE_CANCELED_CALLBACK CanceledCallback
533  );
534 
535 LONG
537  _In_ PEXCEPTION_POINTERS ExceptionPointer,
538  _In_ BOOLEAN AccessingUserBuffer
539  );
540 
541 //
542 // The following functions exist in ncmapping.c
543 //
544 
545 VOID
547  _Out_ PNC_MAPPING_PATH Path
548  );
549 
550 VOID
552  _Inout_ PNC_MAPPING_PATH Path
553  );
554 
555 NTSTATUS
557  _In_ PFLT_VOLUME CONST Volume,
558  _In_ PUNICODE_STRING ParentPath,
559  _In_ PUNICODE_STRING FinalComponentName,
560  _Inout_ PNC_MAPPING_PATH Entry
561  );
562 
563 BOOLEAN
565  PNC_MAPPING Mapping
566  );
567 
568 VOID
570  PNC_MAPPING Mapping
571  );
572 
573 BOOLEAN
575  PNC_MAPPING Mapping
576  );
577 
578 VOID
580  PNC_MAPPING Mapping
581  );
582 
583 VOID
585  _Inout_ PNC_MAPPING Mapping
586  );
587 
588 NTSTATUS
590  _In_ PFILE_OBJECT UserParent,
591  _In_ PFILE_OBJECT RealParent,
592  _In_ PUNICODE_STRING UserFinalComponentShortName,
593  _In_ PUNICODE_STRING UserFinalComponentLongName,
594  _In_ PUNICODE_STRING RealFinalComponentName,
595  _In_ PFLT_INSTANCE Instance,
596  _Out_ PNC_MAPPING Mapping
597  );
598 
599 //
600 // The following functions exist in ncinit.c
601 //
602 
603 NTSTATUS
605  _In_ PUNICODE_STRING RegistryPath
606  );
607 
608 //
609 // The following functions exist in ncpath.c
610 //
611 
612 BOOLEAN
614  _In_ PCUNICODE_STRING Name,
615  _In_ PNC_MAPPING_ENTRY Mapping,
616  _Out_opt_ PUNICODE_STRING Remainder,
617  _In_ BOOLEAN IgnoreCase,
618  _In_ BOOLEAN ContainsDevice,
619  _Out_ PNC_PATH_OVERLAP Overlap
620  );
621 
622 _Post_satisfies_(NewName->MaximumLength < MAXUSHORT)
623 _Post_satisfies_(NewName->Length <= NewName->MaximumLength)
624 _Must_inspect_result_
625 NTSTATUS
626 NcConstructPath (
627  _In_ PNC_MAPPING_ENTRY RealPath,
628  _In_ PUNICODE_STRING Remainder,
629  _In_ BOOLEAN IncludeVolume,
630  _Out_ _At_(NewName->Buffer, __drv_allocatesMem(Mem)) PUNICODE_STRING NewName
631  );
632 
633 NTSTATUS
635  _In_ PUNICODE_STRING EntirePath,
636  _Out_ PUNICODE_STRING ParentPath,
637  _Out_ PUNICODE_STRING FinalComponent
638  );
639 
640 //
641 // The following functions exist in nccontext.c
642 //
643 
644 NTSTATUS
646  _In_ PFLT_FILTER Filter,
647  _In_ PFLT_INSTANCE Instance,
648  _In_ PFILE_OBJECT FileObject,
649  _Out_ PNC_STREAM_HANDLE_CONTEXT * Context
650  );
651 
652 VOID
654  _In_ PFLT_CONTEXT Context,
655  _In_ FLT_CONTEXT_TYPE ContextType
656  );
657 
658 VOID
660  _In_ PFLT_CONTEXT Context,
661  _In_ FLT_CONTEXT_TYPE ContextType
662  );
663 
664 //
665 // The following functions exist in nccreate.c
666 //
667 
668 FLT_PREOP_CALLBACK_STATUS
669 NcPreCreate (
670  _Inout_ PFLT_CALLBACK_DATA Data,
671  _In_ PCFLT_RELATED_OBJECTS FltObjects,
672  _Flt_CompletionContext_Outptr_ PVOID *CompletionContext
673  );
674 
675 //
676 // The following functions exist in ncnameprov.c
677 //
678 
679 NTSTATUS
681  _In_ PFLT_INSTANCE Instance,
682  _In_ PFILE_OBJECT FileObject,
683  _In_opt_ PFLT_CALLBACK_DATA Data,
684  _In_ FLT_FILE_NAME_OPTIONS NameOptions,
685  _Out_ PBOOLEAN CacheFileNameInformation,
686  _Inout_ PFLT_NAME_CONTROL FileName
687  );
688 
689 NTSTATUS
691  _In_ PFLT_INSTANCE Instance,
692  _In_opt_ PFILE_OBJECT FileObject,
693  _In_ PCUNICODE_STRING ParentDirectory,
694  _In_ USHORT DeviceNameLength,
695  _In_ PCUNICODE_STRING Component,
696  _Out_writes_bytes_(ExpandComponentNameLength) PFILE_NAMES_INFORMATION ExpandComponentName,
697  _In_ ULONG ExpandComponentNameLength,
698  _In_ FLT_NORMALIZE_NAME_FLAGS Flags,
699  _Inout_ PVOID *NormalizationContext
700  );
701 
702 //
703 // The following functions exist in ncoffsets.c
704 //
705 
706 BOOLEAN
708  _Out_ PDIRECTORY_CONTROL_OFFSETS Offsets,
709  _In_ FILE_INFORMATION_CLASS Information
710  );
711 
712 VOID
714  PDIRECTORY_CONTROL_OFFSETS Offsets
715  );
716 
717 ULONG
719  _In_ CONST PVOID Buffer,
720  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets
721  );
722 
723 PVOID
725  _In_ CONST PVOID Buffer,
726  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets
727  );
728 
729 ULONG
731  _In_ CONST PVOID Buffer,
732  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets
733  );
734 
735 ULONG
737  _In_ CONST PVOID Buffer,
738  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets
739  );
740 
741 PWSTR
743  _In_ CONST PVOID Buffer,
744  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets
745  );
746 
747 PWSTR
749  _In_ CONST PVOID Buffer,
750  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets
751  );
752 
753 CCHAR
755  _In_ CONST PVOID Buffer,
756  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets
757  );
758 
759 VOID
761  _Inout_ PVOID Buffer,
762  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets,
763  _In_ BOOLEAN ForceLast);
764 
765 VOID
767  _In_ PVOID Entry,
768  _In_ PWSTR NewName,
769  _In_ ULONG Length,
770  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets,
771  _In_ BOOLEAN ForceLast
772  );
773 
774 VOID
776  _In_ PVOID Entry,
777  _In_ PWSTR NewShortName,
778  _In_ USHORT Length,
779  _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets
780  );
781 
782 //
783 // The following functions exist in ncdirenum.c
784 //
785 
786 FLT_PREOP_CALLBACK_STATUS
788  _Inout_ PFLT_CALLBACK_DATA Data,
789  _In_ PCFLT_RELATED_OBJECTS FltObjects,
790  _Flt_CompletionContext_Outptr_ PVOID *CompletionContext
791  );
792 
793 NTSTATUS
795  _Inout_ PNC_DIR_QRY_CONTEXT DirQryCtx,
796  _In_ PCFLT_RELATED_OBJECTS FltObjects,
797  _In_ PNC_INSTANCE_CONTEXT InstanceContext,
798  _In_ PDIRECTORY_CONTROL_OFFSETS Offsets,
799  _In_ FILE_INFORMATION_CLASS InformationClass
800  );
801 
802 VOID
804  _Inout_ PNC_DIR_QRY_CONTEXT dirCtx
805  );
806 
807 NTSTATUS
809 
810 NTSTATUS
812  _In_ PFLT_INSTANCE Instance,
813  _In_ PFILE_OBJECT FileObject,
814  _In_ ULONG BufferLength,
815  _In_ FILE_INFORMATION_CLASS FileInfoClass,
816  _In_ PUNICODE_STRING SearchString,
817  _In_ BOOLEAN RestartScan,
818  _Out_ PNC_CACHE_ENTRY Cache
819  );
820 
821 PNC_CACHE_ENTRY
823  _Inout_ PNC_DIR_QRY_CONTEXT Context,
824  _In_ PDIRECTORY_CONTROL_OFFSETS Offsets,
825  _In_ BOOLEAN IgnoreCase
826  );
827 
828 BOOLEAN
829 NcSkipName (
830  _In_ PDIRECTORY_CONTROL_OFFSETS Offsets,
831  _In_ PNC_DIR_QRY_CONTEXT Context,
832  _In_ NC_PATH_OVERLAP RealOverlap,
833  _In_ PNC_MAPPING Mapping,
834  _In_ BOOLEAN IgnoreCase
835  );
836 
837 _Success_(*Copied)
838 ULONG
840  _Out_ PVOID UserBuffer,
841  _In_ ULONG UserOffset,
842  _In_ ULONG UserSize,
843  _Inout_ PNC_CACHE_ENTRY Entry,
844  _In_ PDIRECTORY_CONTROL_OFFSETS Offsets,
845  _Out_ PBOOLEAN Copied
846  );
847 
848 NTSTATUS
850  _Out_ PNC_DIR_QRY_CONTEXT Context
851  );
852 
853 NTSTATUS
855  _Inout_ PNC_DIR_QRY_CONTEXT DirContext,
856  _In_ PNC_INSTANCE_CONTEXT InstanceContext,
857  _In_ PDIRECTORY_CONTROL_OFFSETS Offsets,
858  _In_ PFLT_CALLBACK_DATA Data,
859  _In_ PCFLT_RELATED_OBJECTS FltObjects,
860  _In_ NC_PATH_OVERLAP UserMappingOverlap,
861  _Out_ PBOOLEAN FirstUsage
862  );
863 
864 VOID
866  _In_ PNC_DIR_QRY_CONTEXT DirContext
867  );
868 
869 //
870 // The following functions exist in ncdirnotify.c
871 //
872 
873 FLT_PREOP_CALLBACK_STATUS
875  _Inout_ PFLT_CALLBACK_DATA Data,
876  _In_ PCFLT_RELATED_OBJECTS FltObjects,
877  _Flt_CompletionContext_Outptr_ PVOID *CompletionContext
878  );
879 
880 FLT_POSTOP_CALLBACK_STATUS
882  _Inout_ PFLT_CALLBACK_DATA Data,
883  _In_ PCFLT_RELATED_OBJECTS FltObjects,
884  _In_ PVOID CompletionContext,
885  _In_ FLT_POST_OPERATION_FLAGS Flags
886  );
887 
888 NTSTATUS
890  _Out_ PNC_DIR_NOT_CONTEXT Context
891  );
892 
893 VOID
895  _In_ PNC_STREAM_HANDLE_CONTEXT HandleContext
896  );
897 
898 VOID
900  _In_ PNC_DIR_NOT_CONTEXT DirContext
901  );
902 
903 //
904 // The following functions exist in ncfileinfo.c
905 //
906 
907 FLT_PREOP_CALLBACK_STATUS
909  _Inout_ PFLT_CALLBACK_DATA Data,
910  _In_ PCFLT_RELATED_OBJECTS FltObjects,
911  _Flt_CompletionContext_Outptr_ PVOID *CompletionContext
912  );
913 
914 FLT_POSTOP_CALLBACK_STATUS
916  _Inout_ PFLT_CALLBACK_DATA Data,
917  _In_ PCFLT_RELATED_OBJECTS FltObjects,
918  _In_opt_ PVOID CompletionContext,
919  _In_ FLT_POST_OPERATION_FLAGS Flags
920  );
921 
922 FLT_POSTOP_CALLBACK_STATUS
924  _Inout_ PFLT_CALLBACK_DATA Data,
925  _In_ PCFLT_RELATED_OBJECTS FltObjects,
926  _In_opt_ PVOID CompletionContext,
927  _In_ FLT_POST_OPERATION_FLAGS Flags
928  );
929 
930 FLT_PREOP_CALLBACK_STATUS
931 NcPreRename (
932  _Inout_ PFLT_CALLBACK_DATA Data,
933  _In_ PCFLT_RELATED_OBJECTS FltObjects,
934  _Flt_CompletionContext_Outptr_ PVOID *CompletionContext
935  );
936 
937 FLT_PREOP_CALLBACK_STATUS
939  _Inout_ PFLT_CALLBACK_DATA Data,
940  _In_ PCFLT_RELATED_OBJECTS FltObjects,
941  _Flt_CompletionContext_Outptr_ PVOID *CompletionContext
942  );
943 
944 FLT_PREOP_CALLBACK_STATUS
946  _Inout_ PFLT_CALLBACK_DATA Data,
947  _In_ PCFLT_RELATED_OBJECTS FltObjects,
948  _Flt_CompletionContext_Outptr_ PVOID *CompletionContext
949  );
950 
951 FLT_PREOP_CALLBACK_STATUS
953  _Inout_ PFLT_CALLBACK_DATA Data,
954  _In_ PCFLT_RELATED_OBJECTS FltObjects,
955  _Flt_CompletionContext_Outptr_ PVOID *CompletionContext
956  );
957 
958 //
959 // The following functions exist in ncfsctrl.c
960 //
961 
962 
963 FLT_POSTOP_CALLBACK_STATUS
965  _Inout_ PFLT_CALLBACK_DATA Data,
966  _In_ PCFLT_RELATED_OBJECTS FltObjects,
967  _In_opt_ PVOID CompletionContext,
968  _In_ FLT_POST_OPERATION_FLAGS Flags
969  );
970 
971 NTSTATUS
973  _Out_ PNC_FIND_BY_SID_CONTEXT Context
974  );
975 
976 VOID
978  _In_ PNC_FIND_BY_SID_CONTEXT Context
979  );
980 
981 FLT_PREOP_CALLBACK_STATUS
983  _Inout_ PFLT_CALLBACK_DATA Data,
984  _In_ PCFLT_RELATED_OBJECTS FltObjects,
985  _Flt_CompletionContext_Outptr_ PVOID *CompletionContext
986  );
987 
988 FLT_POSTOP_CALLBACK_STATUS
990  _Inout_ PFLT_CALLBACK_DATA Data,
991  _In_ PCFLT_RELATED_OBJECTS FltObjects,
992  _In_ PVOID CompletionContext,
993  _In_ FLT_POST_OPERATION_FLAGS Flags
994  );
995 
996 #ifdef FLT_MGR_WIN7
997 FLT_POSTOP_CALLBACK_STATUS
998 NcPostLookupStreamFromCluster (
999  _Inout_ PFLT_CALLBACK_DATA Data,
1000  _In_ PCFLT_RELATED_OBJECTS FltObjects,
1001  _In_opt_ PVOID CompletionContext,
1002  _In_ FLT_POST_OPERATION_FLAGS Flags
1003  );
1004 #endif
1005 
1006 FLT_POSTOP_CALLBACK_STATUS
1008  _Inout_ PFLT_CALLBACK_DATA Data,
1009  _In_ PCFLT_RELATED_OBJECTS FltObjects,
1010  _In_opt_ PVOID CompletionContext,
1011  _In_ FLT_POST_OPERATION_FLAGS Flags
1012  );
1013 
1014 FLT_POSTOP_CALLBACK_STATUS
1016  _Inout_ PFLT_CALLBACK_DATA Data,
1017  _In_ PCFLT_RELATED_OBJECTS FltObjects,
1018  _In_opt_ PVOID CompletionContext,
1019  _In_ FLT_POST_OPERATION_FLAGS Flags
1020  );
1021 
1022 //
1023 // The following functions exist in nccompat.c
1024 //
1025 
1026 VOID
1027 NcCompatInit();
1028 
1029 //
1030 // Global variables
1031 //
1032 
1033 extern PFLT_FILTER gFilterHandle;
1038 
1039 #endif /* __NC_H__ */
1040 
NTSTATUS(* NC_CREATE_FILE_EX2_TYPE)(_In_ PFLT_FILTER Filter, _In_opt_ PFLT_INSTANCE Instance, _Out_ PHANDLE FileHandle, _Outptr_opt_ PFILE_OBJECT *FileObject, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_opt_ PLARGE_INTEGER AllocationSize, _In_ ULONG FileAttributes, _In_ ULONG ShareAccess, _In_ ULONG CreateDisposition, _In_ ULONG CreateOptions, _In_reads_bytes_opt_(EaLength) PVOID EaBuffer, _In_ ULONG EaLength, _In_ ULONG Flags, _In_opt_ PIO_DRIVER_CREATE_CONTEXT DriverContext)
Definition: nc.h:108
NTSTATUS NcSetCancelCompletion(_In_ PFLT_CALLBACK_DATA Data, _In_ PFLT_COMPLETE_CANCELED_CALLBACK CanceledCallback)
Definition: nchelper.c:270
BOOLEAN WatchTree
Definition: nc.h:326
UNICODE_STRING UserMappingFinalComponentLong
Definition: nc.h:470
UNICODE_STRING FinalComponentName
Definition: nc.h:159
BOOLEAN CleanupSeen
Definition: nc.h:323
UNICODE_STRING UserMappingFinalComponentShort
Definition: nc.h:469
PNC_INSTANCE_CONTEXT InstanceContext
Definition: nc.h:369
_Success_ Copied ULONG NcCopyDirEnumEntry(_Out_ PVOID UserBuffer, _In_ ULONG UserOffset, _In_ ULONG UserSize, _Inout_ PNC_CACHE_ENTRY Entry, _In_ PDIRECTORY_CONTROL_OFFSETS Offsets, _Out_ PBOOLEAN Copied)
Definition: ncdirenum.c:1034
NTSTATUS NcStreamHandleContextAllocAndAttach(_In_ PFLT_FILTER Filter, _In_ PFLT_INSTANCE Instance, _In_ PFILE_OBJECT FileObject, _Out_ PNC_STREAM_HANDLE_CONTEXT *Context)
Definition: nccontext.c:126
VOID NcFreeEResource(_In_ PERESOURCE Lock)
Definition: nchelper.c:170
struct _NC_GLOBAL_DATA * PNC_GLOBAL_DATA
_In_ PLARGE_INTEGER _In_ ULONG Length
BOOLEAN ReadyToIssue
Definition: nc.h:287
NC_CACHE_ENTRY InjectionEntry
Definition: nc.h:258
struct _NC_MAPPING * PNC_MAPPING
PFLT_GENERIC_WORKITEM RealParentCloseWorkItem
Definition: nc.h:383
NTSTATUS NcInitializeMapping(_In_ PUNICODE_STRING RegistryPath)
Definition: ncinit.c:282
struct _NC_MAPPING_PATH * PNC_MAPPING_PATH
PNC_CACHE_ENTRY NcDirEnumSelectNextEntry(_Inout_ PNC_DIR_QRY_CONTEXT Context, _In_ PDIRECTORY_CONTROL_OFFSETS Offsets, _In_ BOOLEAN IgnoreCase)
Definition: ncdirenum.c:920
FLT_PREOP_CALLBACK_STATUS NcEnumerateDirectory(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Flt_CompletionContext_Outptr_ PVOID *CompletionContext)
Definition: ncdirenum.c:39
UNICODE_STRING FullPath
Definition: nc.h:156
NTSTATUS NcNormalizeNameComponentEx(_In_ PFLT_INSTANCE Instance, _In_opt_ PFILE_OBJECT FileObject, _In_ PCUNICODE_STRING ParentDirectory, _In_ USHORT DeviceNameLength, _In_ PCUNICODE_STRING Component, _Out_writes_bytes_(ExpandComponentNameLength) PFILE_NAMES_INFORMATION ExpandComponentName, _In_ ULONG ExpandComponentNameLength, _In_ FLT_NORMALIZE_NAME_FLAGS Flags, _Inout_ PVOID *NormalizationContext)
Definition: ncnameprov.c:342
BOOLEAN NcIsMappingZeroed(PNC_MAPPING Mapping)
Definition: ncmapping.c:659
FLT_POSTOP_CALLBACK_STATUS NcPostQueryName(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_opt_ PVOID CompletionContext, _In_ FLT_POST_OPERATION_FLAGS Flags)
Definition: ncfileinfo.c:33
VOID NcInitMappingPath(_Out_ PNC_MAPPING_PATH Path)
Definition: ncmapping.c:131
VOID NcSetNextEntryOffset(_Inout_ PVOID Buffer, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets, _In_ BOOLEAN ForceLast)
Definition: ncoffsets.c:470
UNICODE_STRING MappingParentName
Definition: nc.h:342
struct _DIRECTORY_CONTROL_OFFSETS * PDIRECTORY_CONTROL_OFFSETS
ULONG CurrentOffset
Definition: nc.h:144
ULONG FileNameLengthDist
Definition: nc.h:458
struct _NC_FIND_BY_SID_CONTEXT NC_FIND_BY_SID_CONTEXT
char * Buffer
Definition: nc.h:143
NC_MAPPING_ENTRY RealMapping
Definition: nc.h:186
PVOID(* NC_GET_NEW_SYSTEM_BUFFER_ADDRESS)(_In_ PFLT_CALLBACK_DATA Data)
Definition: nc.h:129
NC_GET_NEW_SYSTEM_BUFFER_ADDRESS NcGetNewSystemBufferAddress
Definition: nccompat.c:81
VOID NcCompatInit()
Definition: nccompat.c:414
FLT_POSTOP_CALLBACK_STATUS NcPostReadFileUsnData(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_opt_ PVOID CompletionContext, _In_ FLT_POST_OPERATION_FLAGS Flags)
Definition: ncfsctrl.c:2520
BOOLEAN IgnoreCase
Definition: nc.h:324
FLT_PREOP_CALLBACK_STATUS NcPreSetDisposition(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Flt_CompletionContext_Outptr_ PVOID *CompletionContext)
Definition: ncfileinfo.c:1189
FLT_POSTOP_CALLBACK_STATUS NcPostNotifyDirectory(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ PVOID CompletionContext, _In_ FLT_POST_OPERATION_FLAGS Flags)
Definition: ncdirnotify.c:2824
NC_DIR_QRY_CONTEXT DirectoryQueryContext
Definition: nc.h:439
ULONG OutstandingRequests
Definition: nc.h:426
struct _NC_STREAM_HANDLE_CONTEXT * PNC_STREAM_HANDLE_CONTEXT
UNICODE_STRING UserMappingPath
Definition: nc.h:468
NC_REPLACE_FILEOBJECT_NAME_TYPE NcReplaceFileObjectName
Definition: nccompat.c:78
FLT_POSTOP_CALLBACK_STATUS NcPostReadUsnJournal(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_opt_ PVOID CompletionContext, _In_ FLT_POST_OPERATION_FLAGS Flags)
Definition: ncfsctrl.c:3576
char * SystemBuffer
Definition: nc.h:301
struct _NC_DIR_NOT_IO_CACHE NC_DIR_NOT_IO_CACHE
_In_opt_ PFILE_OBJECT _In_opt_ PFLT_INSTANCE Instance
Definition: nc.h:493
NTSTATUS NcBuildMappingPathFromVolume(_In_ PFLT_VOLUME CONST Volume, _In_ PUNICODE_STRING ParentPath, _In_ PUNICODE_STRING FinalComponentName, _Inout_ PNC_MAPPING_PATH Entry)
Definition: ncmapping.c:376
BOOLEAN InsufficientBufferSeen
Definition: nc.h:325
NTSTATUS NcGenerateFileName(_In_ PFLT_INSTANCE Instance, _In_ PFILE_OBJECT FileObject, _In_opt_ PFLT_CALLBACK_DATA Data, _In_ FLT_FILE_NAME_OPTIONS NameOptions, _Out_ PBOOLEAN CacheFileNameInformation, _Inout_ PFLT_NAME_CONTROL FileName)
Definition: ncnameprov.c:10
NC_MAPPING_PATH ShortNamePath
Definition: nc.h:176
NTSTATUS NcEnumerateDirectorySetupInjection(_Inout_ PNC_DIR_QRY_CONTEXT DirQryCtx, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ PNC_INSTANCE_CONTEXT InstanceContext, _In_ PDIRECTORY_CONTROL_OFFSETS Offsets, _In_ FILE_INFORMATION_CLASS InformationClass)
Definition: ncdirenum.c:463
struct _NC_DIR_NOT_CONTEXT NC_DIR_NOT_CONTEXT
FLT_PREOP_CALLBACK_STATUS NcPreRename(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Flt_CompletionContext_Outptr_ PVOID *CompletionContext)
Definition: ncfileinfo.c:1621
union NC_PATH_OVERLAP * PNC_PATH_OVERLAP
FLT_POSTOP_CALLBACK_STATUS NcPostEnumUsnData(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_opt_ PVOID CompletionContext, _In_ FLT_POST_OPERATION_FLAGS Flags)
Definition: ncfsctrl.c:2906
NC_MAPPING_PATH LongNamePath
Definition: nc.h:173
PFILE_NOTIFY_INFORMATION BufferToFree
Definition: nc.h:385
_When_(Data==NULL, _Pre_satisfies_(FileObject !=NULL &&Instance !=NULL)) _When_(FileObject
HANDLE RealParentHandle
Definition: nc.h:381
FLT_POSTOP_CALLBACK_STATUS NcPostFindFilesBySid(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ PVOID CompletionContext, _In_ FLT_POST_OPERATION_FLAGS Flags)
Definition: ncfsctrl.c:1092
FLT_PREOP_CALLBACK_STATUS NcPreSetLinkInformation(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Flt_CompletionContext_Outptr_ PVOID *CompletionContext)
Definition: ncfileinfo.c:1377
struct _NC_INSTANCE_CONTEXT NC_INSTANCE_CONTEXT
BOOLEAN NcDetermineStructureOffsets(_Out_ PDIRECTORY_CONTROL_OFFSETS Offsets, _In_ FILE_INFORMATION_CLASS Information)
Definition: ncoffsets.c:52
PFLT_CALLBACK_DATA UserRequest
Definition: nc.h:365
VOID NcStreamHandleContextNotCleanup(_In_ PNC_STREAM_HANDLE_CONTEXT HandleContext)
Definition: ncdirnotify.c:3325
NC_CACHE_ENTRY Cache
Definition: nc.h:281
struct _NC_FIND_BY_SID_CONTEXT * PNC_FIND_BY_SID_CONTEXT
BOOLEAN CancelSeen
Definition: nc.h:322
VOID NcStreamHandleContextClose(_In_ PFLT_CONTEXT Context, _In_ FLT_CONTEXT_TYPE ContextType)
Definition: nccontext.c:65
_Pre_satisfies_(Data !=NULL)) NTSTATUS NcGetFileNameInformation(_In_opt_ PFLT_CALLBACK_DATA Data
UNICODE_STRING VolumelessName
Definition: nc.h:160
PVOID NcGetNextEntry(_In_ CONST PVOID Buffer, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets)
Definition: ncoffsets.c:269
_At_(String->Length, _Out_range_(==, 0)) _At_(String -> MaximumLength, _In_) _At_(String->Buffer, _Pre_maybenull_ _Post_notnull_ _Post_writable_byte_size_(String->MaximumLength)) NTSTATUS CtxAllocateUnicodeString(_Out_ PUNICODE_STRING String)
Definition: ctx/support.c:84
NTSTATUS NcParseFinalComponent(_In_ PUNICODE_STRING EntirePath, _Out_ PUNICODE_STRING ParentPath, _Out_ PUNICODE_STRING FinalComponent)
Definition: ncpath.c:572
NC_MAPPING Mapping
Definition: nc.h:233
NC_FIND_BY_SID_CONTEXT FindBySidContext
Definition: nc.h:440
_In_opt_ PFILE_OBJECT _In_opt_ PFLT_INSTANCE _In_ FLT_FILE_NAME_OPTIONS NameOptions
Definition: nc.h:493
NTSTATUS NcPerformEnumeration()
FLT_FILESYSTEM_TYPE VolumeFilesystemType
Definition: nc.h:236
NC_CREATE_FILE_EX2_TYPE NcCreateFileEx2
Definition: nccompat.c:80
NTSTATUS NcStreamHandleContextEnumSetup(_Inout_ PNC_DIR_QRY_CONTEXT DirContext, _In_ PNC_INSTANCE_CONTEXT InstanceContext, _In_ PDIRECTORY_CONTROL_OFFSETS Offsets, _In_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_ NC_PATH_OVERLAP UserMappingOverlap, _Out_ PBOOLEAN FirstUsage)
Definition: ncdirenum.c:1172
IoStatus Information
VOID NcInitMapping(PNC_MAPPING Mapping)
Definition: ncmapping.c:678
FLT_POSTOP_CALLBACK_STATUS NcPostQueryHardLinks(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _In_opt_ PVOID CompletionContext, _In_ FLT_POST_OPERATION_FLAGS Flags)
Definition: ncfileinfo.c:581
BOOLEAN NcSkipName(_In_ PDIRECTORY_CONTROL_OFFSETS Offsets, _In_ PNC_DIR_QRY_CONTEXT Context, _In_ NC_PATH_OVERLAP RealOverlap, _In_ PNC_MAPPING Mapping, _In_ BOOLEAN IgnoreCase)
Definition: ncdirenum.c:714
NTSTATUS NcStreamHandleContextDirEnumCreate(_Out_ PNC_DIR_QRY_CONTEXT Context)
Definition: ncdirenum.c:1132
struct _DIRECTORY_CONTROL_OFFSETS DIRECTORY_CONTROL_OFFSETS
NTSTATUS NcStreamHandleContextFindBySidCreate(_Out_ PNC_FIND_BY_SID_CONTEXT Context)
Definition: ncfsctrl.c:75
VOID NcStreamHandleContextFindBySidClose(_In_ PNC_FIND_BY_SID_CONTEXT Context)
Definition: ncfsctrl.c:113
NTSTATUS(* NC_REPLACE_FILEOBJECT_NAME_TYPE)(_In_ PFILE_OBJECT FileObject, _In_reads_bytes_(FileNameLength) PWSTR NewFileName, _In_ USHORT FileNameLength)
Definition: nc.h:66
struct _NC_STREAM_HANDLE_CONTEXT NC_STREAM_HANDLE_CONTEXT
NC_MAPPING_ENTRY UserMapping
Definition: nc.h:187
PFLT_CALLBACK_DATA Io
Definition: nc.h:294
_In_opt_ PFILE_OBJECT _In_opt_ PFLT_INSTANCE _In_ FLT_FILE_NAME_OPTIONS _Outptr_ PFLT_FILE_NAME_INFORMATION * FileNameInformation
Definition: nc.h:493
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Out_writes_bytes_(Length)
FLT_PREOP_CALLBACK_STATUS NcPreNotifyDirectory(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Flt_CompletionContext_Outptr_ PVOID *CompletionContext)
Definition: ncdirnotify.c:1067
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_reads_bytes_(Length)
VOID NcSetFileName(_In_ PVOID Entry, _In_ PWSTR NewName, _In_ ULONG Length, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets, _In_ BOOLEAN ForceLast)
Definition: ncoffsets.c:527
int Ancestor
Definition: nc.h:217
NTSTATUS NcAllocateEResource(_Out_ PERESOURCE *OutputLock)
Definition: nchelper.c:104
NC_QUERY_DIRECTORY_FILE_TYPE NcQueryDirectoryFile
Definition: nccompat.c:79
ULONG NcGetNextEntryOffset(_In_ CONST PVOID Buffer, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets)
Definition: ncoffsets.c:240
struct __NC_CACHE_ENTRY * PNC_CACHE_ENTRY
_Post_satisfies_(NewName->MaximumLength< MAXUSHORT) _Post_satisfies_(NewName -> Length<=NewName->MaximumLength) _Must_inspect_result_ NTSTATUS NcConstructPath(_In_ PNC_MAPPING_ENTRY RealPath, _In_ PUNICODE_STRING Remainder, _In_ BOOLEAN IncludeVolume, _Out_ _At_(NewName->Buffer, __drv_allocatesMem(Mem)) PUNICODE_STRING NewName)
Definition: ncpath.c:439
struct __NC_CACHE_ENTRY NC_CACHE_ENTRY
VOID NcInstanceContextClose(_In_ PFLT_CONTEXT Context, _In_ FLT_CONTEXT_TYPE ContextType)
Definition: nccontext.c:31
PFILE_NAME_INFORMATION BufferToFree
Definition: nc.h:415
NC_DIR_NOT_CONTEXT DirectoryNotificationContext
Definition: nc.h:438
struct _NC_MAPPING NC_MAPPING
NcLoadRegistryStringRetry NULL
Definition: ncinit.c:53
VOID NcStreamHandleContextNotClose(_In_ PNC_DIR_NOT_CONTEXT DirContext)
Definition: ncdirnotify.c:3423
int InMapping
Definition: nc.h:220
FLT_PREOP_CALLBACK_STATUS NcPreCreate(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Flt_CompletionContext_Outptr_ PVOID *CompletionContext)
Definition: nccreate.c:29
PFLT_CALLBACK_DATA MappingRequest
Definition: nc.h:367
ULONG EntireFlags
Definition: nc.h:215
UNICODE_STRING ParentPath
Definition: nc.h:158
ULONG NcGetEntrySize(_In_ CONST PVOID Buffer, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets)
Definition: ncoffsets.c:328
int Match
Definition: nc.h:219
VOID NcStreamHandleContextEnumClose(_In_ PNC_DIR_QRY_CONTEXT DirContext)
Definition: ncdirenum.c:1374
PFLT_FILTER gFilterHandle
Definition: delete.c:69
_Success_(IoStatus->Status==0) BOOLEAN CdoFastIoQueryBasicInfo(_In_ PFILE_OBJECT FileObject
NTSTATUS NcBuildMapping(_In_ PFILE_OBJECT UserParent, _In_ PFILE_OBJECT RealParent, _In_ PUNICODE_STRING UserFinalComponentShortName, _In_ PUNICODE_STRING UserFinalComponentLongName, _In_ PUNICODE_STRING RealFinalComponentName, _In_ PFLT_INSTANCE Instance, _Out_ PNC_MAPPING Mapping)
Definition: ncmapping.c:698
ULONG NextEntryOffsetDist
Definition: nc.h:457
BOOLEAN NcComparePath(_In_ PCUNICODE_STRING Name, _In_ PNC_MAPPING_ENTRY Mapping, _Out_opt_ PUNICODE_STRING Remainder, _In_ BOOLEAN IgnoreCase, _In_ BOOLEAN ContainsDevice, _Out_ PNC_PATH_OVERLAP Overlap)
Definition: ncpath.c:13
PWSTR NcGetShortName(_In_ CONST PVOID Buffer, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets)
Definition: ncoffsets.c:396
VOID NcEnumerateDirectoryReset(_Inout_ PNC_DIR_QRY_CONTEXT dirCtx)
Definition: ncdirenum.c:682
ULONG ShortNameLengthDist
Definition: nc.h:462
BOOLEAN ShortNamePresent
Definition: nc.h:461
VOID NcTeardownMapping(_Inout_ PNC_MAPPING Mapping)
Definition: ncmapping.c:688
USHORT NumberComponentsInFullPath
Definition: nc.h:161
ULONG CurrentEntry
Definition: nc.h:417
VOID NcCalculateDirectoryNotificationOffsets(PDIRECTORY_CONTROL_OFFSETS Offsets)
Definition: ncoffsets.c:201
struct _NC_GLOBAL_DATA NC_GLOBAL_DATA
struct _NC_DIR_QRY_CONTEXT * PNC_DIR_QRY_CONTEXT
struct _NC_INSTANCE_CONTEXT * PNC_INSTANCE_CONTEXT
PWSTR NcGetFileName(_In_ CONST PVOID Buffer, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets)
Definition: ncoffsets.c:368
LONG NcExceptionFilter(_In_ PEXCEPTION_POINTERS ExceptionPointer, _In_ BOOLEAN AccessingUserBuffer)
Definition: nchelper.c:322
PFILE_OBJECT RealParentFileObject
Definition: nc.h:382
struct _NC_DIR_NOT_IO_CACHE * PNC_DIR_NOT_IO_CACHE
CCHAR NcGetShortNameLength(_In_ CONST PVOID Buffer, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets)
Definition: ncoffsets.c:432
NTSTATUS(* NC_QUERY_DIRECTORY_FILE_TYPE)(_In_ PFLT_INSTANCE Instance, _In_ PFILE_OBJECT FileObject, _Out_writes_bytes_(Length) PVOID FileInformation, _In_ ULONG Length, _In_ FILE_INFORMATION_CLASS FileInformationClass, _In_ BOOLEAN ReturnSingleEntry, _In_opt_ PUNICODE_STRING FileName, _In_ BOOLEAN RestartScan, _Out_opt_ PULONG LengthReturned)
Definition: nc.h:74
UNICODE_STRING SearchString
Definition: nc.h:262
NTSTATUS(* NC_CREATE_FILE_EX_TYPE)(_In_ PFLT_FILTER Filter, _In_opt_ PFLT_INSTANCE Instance, _Out_ PHANDLE FileHandle, _Outptr_opt_ PFILE_OBJECT *FileObject, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_opt_ PLARGE_INTEGER AllocationSize, _In_ ULONG FileAttributes, _In_ ULONG ShareAccess, _In_ ULONG CreateDisposition, _In_ ULONG CreateOptions, _In_reads_bytes_opt_(EaLength) PVOID EaBuffer, _In_ ULONG EaLength, _In_ ULONG Flags)
Definition: nc.h:88
BOOLEAN EnumerationOutstanding
Definition: nc.h:248
struct _NC_MAPPING_ENTRY * PNC_MAPPING_ENTRY
struct _NC_MAPPING_ENTRY NC_MAPPING_ENTRY
ULONG CompletionFilter
Definition: nc.h:328
FILE_INFORMATION_CLASS InformationClass
Definition: nc.h:265
FLT_PREOP_CALLBACK_STATUS NcPreQueryAlternateName(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Flt_CompletionContext_Outptr_ PVOID *CompletionContext)
Definition: ncfileinfo.c:367
NTSTATUS NcCreateFileHelper(_In_ PFLT_FILTER Filter, _In_opt_ PFLT_INSTANCE Instance, _Out_ PHANDLE FileHandle, _Outptr_opt_ PFILE_OBJECT *FileObject, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_opt_ PLARGE_INTEGER AllocationSize, _In_ ULONG FileAttributes, _In_ ULONG ShareAccess, _In_ ULONG CreateDisposition, _In_ ULONG CreateOptions, _In_reads_bytes_opt_(EaLength) PVOID EaBuffer, _In_ ULONG EaLength, _In_ ULONG Flags, _In_opt_ PFILE_OBJECT ParentFileObject)
Definition: nchelper.c:195
int Peer
Definition: nc.h:221
NTSTATUS NcPopulateCacheEntry(_In_ PFLT_INSTANCE Instance, _In_ PFILE_OBJECT FileObject, _In_ ULONG BufferLength, _In_ FILE_INFORMATION_CLASS FileInfoClass, _In_ PUNICODE_STRING SearchString, _In_ BOOLEAN RestartScan, _Out_ PNC_CACHE_ENTRY Cache)
Definition: ncdirenum.c:809
NTSTATUS NcStreamHandleContextNotCreate(_Out_ PNC_DIR_NOT_CONTEXT Context)
Definition: ncdirnotify.c:3276
PERESOURCE Lock
Definition: nc.h:436
PFILE_OBJECT RealFileObject
Definition: nc.h:401
USHORT NumberComponentsInVolumePath
Definition: nc.h:162
UCHAR OperationFlags
Definition: nc.h:327
NC_CACHE_ENTRY Cache
Definition: nc.h:255
VOID NcSetShortName(_In_ PVOID Entry, _In_ PWSTR NewShortName, _In_ USHORT Length, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets)
Definition: ncoffsets.c:587
ULONG SystemBufferLength
Definition: nc.h:302
NC_GLOBAL_DATA NcGlobalData
Definition: nc.c:335
struct _NC_MAPPING_PATH NC_MAPPING_PATH
UNICODE_STRING RealMappingFinalComponent
Definition: nc.h:473
ULONG NcGetFileNameLength(_In_ CONST PVOID Buffer, _In_ CONST PDIRECTORY_CONTROL_OFFSETS Offsets)
Definition: ncoffsets.c:299
ULONG BufferLength
Definition: nc.h:386
FLT_PREOP_CALLBACK_STATUS NcPreSetShortName(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Flt_CompletionContext_Outptr_ PVOID *CompletionContext)
Definition: ncfileinfo.c:999
int Parent
Definition: nc.h:218
struct _NC_DIR_NOT_CONTEXT * PNC_DIR_NOT_CONTEXT
PFLT_FILTER FilterHandle
Definition: nc.h:475
UNICODE_STRING UserRequestName
Definition: nc.h:341
struct _NC_DIR_QRY_CONTEXT NC_DIR_QRY_CONTEXT
BOOLEAN InUse
Definition: nc.h:252
PFLT_CALLBACK_DATA ShadowRequest
Definition: nc.h:366
FLT_PREOP_CALLBACK_STATUS NcPreFindFilesBySid(_Inout_ PFLT_CALLBACK_DATA Data, _In_ PCFLT_RELATED_OBJECTS FltObjects, _Flt_CompletionContext_Outptr_ PVOID *CompletionContext)
Definition: ncfsctrl.c:587
HANDLE RealHandle
Definition: nc.h:400
_In_opt_ PFILE_OBJECT FileObject
Definition: nc.h:493
UNICODE_STRING RealMappingPath
Definition: nc.h:472
UNICODE_STRING VolumePath
Definition: nc.h:157
VOID NcTeardownMappingPath(_Inout_ PNC_MAPPING_PATH Path)
Definition: ncmapping.c:155

Social Network


Services Overview

Architect, implement and test file system filter drivers for a wide range of functionality. We can offer several levels of assistance to meet your specific.

Contact Us

You are welcome to contact us for salse or partnership.

Sales: sales@easefilter.com
Support: support@easefilter.com
Info: info@easefilter.com