ReactOS  0.4.13-dev-563-g0561610
init.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYRIGHT.TXT
3  * PROJECT: Ext2 File System Driver for WinNT/2K/XP
4  * FILE: init.c
5  * PROGRAMMER: Matt Wu <mattwu@163.com>
6  * HOMEPAGE: http://www.ext2fsd.com
7  * UPDATE HISTORY:
8  */
9 
10 /* INCLUDES *****************************************************************/
11 
12 #include "ext2fs.h"
13 
14 /* GLOBALS ***************************************************************/
15 
17 
18 /*
19  * Ext2Fsd version, building date/time
20  */
21 
23 CHAR gTime[] = __TIME__;
24 CHAR gDate[] = __DATE__;
25 
26 
27 /* DEFINITIONS ***********************************************************/
28 
33 
34 #ifdef ALLOC_PRAGMA
35 #pragma alloc_text(INIT, Ext2QueryGlobalParameters)
36 #pragma alloc_text(INIT, Ext2QueryRegistrySettings)
37 #pragma alloc_text(INIT, DriverEntry)
38 #if EXT2_UNLOAD
39 #pragma alloc_text(PAGE, DriverUnload)
40 #endif
41 #endif
42 
43 /* FUNCTIONS ***************************************************************/
44 
47 
48 #if EXT2_UNLOAD
49 
50 /*
51  * FUNCTION: Called by the system to unload the driver
52  * ARGUMENTS:
53  * DriverObject = object describing this driver
54  * RETURNS: None
55  */
56 
57 VOID NTAPI
59 {
60 
62 
63  DEBUG(DL_FUN, ( "Ext2Fsd: Unloading routine.\n"));
64 
65  /*
66  * stop reaper thread ...
67  */
68 
69 
70  /*
71  * removing memory allocations and objects
72  */
73 
76 
78 
80 
87 
90 
91  /* cleanup journal related caches */
93 
94  /* cleanup linux lib */
96 
97  Ext2FreePool(Ext2Global, 'LG2E');
98  Ext2Global = NULL;
99 }
100 
101 #endif
102 
109  IN PVOID Context,
111  )
112 {
113  ULONG i = 0;
114  BYTE *s, *t;
115 
116  if (NULL == ValueName || NULL == ValueData)
117  return STATUS_SUCCESS;
118 
121 
122  if (ValueData && ValueLength == sizeof(DWORD)) {
123  if (*((PULONG)ValueData)) {
125  } else {
127  }
128  }
129  } else if (ValueType == REG_DWORD && wcslen(ValueName) == wcslen(CHECKING_BITMAP) &&
131 
132  if (ValueData && ValueLength == sizeof(DWORD)) {
133  if (*((PULONG)ValueData)) {
135  } else {
137  }
138  }
141 
142  if (ValueData && ValueLength == sizeof(DWORD)) {
143  if (*((PULONG)ValueData)) {
146  } else {
148  }
149  }
150  } else if (ValueType == REG_DWORD && wcslen(ValueName) == wcslen(AUTO_MOUNT) &&
152 
153  if (ValueData && ValueLength == sizeof(DWORD)) {
154  if (*((PULONG)ValueData)) {
156  } else {
158  }
159  }
160  } else if (ValueType == REG_SZ && wcslen(ValueName) == wcslen(CODEPAGE_NAME) &&
162 
163  if (ValueData && ValueLength <= sizeof(WCHAR) * CODEPAGE_MAXLEN) {
164  RtlCopyMemory(&Ext2Global->Codepage.PageName[0],
166  }
167  } else if (ValueType == REG_SZ && wcslen(ValueName) == wcslen(HIDING_PREFIX) &&
169 
170  if (ValueData && ValueLength <= sizeof(WCHAR) * HIDINGPAT_LEN) {
173  }
174  } else if (ValueType == REG_SZ && wcslen(ValueName) == wcslen(HIDING_SUFFIX) &&
176 
177  if (ValueData && ValueLength <= sizeof(WCHAR) * HIDINGPAT_LEN) {
180  }
181  }
182 
183 
184  return STATUS_SUCCESS;
185 }
186 
187 NTSTATUS
189 {
191  int i = 0;
193 
195 
196  /*
197  * 1 writing support
198  */
199  QueryTable[i].Flags = 0;
206  i++;
207 
208  /*
209  * 2 checking bitmap
210  */
211  QueryTable[i].Flags = 0;
218  i++;
219 
220  /*
221  * 3 force writing
222  */
223  QueryTable[i].Flags = 0;
230  i++;
231 
232  /*
233  * 4 automount
234  */
235  QueryTable[i].Flags = 0;
242  i++;
243 
244  /*
245  * 5 codepage
246  */
247  QueryTable[i].Flags = 0;
254  i++;
255 
256  /*
257  * 6 hidden prefix
258  */
259  QueryTable[i].Flags = 0;
266  i++;
267 
268 
269  /*
270  * 7 hidden suffix
271  */
272  QueryTable[i].Flags = 0;
279  i++;
280 
284  &QueryTable[0],
285  NULL,
286  NULL
287  );
288 
289  return NT_SUCCESS(Status);
290 }
291 
292 
293 BOOLEAN
295 {
296  UNICODE_STRING ParameterPath;
297  UNICODE_STRING UniName;
298  ANSI_STRING AnsiName;
299 
300  ULONG WritingSupport = 0;
301  ULONG CheckingBitmap = 0;
302  ULONG Ext3ForceWriting = 0;
303  ULONG AutoMount = 0;
304 
305  WCHAR UniBuffer[CODEPAGE_MAXLEN];
307 
309 
310  ParameterPath.Length = 0;
311  ParameterPath.MaximumLength =
312  RegistryPath->Length + sizeof(PARAMETERS_KEY) + sizeof(WCHAR);
313  ParameterPath.Buffer =
315  PagedPool,
316  ParameterPath.MaximumLength,
317  'LG2E'
318  );
319  if (!ParameterPath.Buffer) {
320  DbgBreak();
321  DEBUG(DL_ERR, ( "Ex2QueryParameters: failed to allocate Parameters...\n"));
322  return FALSE;
323  }
324 
325  RtlCopyUnicodeString(&ParameterPath, RegistryPath);
326  RtlAppendUnicodeToString(&ParameterPath, PARAMETERS_KEY);
327 
328  /* enable automount of ext2/3/4 volumes */
330 
331  /* query parameter settings from registry */
332  Ext2QueryGlobalParameters(&ParameterPath);
333 
334  /* set global codepage settings */
335  if (wcslen(&Ext2Global->Codepage.PageName[0])) {
336  UniName.Length = sizeof(WCHAR) * wcslen(&Ext2Global->Codepage.PageName[0]);
337  UniName.MaximumLength = CODEPAGE_MAXLEN * sizeof(WCHAR);
338  UniName.Buffer = &Ext2Global->Codepage.PageName[0];
339  AnsiName.MaximumLength = CODEPAGE_MAXLEN;
340  AnsiName.Length = 0;
341  AnsiName.Buffer = &Ext2Global->Codepage.AnsiName[0];
343  &AnsiName,
344  &UniName,
345  FALSE);
346  if (!NT_SUCCESS(Status)) {
347  DEBUG(DL_ERR, ( "Ext2QueryParameters: Wrong CodePage %wZ ...\n", &UniName));
348  RtlCopyMemory(&(Ext2Global->Codepage.AnsiName[0]),"default\0", 8);
349  }
350  } else {
351  DEBUG(DL_ERR, ( "Ext2QueryParameters: CodePage not specified.\n"));
352  RtlCopyMemory(&(Ext2Global->Codepage.AnsiName[0]),"default\0", 8);
353  }
354  Ext2Global->Codepage.AnsiName[CODEPAGE_MAXLEN - 1] = 0;
355 
356 
357  /* set global hidden prefix pattern */
358  if (wcslen(&Ext2Global->wHidingPrefix[0])) {
359  UniName.Length = sizeof(WCHAR) * wcslen(&Ext2Global->wHidingPrefix[0]);
360  UniName.MaximumLength = HIDINGPAT_LEN * sizeof(WCHAR);
361  UniName.Buffer = &Ext2Global->wHidingPrefix[0];
362  AnsiName.MaximumLength = HIDINGPAT_LEN;
363  AnsiName.Length = 0;
364  AnsiName.Buffer = &(Ext2Global->sHidingPrefix[0]);
365 
367  &AnsiName,
368  &UniName,
369  FALSE);
370  if (NT_SUCCESS(Status)) {
372  } else {
373  DEBUG(DL_ERR, ( "Ext2QueryParameters: Wrong HidingPrefix ...\n"));
374  }
375  } else {
376  DEBUG(DL_ERR, ( "Ext2QueryParameters: HidingPrefix not specified.\n"));
377  }
379 
380 
381  /* set global hidden suffix pattern */
382  if (wcslen(&Ext2Global->wHidingSuffix[0])) {
383  UniName.Length = sizeof(WCHAR) * wcslen(&Ext2Global->wHidingSuffix[0]);
384  UniName.MaximumLength = HIDINGPAT_LEN * sizeof(WCHAR);
385  UniName.Buffer = &Ext2Global->wHidingSuffix[0];
386  AnsiName.MaximumLength = HIDINGPAT_LEN;
387  AnsiName.Length = 0;
388  AnsiName.Buffer = &(Ext2Global->sHidingSuffix[0]);
389 
391  &AnsiName,
392  &UniName,
393  FALSE);
394  if (NT_SUCCESS(Status)) {
396  } else {
397  DEBUG(DL_ERR, ( "Ext2QueryParameters: Wrong HidingSuffix ...\n"));
398  }
399  } else {
400  DEBUG(DL_ERR, ( "Ext2QueryParameters: HidingSuffix not specified.\n"));
401  }
403 
404  Ext2Global->RegistryPath.Buffer = ParameterPath.Buffer;
409 
410  return TRUE;
411 }
412 
413 
414 #define NLS_OEM_LEAD_BYTE_INFO (*NlsOemLeadByteInfo)
415 
416 #ifndef __REACTOS__
417 #define FsRtlIsLeadDbcsCharacter(DBCS_CHAR) ( \
418  (BOOLEAN)((UCHAR)(DBCS_CHAR) < 0x80 ? FALSE : \
419  (NLS_MB_CODE_PAGE_TAG && \
420  (NLS_OEM_LEAD_BYTE_INFO[(UCHAR)(DBCS_CHAR)] != 0))) \
421 )
422 #endif
423 
424 VOID
426 {
427  /* Verify ERESOURCE alignment in structures */
429  CL_ASSERT((FIELD_OFFSET(EXT2_VCB, MainResource) & 7) == 0);
430  CL_ASSERT((FIELD_OFFSET(EXT2_VCB, PagingIoResource) & 7) == 0);
431  CL_ASSERT((FIELD_OFFSET(EXT2_VCB, MetaInode) & 7) == 0);
432  CL_ASSERT((FIELD_OFFSET(EXT2_VCB, MetaBlock) & 7) == 0);
433  CL_ASSERT((FIELD_OFFSET(EXT2_VCB, McbLock) & 7) == 0);
434  CL_ASSERT((FIELD_OFFSET(EXT2_VCB, FcbLock) & 7) == 0);
435  CL_ASSERT((FIELD_OFFSET(EXT2_VCB, bd.bd_bh_lock) & 7) == 0);
436  CL_ASSERT((FIELD_OFFSET(EXT2_VCB, sbi.s_gd_lock) & 7) == 0);
437  CL_ASSERT((FIELD_OFFSET(EXT2_FCBVCB, MainResource) & 7) == 0);
438  CL_ASSERT((FIELD_OFFSET(EXT2_FCBVCB, PagingIoResource) & 7) == 0);
439  CL_ASSERT((FIELD_OFFSET(EXT2_FCB, MainResource) & 7) == 0);
440  CL_ASSERT((FIELD_OFFSET(EXT2_FCB, PagingIoResource) & 7) == 0);
441 }
442 
443 /*
444  * NAME: DriverEntry
445  * FUNCTION: Called by the system to initalize the driver
446  *
447  * ARGUMENTS:
448  * DriverObject = object describing this driver
449  * RegistryPath = path to our configuration entries
450  * RETURNS: Success or failure
451  */
456 )
457 {
458  PDEVICE_OBJECT DiskdevObject = NULL;
459  PDEVICE_OBJECT CdromdevObject = NULL;
462 
464  PCACHE_MANAGER_CALLBACKS CacheManagerCallbacks;
465 
467 
468  int rc = 0;
469  BOOLEAN linux_lib_inited = FALSE;
470  BOOLEAN journal_module_inited = FALSE;
471 
472  /* Verity super block ... */
473  ASSERT(sizeof(EXT2_SUPER_BLOCK) == 1024);
474  ASSERT(FIELD_OFFSET(EXT2_SUPER_BLOCK, s_magic) == 56);
475 
476  DbgPrint(
477  "Ext2Fsd --"
478 #ifdef _WIN2K_TARGET_
479  " Win2k --"
480 #endif
481  " Version "
483 #if EXT2_DEBUG
484  " Checked"
485 #else
486  " Free"
487 #endif
488  " -- "
489  __DATE__ " "
490  __TIME__ ".\n");
491 
492  DEBUG(DL_FUN, ( "Ext2 DriverEntry ...\n"));
493 
494  /* initialize winlib structures */
495  if (ext2_init_linux()) {
497  goto errorout;
498  }
499  linux_lib_inited = TRUE;
500 
501  /* initialize journal module structures */
503  if (rc != 0) {
505  goto errorout;
506  }
507  journal_module_inited = TRUE;
508 
509  /* allocate memory for Ext2Global */
511  if (!Ext2Global) {
513  goto errorout;
514  }
515 
516  /* initialize Ext2Global */
520 
523 
524  /* query registry settings */
526 
527  /* create Ext2Fsd cdrom fs deivce */
530  DriverObject,
531  0,
532  &DeviceName,
534  0,
535  FALSE,
536  &CdromdevObject );
537 
538  if (!NT_SUCCESS(Status)) {
539  DEBUG(DL_ERR, ( "IoCreateDevice cdrom device object error.\n"));
540  goto errorout;
541  }
542 
543  /* create Ext2Fsd disk fs deivce */
546  DriverObject,
547  0,
548  &DeviceName,
550  0,
551  FALSE,
552  &DiskdevObject );
553 
554  if (!NT_SUCCESS(Status)) {
555  DEBUG(DL_ERR, ( "IoCreateDevice disk device object error.\n"));
556  goto errorout;
557  }
558 
562  if (!NT_SUCCESS(Status)) {
563  goto errorout;
564  }
565 
566  /* start resource reaper thread */
570  if (!NT_SUCCESS(Status)) {
572  goto errorout;
573  }
574 
578  if (!NT_SUCCESS(Status)) {
581  goto errorout;
582  }
583 
584 #ifdef _PNP_POWER_
585  DiskdevObject->DeviceObjectExtension->PowerControlNeeded = FALSE;
586  CdromdevObject->DeviceObjectExtension->PowerControlNeeded = FALSE;
587 #endif
588 
589  /* initializing */
590  Ext2Global->DiskdevObject = DiskdevObject;
591  Ext2Global->CdromdevObject = CdromdevObject;
592 
597 
600 
603 
606 
611 
614 
616 
617 #if (_WIN32_WINNT >= 0x0500)
619 #endif //(_WIN32_WINNT >= 0x0500)
620 
621 #if EXT2_UNLOAD
623 #else
625 #endif
626 
627  //
628  // Initialize the fast I/O entry points
629  //
630 
632 
644 
653 
655 
656  //
657  // initializing structure sizes for statistics
658  // 1 means flexible/not fixed for all allocations (for different volumes).
659  //
663 
665  Ext2Global->PerfStat.Unit.Slot[PS_VCB] = sizeof(EXT2_VCB); /* 1 */
666  Ext2Global->PerfStat.Unit.Slot[PS_FCB] = sizeof(EXT2_FCB); /* 2 */
667  Ext2Global->PerfStat.Unit.Slot[PS_CCB] = sizeof(EXT2_CCB); /* 3 */
668  Ext2Global->PerfStat.Unit.Slot[PS_MCB] = sizeof(EXT2_MCB); /* 4 */
669  Ext2Global->PerfStat.Unit.Slot[PS_EXTENT] = sizeof(EXT2_EXTENT); /* 5 */
671  Ext2Global->PerfStat.Unit.Slot[PS_VPB] = sizeof(VPB); /* 7 */
672  Ext2Global->PerfStat.Unit.Slot[PS_FILE_NAME] = 1; /* 8 */
673  Ext2Global->PerfStat.Unit.Slot[PS_MCB_NAME] = 1; /* 9 */
674  Ext2Global->PerfStat.Unit.Slot[PS_INODE_NAME] = 1; /* a */
677  Ext2Global->PerfStat.Unit.Slot[PS_DISK_EVENT] = sizeof(KEVENT); /* d */
679  Ext2Global->PerfStat.Unit.Slot[PS_BLOCK_DATA] = 1; /* f */
680  Ext2Global->PerfStat.Unit.Slot[PS_EXT2_INODE] = 1; /* 10 */
681  Ext2Global->PerfStat.Unit.Slot[PS_DENTRY] = sizeof(struct dentry); /* 11 */
682  Ext2Global->PerfStat.Unit.Slot[PS_BUFF_HEAD] = sizeof(struct buffer_head); /* 12 */
683 
684  switch ( MmQuerySystemSize() ) {
685 
686  case MmSmallSystem:
687 
688  Ext2Global->MaxDepth = 64;
689  break;
690 
691  case MmMediumSystem:
692 
693  Ext2Global->MaxDepth = 128;
694  break;
695 
696  case MmLargeSystem:
697 
698  Ext2Global->MaxDepth = 256;
699  break;
700  }
701 
702  //
703  // Initialize the Cache Manager callbacks
704  //
705 
706  CacheManagerCallbacks = &(Ext2Global->CacheManagerCallbacks);
707  CacheManagerCallbacks->AcquireForLazyWrite = Ext2AcquireForLazyWrite;
708  CacheManagerCallbacks->ReleaseFromLazyWrite = Ext2ReleaseFromLazyWrite;
709  CacheManagerCallbacks->AcquireForReadAhead = Ext2AcquireForReadAhead;
710  CacheManagerCallbacks->ReleaseFromReadAhead = Ext2ReleaseFromReadAhead;
711 
716 
717 
718 #ifndef _WIN2K_TARGET_
719  //
720  // Initialize FS Filter callbacks
721  //
722 
727 
728 #endif
729 
730  //
731  // Initialize the global data
732  //
733 
735  NULL,
736  NULL,
737  0,
738  sizeof(EXT2_IRP_CONTEXT),
739  'PRIE',
740  0 );
741 
743  NULL,
744  NULL,
745  0,
746  sizeof(EXT2_FCB),
747  'BCFE',
748  0 );
749 
751  NULL,
752  NULL,
753  0,
754  sizeof(EXT2_CCB),
755  'BCCE',
756  0 );
757 
759  NULL,
760  NULL,
761  0,
762  sizeof(EXT2_MCB),
763  'BCME',
764  0 );
765 
767  NULL,
768  NULL,
769  0,
770  sizeof(EXT2_EXTENT),
771  'STXE',
772  0 );
773 
775  NULL,
776  NULL,
777  0,
778  sizeof(struct dentry),
779  'TNED',
780  0 );
781 
784 
785 #if EXT2_DEBUG
787 #endif
788 
789  Ext2LoadAllNls();
790 
791  Ext2Global->Codepage.PageTable =
792  load_nls(Ext2Global->Codepage.AnsiName);
793 
794  /* register file system devices for disk and cdrom */
795  IoRegisterFileSystem(DiskdevObject);
796  ObReferenceObject(DiskdevObject);
797 
798  IoRegisterFileSystem(CdromdevObject);
799  ObReferenceObject(CdromdevObject);
800 
801 errorout:
802 
803  if (!NT_SUCCESS(Status)) {
804 
805  /*
806  * stop reaper thread ...
807  */
808 
809 
810  /*
811  * cleanup resources ...
812  */
813 
814  if (Ext2Global) {
816  Ext2FreePool(Ext2Global, 'LG2E');
817  }
818 
819  if (CdromdevObject) {
820  IoDeleteDevice(CdromdevObject);
821  }
822 
823  if (DiskdevObject) {
824  IoDeleteDevice(DiskdevObject);
825  }
826 
827  if (journal_module_inited) {
828  /* cleanup journal related caches */
830  }
831 
832  if (linux_lib_inited) {
833  /* cleanup linux lib */
835  }
836  }
837 
838  return Status;
839 }
struct _EXT2_PERF_STATISTICS_V2 EXT2_PERF_STATISTICS_V2
#define PS_CCB
Definition: common.h:19
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
Definition: rtlfuncs.h:3988
#define IN
Definition: typedefs.h:38
PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle
Definition: iotypes.h:1696
NPAGED_LOOKASIDE_LIST Ext2McbLookasideList
Definition: ext2fs.h:547
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
BOOLEAN NTAPI Ext2FastIoLock(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN PEPROCESS Process, IN ULONG Key, IN BOOLEAN FailImmediately, IN BOOLEAN ExclusiveLock, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:493
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define EXT2_PERF_STAT_MAGIC
Definition: common.h:115
ULONG SizeOfFsFilterCallbacks
Definition: iotypes.h:7069
USHORT MaxDepth
Definition: ext2fs.h:550
#define _WIN2K_TARGET_
Definition: module.h:23
#define IRP_MJ_FLUSH_BUFFERS
#define HIDINGPAT_LEN
Definition: common.h:160
#define DbgPrint
Definition: loader.c:25
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define IRP_MJ_SHUTDOWN
#define EXT2_DEBUG
Definition: ext2fs.h:34
uint16_t * PWSTR
Definition: typedefs.h:54
NPAGED_LOOKASIDE_LIST Ext2IrpContextLookasideList
Definition: ext2fs.h:544
VOID NTAPI Ext2StopReaper(PEXT2_REAPER Reaper)
Definition: memory.c:3518
#define PARAMETERS_KEY
Definition: ext2fs.h:142
ERESOURCE Resource
Definition: ext2fs.h:510
#define DOS_DEVICE_NAME
Definition: ext2fs.h:159
#define PS_DENTRY
Definition: common.h:34
#define HIDING_PREFIX
Definition: ext2fs.h:150
char CHAR
Definition: xmlstorage.h:175
_In_ PCWSTR _In_z_ PCWSTR _In_ ULONG ValueType
Definition: rtlfuncs.h:4000
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
EXT2_REAPER bhReaper
Definition: ext2fs.h:541
LONG NTSTATUS
Definition: precomp.h:26
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
struct _EXT2_RW_CONTEXT EXT2_RW_CONTEXT
GLdouble GLdouble t
Definition: gl.h:2047
#define IRP_MJ_SET_VOLUME_INFORMATION
BOOLEAN NTAPI Ext2AcquireForLazyWrite(IN PVOID Context, IN BOOLEAN Wait)
Definition: cmcb.c:23
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
NTSTATUS NTAPI ExDeleteResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1456
NPAGED_LOOKASIDE_LIST Ext2FcbLookasideList
Definition: ext2fs.h:545
PFAST_IO_UNLOCK_ALL FastIoUnlockAll
Definition: iotypes.h:1697
PFAST_IO_RELEASE_FILE ReleaseFileForNtCreateSection
Definition: iotypes.h:1701
EXT2_PERF_STATISTICS_V2 PerfStat
Definition: ext2fs.h:573
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
LIST_ENTRY VcbList
Definition: ext2fs.h:536
PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo
Definition: iotypes.h:1703
WCHAR DeviceName[]
Definition: adapter.cpp:21
EXT2_IDENTIFIER Identifier
Definition: ext2fs.h:507
PFAST_IO_RELEASE_FOR_MOD_WRITE ReleaseForModWrite
Definition: iotypes.h:1714
PEXT2_GLOBAL Ext2Global
Definition: init.c:16
#define PS_EXTENT
Definition: common.h:21
NTSTATUS NTAPI Ext2AcquireFileForModWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER EndingOffset, OUT PERESOURCE *ResourceToRelease, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1029
ULONG ProcessNameOffset
#define PS_INODE_NAME
Definition: common.h:26
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
#define EXT3_FORCEWRITING
Definition: ext2fs.h:148
NPAGED_LOOKASIDE_LIST Ext2CcbLookasideList
Definition: ext2fs.h:546
#define PS_RW_CONTEXT
Definition: common.h:22
EXT2_IDENTIFIER_TYPE Type
Definition: ext2fs.h:472
NPAGED_LOOKASIDE_LIST Ext2DentryLookasideList
Definition: ext2fs.h:549
CHAR sHidingPrefix[HIDINGPAT_LEN]
Definition: ext2fs.h:563
#define PS_VPB
Definition: common.h:23
struct _EXT2_GLOBAL::@653 Codepage
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
#define PS_EXT2_INODE
Definition: common.h:33
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define EXT2_PERF_STAT_VER2
Definition: common.h:116
#define WRITING_SUPPORT
Definition: ext2fs.h:146
PFS_FILTER_CALLBACK PreAcquireForSectionSynchronization
Definition: iotypes.h:7071
#define PS_FILE_NAME
Definition: common.h:24
NPAGED_LOOKASIDE_LIST Ext2ExtLookasideList
Definition: ext2fs.h:548
BOOLEAN NTAPI Ext2FastIoUnlockSingle(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN PEPROCESS Process, IN ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:601
BOOLEAN NTAPI Ext2FastIoCheckIfPossible(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, IN BOOLEAN CheckForReadOperation, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:60
VOID NTAPI Ext2bhReaperThread(PVOID Context)
Definition: memory.c:3219
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine
Definition: nt_native.h:109
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:848
DECLARE_INIT(journal_init)
NTSTATUS NTAPI Ext2ReleaseFileForCcFlush(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1092
NTSTATUS NTAPI DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: init.c:700
PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo
Definition: iotypes.h:1693
int Ext2LoadAllNls()
Definition: nls.c:118
#define IRP_MJ_SET_EA
struct _FAST_IO_DISPATCH FAST_IO_DISPATCH
WCHAR wHidingPrefix[HIDINGPAT_LEN]
Definition: ext2fs.h:560
PDEVICE_OBJECT DiskdevObject
Definition: ext2fs.h:530
unsigned char BOOLEAN
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
Definition: rtlfuncs.h:3988
#define PS_BUFF_HEAD
Definition: common.h:35
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI Ext2BuildRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
struct ext3_dir_entry_2 EXT2_DIR_ENTRY2
Definition: ext2fs.h:109
struct _EXT2_CCB EXT2_CCB
FAST_IO_DISPATCH FastIoDispatch
Definition: ext2fs.h:517
#define ClearLongFlag(_F, _SF)
Definition: ext2fs.h:254
Definition: bufpool.h:45
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
Definition: fs.h:117
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: rdpdr.c:50
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
PDEVICE_OBJECT CdromdevObject
Definition: ext2fs.h:533
#define PS_DIR_ENTRY
Definition: common.h:27
#define PS_DISK_BUFFER
Definition: common.h:30
#define FILE_DEVICE_DISK_FILE_SYSTEM
Definition: winioctl.h:113
ULONG Slot[PS_MAX_TYPE_V2]
Definition: common.h:67
struct _EXT2_FCB EXT2_FCB
#define IRP_MJ_QUERY_EA
#define CODEPAGE_NAME
Definition: ext2fs.h:149
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
USHORT MaximumLength
Definition: env_spec_w32.h:377
#define CODEPAGE_MAXLEN
Definition: common.h:159
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:222
DECLARE_EXIT(journal_exit)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define PS_FCB
Definition: common.h:18
struct ext2_icb EXT2_IRP_CONTEXT
BOOLEAN bHidingPrefix
Definition: ext2fs.h:562
#define IRP_MJ_FILE_SYSTEM_CONTROL
MM_SYSTEMSIZE NTAPI MmQuerySystemSize(VOID)
Definition: mmsup.c:257
struct _EXT2_VCB EXT2_VCB
#define EXT2_SUPPORT_WRITING
Definition: ext2fs.h:582
PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite
Definition: cctypes.h:39
_In_ GUID _In_ PVOID ValueData
Definition: hubbusif.h:311
PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey
Definition: iotypes.h:1698
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _KEVENT KEVENT
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
#define EXT2_AUTO_MOUNT
Definition: ext2fs.h:585
#define EXT2FSD_VERSION
Definition: ext2fs.h:51
CHAR gDate[]
Definition: init.c:24
PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead
Definition: cctypes.h:41
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static char DosDeviceName[DEVICE_SIZE]
Definition: lsdd.c:26
NTSTATUS NTAPI FsRtlRegisterFileSystemFilterCallbacks(PDRIVER_OBJECT FilterDriverObject, PFS_FILTER_CALLBACKS Callbacks)
Definition: fastio.c:1947
PFAST_IO_ACQUIRE_FOR_CCFLUSH AcquireForCcFlush
Definition: iotypes.h:1715
#define CL_ASSERT(cond)
Definition: ext2fs.h:132
PFAST_IO_LOCK FastIoLock
Definition: iotypes.h:1695
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define EXT2_CHECKING_BITMAP
Definition: ext2fs.h:584
void ext2_destroy_linux()
Definition: linux.c:1011
NTSTATUS NTAPI Ext2ReleaseFileForModWrite(IN PFILE_OBJECT FileObject, IN PERESOURCE ResourceToRelease, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1054
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2179
_In_ GUID _In_ PVOID _In_ ULONG ValueLength
Definition: hubbusif.h:311
BOOLEAN NTAPI Ext2FastIoUnlockAllByKey(IN PFILE_OBJECT FileObject, IN PEPROCESS Process, IN ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:795
BOOLEAN NTAPI Ext2FastIoUnlockAll(IN PFILE_OBJECT FileObject, IN PEPROCESS Process, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:704
PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead
Definition: cctypes.h:42
NTSTATUS NTAPI Ext2RegistryQueryCallback(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
Definition: init.c:104
unsigned char BYTE
Definition: mem.h:68
GLdouble s
Definition: gl.h:2039
VOID Ext2EresourceAlignmentChecking()
Definition: init.c:425
VOID NTAPI Ext2ReleaseForCreateSection(IN PFILE_OBJECT FileObject)
Definition: fastio.c:1014
#define RTL_REGISTRY_ABSOLUTE
Definition: nt_native.h:161
#define EXT3_FORCE_WRITING
Definition: ext2fs.h:583
struct _EXT2_MCB EXT2_MCB
Definition: ext2fs.h:479
BOOLEAN NTAPI Ext2FastIoQueryStandardInfo(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, OUT PFILE_STANDARD_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:376
struct _FS_FILTER_CALLBACKS FS_FILTER_CALLBACKS
NTSTATUS Ext2StartReaper(PEXT2_REAPER, EXT2_REAPER_RELEASE)
Definition: memory.c:3454
PFAST_IO_ACQUIRE_FOR_MOD_WRITE AcquireForModWrite
Definition: iotypes.h:1704
struct _VPB VPB
#define PS_VCB
Definition: common.h:17
Status
Definition: gdiplustypes.h:24
BOOLEAN NTAPI Ext2NoOpAcquire(IN PVOID Fcb, IN BOOLEAN Wait)
Definition: cmcb.c:118
#define DL_ERR
Definition: ext2fs.h:1397
BOOLEAN NTAPI Ext2FastIoQueryBasicInfo(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, OUT PFILE_BASIC_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:264
#define VOLUMES_KEY
Definition: ext2fs.h:143
#define PS_MCB
Definition: common.h:20
BOOLEAN bHidingSuffix
Definition: ext2fs.h:564
#define DL_FUN
Definition: ext2fs.h:1400
int journal_init(struct super_block *, const char *j_dev_name, int old_format, unsigned int)
PFAST_IO_READ FastIoRead
Definition: iotypes.h:1691
ULONG Ext2GetProcessNameOffset(VOID)
BOOLEAN NTAPI Ext2AcquireForReadAhead(IN PVOID Context, IN BOOLEAN Wait)
Definition: cmcb.c:80
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1250
NTSTATUS NTAPI Ext2AcquireFileForCcFlush(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1075
VOID Ext2UnloadAllNls()
Definition: nls.c:181
#define UNLOAD_MODULE(X)
Definition: module.h:286
CHAR gTime[]
Definition: init.c:23
PFAST_IO_WRITE FastIoWrite
Definition: iotypes.h:1692
NTSTATUS NTAPI Ext2PreAcquireForCreateSection(IN PFS_FILTER_CALLBACK_DATA cd, OUT PVOID *cc)
Definition: fastio.c:1110
#define HIDING_SUFFIX
Definition: ext2fs.h:151
unsigned short USHORT
Definition: pedump.c:61
BOOLEAN NTAPI Ext2FastIoWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:195
BOOLEAN Ext2QueryRegistrySettings(IN PUNICODE_STRING RegistryPath)
Definition: init.c:294
VOID NTAPI Ext2AcquireForCreateSection(IN PFILE_OBJECT FileObject)
Definition: fastio.c:999
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
static DRIVER_UNLOAD DriverUnload
Definition: kbdclass.c:17
#define PS_DIR_PATTERN
Definition: common.h:28
static void __exit journal_exit(void)
Definition: replay.c:1641
#define SetLongFlag(_F, _SF)
Definition: ext2fs.h:253
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int * PULONG
Definition: retypes.h:1
PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo
Definition: iotypes.h:1694
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
#define AUTO_MOUNT
Definition: ext2fs.h:152
#define IRP_MJ_LOCK_CONTROL
Definition: rdpdr.c:53
VOID NTAPI Ext2McbReaperThread(PVOID Context)
Definition: memory.c:3039
#define IRP_MJ_READ
Definition: rdpdr.c:46
VOID NTAPI Ext2ReleaseFromLazyWrite(IN PVOID Context)
Definition: cmcb.c:55
#define PS_DISK_EVENT
Definition: common.h:29
VOID NTAPI IoRegisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:992
struct _FAST_IO_DISPATCH * FastIoDispatch
Definition: iotypes.h:2176
#define IRP_MJ_CLEANUP
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM
Definition: winioctl.h:108
#define ObReferenceObject
Definition: obfuncs.h:204
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2180
PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite
Definition: cctypes.h:40
UNICODE_STRING RegistryPath
Definition: ext2fs.h:568
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
unsigned int ULONG
Definition: retypes.h:1
#define PS_MCB_NAME
Definition: common.h:25
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible
Definition: iotypes.h:1690
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
#define DbgBreak()
Definition: ext2fs.h:46
VOID Ext2FreePool(IN PVOID P, IN ULONG Tag)
Definition: debug.c:2697
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define DEVICE_NAME
Definition: ext2fs.h:137
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
#define DEBUG(args)
Definition: rdesktop.h:129
CACHE_MANAGER_CALLBACKS CacheManagerNoOpCallbacks
Definition: ext2fs.h:524
BOOLEAN NTAPI Ext2FastIoRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN ULONG LockKey, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:164
WCHAR wHidingSuffix[HIDINGPAT_LEN]
Definition: ext2fs.h:561
#define REG_NONE
Definition: nt_native.h:1492
struct _EXT2_EXTENT EXT2_EXTENT
#define CDROM_NAME
Definition: ext2fs.h:138
EXT2_REAPER McbReaper
Definition: ext2fs.h:540
PFAST_IO_ACQUIRE_FILE AcquireFileForNtCreateSection
Definition: iotypes.h:1700
CHAR sHidingSuffix[HIDINGPAT_LEN]
Definition: ext2fs.h:565
return STATUS_SUCCESS
Definition: btrfs.c:2777
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:174
CHAR gVersion[]
Definition: init.c:22
PVOID Ext2AllocatePool(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag)
Definition: debug.c:2684
#define REG_DWORD
Definition: sdbapi.c:596
PFAST_IO_RELEASE_FOR_CCFLUSH ReleaseForCcFlush
Definition: iotypes.h:1716
CACHE_MANAGER_CALLBACKS CacheManagerCallbacks
Definition: ext2fs.h:523
EXT2_REAPER FcbReaper
Definition: ext2fs.h:539
BOOLEAN NTAPI Ext2FastIoQueryNetworkOpenInfo(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, OUT PFILE_NETWORK_OPEN_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
struct nls_table * load_nls(char *)
Definition: nls_base.c:218
#define PS_IRP_CONTEXT
Definition: common.h:16
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define CHECKING_BITMAP
Definition: ext2fs.h:147
struct _EXT2_GLOBAL EXT2_GLOBAL
NTSTATUS Ext2QueryGlobalParameters(IN PUNICODE_STRING RegistryPath)
Definition: init.c:188
ULONG Flags
Definition: ext2fs.h:514
VOID NTAPI Ext2FcbReaperThread(PVOID Context)
Definition: memory.c:3367
#define PS_BLOCK_DATA
Definition: common.h:31
VOID NTAPI Ext2ReleaseFromReadAhead(IN PVOID Context)
Definition: cmcb.c:101
FS_FILTER_CALLBACKS FilterCallbacks
Definition: ext2fs.h:520
int ext2_init_linux()
Definition: linux.c:996
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
ULONG SizeOfFastIoDispatch
Definition: iotypes.h:1689
#define LOAD_MODULE(X)
Definition: module.h:282
VOID NTAPI Ext2NoOpRelease(IN PVOID Fcb)
Definition: cmcb.c:129
#define REG_SZ
Definition: layer.c:22
EXT2_STAT_ARRAY_V2 Unit
Definition: common.h:131