WDK Mini Filter Example
mspyLog.c
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) 1989-2002 Microsoft Corporation
4 
5 Module Name:
6 
7  mspyLog.c
8 
9 Abstract:
10 
11  This module contains functions used to retrieve and see the log records
12  recorded by MiniSpy.sys.
13 
14 Environment:
15 
16  User mode
17 
18 --*/
19 
20 #include <DriverSpecs.h>
21 _Analysis_mode_(_Analysis_code_type_user_code_)
22 
23 #include <stdio.h>
24 #include <windows.h>
25 #include <stdlib.h>
26 #include <winioctl.h>
27 #include "mspyLog.h"
28 
29 #define TIME_BUFFER_LENGTH 20
30 #define TIME_ERROR "time error"
31 
32 #define POLL_INTERVAL 200 // 200 milliseconds
33 
34 BOOLEAN
35 TranslateFileTag(
36  _In_ PLOG_RECORD logRecord
37  )
38 /*++
39 
40 Routine Description:
41 
42  If this is a mount point reparse point, move the given name string to the
43  correct position in the log record structure so it will be displayed
44  by the common routines.
45 
46 Arguments:
47 
48  logRecord - The log record to update
49 
50 Return Value:
51 
52  TRUE - if this is a mount point reparse point
53  FALSE - otherwise
54 
55 --*/
56 {
57  PFLT_TAG_DATA_BUFFER TagData;
58  ULONG Length;
59 
60  //
61  // The reparse data structure starts in the NAME field, point to it.
62  //
63 
64  TagData = (PFLT_TAG_DATA_BUFFER) &logRecord->Name[0];
65 
66  //
67  // See if MOUNT POINT tag
68  //
69 
70  if (TagData->FileTag == IO_REPARSE_TAG_MOUNT_POINT) {
71 
72  //
73  // calculate how much to copy
74  //
75 
76  Length = min( MAX_NAME_SPACE - sizeof(UNICODE_NULL), TagData->MountPointReparseBuffer.SubstituteNameLength );
77 
78  //
79  // Position the reparse name at the proper position in the buffer.
80  // Note that we are doing an overlapped copy
81  //
82 
83  MoveMemory( &logRecord->Name[0],
84  TagData->MountPointReparseBuffer.PathBuffer,
85  Length );
86 
87  logRecord->Name[Length/sizeof(WCHAR)] = UNICODE_NULL;
88  return TRUE;
89  }
90 
91  return FALSE;
92 }
93 
94 
95 DWORD
96 WINAPI
98  _In_ LPVOID lpParameter
99  )
100 /*++
101 
102 Routine Description:
103 
104  This runs as a separate thread. Its job is to retrieve log records
105  from the filter and then output them
106 
107 Arguments:
108 
109  lpParameter - Contains context structure for synchronizing with the
110  main program thread.
111 
112 Return Value:
113 
114  The thread successfully terminated
115 
116 --*/
117 {
118  PLOG_CONTEXT context = (PLOG_CONTEXT)lpParameter;
119  DWORD bytesReturned = 0;
120  DWORD used;
121  PVOID alignedBuffer[BUFFER_SIZE/sizeof( PVOID )];
122  PCHAR buffer = (PCHAR) alignedBuffer;
123  HRESULT hResult;
124  PLOG_RECORD pLogRecord;
125  PRECORD_DATA pRecordData;
126  COMMAND_MESSAGE commandMessage;
127 
128  //printf("Log: Starting up\n");
129 
130 #pragma warning(push)
131 #pragma warning(disable:4127) // conditional expression is constant
132 
133  while (TRUE) {
134 
135 #pragma warning(pop)
136 
137  //
138  // Check to see if we should shut down.
139  //
140 
141  if (context->CleaningUp) {
142 
143  break;
144  }
145 
146  //
147  // Request log data from MiniSpy.
148  //
149 
150  commandMessage.Command = GetMiniSpyLog;
151 
152  hResult = FilterSendMessage( context->Port,
153  &commandMessage,
154  sizeof( COMMAND_MESSAGE ),
155  buffer,
156  sizeof(alignedBuffer),
157  &bytesReturned );
158 
159  if (IS_ERROR( hResult )) {
160 
161  if (HRESULT_FROM_WIN32( ERROR_INVALID_HANDLE ) == hResult) {
162 
163  printf( "The kernel component of minispy has unloaded. Exiting\n" );
164  ExitProcess( 0 );
165  } else {
166 
167  if (hResult != HRESULT_FROM_WIN32( ERROR_NO_MORE_ITEMS )) {
168 
169  printf( "UNEXPECTED ERROR received: %x\n", hResult );
170  }
171 
172  Sleep( POLL_INTERVAL );
173  }
174 
175  continue;
176  }
177 
178  //
179  // Buffer is filled with a series of LOG_RECORD structures, one
180  // right after another. Each LOG_RECORD says how long it is, so
181  // we know where the next LOG_RECORD begins.
182  //
183 
184  pLogRecord = (PLOG_RECORD) buffer;
185  used = 0;
186 
187  //
188  // Logic to write record to screen and/or file
189  //
190 
191  for (;;) {
192 
193  if (used+FIELD_OFFSET(LOG_RECORD,Name) > bytesReturned) {
194 
195  break;
196  }
197 
198  if (pLogRecord->Length < (sizeof(LOG_RECORD)+sizeof(WCHAR))) {
199 
200  printf( "UNEXPECTED LOG_RECORD->Length: length=%d expected>=%d\n",
201  pLogRecord->Length,
202  (ULONG)(sizeof(LOG_RECORD)+sizeof(WCHAR)));
203 
204  break;
205  }
206 
207  used += pLogRecord->Length;
208 
209  if (used > bytesReturned) {
210 
211  printf( "UNEXPECTED LOG_RECORD size: used=%d bytesReturned=%d\n",
212  used,
213  bytesReturned);
214 
215  break;
216  }
217 
218  pRecordData = &pLogRecord->Data;
219 
220  //
221  // See if a reparse point entry
222  //
223 
224  if (FlagOn(pLogRecord->RecordType,RECORD_TYPE_FILETAG)) {
225 
226  if (!TranslateFileTag( pLogRecord )){
227 
228  //
229  // If this is a reparse point that can't be interpreted, move on.
230  //
231 
232  pLogRecord = (PLOG_RECORD)Add2Ptr(pLogRecord,pLogRecord->Length);
233  continue;
234  }
235  }
236 
237  if (context->LogToScreen) {
238 
239  ScreenDump( pLogRecord->SequenceNumber,
240  pLogRecord->Name,
241  pRecordData );
242  }
243 
244  if (context->LogToFile) {
245 
246  FileDump( pLogRecord->SequenceNumber,
247  pLogRecord->Name,
248  pRecordData,
249  context->OutputFile );
250  }
251 
252  //
253  // The RecordType could also designate that we are out of memory
254  // or hit our program defined memory limit, so check for these
255  // cases.
256  //
257 
259 
260  if (context->LogToScreen) {
261 
262  printf( "M: %08X System Out of Memory\n",
263  pLogRecord->SequenceNumber );
264  }
265 
266  if (context->LogToFile) {
267 
268  fprintf( context->OutputFile,
269  "M:\t0x%08X\tSystem Out of Memory\n",
270  pLogRecord->SequenceNumber );
271  }
272 
274 
275  if (context->LogToScreen) {
276 
277  printf( "M: %08X Exceeded Mamimum Allowed Memory Buffers\n",
278  pLogRecord->SequenceNumber );
279  }
280 
281  if (context->LogToFile) {
282 
283  fprintf( context->OutputFile,
284  "M:\t0x%08X\tExceeded Mamimum Allowed Memory Buffers\n",
285  pLogRecord->SequenceNumber );
286  }
287  }
288 
289  //
290  // Move to next LOG_RECORD
291  //
292 
293  pLogRecord = (PLOG_RECORD)Add2Ptr(pLogRecord,pLogRecord->Length);
294  }
295 
296  //
297  // If we didn't get any data, pause for 1/2 second
298  //
299 
300  if (bytesReturned == 0) {
301 
302  Sleep( POLL_INTERVAL );
303  }
304  }
305 
306  printf( "Log: Shutting down\n" );
307  ReleaseSemaphore( context->ShutDown, 1, NULL );
308  printf( "Log: All done\n" );
309  return 0;
310 }
311 
312 
313 VOID
315  _In_ UCHAR MajorCode,
316  _In_ UCHAR MinorCode,
317  _In_opt_ FILE *OutputFile,
318  _In_ BOOLEAN PrintMajorCode
319 )
320 /*++
321 
322 Routine Description:
323 
324  Display the operation code
325 
326 Arguments:
327 
328  MajorCode - Major function code of operation
329 
330  MinorCode - Minor function code of operation
331 
332  OutputFile - If writing to a file (not the screen) the handle for that file
333 
334  PrintMajorCode - Only used when printing to the display:
335  TRUE - if we want to display the MAJOR CODE
336  FALSE - if we want to display the MINOR code
337 
338 Return Value:
339 
340  None
341 
342 --*/
343 {
344  CHAR *irpMajorString, *irpMinorString = NULL;
345  CHAR errorBuf[128];
346 
347  switch (MajorCode) {
348  case IRP_MJ_CREATE:
349  irpMajorString = IRP_MJ_CREATE_STRING;
350  break;
352  irpMajorString = IRP_MJ_CREATE_NAMED_PIPE_STRING;
353  break;
354  case IRP_MJ_CLOSE:
355  irpMajorString = IRP_MJ_CLOSE_STRING;
356  break;
357  case IRP_MJ_READ:
358  irpMajorString = IRP_MJ_READ_STRING;
359  switch (MinorCode) {
360  case IRP_MN_NORMAL:
361  irpMinorString = IRP_MN_NORMAL_STRING;
362  break;
363  case IRP_MN_DPC:
364  irpMinorString = IRP_MN_DPC_STRING;
365  break;
366  case IRP_MN_MDL:
367  irpMinorString = IRP_MN_MDL_STRING;
368  break;
369  case IRP_MN_COMPLETE:
370  irpMinorString = IRP_MN_COMPLETE_STRING;
371  break;
372  case IRP_MN_COMPRESSED:
373  irpMinorString = IRP_MN_COMPRESSED_STRING;
374  break;
375  case IRP_MN_MDL_DPC:
376  irpMinorString = IRP_MN_MDL_DPC_STRING;
377  break;
378  case IRP_MN_COMPLETE_MDL:
379  irpMinorString = IRP_MN_COMPLETE_MDL_STRING;
380  break;
382  irpMinorString = IRP_MN_COMPLETE_MDL_DPC_STRING;
383  break;
384  default:
385  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp minor code (%u)",MinorCode);
386  irpMinorString = errorBuf;
387  }
388  break;
389 
390  case IRP_MJ_WRITE:
391  irpMajorString = IRP_MJ_WRITE_STRING;
392  switch (MinorCode) {
393  case IRP_MN_NORMAL:
394  irpMinorString = IRP_MN_NORMAL_STRING;
395  break;
396  case IRP_MN_DPC:
397  irpMinorString = IRP_MN_DPC_STRING;
398  break;
399  case IRP_MN_MDL:
400  irpMinorString = IRP_MN_MDL_STRING;
401  break;
402  case IRP_MN_COMPLETE:
403  irpMinorString = IRP_MN_COMPLETE_STRING;
404  break;
405  case IRP_MN_COMPRESSED:
406  irpMinorString = IRP_MN_COMPRESSED_STRING;
407  break;
408  case IRP_MN_MDL_DPC:
409  irpMinorString = IRP_MN_MDL_DPC_STRING;
410  break;
411  case IRP_MN_COMPLETE_MDL:
412  irpMinorString = IRP_MN_COMPLETE_MDL_STRING;
413  break;
415  irpMinorString = IRP_MN_COMPLETE_MDL_DPC_STRING;
416  break;
417  default:
418  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp minor code (%u)",MinorCode);
419  irpMinorString = errorBuf;
420  }
421  break;
422 
424  irpMajorString = IRP_MJ_QUERY_INFORMATION_STRING;
425  break;
427  irpMajorString = IRP_MJ_SET_INFORMATION_STRING;
428  break;
429  case IRP_MJ_QUERY_EA:
430  irpMajorString = IRP_MJ_QUERY_EA_STRING;
431  break;
432  case IRP_MJ_SET_EA:
433  irpMajorString = IRP_MJ_SET_EA_STRING;
434  break;
436  irpMajorString = IRP_MJ_FLUSH_BUFFERS_STRING;
437  break;
440  break;
442  irpMajorString = IRP_MJ_SET_VOLUME_INFORMATION_STRING;
443  break;
445  irpMajorString = IRP_MJ_DIRECTORY_CONTROL_STRING;
446  switch (MinorCode) {
448  irpMinorString = IRP_MN_QUERY_DIRECTORY_STRING;
449  break;
451  irpMinorString = IRP_MN_NOTIFY_CHANGE_DIRECTORY_STRING;
452  break;
453  default:
454  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp minor code (%u)",MinorCode);
455  irpMinorString = errorBuf;
456  }
457  break;
458 
460  irpMajorString = IRP_MJ_FILE_SYSTEM_CONTROL_STRING;
461  switch (MinorCode) {
463  irpMinorString = IRP_MN_USER_FS_REQUEST_STRING;
464  break;
465  case IRP_MN_MOUNT_VOLUME:
466  irpMinorString = IRP_MN_MOUNT_VOLUME_STRING;
467  break;
469  irpMinorString = IRP_MN_VERIFY_VOLUME_STRING;
470  break;
472  irpMinorString = IRP_MN_LOAD_FILE_SYSTEM_STRING;
473  break;
474  case IRP_MN_TRACK_LINK:
475  irpMinorString = IRP_MN_TRACK_LINK_STRING;
476  break;
477  default:
478  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp minor code (%u)",MinorCode);
479  irpMinorString = errorBuf;
480  }
481  break;
482 
484  irpMajorString = IRP_MJ_DEVICE_CONTROL_STRING;
485  switch (MinorCode) {
486  case IRP_MN_SCSI_CLASS:
487  irpMinorString = IRP_MN_SCSI_CLASS_STRING;
488  break;
489  default:
490  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp minor code (%u)",MinorCode);
491  irpMinorString = errorBuf;
492  }
493  break;
494 
496  irpMajorString = IRP_MJ_INTERNAL_DEVICE_CONTROL_STRING;
497  break;
498  case IRP_MJ_SHUTDOWN:
499  irpMajorString = IRP_MJ_SHUTDOWN_STRING;
500  break;
501  case IRP_MJ_LOCK_CONTROL:
502  irpMajorString = IRP_MJ_LOCK_CONTROL_STRING;
503  switch (MinorCode) {
504  case IRP_MN_LOCK:
505  irpMinorString = IRP_MN_LOCK_STRING;
506  break;
508  irpMinorString = IRP_MN_UNLOCK_SINGLE_STRING;
509  break;
510  case IRP_MN_UNLOCK_ALL:
511  irpMinorString = IRP_MN_UNLOCK_ALL_STRING;
512  break;
514  irpMinorString = IRP_MN_UNLOCK_ALL_BY_KEY_STRING;
515  break;
516  default:
517  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp minor code (%u)",MinorCode);
518  irpMinorString = errorBuf;
519  }
520  break;
521 
522  case IRP_MJ_CLEANUP:
523  irpMajorString = IRP_MJ_CLEANUP_STRING;
524  break;
526  irpMajorString = IRP_MJ_CREATE_MAILSLOT_STRING;
527  break;
529  irpMajorString = IRP_MJ_QUERY_SECURITY_STRING;
530  break;
531  case IRP_MJ_SET_SECURITY:
532  irpMajorString = IRP_MJ_SET_SECURITY_STRING;
533  break;
534  case IRP_MJ_POWER:
535  irpMajorString = IRP_MJ_POWER_STRING;
536  switch (MinorCode) {
537  case IRP_MN_WAIT_WAKE:
538  irpMinorString = IRP_MN_WAIT_WAKE_STRING;
539  break;
541  irpMinorString = IRP_MN_POWER_SEQUENCE_STRING;
542  break;
543  case IRP_MN_SET_POWER:
544  irpMinorString = IRP_MN_SET_POWER_STRING;
545  break;
546  case IRP_MN_QUERY_POWER:
547  irpMinorString = IRP_MN_QUERY_POWER_STRING;
548  break;
549  default :
550  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp minor code (%u)",MinorCode);
551  irpMinorString = errorBuf;
552  }
553  break;
554 
556  irpMajorString = IRP_MJ_SYSTEM_CONTROL_STRING;
557  switch (MinorCode) {
559  irpMinorString = IRP_MN_QUERY_ALL_DATA_STRING;
560  break;
562  irpMinorString = IRP_MN_QUERY_SINGLE_INSTANCE_STRING;
563  break;
565  irpMinorString = IRP_MN_CHANGE_SINGLE_INSTANCE_STRING;
566  break;
568  irpMinorString = IRP_MN_CHANGE_SINGLE_ITEM_STRING;
569  break;
571  irpMinorString = IRP_MN_ENABLE_EVENTS_STRING;
572  break;
574  irpMinorString = IRP_MN_DISABLE_EVENTS_STRING;
575  break;
577  irpMinorString = IRP_MN_ENABLE_COLLECTION_STRING;
578  break;
580  irpMinorString = IRP_MN_DISABLE_COLLECTION_STRING;
581  break;
582  case IRP_MN_REGINFO:
583  irpMinorString = IRP_MN_REGINFO_STRING;
584  break;
586  irpMinorString = IRP_MN_EXECUTE_METHOD_STRING;
587  break;
588  default :
589  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp minor code (%u)",MinorCode);
590  irpMinorString = errorBuf;
591  }
592  break;
593 
595  irpMajorString = IRP_MJ_DEVICE_CHANGE_STRING;
596  break;
597  case IRP_MJ_QUERY_QUOTA:
598  irpMajorString = IRP_MJ_QUERY_QUOTA_STRING;
599  break;
600  case IRP_MJ_SET_QUOTA:
601  irpMajorString = IRP_MJ_SET_QUOTA_STRING;
602  break;
603  case IRP_MJ_PNP:
604  irpMajorString = IRP_MJ_PNP_STRING;
605  switch (MinorCode) {
606  case IRP_MN_START_DEVICE:
607  irpMinorString = IRP_MN_START_DEVICE_STRING;
608  break;
610  irpMinorString = IRP_MN_QUERY_REMOVE_DEVICE_STRING;
611  break;
613  irpMinorString = IRP_MN_REMOVE_DEVICE_STRING;
614  break;
616  irpMinorString = IRP_MN_CANCEL_REMOVE_DEVICE_STRING;
617  break;
618  case IRP_MN_STOP_DEVICE:
619  irpMinorString = IRP_MN_STOP_DEVICE_STRING;
620  break;
622  irpMinorString = IRP_MN_QUERY_STOP_DEVICE_STRING;
623  break;
625  irpMinorString = IRP_MN_CANCEL_STOP_DEVICE_STRING;
626  break;
628  irpMinorString = IRP_MN_QUERY_DEVICE_RELATIONS_STRING;
629  break;
631  irpMinorString = IRP_MN_QUERY_INTERFACE_STRING;
632  break;
634  irpMinorString = IRP_MN_QUERY_CAPABILITIES_STRING;
635  break;
637  irpMinorString = IRP_MN_QUERY_RESOURCES_STRING;
638  break;
641  break;
643  irpMinorString = IRP_MN_QUERY_DEVICE_TEXT_STRING;
644  break;
647  break;
648  case IRP_MN_READ_CONFIG:
649  irpMinorString = IRP_MN_READ_CONFIG_STRING;
650  break;
651  case IRP_MN_WRITE_CONFIG:
652  irpMinorString = IRP_MN_WRITE_CONFIG_STRING;
653  break;
654  case IRP_MN_EJECT:
655  irpMinorString = IRP_MN_EJECT_STRING;
656  break;
657  case IRP_MN_SET_LOCK:
658  irpMinorString = IRP_MN_SET_LOCK_STRING;
659  break;
660  case IRP_MN_QUERY_ID:
661  irpMinorString = IRP_MN_QUERY_ID_STRING;
662  break;
664  irpMinorString = IRP_MN_QUERY_PNP_DEVICE_STATE_STRING;
665  break;
667  irpMinorString = IRP_MN_QUERY_BUS_INFORMATION_STRING;
668  break;
671  break;
673  irpMinorString = IRP_MN_SURPRISE_REMOVAL_STRING;
674  break;
677  break;
678  default :
679  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp minor code (%u)",MinorCode);
680  irpMinorString = errorBuf;
681  }
682  break;
683 
684 
687  break;
688 
691  break;
692 
694  irpMajorString = IRP_MJ_ACQUIRE_FOR_MOD_WRITE_STRING;
695  break;
696 
698  irpMajorString = IRP_MJ_RELEASE_FOR_MOD_WRITE_STRING;
699  break;
700 
702  irpMajorString = IRP_MJ_ACQUIRE_FOR_CC_FLUSH_STRING;
703  break;
704 
706  irpMajorString = IRP_MJ_RELEASE_FOR_CC_FLUSH_STRING;
707  break;
708 
711  break;
712 
713 
714 
717  break;
718 
720  irpMajorString = IRP_MJ_NETWORK_QUERY_OPEN_STRING;
721  break;
722 
723  case IRP_MJ_MDL_READ:
724  irpMajorString = IRP_MJ_MDL_READ_STRING;
725  break;
726 
728  irpMajorString = IRP_MJ_MDL_READ_COMPLETE_STRING;
729  break;
730 
732  irpMajorString = IRP_MJ_PREPARE_MDL_WRITE_STRING;
733  break;
734 
736  irpMajorString = IRP_MJ_MDL_WRITE_COMPLETE_STRING;
737  break;
738 
739  case IRP_MJ_VOLUME_MOUNT:
740  irpMajorString = IRP_MJ_VOLUME_MOUNT_STRING;
741  break;
742 
744  irpMajorString = IRP_MJ_VOLUME_DISMOUNT_STRING;
745  break;
746 
748  irpMajorString = IRP_MJ_TRANSACTION_NOTIFY_STRING;
749  switch (MinorCode) {
750  case 0:
751  irpMinorString = TRANSACTION_BEGIN;
752  break;
754  irpMinorString = TRANSACTION_NOTIFY_PREPREPARE_STRING;
755  break;
757  irpMinorString = TRANSACTION_NOTIFY_PREPARE_STRING;
758  break;
760  irpMinorString = TRANSACTION_NOTIFY_COMMIT_STRING;
761  break;
764  break;
766  irpMinorString = TRANSACTION_NOTIFY_ROLLBACK_STRING;
767  break;
770  break;
773  break;
776  break;
778  irpMinorString = TRANSACTION_NOTIFY_RECOVER_STRING;
779  break;
782  break;
785  break;
788  break;
791  break;
794  break;
796  irpMinorString = TRANSACTION_NOTIFY_INDOUBT_STRING;
797  break;
800  break;
803  break;
805  irpMinorString = TRANSACTION_NOTIFY_MARSHAL_STRING;
806  break;
808  irpMinorString = TRANSACTION_NOTIFY_ENLIST_MASK_STRING;
809  break;
810  default:
811  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Transaction notication code (%u)",MinorCode);
812  irpMinorString = errorBuf;
813  }
814  break;
815 
816 
817  default:
818  sprintf_s(errorBuf,sizeof(errorBuf),"Unknown Irp major function (%d)",MajorCode);
819  irpMajorString = errorBuf;
820  break;
821  }
822 
823  if (OutputFile) {
824 
825  if (irpMinorString) {
826 
827  fprintf(OutputFile, "\t%-35s\t%-35s", irpMajorString, irpMinorString);
828 
829  } else {
830 
831  fprintf(OutputFile, "\t%-35s\t ", irpMajorString);
832  }
833 
834  } else {
835 
836  if (PrintMajorCode) {
837 
838  printf("%-35s ", irpMajorString);
839 
840  } else {
841 
842  if (irpMinorString) {
843 
844  printf(" %-35s\n",
845  irpMinorString);
846  }
847  }
848  }
849 }
850 
851 
852 ULONG
854  _In_ SYSTEMTIME *SystemTime,
855  _Out_writes_bytes_(BufferLength) CHAR *Buffer,
856  _In_ ULONG BufferLength
857  )
858 /*++
859 Routine Description:
860 
861  Formats the values in a SystemTime struct into the buffer
862  passed in. The resulting string is NULL terminated. The format
863  for the time is:
864  hours:minutes:seconds:milliseconds
865 
866 Arguments:
867 
868  SystemTime - the struct to format
869  Buffer - the buffer to place the formatted time in
870  BufferLength - the size of the buffer
871 
872 Return Value:
873 
874  The length of the string returned in Buffer.
875 
876 --*/
877 {
878  ULONG returnLength = 0;
879 
880  if (BufferLength < TIME_BUFFER_LENGTH) {
881 
882  //
883  // Buffer is too short so exit
884  //
885 
886  return 0;
887  }
888 
889  returnLength = sprintf_s( Buffer,
890  BufferLength,
891  "%02d:%02d:%02d:%03d",
892  SystemTime->wHour,
893  SystemTime->wMinute,
894  SystemTime->wSecond,
895  SystemTime->wMilliseconds );
896 
897  return returnLength;
898 }
899 
900 
901 VOID
903  _In_ ULONG SequenceNumber,
904  _In_ WCHAR CONST *Name,
905  _In_ PRECORD_DATA RecordData,
906  _In_ FILE *File
907  )
908 /*++
909 Routine Description:
910 
911  Prints a Data log record to the specified file. The output is in a tab
912  delimited format with the fields in the following order:
913 
914  SequenceNumber, OriginatingTime, CompletionTime, CallbackMajorId, CallbackMinorId,
915  Flags, NoCache, Paging I/O, Synchronous, Synchronous paging, FileName,
916  ReturnStatus, FileName
917 
918 
919 Arguments:
920 
921  SequenceNumber - the sequence number for this log record
922  Name - the name of the file that this Irp relates to
923  RecordData - the Data record to print
924  File - the file to print to
925 
926 Return Value:
927 
928  None.
929 
930 --*/
931 {
932  FILETIME localTime;
933  SYSTEMTIME systemTime;
934  CHAR time[TIME_BUFFER_LENGTH];
935  static BOOLEAN didFileHeader = FALSE;
936 
937  //
938  // Is this an Irp or a FastIo?
939  //
940 
941  if (!didFileHeader) {
942 
943 #if defined(_WIN64)
944  fprintf( File, "Opr\t SeqNum \t PreOp Time \tPostOp Time \t Process.Thrd\t Major Operation \t Minor Operation \t IrpFlags \t DevObj \t FileObj \t Transactn \t status:inform \t Arg 1 \t Arg 2 \t Arg 3 \t Arg 4 \t Arg 5 \t Arg 6 \tName\n");
945  fprintf( File, "---\t----------\t------------\t------------\t-------------\t-----------------------------------\t-----------------------------------\t---------------\t------------------\t------------------\t------------------\t-----------------------------\t------------------\t------------------\t------------------\t------------------\t------------------\t----------\t--------------------------------------------------\n");
946 #else
947  fprintf( File, "Opr\t SeqNum \t PreOp Time \tPostOp Time \t Process.Thrd\t Major Operation \t Minor Operation \t IrpFlags \t DevObj \t FileObj \tTransactn \t status:inform \t Arg 1 \t Arg 2 \t Arg 3 \t Arg 4 \t Arg 5 \t Arg 6 \tName\n");
948  fprintf( File, "---\t----------\t------------\t------------\t-------------\t-----------------------------------\t-----------------------------------\t---------------\t----------\t----------\t----------\t---------------------\t----------\t----------\t----------\t----------\t----------\t----------\t--------------------------------------------------\n");
949 #endif
950  didFileHeader = TRUE;
951  }
952 
953  //
954  // Is this an Irp or a FastIo?
955  //
956 
957  if (RecordData->Flags & FLT_CALLBACK_DATA_IRP_OPERATION) {
958 
959  fprintf( File, "IRP");
960 
961  } else if (RecordData->Flags & FLT_CALLBACK_DATA_FAST_IO_OPERATION) {
962 
963  fprintf( File, "FIO");
964 
965  } else if (RecordData->Flags & FLT_CALLBACK_DATA_FS_FILTER_OPERATION) {
966 
967  fprintf( File, "FSF");
968 
969  } else {
970 
971  fprintf( File, "ERR");
972  }
973 
974  //
975  // Print the sequence number
976  //
977 
978  fprintf( File, "\t0x%08X", SequenceNumber );
979 
980  //
981  // Convert originating time
982  //
983 
984  FileTimeToLocalFileTime( (FILETIME *)&(RecordData->OriginatingTime),
985  &localTime );
986  FileTimeToSystemTime( &localTime,
987  &systemTime );
988 
989  if (FormatSystemTime( &systemTime, time, TIME_BUFFER_LENGTH )) {
990 
991  fprintf( File, "\t%-12s", time );
992 
993  } else {
994 
995  fprintf( File, "\t%-12s", TIME_ERROR );
996  }
997 
998  //
999  // Convert completion time
1000  //
1001 
1002  FileTimeToLocalFileTime( (FILETIME *)&(RecordData->CompletionTime),
1003  &localTime );
1004  FileTimeToSystemTime( &localTime,
1005  &systemTime );
1006 
1007  if (FormatSystemTime( &systemTime, time, TIME_BUFFER_LENGTH )) {
1008 
1009  fprintf( File, "\t%-12s", time );
1010 
1011  } else {
1012 
1013  fprintf( File, "\t%-12s", TIME_ERROR );
1014  }
1015 
1016  fprintf(File, "\t%8Ix.%-4Ix ", RecordData->ProcessId, RecordData->ThreadId);
1017 
1018  PrintIrpCode( RecordData->CallbackMajorId,
1019  RecordData->CallbackMinorId,
1020  File,
1021  TRUE );
1022 
1023  //
1024  // Interpret set IrpFlags
1025  //
1026 
1027  fprintf( File, "\t0x%08lx ", RecordData->IrpFlags );
1028  fprintf( File, "%s", (RecordData->IrpFlags & IRP_NOCACHE) ? "N":"-" );
1029  fprintf( File, "%s", (RecordData->IrpFlags & IRP_PAGING_IO) ? "P":"-" );
1030  fprintf( File, "%s", (RecordData->IrpFlags & IRP_SYNCHRONOUS_API) ? "S":"-" );
1031  fprintf( File, "%s", (RecordData->IrpFlags & IRP_SYNCHRONOUS_PAGING_IO) ? "Y":"-" );
1032 
1033  fprintf( File, "\t0x%08p", (PVOID) RecordData->DeviceObject );
1034  fprintf( File, "\t0x%08p", (PVOID) RecordData->FileObject );
1035  fprintf( File, "\t0x%08p", (PVOID) RecordData->Transaction );
1036  fprintf( File, "\t0x%08lx:0x%p", RecordData->Status, (PVOID)RecordData->Information );
1037 
1038  fprintf( File, "\t0x%p", RecordData->Arg1 );
1039  fprintf( File, "\t0x%p", RecordData->Arg2 );
1040  fprintf( File, "\t0x%p", RecordData->Arg3 );
1041  fprintf( File, "\t0x%p", RecordData->Arg4 );
1042  fprintf( File, "\t0x%p", RecordData->Arg5 );
1043  fprintf( File, "\t0x%08I64x", RecordData->Arg6.QuadPart );
1044 
1045  fprintf( File, "\t%S", Name );
1046  fprintf( File, "\n" );
1047 }
1048 
1049 
1050 VOID
1052  _In_ ULONG SequenceNumber,
1053  _In_ WCHAR CONST *Name,
1054  _In_ PRECORD_DATA RecordData
1055  )
1056 /*++
1057 Routine Description:
1058 
1059  Prints a Irp log record to the screen in the following order:
1060  SequenceNumber, OriginatingTime, CompletionTime, IrpMajor, IrpMinor,
1061  Flags, IrpFlags, NoCache, Paging I/O, Synchronous, Synchronous paging,
1062  FileName, ReturnStatus, FileName
1063 
1064 Arguments:
1065 
1066  SequenceNumber - the sequence number for this log record
1067  Name - the file name to which this Irp relates
1068  RecordData - the Irp record to print
1069 
1070 Return Value:
1071 
1072  None.
1073 
1074 --*/
1075 {
1076  FILETIME localTime;
1077  SYSTEMTIME systemTime;
1078  CHAR time[TIME_BUFFER_LENGTH];
1079  static BOOLEAN didScreenHeader = FALSE;
1080 
1081  //
1082  // Is this an Irp or a FastIo?
1083  //
1084 
1085  if (!didScreenHeader) {
1086 
1087 #if defined(_WIN64)
1088  printf("Opr SeqNum PreOp Time PostOp Time Process.Thrd Major/Minor Operation IrpFlags DevObj FileObj Transact status:inform Arguments Name\n");
1089  printf("--- -------- ------------ ------------ ------------- ----------------------------------- ------------- ---------------- ---------------- ---------------- ------------------------- --------------------------------------------------------------------------------------------------------- -----------------------------------\n");
1090 #else
1091  printf("Opr SeqNum PreOp Time PostOp Time Process.Thrd Major/Minor Operation IrpFlags DevObj FileObj Transact status:inform Arguments Name\n");
1092  printf("--- -------- ------------ ------------ ------------- ----------------------------------- ------------- -------- -------- -------- ----------------- ----------------------------------------------------------------- -----------------------------------\n");
1093 #endif
1094  didScreenHeader = TRUE;
1095  }
1096 
1097  //
1098  // Display informatoin
1099  //
1100 
1101  if (RecordData->Flags & FLT_CALLBACK_DATA_IRP_OPERATION) {
1102 
1103  printf( "IRP ");
1104 
1105  } else if (RecordData->Flags & FLT_CALLBACK_DATA_FAST_IO_OPERATION) {
1106 
1107  printf( "FIO ");
1108 
1109  } else if (RecordData->Flags & FLT_CALLBACK_DATA_FS_FILTER_OPERATION) {
1110 
1111  printf( "FSF " );
1112  } else {
1113 
1114  printf( "ERR ");
1115  }
1116 
1117  printf( "%08X ", SequenceNumber );
1118 
1119 
1120  //
1121  // Convert originating time
1122  //
1123 
1124  FileTimeToLocalFileTime( (FILETIME *)&(RecordData->OriginatingTime),
1125  &localTime );
1126  FileTimeToSystemTime( &localTime,
1127  &systemTime );
1128 
1129  if (FormatSystemTime( &systemTime, time, TIME_BUFFER_LENGTH )) {
1130 
1131  printf( "%-12s ", time );
1132 
1133  } else {
1134 
1135  printf( "%-12s ", TIME_ERROR );
1136  }
1137 
1138  //
1139  // Convert completion time
1140  //
1141 
1142  FileTimeToLocalFileTime( (FILETIME *)&(RecordData->CompletionTime),
1143  &localTime );
1144  FileTimeToSystemTime( &localTime,
1145  &systemTime );
1146 
1147  if (FormatSystemTime( &systemTime, time, TIME_BUFFER_LENGTH )) {
1148 
1149  printf( "%-12s ", time );
1150 
1151  } else {
1152 
1153  printf( "%-12s ", TIME_ERROR );
1154  }
1155 
1156  printf("%8Ix.%-4Ix ", RecordData->ProcessId, RecordData->ThreadId);
1157 
1158  PrintIrpCode( RecordData->CallbackMajorId,
1159  RecordData->CallbackMinorId,
1160  NULL,
1161  TRUE );
1162 
1163  //
1164  // Interpret set IrpFlags
1165  //
1166 
1167  printf( "%08lx ", RecordData->IrpFlags );
1168  printf( "%s", (RecordData->IrpFlags & IRP_NOCACHE) ? "N":"-" );
1169  printf( "%s", (RecordData->IrpFlags & IRP_PAGING_IO) ? "P":"-" );
1170  printf( "%s", (RecordData->IrpFlags & IRP_SYNCHRONOUS_API) ? "S":"-" );
1171  printf( "%s ", (RecordData->IrpFlags & IRP_SYNCHRONOUS_PAGING_IO) ? "Y":"-" );
1172 
1173  printf( "%08p ", (PVOID) RecordData->DeviceObject );
1174  printf( "%08p ", (PVOID) RecordData->FileObject );
1175  printf( "%08p ", (PVOID) RecordData->Transaction );
1176  printf( "%08lx:%p ", RecordData->Status, (PVOID)RecordData->Information );
1177 
1178  printf( "1:%p 2:%p 3:%p 4:%p 5:%p 6:%08I64x ",
1179  RecordData->Arg1,
1180  RecordData->Arg2,
1181  RecordData->Arg3,
1182  RecordData->Arg4,
1183  RecordData->Arg5,
1184  RecordData->Arg6.QuadPart );
1185 
1186  printf( "%S", Name );
1187  printf( "\n" );
1188  PrintIrpCode( RecordData->CallbackMajorId,
1189  RecordData->CallbackMinorId,
1190  NULL,
1191  FALSE );
1192 }
1193 
#define IRP_MN_UNLOCK_ALL_STRING
Definition: mspyLog.h:156
#define IRP_MJ_WRITE_STRING
Definition: mspyLog.h:91
#define IRP_MN_UNLOCK_SINGLE_STRING
Definition: mspyLog.h:155
#define IRP_MJ_SET_VOLUME_INFORMATION_STRING
Definition: mspyLog.h:98
#define IRP_MN_UNLOCK_SINGLE
Definition: mspyLog.h:326
#define BUFFER_SIZE
Definition: mspyLog.h:26
#define IRP_MN_NORMAL_STRING
Definition: mspyLog.h:158
#define IRP_MN_DISABLE_EVENTS_STRING
Definition: mspyLog.h:200
#define IRP_MN_REGINFO
Definition: mspyLog.h:374
#define IRP_MJ_MDL_WRITE_COMPLETE_STRING
Definition: mspyLog.h:139
ULONG Length
Definition: minispy.h:146
#define TRANSACTION_NOTIFY_PREPREPARE_COMPLETE_STRING
Definition: mspyLog.h:217
BOOLEAN LogToScreen
Definition: mspyLog.h:35
#define TRANSACTION_NOTIFY_RECOVER_QUERY_STRING
Definition: mspyLog.h:225
#define IRP_MJ_WRITE
Definition: mspyLog.h:288
#define IRP_MN_UNLOCK_ALL_BY_KEY
Definition: mspyLog.h:328
#define FLT_CALLBACK_DATA_FAST_IO_OPERATION
Definition: mspyLog.h:80
#define IRP_MN_ENABLE_COLLECTION_STRING
Definition: mspyLog.h:201
#define IRP_MN_USER_FS_REQUEST
Definition: mspyLog.h:320
_In_ PLARGE_INTEGER _In_ ULONG Length
#define IRP_MN_QUERY_DEVICE_RELATIONS_STRING
Definition: mspyLog.h:174
#define IRP_MJ_DEVICE_CONTROL_STRING
Definition: mspyLog.h:101
#define TRANSACTION_NOTIFY_SINGLE_PHASE_COMMIT_STRING
Definition: mspyLog.h:223
#define IRP_MN_COMPLETE_MDL
Definition: mspyLog.h:335
#define IRP_MN_EJECT_STRING
Definition: mspyLog.h:183
#define IRP_MJ_READ
Definition: mspyLog.h:287
#define IRP_MJ_MDL_WRITE_COMPLETE
Definition: minispy.h:41
#define IRP_MN_QUERY_SINGLE_INSTANCE_STRING
Definition: mspyLog.h:196
#define TRANSACTION_NOTIFY_ENLIST_MASK_STRING
Definition: mspyLog.h:232
#define TRANSACTION_NOTIFY_PREPARE_STRING
Definition: mspyLog.h:214
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS_STRING
Definition: mspyLog.h:178
#define IRP_MJ_CLEANUP
Definition: mspyLog.h:302
#define IRP_MN_QUERY_ID_STRING
Definition: mspyLog.h:185
#define IRP_MN_ENABLE_EVENTS
Definition: mspyLog.h:370
WCHAR Name[]
Definition: minispy.h:153
#define IRP_MN_CHANGE_SINGLE_INSTANCE
Definition: mspyLog.h:368
#define IRP_MJ_SET_EA
Definition: mspyLog.h:292
#define IRP_MN_QUERY_STOP_DEVICE_STRING
Definition: mspyLog.h:172
#define IRP_MJ_RELEASE_FOR_SECTION_SYNCHRONIZATION_STRING
Definition: mspyLog.h:122
#define IRP_MJ_ACQUIRE_FOR_CC_FLUSH
Definition: minispy.h:32
#define IRP_MN_STOP_DEVICE_STRING
Definition: mspyLog.h:171
#define IRP_MN_QUERY_REMOVE_DEVICE_STRING
Definition: mspyLog.h:168
#define TRANSACTION_NOTIFY_PROPAGATE_PUSH_STRING
Definition: mspyLog.h:230
#define IRP_MJ_RELEASE_FOR_SECTION_SYNCHRONIZATION
Definition: minispy.h:29
#define IRP_MJ_MDL_READ_STRING
Definition: mspyLog.h:136
#define IRP_MN_POWER_SEQUENCE
Definition: mspyLog.h:363
#define IRP_MN_QUERY_REMOVE_DEVICE
Definition: mspyLog.h:339
FILE * OutputFile
Definition: mspyLog.h:37
#define IRP_MN_QUERY_INTERFACE
Definition: mspyLog.h:346
#define IRP_MN_QUERY_SINGLE_INSTANCE
Definition: mspyLog.h:367
#define IRP_MN_QUERY_DEVICE_TEXT
Definition: mspyLog.h:350
#define IRP_SYNCHRONOUS_PAGING_IO
Definition: mspyLog.h:384
#define TRANSACTION_NOTIFY_DELEGATE_COMMIT_STRING
Definition: mspyLog.h:224
AVSCAN_COMMAND Command
Definition: avlib.h:95
#define IRP_MJ_DEVICE_CONTROL
Definition: mspyLog.h:298
#define IRP_MN_COMPLETE_STRING
Definition: mspyLog.h:161
#define IRP_MN_POWER_SEQUENCE_STRING
Definition: mspyLog.h:192
#define IRP_MJ_VOLUME_MOUNT_STRING
Definition: mspyLog.h:140
#define IRP_MN_READ_CONFIG_STRING
Definition: mspyLog.h:181
#define IRP_MN_REMOVE_DEVICE_STRING
Definition: mspyLog.h:169
#define IRP_MJ_VOLUME_DISMOUNT_STRING
Definition: mspyLog.h:141
#define IRP_MN_START_DEVICE
Definition: mspyLog.h:338
#define Add2Ptr(P, I)
Definition: minispy.h:238
#define IRP_MJ_QUERY_QUOTA
Definition: mspyLog.h:309
#define IRP_MJ_CLOSE_STRING
Definition: mspyLog.h:89
#define IRP_MN_COMPLETE_MDL_DPC
Definition: mspyLog.h:336
#define IRP_MJ_NETWORK_QUERY_OPEN
Definition: minispy.h:37
#define IRP_MJ_SET_VOLUME_INFORMATION
Definition: mspyLog.h:295
#define FLT_CALLBACK_DATA_FS_FILTER_OPERATION
Definition: mspyLog.h:81
#define IRP_MN_UNLOCK_ALL_BY_KEY_STRING
Definition: mspyLog.h:157
#define IRP_MN_REGINFO_STRING
Definition: mspyLog.h:203
#define IRP_MN_SCSI_CLASS_STRING
Definition: mspyLog.h:166
HANDLE ShutDown
Definition: mspyLog.h:46
DWORD WINAPI RetrieveLogRecords(_In_ LPVOID lpParameter)
Definition: mspyLog.c:97
#define RECORD_TYPE_FILETAG
Definition: minispy.h:90
#define IRP_MN_QUERY_DEVICE_RELATIONS
Definition: mspyLog.h:345
VOID FileDump(_In_ ULONG SequenceNumber, _In_ WCHAR CONST *Name, _In_ PRECORD_DATA RecordData, _In_ FILE *File)
Definition: mspyLog.c:902
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY
Definition: mspyLog.h:319
#define IRP_MN_CHANGE_SINGLE_ITEM
Definition: mspyLog.h:369
#define IRP_MJ_ACQUIRE_FOR_CC_FLUSH_STRING
Definition: mspyLog.h:125
#define IRP_MJ_QUERY_INFORMATION
Definition: mspyLog.h:289
#define TIME_ERROR
#define IRP_MJ_SYSTEM_CONTROL
Definition: mspyLog.h:307
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
Definition: mspyLog.h:299
#define IRP_MN_QUERY_PNP_DEVICE_STATE_STRING
Definition: mspyLog.h:186
#define IRP_MJ_RELEASE_FOR_MOD_WRITE_STRING
Definition: mspyLog.h:124
#define IRP_MJ_SET_SECURITY
Definition: mspyLog.h:305
#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION
Definition: mspyLog.h:361
#define TRANSACTION_NOTIFY_COMMIT_FINALIZE_STRING
Definition: mspyLog.h:220
#define IRP_MJ_RELEASE_FOR_CC_FLUSH
Definition: minispy.h:33
return TRUE
#define IRP_MN_QUERY_ALL_DATA
Definition: mspyLog.h:366
#define IRP_MN_QUERY_ID
Definition: mspyLog.h:356
#define IRP_MJ_CREATE_MAILSLOT
Definition: mspyLog.h:303
#define IRP_MN_QUERY_BUS_INFORMATION
Definition: mspyLog.h:358
#define IRP_MJ_CREATE_NAMED_PIPE_STRING
Definition: mspyLog.h:88
#define IRP_MN_QUERY_ALL_DATA_STRING
Definition: mspyLog.h:195
#define IRP_MJ_QUERY_VOLUME_INFORMATION_STRING
Definition: mspyLog.h:97
#define IRP_PAGING_IO
Definition: mspyLog.h:382
#define IRP_MN_COMPLETE
Definition: mspyLog.h:332
#define IRP_MN_UNLOCK_ALL
Definition: mspyLog.h:327
#define IRP_MJ_SET_SECURITY_STRING
Definition: mspyLog.h:108
BOOLEAN LogToFile
Definition: mspyLog.h:36
#define IRP_MN_WRITE_CONFIG
Definition: mspyLog.h:353
BOOLEAN CleaningUp
Definition: mspyLog.h:45
ULONG SequenceNumber
Definition: minispy.h:147
#define IRP_MN_VERIFY_VOLUME
Definition: mspyLog.h:322
#define IRP_MJ_FILE_SYSTEM_CONTROL_STRING
Definition: mspyLog.h:100
#define RECORD_TYPE_FLAG_EXCEED_MEMORY_ALLOWANCE
Definition: minispy.h:93
#define IRP_MN_QUERY_INTERFACE_STRING
Definition: mspyLog.h:175
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
Definition: mspyLog.h:349
#define TRANSACTION_NOTIFY_INDOUBT_STRING
Definition: mspyLog.h:228
#define IRP_MN_QUERY_DIRECTORY_STRING
Definition: mspyLog.h:147
#define IRP_MN_LOCK_STRING
Definition: mspyLog.h:154
#define IRP_MN_EXECUTE_METHOD_STRING
Definition: mspyLog.h:204
#define IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION
Definition: minispy.h:28
#define IRP_MJ_LOCK_CONTROL
Definition: mspyLog.h:301
#define IRP_MN_SET_POWER_STRING
Definition: mspyLog.h:193
#define IRP_MJ_INTERNAL_DEVICE_CONTROL_STRING
Definition: mspyLog.h:102
struct _LOG_CONTEXT * PLOG_CONTEXT
#define IRP_MN_SET_LOCK_STRING
Definition: mspyLog.h:184
#define IRP_MN_MOUNT_VOLUME_STRING
Definition: mspyLog.h:150
#define IRP_MJ_DIRECTORY_CONTROL_STRING
Definition: mspyLog.h:99
#define IRP_MJ_TRANSACTION_NOTIFY_STRING
Definition: mspyLog.h:210
#define IRP_MN_QUERY_POWER_STRING
Definition: mspyLog.h:194
#define IRP_MJ_FAST_IO_CHECK_IF_POSSIBLE_STRING
Definition: mspyLog.h:133
#define IRP_MN_WRITE_CONFIG_STRING
Definition: mspyLog.h:182
#define IRP_MN_DISABLE_COLLECTION_STRING
Definition: mspyLog.h:202
#define IRP_MN_DISABLE_COLLECTION
Definition: mspyLog.h:373
_In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Out_writes_bytes_(Length)
#define IRP_MN_STOP_DEVICE
Definition: mspyLog.h:342
_In_ BOOLEAN _Out_ PFILE_BASIC_INFORMATION Buffer
#define IRP_MN_NORMAL
Definition: mspyLog.h:329
#define IRP_MJ_SYSTEM_CONTROL_STRING
Definition: mspyLog.h:110
#define IRP_MN_CANCEL_STOP_DEVICE_STRING
Definition: mspyLog.h:173
#define IRP_MJ_SET_INFORMATION
Definition: mspyLog.h:290
#define FlagOn(_F, _SF)
Definition: minispy.h:247
#define IRP_MJ_POWER
Definition: mspyLog.h:306
#define IRP_MJ_SET_EA_STRING
Definition: mspyLog.h:95
#define IRP_MJ_MDL_READ
Definition: minispy.h:38
_Analysis_mode_(_Analysis_code_type_user_code_)
Definition: mspyLog.c:21
#define IRP_MN_LOCK
Definition: mspyLog.h:325
#define IRP_MJ_LOCK_CONTROL_STRING
Definition: mspyLog.h:104
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY_STRING
Definition: mspyLog.h:148
#define IRP_MN_COMPRESSED
Definition: mspyLog.h:333
#define IRP_MN_SET_POWER
Definition: mspyLog.h:364
#define MAX_NAME_SPACE
Definition: minispy.h:210
#define IRP_MJ_SET_QUOTA_STRING
Definition: mspyLog.h:113
#define TRANSACTION_NOTIFY_ROLLBACK_COMPLETE_STRING
Definition: mspyLog.h:221
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS_STRING
Definition: mspyLog.h:180
HANDLE Port
Definition: mspyLog.h:34
#define IRP_MJ_CREATE_STRING
Definition: mspyLog.h:87
#define IRP_MN_MDL_DPC
Definition: mspyLog.h:334
#define TRANSACTION_NOTIFY_PROPAGATE_PULL_STRING
Definition: mspyLog.h:229
#define IRP_MN_CANCEL_REMOVE_DEVICE_STRING
Definition: mspyLog.h:170
#define IRP_NOCACHE
Definition: mspyLog.h:381
#define IRP_MJ_DEVICE_CHANGE_STRING
Definition: mspyLog.h:111
NcLoadRegistryStringRetry NULL
Definition: ncinit.c:53
#define TRANSACTION_NOTIFY_ROLLBACK_STRING
Definition: mspyLog.h:216
#define IRP_MN_TRACK_LINK_STRING
Definition: mspyLog.h:153
#define TRANSACTION_NOTIFY_LAST_RECOVER_STRING
Definition: mspyLog.h:227
#define IRP_MN_EJECT
Definition: mspyLog.h:354
#define IRP_MJ_SET_QUOTA
Definition: mspyLog.h:310
#define TRANSACTION_NOTIFY_PREPREPARE_STRING
Definition: mspyLog.h:213
ULONG FormatSystemTime(_In_ SYSTEMTIME *SystemTime, _Out_writes_bytes_(BufferLength) CHAR *Buffer, _In_ ULONG BufferLength)
Definition: mspyLog.c:853
#define IRP_MN_QUERY_STOP_DEVICE
Definition: mspyLog.h:343
#define IRP_MJ_ACQUIRE_FOR_MOD_WRITE
Definition: minispy.h:30
VOID PrintIrpCode(_In_ UCHAR MajorCode, _In_ UCHAR MinorCode, _In_opt_ FILE *OutputFile, _In_ BOOLEAN PrintMajorCode)
Definition: mspyLog.c:314
#define IRP_MN_CANCEL_STOP_DEVICE
Definition: mspyLog.h:344
#define IRP_MN_QUERY_RESOURCES
Definition: mspyLog.h:348
#define IRP_MJ_RELEASE_FOR_MOD_WRITE
Definition: minispy.h:31
#define IRP_MJ_QUERY_SECURITY_STRING
Definition: mspyLog.h:107
#define IRP_MN_QUERY_CAPABILITIES
Definition: mspyLog.h:347
#define IRP_MN_QUERY_POWER
Definition: mspyLog.h:365
#define IRP_MJ_VOLUME_DISMOUNT
Definition: minispy.h:43
#define IRP_MN_CHANGE_SINGLE_INSTANCE_STRING
Definition: mspyLog.h:197
#define IRP_MJ_CLOSE
Definition: mspyLog.h:286
#define TRANSACTION_NOTIFY_MARSHAL_STRING
Definition: mspyLog.h:231
#define IRP_MN_CHANGE_SINGLE_ITEM_STRING
Definition: mspyLog.h:198
#define TRANSACTION_NOTIFY_RECOVER_STRING
Definition: mspyLog.h:222
RECORD_DATA Data
Definition: minispy.h:152
struct _FLT_TAG_DATA_BUFFER * PFLT_TAG_DATA_BUFFER
#define IRP_MN_READ_CONFIG
Definition: mspyLog.h:352
#define IRP_MN_QUERY_DEVICE_TEXT_STRING
Definition: mspyLog.h:179
#define TRANSACTION_NOTIFY_ENLIST_PREPREPARE_STRING
Definition: mspyLog.h:226
#define IRP_MN_USER_FS_REQUEST_STRING
Definition: mspyLog.h:149
#define IRP_MJ_CREATE_MAILSLOT_STRING
Definition: mspyLog.h:106
#define IRP_MN_SURPRISE_REMOVAL
Definition: mspyLog.h:360
#define IRP_MN_DISABLE_EVENTS
Definition: mspyLog.h:371
#define IRP_MJ_SHUTDOWN_STRING
Definition: mspyLog.h:103
#define IRP_MJ_READ_STRING
Definition: mspyLog.h:90
#define IRP_MN_REMOVE_DEVICE
Definition: mspyLog.h:340
#define IRP_MN_COMPRESSED_STRING
Definition: mspyLog.h:162
#define IRP_MN_MOUNT_VOLUME
Definition: mspyLog.h:321
#define IRP_MN_DPC_STRING
Definition: mspyLog.h:159
#define IRP_MN_WAIT_WAKE
Definition: mspyLog.h:362
#define IRP_MJ_FILE_SYSTEM_CONTROL
Definition: mspyLog.h:297
#define IRP_MN_QUERY_DIRECTORY
Definition: mspyLog.h:318
#define IRP_MJ_NOTIFY_STREAM_FO_CREATION
Definition: minispy.h:34
#define IRP_MJ_QUERY_EA_STRING
Definition: mspyLog.h:94
#define IRP_MN_QUERY_BUS_INFORMATION_STRING
Definition: mspyLog.h:187
#define IRP_MN_TRACK_LINK
Definition: mspyLog.h:324
#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION_STRING
Definition: mspyLog.h:190
if(Status !=STATUS_BUFFER_TOO_SMALL &&Status !=STATUS_BUFFER_OVERFLOW)
Definition: ncinit.c:65
#define IRP_MJ_FLUSH_BUFFERS_STRING
Definition: mspyLog.h:96
#define IRP_MJ_DIRECTORY_CONTROL
Definition: mspyLog.h:296
#define FLT_CALLBACK_DATA_IRP_OPERATION
Definition: mspyLog.h:79
#define IRP_MN_START_DEVICE_STRING
Definition: mspyLog.h:167
#define IRP_MN_MDL_STRING
Definition: mspyLog.h:160
#define IRP_MJ_FAST_IO_CHECK_IF_POSSIBLE
Definition: minispy.h:36
#define IRP_MJ_PREPARE_MDL_WRITE
Definition: minispy.h:40
#define IRP_MJ_NOTIFY_STREAM_FO_CREATION_STRING
Definition: mspyLog.h:127
#define IRP_MJ_MDL_READ_COMPLETE_STRING
Definition: mspyLog.h:137
#define IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION_STRING
Definition: mspyLog.h:121
#define IRP_MJ_TRANSACTION_NOTIFY
Definition: minispy.h:49
#define IRP_MJ_QUERY_SECURITY
Definition: mspyLog.h:304
#define IRP_MN_QUERY_PNP_DEVICE_STATE
Definition: mspyLog.h:357
#define TRANSACTION_NOTIFY_COMMIT_COMPLETE_STRING
Definition: mspyLog.h:219
#define IRP_MJ_PNP
Definition: mspyLog.h:311
struct _LOG_RECORD * PLOG_RECORD
#define IRP_MJ_RELEASE_FOR_CC_FLUSH_STRING
Definition: mspyLog.h:126
#define IRP_MN_ENABLE_EVENTS_STRING
Definition: mspyLog.h:199
#define IRP_MJ_QUERY_INFORMATION_STRING
Definition: mspyLog.h:92
#define IRP_MJ_VOLUME_MOUNT
Definition: minispy.h:42
#define IRP_MN_SURPRISE_REMOVAL_STRING
Definition: mspyLog.h:189
#define IRP_MJ_ACQUIRE_FOR_MOD_WRITE_STRING
Definition: mspyLog.h:123
#define IRP_MN_LOAD_FILE_SYSTEM
Definition: mspyLog.h:323
VOID ScreenDump(_In_ ULONG SequenceNumber, _In_ WCHAR CONST *Name, _In_ PRECORD_DATA RecordData)
Definition: mspyLog.c:1051
#define IRP_MN_DEVICE_USAGE_NOTIFICATION_STRING
Definition: mspyLog.h:188
#define IRP_MJ_NETWORK_QUERY_OPEN_STRING
Definition: mspyLog.h:135
#define IRP_MJ_PNP_STRING
Definition: mspyLog.h:114
struct _FLT_TAG_DATA_BUFFER::@5::@8 MountPointReparseBuffer
#define IRP_MN_QUERY_RESOURCES_STRING
Definition: mspyLog.h:177
#define IRP_MJ_CLEANUP_STRING
Definition: mspyLog.h:105
#define IRP_MN_SCSI_CLASS
Definition: mspyLog.h:337
#define IRP_MN_EXECUTE_METHOD
Definition: mspyLog.h:375
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
Definition: mspyLog.h:359
#define TIME_BUFFER_LENGTH
#define IRP_MJ_QUERY_QUOTA_STRING
Definition: mspyLog.h:112
#define IRP_SYNCHRONOUS_API
Definition: mspyLog.h:383
#define IRP_MJ_QUERY_EA
Definition: mspyLog.h:291
#define IRP_MJ_FLUSH_BUFFERS
Definition: mspyLog.h:293
#define IRP_MJ_MDL_READ_COMPLETE
Definition: minispy.h:39
#define IRP_MJ_PREPARE_MDL_WRITE_STRING
Definition: mspyLog.h:138
#define IRP_MN_QUERY_CAPABILITIES_STRING
Definition: mspyLog.h:176
#define POLL_INTERVAL
#define TRANSACTION_NOTIFY_COMMIT_STRING
Definition: mspyLog.h:215
#define IRP_MN_VERIFY_VOLUME_STRING
Definition: mspyLog.h:151
#define IRP_MJ_DEVICE_CHANGE
Definition: mspyLog.h:308
#define IRP_MN_SET_LOCK
Definition: mspyLog.h:355
#define IRP_MJ_SHUTDOWN
Definition: mspyLog.h:300
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
Definition: mspyLog.h:351
ULONG RecordType
Definition: minispy.h:149
#define IRP_MJ_POWER_STRING
Definition: mspyLog.h:109
#define IRP_MN_ENABLE_COLLECTION
Definition: mspyLog.h:372
#define IRP_MJ_SET_INFORMATION_STRING
Definition: mspyLog.h:93
#define IRP_MN_WAIT_WAKE_STRING
Definition: mspyLog.h:191
#define IRP_MN_COMPLETE_MDL_DPC_STRING
Definition: mspyLog.h:165
#define RECORD_TYPE_FLAG_OUT_OF_MEMORY
Definition: minispy.h:94
#define IRP_MN_DPC
Definition: mspyLog.h:330
#define IRP_MN_LOAD_FILE_SYSTEM_STRING
Definition: mspyLog.h:152
#define TRANSACTION_BEGIN
Definition: mspyLog.h:212
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: mspyLog.h:294
#define IRP_MN_MDL_DPC_STRING
Definition: mspyLog.h:163
#define IRP_MJ_CREATE_NAMED_PIPE
Definition: mspyLog.h:285
#define IRP_MN_CANCEL_REMOVE_DEVICE
Definition: mspyLog.h:341
#define IRP_MN_COMPLETE_MDL_STRING
Definition: mspyLog.h:164
#define IRP_MJ_CREATE
Definition: mspyLog.h:284
#define IRP_MN_MDL
Definition: mspyLog.h:331

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