ReactOS 0.4.16-dev-311-g9382aa2
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
23CHAR gTime[] = __TIME__;
24CHAR gDate[] = __DATE__;
25
26
27/* DEFINITIONS ***********************************************************/
28
29#ifdef __REACTOS__
31#else
33#endif
37
38#ifdef ALLOC_PRAGMA
39#pragma alloc_text(INIT, Ext2QueryGlobalParameters)
40#pragma alloc_text(INIT, Ext2QueryRegistrySettings)
41#pragma alloc_text(INIT, DriverEntry)
42#if EXT2_UNLOAD
43#pragma alloc_text(PAGE, DriverUnload)
44#endif
45#endif
46
47/* FUNCTIONS ***************************************************************/
48
51
52#if EXT2_UNLOAD
53
54/*
55 * FUNCTION: Called by the system to unload the driver
56 * ARGUMENTS:
57 * DriverObject = object describing this driver
58 * RETURNS: None
59 */
60#ifdef __REACTOS__
62#else
63VOID
64#endif
66{
67
69
70 DEBUG(DL_FUN, ( "Ext2Fsd: Unloading routine.\n"));
71
72 /*
73 * stop reaper thread ...
74 */
75
76
77 /*
78 * removing memory allocations and objects
79 */
80
83
85
87
94
97
98 /* cleanup journal related caches */
100
101 /* cleanup linux lib */
103
104 Ext2FreePool(Ext2Global, 'LG2E');
106}
107
108#endif
109
110#ifdef __REACTOS__
112#else
114#endif
122 )
123{
124 ULONG i = 0;
125 BYTE *s, *t;
126
127 if (NULL == ValueName || NULL == ValueData)
128 return STATUS_SUCCESS;
129
132
133 if (ValueData && ValueLength == sizeof(DWORD)) {
134 if (*((PULONG)ValueData)) {
136 } else {
138 }
139 }
142
143 if (ValueData && ValueLength == sizeof(DWORD)) {
144 if (*((PULONG)ValueData)) {
146 } else {
148 }
149 }
152
153 if (ValueData && ValueLength == sizeof(DWORD)) {
154 if (*((PULONG)ValueData)) {
157 } else {
159 }
160 }
161 } else if (ValueType == REG_DWORD && wcslen(ValueName) == wcslen(AUTO_MOUNT) &&
163
164 if (ValueData && ValueLength == sizeof(DWORD)) {
165 if (*((PULONG)ValueData)) {
167 } else {
169 }
170 }
171 } else if (ValueType == REG_SZ && wcslen(ValueName) == wcslen(CODEPAGE_NAME) &&
173
174 if (ValueData && ValueLength <= sizeof(WCHAR) * CODEPAGE_MAXLEN) {
175 RtlCopyMemory(&Ext2Global->Codepage.PageName[0],
177 }
178 } else if (ValueType == REG_SZ && wcslen(ValueName) == wcslen(HIDING_PREFIX) &&
180
181 if (ValueData && ValueLength <= sizeof(WCHAR) * HIDINGPAT_LEN) {
184 }
185 } else if (ValueType == REG_SZ && wcslen(ValueName) == wcslen(HIDING_SUFFIX) &&
187
188 if (ValueData && ValueLength <= sizeof(WCHAR) * HIDINGPAT_LEN) {
191 }
192 }
193
194
195 return STATUS_SUCCESS;
196}
197
200{
202 int i = 0;
204
206
207 /*
208 * 1 writing support
209 */
210 QueryTable[i].Flags = 0;
217 i++;
218
219 /*
220 * 2 checking bitmap
221 */
222 QueryTable[i].Flags = 0;
229 i++;
230
231 /*
232 * 3 force writing
233 */
234 QueryTable[i].Flags = 0;
241 i++;
242
243 /*
244 * 4 automount
245 */
246 QueryTable[i].Flags = 0;
253 i++;
254
255 /*
256 * 5 codepage
257 */
258 QueryTable[i].Flags = 0;
265 i++;
266
267 /*
268 * 6 hidden prefix
269 */
270 QueryTable[i].Flags = 0;
277 i++;
278
279
280 /*
281 * 7 hidden suffix
282 */
283 QueryTable[i].Flags = 0;
290 i++;
291
294 RegistryPath->Buffer,
295 &QueryTable[0],
296 NULL,
297 NULL
298 );
299
300 return NT_SUCCESS(Status);
301}
302
303
306{
307 UNICODE_STRING ParameterPath;
308 UNICODE_STRING UniName;
309 ANSI_STRING AnsiName;
310
311 ULONG WritingSupport = 0;
312 ULONG CheckingBitmap = 0;
313 ULONG Ext3ForceWriting = 0;
314 ULONG AutoMount = 0;
315
316 WCHAR UniBuffer[CODEPAGE_MAXLEN];
318
320
321 ParameterPath.Length = 0;
322 ParameterPath.MaximumLength =
323 RegistryPath->Length + sizeof(PARAMETERS_KEY) + sizeof(WCHAR);
324 ParameterPath.Buffer =
326 PagedPool,
327 ParameterPath.MaximumLength,
328 'LG2E'
329 );
330 if (!ParameterPath.Buffer) {
331 DbgBreak();
332 DEBUG(DL_ERR, ( "Ex2QueryParameters: failed to allocate Parameters...\n"));
333 return FALSE;
334 }
335
336 RtlCopyUnicodeString(&ParameterPath, RegistryPath);
338
339 /* enable automount of ext2/3/4 volumes */
341
342 /* query parameter settings from registry */
343 Ext2QueryGlobalParameters(&ParameterPath);
344
345 /* set global codepage settings */
346 if (wcslen(&Ext2Global->Codepage.PageName[0])) {
347 UniName.Length = sizeof(WCHAR) * wcslen(&Ext2Global->Codepage.PageName[0]);
348 UniName.MaximumLength = CODEPAGE_MAXLEN * sizeof(WCHAR);
349 UniName.Buffer = &Ext2Global->Codepage.PageName[0];
351 AnsiName.Length = 0;
352 AnsiName.Buffer = &Ext2Global->Codepage.AnsiName[0];
354 &AnsiName,
355 &UniName,
356 FALSE);
357 if (!NT_SUCCESS(Status)) {
358 DEBUG(DL_ERR, ( "Ext2QueryParameters: Wrong CodePage %wZ ...\n", &UniName));
359 RtlCopyMemory(&(Ext2Global->Codepage.AnsiName[0]),"default\0", 8);
360 }
361 } else {
362 DEBUG(DL_ERR, ( "Ext2QueryParameters: CodePage not specified.\n"));
363 RtlCopyMemory(&(Ext2Global->Codepage.AnsiName[0]),"default\0", 8);
364 }
365 Ext2Global->Codepage.AnsiName[CODEPAGE_MAXLEN - 1] = 0;
366
367
368 /* set global hidden prefix pattern */
369 if (wcslen(&Ext2Global->wHidingPrefix[0])) {
370 UniName.Length = sizeof(WCHAR) * wcslen(&Ext2Global->wHidingPrefix[0]);
371 UniName.MaximumLength = HIDINGPAT_LEN * sizeof(WCHAR);
372 UniName.Buffer = &Ext2Global->wHidingPrefix[0];
373 AnsiName.MaximumLength = HIDINGPAT_LEN;
374 AnsiName.Length = 0;
375 AnsiName.Buffer = &(Ext2Global->sHidingPrefix[0]);
376
378 &AnsiName,
379 &UniName,
380 FALSE);
381 if (NT_SUCCESS(Status)) {
383 } else {
384 DEBUG(DL_ERR, ( "Ext2QueryParameters: Wrong HidingPrefix ...\n"));
385 }
386 } else {
387 DEBUG(DL_ERR, ( "Ext2QueryParameters: HidingPrefix not specified.\n"));
388 }
390
391
392 /* set global hidden suffix pattern */
393 if (wcslen(&Ext2Global->wHidingSuffix[0])) {
394 UniName.Length = sizeof(WCHAR) * wcslen(&Ext2Global->wHidingSuffix[0]);
395 UniName.MaximumLength = HIDINGPAT_LEN * sizeof(WCHAR);
396 UniName.Buffer = &Ext2Global->wHidingSuffix[0];
397 AnsiName.MaximumLength = HIDINGPAT_LEN;
398 AnsiName.Length = 0;
399 AnsiName.Buffer = &(Ext2Global->sHidingSuffix[0]);
400
402 &AnsiName,
403 &UniName,
404 FALSE);
405 if (NT_SUCCESS(Status)) {
407 } else {
408 DEBUG(DL_ERR, ( "Ext2QueryParameters: Wrong HidingSuffix ...\n"));
409 }
410 } else {
411 DEBUG(DL_ERR, ( "Ext2QueryParameters: HidingSuffix not specified.\n"));
412 }
414
415 Ext2Global->RegistryPath.Buffer = ParameterPath.Buffer;
420
421 return TRUE;
422}
423
424
425#define NLS_OEM_LEAD_BYTE_INFO (*NlsOemLeadByteInfo)
426
427#ifndef __REACTOS__
428#define FsRtlIsLeadDbcsCharacter(DBCS_CHAR) ( \
429 (BOOLEAN)((UCHAR)(DBCS_CHAR) < 0x80 ? FALSE : \
430 (NLS_MB_CODE_PAGE_TAG && \
431 (NLS_OEM_LEAD_BYTE_INFO[(UCHAR)(DBCS_CHAR)] != 0))) \
432)
433#endif
434
435VOID
437{
438 /* Verify ERESOURCE alignment in structures */
440 CL_ASSERT((FIELD_OFFSET(EXT2_VCB, MainResource) & 7) == 0);
441 CL_ASSERT((FIELD_OFFSET(EXT2_VCB, PagingIoResource) & 7) == 0);
442 CL_ASSERT((FIELD_OFFSET(EXT2_VCB, MetaInode) & 7) == 0);
443 CL_ASSERT((FIELD_OFFSET(EXT2_VCB, MetaBlock) & 7) == 0);
444 CL_ASSERT((FIELD_OFFSET(EXT2_VCB, McbLock) & 7) == 0);
445 CL_ASSERT((FIELD_OFFSET(EXT2_VCB, FcbLock) & 7) == 0);
446 CL_ASSERT((FIELD_OFFSET(EXT2_VCB, bd.bd_bh_lock) & 7) == 0);
447 CL_ASSERT((FIELD_OFFSET(EXT2_VCB, sbi.s_gd_lock) & 7) == 0);
448 CL_ASSERT((FIELD_OFFSET(EXT2_FCBVCB, MainResource) & 7) == 0);
449 CL_ASSERT((FIELD_OFFSET(EXT2_FCBVCB, PagingIoResource) & 7) == 0);
450 CL_ASSERT((FIELD_OFFSET(EXT2_FCB, MainResource) & 7) == 0);
451 CL_ASSERT((FIELD_OFFSET(EXT2_FCB, PagingIoResource) & 7) == 0);
452}
453
454/*
455 * NAME: DriverEntry
456 * FUNCTION: Called by the system to initalize the driver
457 *
458 * ARGUMENTS:
459 * DriverObject = object describing this driver
460 * RegistryPath = path to our configuration entries
461 * RETURNS: Success or failure
462 */
463#ifdef __REACTOS__
465#else
467#endif
471)
472{
473 PDEVICE_OBJECT DiskdevObject = NULL;
474 PDEVICE_OBJECT CdromdevObject = NULL;
477
479 PCACHE_MANAGER_CALLBACKS CacheManagerCallbacks;
480
482
483 int rc = 0;
484 BOOLEAN linux_lib_inited = FALSE;
485 BOOLEAN journal_module_inited = FALSE;
486
487 /* Verity super block ... */
488 ASSERT(sizeof(EXT2_SUPER_BLOCK) == 1024);
489 ASSERT(FIELD_OFFSET(EXT2_SUPER_BLOCK, s_magic) == 56);
490
491 DbgPrint(
492 "Ext2Fsd --"
493#ifdef _WIN2K_TARGET_
494 " Win2k --"
495#endif
496 " Version "
498#if EXT2_DEBUG
499 " Checked"
500#else
501 " Free"
502#endif
503 " -- "
504 __DATE__ " "
505 __TIME__ ".\n");
506
507 DEBUG(DL_FUN, ( "Ext2 DriverEntry ...\n"));
508
509 /* initialize winlib structures */
510 if (ext2_init_linux()) {
512 goto errorout;
513 }
514 linux_lib_inited = TRUE;
515
516 /* initialize journal module structures */
518 if (rc != 0) {
520 goto errorout;
521 }
522 journal_module_inited = TRUE;
523
524 /* allocate memory for Ext2Global */
526 if (!Ext2Global) {
528 goto errorout;
529 }
530
531 /* initialize Ext2Global */
535
538
539 /* query registry settings */
541
542 /* create Ext2Fsd cdrom fs deivce */
546 0,
547 &DeviceName,
549 0,
550 FALSE,
551 &CdromdevObject );
552
553 if (!NT_SUCCESS(Status)) {
554 DEBUG(DL_ERR, ( "IoCreateDevice cdrom device object error.\n"));
555 goto errorout;
556 }
557
558 /* create Ext2Fsd disk fs deivce */
562 0,
563 &DeviceName,
565 0,
566 FALSE,
567 &DiskdevObject );
568
569 if (!NT_SUCCESS(Status)) {
570 DEBUG(DL_ERR, ( "IoCreateDevice disk device object error.\n"));
571 goto errorout;
572 }
573
577 if (!NT_SUCCESS(Status)) {
578 goto errorout;
579 }
580
581 /* start resource reaper thread */
585 if (!NT_SUCCESS(Status)) {
587 goto errorout;
588 }
589
593 if (!NT_SUCCESS(Status)) {
596 goto errorout;
597 }
598
599#ifdef _PNP_POWER_
600 DiskdevObject->DeviceObjectExtension->PowerControlNeeded = FALSE;
601 CdromdevObject->DeviceObjectExtension->PowerControlNeeded = FALSE;
602#endif
603
604 /* initializing */
605 Ext2Global->DiskdevObject = DiskdevObject;
606 Ext2Global->CdromdevObject = CdromdevObject;
607
610 DriverObject->MajorFunction[IRP_MJ_READ] = Ext2BuildRequest;
612
615
618
621
626
629
631
632#if (_WIN32_WINNT >= 0x0500)
633 DriverObject->MajorFunction[IRP_MJ_PNP] = Ext2BuildRequest;
634#endif //(_WIN32_WINNT >= 0x0500)
635
636#if EXT2_UNLOAD
637 DriverObject->DriverUnload = DriverUnload;
638#else
639 DriverObject->DriverUnload = NULL;
640#endif
641
642 //
643 // Initialize the fast I/O entry points
644 //
645
647
659
668
669 DriverObject->FastIoDispatch = FastIoDispatch;
670
671 //
672 // initializing structure sizes for statistics
673 // 1 means flexible/not fixed for all allocations (for different volumes).
674 //
678
680 Ext2Global->PerfStat.Unit.Slot[PS_VCB] = sizeof(EXT2_VCB); /* 1 */
681 Ext2Global->PerfStat.Unit.Slot[PS_FCB] = sizeof(EXT2_FCB); /* 2 */
682 Ext2Global->PerfStat.Unit.Slot[PS_CCB] = sizeof(EXT2_CCB); /* 3 */
683 Ext2Global->PerfStat.Unit.Slot[PS_MCB] = sizeof(EXT2_MCB); /* 4 */
684 Ext2Global->PerfStat.Unit.Slot[PS_EXTENT] = sizeof(EXT2_EXTENT); /* 5 */
686 Ext2Global->PerfStat.Unit.Slot[PS_VPB] = sizeof(VPB); /* 7 */
692 Ext2Global->PerfStat.Unit.Slot[PS_DISK_EVENT] = sizeof(KEVENT); /* d */
696 Ext2Global->PerfStat.Unit.Slot[PS_DENTRY] = sizeof(struct dentry); /* 11 */
697 Ext2Global->PerfStat.Unit.Slot[PS_BUFF_HEAD] = sizeof(struct buffer_head); /* 12 */
698
699 switch ( MmQuerySystemSize() ) {
700
701 case MmSmallSystem:
702
703 Ext2Global->MaxDepth = 64;
704 break;
705
706 case MmMediumSystem:
707
708 Ext2Global->MaxDepth = 128;
709 break;
710
711 case MmLargeSystem:
712
713 Ext2Global->MaxDepth = 256;
714 break;
715 }
716
717 //
718 // Initialize the Cache Manager callbacks
719 //
720
721 CacheManagerCallbacks = &(Ext2Global->CacheManagerCallbacks);
722 CacheManagerCallbacks->AcquireForLazyWrite = Ext2AcquireForLazyWrite;
723 CacheManagerCallbacks->ReleaseFromLazyWrite = Ext2ReleaseFromLazyWrite;
724 CacheManagerCallbacks->AcquireForReadAhead = Ext2AcquireForReadAhead;
725 CacheManagerCallbacks->ReleaseFromReadAhead = Ext2ReleaseFromReadAhead;
726
731
732
733#ifndef _WIN2K_TARGET_
734 //
735 // Initialize FS Filter callbacks
736 //
737
742
743#endif
744
745 //
746 // Initialize the global data
747 //
748
750 NULL,
751 NULL,
752 0,
753 sizeof(EXT2_IRP_CONTEXT),
754 'PRIE',
755 0 );
756
758 NULL,
759 NULL,
760 0,
761 sizeof(EXT2_FCB),
762 'BCFE',
763 0 );
764
766 NULL,
767 NULL,
768 0,
769 sizeof(EXT2_CCB),
770 'BCCE',
771 0 );
772
774 NULL,
775 NULL,
776 0,
777 sizeof(EXT2_MCB),
778 'BCME',
779 0 );
780
782 NULL,
783 NULL,
784 0,
785 sizeof(EXT2_EXTENT),
786 'STXE',
787 0 );
788
790 NULL,
791 NULL,
792 0,
793 sizeof(struct dentry),
794 'TNED',
795 0 );
796
799
800#if EXT2_DEBUG
802#endif
803
805
806 Ext2Global->Codepage.PageTable =
807 load_nls(Ext2Global->Codepage.AnsiName);
808
809 /* register file system devices for disk and cdrom */
810 IoRegisterFileSystem(DiskdevObject);
811 ObReferenceObject(DiskdevObject);
812
813 IoRegisterFileSystem(CdromdevObject);
814 ObReferenceObject(CdromdevObject);
815
816errorout:
817
818 if (!NT_SUCCESS(Status)) {
819
820 /*
821 * stop reaper thread ...
822 */
823
824
825 /*
826 * cleanup resources ...
827 */
828
829 if (Ext2Global) {
831 Ext2FreePool(Ext2Global, 'LG2E');
832 }
833
834 if (CdromdevObject) {
835 IoDeleteDevice(CdromdevObject);
836 }
837
838 if (DiskdevObject) {
839 IoDeleteDevice(DiskdevObject);
840 }
841
842 if (journal_module_inited) {
843 /* cleanup journal related caches */
845 }
846
847 if (linux_lib_inited) {
848 /* cleanup linux lib */
850 }
851 }
852
853 return Status;
854}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define DEBUG(args)
Definition: rdesktop.h:129
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:843
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
#define PS_FCB
Definition: common.h:18
#define EXT2_PERF_STAT_VER2
Definition: common.h:116
struct _EXT2_PERF_STATISTICS_V2 EXT2_PERF_STATISTICS_V2
#define PS_DISK_EVENT
Definition: common.h:29
#define PS_CCB
Definition: common.h:19
#define PS_EXT2_INODE
Definition: common.h:33
#define PS_FILE_NAME
Definition: common.h:24
#define PS_RW_CONTEXT
Definition: common.h:22
#define PS_MCB
Definition: common.h:20
#define HIDINGPAT_LEN
Definition: common.h:160
#define CODEPAGE_MAXLEN
Definition: common.h:159
#define PS_IRP_CONTEXT
Definition: common.h:16
#define PS_MCB_NAME
Definition: common.h:25
#define PS_DIR_PATTERN
Definition: common.h:28
#define PS_DISK_BUFFER
Definition: common.h:30
#define PS_VPB
Definition: common.h:23
#define PS_INODE_NAME
Definition: common.h:26
#define PS_VCB
Definition: common.h:17
#define PS_BUFF_HEAD
Definition: common.h:35
#define PS_BLOCK_DATA
Definition: common.h:31
#define PS_DENTRY
Definition: common.h:34
#define EXT2_PERF_STAT_MAGIC
Definition: common.h:115
#define PS_DIR_ENTRY
Definition: common.h:27
#define PS_EXTENT
Definition: common.h:21
CHAR gDate[]
Definition: init.c:24
CHAR gVersion[]
Definition: init.c:22
PEXT2_GLOBAL Ext2Global
Definition: init.c:16
NTSTATUS Ext2RegistryQueryCallback(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
Definition: init.c:115
VOID Ext2EresourceAlignmentChecking()
Definition: init.c:436
BOOLEAN Ext2QueryRegistrySettings(IN PUNICODE_STRING RegistryPath)
Definition: init.c:305
NTSTATUS Ext2QueryGlobalParameters(IN PUNICODE_STRING RegistryPath)
Definition: init.c:199
CHAR gTime[]
Definition: init.c:23
#define KEVENT
Definition: env_spec_w32.h:69
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
#define ExDeleteResourceLite(res)
Definition: env_spec_w32.h:647
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define PagedPool
Definition: env_spec_w32.h:308
#define EXT2_CHECKING_BITMAP
Definition: ext2fs.h:593
VOID Ext2FreePool(IN PVOID P, IN ULONG Tag)
Definition: debug.c:2697
#define AUTO_MOUNT
Definition: ext2fs.h:152
struct ext2_icb EXT2_IRP_CONTEXT
#define HIDING_PREFIX
Definition: ext2fs.h:150
BOOLEAN 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:172
BOOLEAN 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:517
VOID Ext2bhReaperThread(PVOID Context)
Definition: memory.c:3239
VOID Ext2McbReaperThread(PVOID Context)
Definition: memory.c:3055
struct _EXT2_CCB EXT2_CCB
BOOLEAN 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:280
struct _EXT2_EXTENT EXT2_EXTENT
BOOLEAN Ext2FastIoUnlockAllByKey(IN PFILE_OBJECT FileObject, IN PEPROCESS Process, IN ULONG Key, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:831
NTSTATUS Ext2StartReaper(PEXT2_REAPER, EXT2_REAPER_RELEASE)
Definition: memory.c:3478
struct _EXT2_GLOBAL EXT2_GLOBAL
#define VOLUMES_KEY
Definition: ext2fs.h:143
PVOID Ext2AllocatePool(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag)
Definition: debug.c:2684
BOOLEAN 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:207
@ EXT2FGD
Definition: ext2fs.h:461
BOOLEAN Ext2AcquireForLazyWrite(IN PVOID Context, IN BOOLEAN Wait)
Definition: cmcb.c:27
ULONG Ext2GetProcessNameOffset(VOID)
struct _EXT2_VCB EXT2_VCB
#define PARAMETERS_KEY
Definition: ext2fs.h:142
NTSTATUS Ext2ReleaseFileForModWrite(IN PFILE_OBJECT FileObject, IN PERESOURCE ResourceToRelease, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1110
VOID Ext2AcquireForCreateSection(IN PFILE_OBJECT FileObject)
Definition: fastio.c:1043
#define CL_ASSERT(cond)
Definition: ext2fs.h:132
VOID Ext2ReleaseFromLazyWrite(IN PVOID Context)
Definition: cmcb.c:63
BOOLEAN 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:396
#define DEVICE_NAME
Definition: ext2fs.h:137
#define SetLongFlag(_F, _SF)
Definition: ext2fs.h:258
#define DOS_DEVICE_NAME
Definition: ext2fs.h:159
#define CHECKING_BITMAP
Definition: ext2fs.h:147
VOID Ext2UnloadAllNls()
Definition: nls.c:181
BOOLEAN Ext2NoOpAcquire(IN PVOID Fcb, IN BOOLEAN Wait)
Definition: cmcb.c:138
NTSTATUS Ext2ReleaseFileForCcFlush(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1156
#define EXT2FSD_VERSION
Definition: ext2fs.h:51
ULONG ProcessNameOffset
#define ClearLongFlag(_F, _SF)
Definition: ext2fs.h:259
int Ext2LoadAllNls()
Definition: nls.c:118
NTSTATUS Ext2PreAcquireForCreateSection(IN PFS_FILTER_CALLBACK_DATA cd, OUT PVOID *cc)
Definition: fastio.c:1178
BOOLEAN Ext2AcquireForReadAhead(IN PVOID Context, IN BOOLEAN Wait)
Definition: cmcb.c:92
NTSTATUS Ext2AcquireFileForCcFlush(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1135
VOID Ext2ReleaseFromReadAhead(IN PVOID Context)
Definition: cmcb.c:117
#define HIDING_SUFFIX
Definition: ext2fs.h:151
#define CDROM_NAME
Definition: ext2fs.h:138
void ext2_destroy_linux()
Definition: linux.c:1019
BOOLEAN Ext2FastIoUnlockAll(IN PFILE_OBJECT FileObject, IN PEPROCESS Process, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:736
int ext2_init_linux()
Definition: linux.c:1004
#define CODEPAGE_NAME
Definition: ext2fs.h:149
#define DbgBreak()
Definition: ext2fs.h:46
BOOLEAN 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:64
VOID Ext2StopReaper(PEXT2_REAPER Reaper)
Definition: memory.c:3546
#define EXT2_SUPPORT_WRITING
Definition: ext2fs.h:591
VOID Ext2FcbReaperThread(PVOID Context)
Definition: memory.c:3391
struct _EXT2_FCB EXT2_FCB
#define EXT2_AUTO_MOUNT
Definition: ext2fs.h:594
BOOLEAN Ext2FastIoQueryNetworkOpenInfo(IN PFILE_OBJECT FileObject, IN BOOLEAN Wait, OUT PFILE_NETWORK_OPEN_INFORMATION Buffer, OUT PIO_STATUS_BLOCK IoStatus, IN PDEVICE_OBJECT DeviceObject)
#define DL_ERR
Definition: ext2fs.h:1434
VOID Ext2ReleaseForCreateSection(IN PFILE_OBJECT FileObject)
Definition: fastio.c:1062
#define EXT3_FORCEWRITING
Definition: ext2fs.h:148
#define EXT3_FORCE_WRITING
Definition: ext2fs.h:592
struct ext3_dir_entry_2 EXT2_DIR_ENTRY2
Definition: ext2fs.h:109
VOID Ext2NoOpRelease(IN PVOID Fcb)
Definition: cmcb.c:153
NTSTATUS Ext2BuildRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _EXT2_MCB EXT2_MCB
Definition: ext2fs.h:484
#define WRITING_SUPPORT
Definition: ext2fs.h:146
BOOLEAN 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:629
struct _EXT2_RW_CONTEXT EXT2_RW_CONTEXT
#define DL_FUN
Definition: ext2fs.h:1437
#define EXT2_DEBUG
Definition: ext2fs.h:34
NTSTATUS Ext2AcquireFileForModWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER EndingOffset, OUT PERESOURCE *ResourceToRelease, IN PDEVICE_OBJECT DeviceObject)
Definition: fastio.c:1081
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:25
GLdouble s
Definition: gl.h:2039
GLdouble GLdouble t
Definition: gl.h:2047
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 DbgPrint
Definition: hal.h:12
_In_ GUID _In_ PVOID ValueData
Definition: hubbusif.h:312
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
static DRIVER_UNLOAD DriverUnload
Definition: kbdclass.c:17
#define REG_SZ
Definition: layer.c:22
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
Definition: lookas.c:170
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:218
static char DosDeviceName[DEVICE_SIZE]
Definition: lsdd.c:26
MM_SYSTEMSIZE NTAPI MmQuerySystemSize(VOID)
Definition: mmsup.c:257
#define ASSERT(a)
Definition: mode.c:44
#define DECLARE_EXIT(X)
Definition: module.h:282
#define DECLARE_INIT(X)
Definition: module.h:281
struct nls_table * load_nls(char *)
Definition: nls_base.c:218
#define LOAD_MODULE(X)
Definition: module.h:284
#define UNLOAD_MODULE(X)
Definition: module.h:288
#define _WIN2K_TARGET_
Definition: module.h:23
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
Definition: rtlfuncs.h:4219
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
Definition: rtlfuncs.h:4220
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RTL_REGISTRY_ABSOLUTE
Definition: nt_native.h:161
#define REG_NONE
Definition: nt_native.h:1492
NTSTATUS NTAPI FsRtlRegisterFileSystemFilterCallbacks(PDRIVER_OBJECT FilterDriverObject, PFS_FILTER_CALLBACKS Callbacks)
Definition: fastio.c:2014
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
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
VOID NTAPI IoRegisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:987
FAST_IO_DISPATCH FastIoDispatch
Definition: null.c:15
unsigned short USHORT
Definition: pedump.c:61
#define FILE_DEVICE_DISK_FILE_SYSTEM
Definition: winioctl.h:53
#define FILE_DEVICE_CD_ROM_FILE_SYSTEM
Definition: winioctl.h:48
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_QUERY_VOLUME_INFORMATION
Definition: rdpdr.c:50
#define IRP_MJ_LOCK_CONTROL
Definition: rdpdr.c:53
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
static void __exit journal_exit(void)
Definition: replay.c:1641
static int __init journal_init(void)
Definition: replay.c:1628
#define REG_DWORD
Definition: sdbapi.c:596
_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)
#define STATUS_SUCCESS
Definition: shellext.h:65
USHORT MaximumLength
Definition: env_spec_w32.h:377
PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite
Definition: cctypes.h:39
PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite
Definition: cctypes.h:40
PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead
Definition: cctypes.h:41
PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead
Definition: cctypes.h:42
FAST_IO_DISPATCH FastIoDispatch
Definition: ext2fs.h:526
struct _EXT2_GLOBAL::@698 Codepage
UNICODE_STRING RegistryPath
Definition: ext2fs.h:577
CACHE_MANAGER_CALLBACKS CacheManagerNoOpCallbacks
Definition: ext2fs.h:533
NPAGED_LOOKASIDE_LIST Ext2ExtLookasideList
Definition: ext2fs.h:557
NPAGED_LOOKASIDE_LIST Ext2McbLookasideList
Definition: ext2fs.h:556
NPAGED_LOOKASIDE_LIST Ext2IrpContextLookasideList
Definition: ext2fs.h:553
NPAGED_LOOKASIDE_LIST Ext2FcbLookasideList
Definition: ext2fs.h:554
EXT2_IDENTIFIER Identifier
Definition: ext2fs.h:516
FS_FILTER_CALLBACKS FilterCallbacks
Definition: ext2fs.h:529
PDEVICE_OBJECT DiskdevObject
Definition: ext2fs.h:539
NPAGED_LOOKASIDE_LIST Ext2DentryLookasideList
Definition: ext2fs.h:558
EXT2_REAPER bhReaper
Definition: ext2fs.h:550
USHORT MaxDepth
Definition: ext2fs.h:559
WCHAR wHidingSuffix[HIDINGPAT_LEN]
Definition: ext2fs.h:570
EXT2_PERF_STATISTICS_V2 PerfStat
Definition: ext2fs.h:582
CHAR sHidingSuffix[HIDINGPAT_LEN]
Definition: ext2fs.h:574
NPAGED_LOOKASIDE_LIST Ext2CcbLookasideList
Definition: ext2fs.h:555
BOOLEAN bHidingSuffix
Definition: ext2fs.h:573
ERESOURCE Resource
Definition: ext2fs.h:519
ULONG Flags
Definition: ext2fs.h:523
WCHAR wHidingPrefix[HIDINGPAT_LEN]
Definition: ext2fs.h:569
BOOLEAN bHidingPrefix
Definition: ext2fs.h:571
EXT2_REAPER McbReaper
Definition: ext2fs.h:549
CHAR sHidingPrefix[HIDINGPAT_LEN]
Definition: ext2fs.h:572
CACHE_MANAGER_CALLBACKS CacheManagerCallbacks
Definition: ext2fs.h:532
LIST_ENTRY VcbList
Definition: ext2fs.h:545
EXT2_REAPER FcbReaper
Definition: ext2fs.h:548
PDEVICE_OBJECT CdromdevObject
Definition: ext2fs.h:542
EXT2_IDENTIFIER_TYPE Type
Definition: ext2fs.h:477
EXT2_STAT_ARRAY_V2 Unit
Definition: common.h:131
PFAST_IO_ACQUIRE_FOR_MOD_WRITE AcquireForModWrite
Definition: iotypes.h:1748
PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo
Definition: iotypes.h:1738
PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey
Definition: iotypes.h:1742
PFAST_IO_RELEASE_FOR_CCFLUSH ReleaseForCcFlush
Definition: iotypes.h:1760
PFAST_IO_WRITE FastIoWrite
Definition: iotypes.h:1736
PFAST_IO_UNLOCK_ALL FastIoUnlockAll
Definition: iotypes.h:1741
PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo
Definition: iotypes.h:1747
PFAST_IO_ACQUIRE_FOR_CCFLUSH AcquireForCcFlush
Definition: iotypes.h:1759
ULONG SizeOfFastIoDispatch
Definition: iotypes.h:1733
PFAST_IO_ACQUIRE_FILE AcquireFileForNtCreateSection
Definition: iotypes.h:1744
PFAST_IO_READ FastIoRead
Definition: iotypes.h:1735
PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo
Definition: iotypes.h:1737
PFAST_IO_LOCK FastIoLock
Definition: iotypes.h:1739
PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle
Definition: iotypes.h:1740
PFAST_IO_RELEASE_FILE ReleaseFileForNtCreateSection
Definition: iotypes.h:1745
PFAST_IO_RELEASE_FOR_MOD_WRITE ReleaseForModWrite
Definition: iotypes.h:1758
PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible
Definition: iotypes.h:1734
ULONG SizeOfFsFilterCallbacks
Definition: iotypes.h:7426
PFS_FILTER_CALLBACK PreAcquireForSectionSynchronization
Definition: iotypes.h:7428
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine
Definition: nt_native.h:109
USHORT MaximumLength
Definition: env_spec_w32.h:370
Definition: fs.h:117
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
ULONG Slot[PS_MAX_TYPE_V2]
Definition: common.h:67
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
Definition: wdfregistry.h:282
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG ValueLength
Definition: wdfregistry.h:275
#define IRP_MJ_QUERY_EA
#define IRP_MJ_FILE_SYSTEM_CONTROL
#define IRP_MJ_SET_VOLUME_INFORMATION
#define IRP_MJ_SET_EA
struct _FS_FILTER_CALLBACKS FS_FILTER_CALLBACKS
struct _VPB VPB
struct _FAST_IO_DISPATCH FAST_IO_DISPATCH
#define IRP_MJ_FLUSH_BUFFERS
#define IRP_MJ_SHUTDOWN
#define IRP_MJ_CLEANUP
@ MmLargeSystem
Definition: mmtypes.h:147
@ MmMediumSystem
Definition: mmtypes.h:146
@ MmSmallSystem
Definition: mmtypes.h:145
#define ObDereferenceObject
Definition: obfuncs.h:203
#define ObReferenceObject
Definition: obfuncs.h:204
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175
unsigned char BYTE
Definition: xxhash.c:193