ReactOS 0.4.15-dev-7918-g2a2556c
devctl.c File Reference
#include "ext2fs.h"
Include dependency graph for devctl.c:

Go to the source code of this file.

Functions

NTSTATUS Ext2DeviceControlCompletion (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
 
NTSTATUS Ext2DeviceControlNormal (IN PEXT2_IRP_CONTEXT IrpContext)
 
NTSTATUS Ext2ProcessGlobalProperty (IN PDEVICE_OBJECT DeviceObject, IN PEXT2_VOLUME_PROPERTY3 Property3, IN ULONG Length)
 
NTSTATUS Ext2ProcessVolumeProperty (IN PEXT2_VCB Vcb, IN PEXT2_VOLUME_PROPERTY3 Property3, IN ULONG Length)
 
NTSTATUS Ext2ProcessUserProperty (IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VOLUME_PROPERTY3 Property, IN ULONG Length)
 
NTSTATUS Ex2ProcessUserPerfStat (IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_QUERY_PERFSTAT QueryPerf, IN ULONG Length)
 
NTSTATUS Ex2ProcessMountPoint (IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_MOUNT_POINT MountPoint, IN ULONG Length)
 
NTSTATUS Ext2DeviceControl (IN PEXT2_IRP_CONTEXT IrpContext)
 

Variables

PEXT2_GLOBAL Ext2Global
 
CHAR gVersion []
 
CHAR gTime []
 
CHAR gDate []
 

Function Documentation

◆ Ex2ProcessMountPoint()

NTSTATUS Ex2ProcessMountPoint ( IN PEXT2_IRP_CONTEXT  IrpContext,
IN PEXT2_MOUNT_POINT  MountPoint,
IN ULONG  Length 
)

Definition at line 723 of file devctl.c.

728{
731 WCHAR Buffer[] = L"\\DosDevices\\Global\\Z:";
733
735
736 _SEH2_TRY {
737
738 ASSERT(IrpContext != NULL);
739 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
740 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
741
742 DeviceObject = IrpContext->DeviceObject;
746 }
747
748 if (Length != sizeof(EXT2_MOUNT_POINT) ||
749 MountPoint->Magic != EXT2_APP_MOUNTPOINT_MAGIC) {
752 }
753
755 Buffer[12] = MountPoint->Link[0];
756
757 switch (MountPoint->Command) {
758
760 RtlInitUnicodeString(&Target, &MountPoint->Name[0]);
762 break;
763
766 break;
767
768 default:
770 }
771
772 } _SEH2_FINALLY {
773
774 if (!IrpContext->ExceptionInProgress) {
775 Ext2CompleteIrpContext(IrpContext, status);
776 }
777 } _SEH2_END;
778
779 return status;
780}
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
#define NULL
Definition: types.h:112
#define APP_CMD_DEL_DOS_SYMLINK
Definition: common.h:263
#define EXT2_APP_MOUNTPOINT_MAGIC
Definition: common.h:252
#define APP_CMD_ADD_DOS_SYMLINK
Definition: common.h:262
@ EXT2ICX
Definition: ext2fs.h:465
#define IsExt2FsDevice(DO)
Definition: ext2fs.h:616
NTSTATUS Ext2CompleteIrpContext(IN PEXT2_IRP_CONTEXT IrpContext, IN NTSTATUS Status)
Definition: read.c:32
#define _SEH2_FINALLY
Definition: filesup.c:21
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define _SEH2_LEAVE
Definition: filesup.c:20
#define ASSERT(a)
Definition: mode.c:44
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: ps.c:97
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
static int Link(const char **args)
Definition: vfdcmd.c:2414
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by Ext2DeviceControl().

◆ Ex2ProcessUserPerfStat()

NTSTATUS Ex2ProcessUserPerfStat ( IN PEXT2_IRP_CONTEXT  IrpContext,
IN PEXT2_QUERY_PERFSTAT  QueryPerf,
IN ULONG  Length 
)

Definition at line 640 of file devctl.c.

645{
646
647#ifndef __REACTOS__
649#endif
651
652 BOOLEAN GlobalDataResourceAcquired = FALSE;
654
655 _SEH2_TRY {
656
657 ASSERT(IrpContext != NULL);
658 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
659 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
660
661 DeviceObject = IrpContext->DeviceObject;
663
664 if (QueryPerf->Magic != EXT2_QUERY_PERFSTAT_MAGIC) {
667 }
668
669 if (QueryPerf->Command != IOCTL_APP_QUERY_PERFSTAT) {
672 }
673
678 }
679
681 GlobalDataResourceAcquired = TRUE;
682
684 QueryPerf->Flags = EXT2_QUERY_PERFSTAT_VER2;
685 QueryPerf->PerfStatV2 = Ext2Global->PerfStat;
686 } else {
687 memcpy(&QueryPerf->PerfStatV1.Irps[0], &Ext2Global->PerfStat.Irps[0],
689 memcpy(&QueryPerf->PerfStatV1.Unit, &Ext2Global->PerfStat.Unit,
690 sizeof(EXT2_STAT_ARRAY_V1));
691 memcpy(&QueryPerf->PerfStatV1.Current, &Ext2Global->PerfStat.Current,
692 sizeof(EXT2_STAT_ARRAY_V1));
693 memcpy(&QueryPerf->PerfStatV1.Size, &Ext2Global->PerfStat.Size,
694 sizeof(EXT2_STAT_ARRAY_V1));
695 memcpy(&QueryPerf->PerfStatV1.Total, &Ext2Global->PerfStat.Total,
696 sizeof(EXT2_STAT_ARRAY_V1));
697 }
698
699 } else {
702 }
703
704 if (NT_SUCCESS(Status)) {
705 IrpContext->Irp->IoStatus.Information = Length;
706 }
707
708 } _SEH2_FINALLY {
709
710 if (GlobalDataResourceAcquired) {
712 }
713
714 if (!IrpContext->ExceptionInProgress) {
715 Ext2CompleteIrpContext(IrpContext, Status);
716 }
717 } _SEH2_END
718
719 return Status;
720}
unsigned char BOOLEAN
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define EXT2_QUERY_PERFSTAT_SZV1
Definition: common.h:248
#define IOCTL_APP_QUERY_PERFSTAT
Definition: common.h:8
#define EXT2_QUERY_PERFSTAT_VER2
Definition: common.h:236
#define EXT2_QUERY_PERFSTAT_SZV2
Definition: common.h:249
#define EXT2_QUERY_PERFSTAT_MAGIC
Definition: common.h:235
#define ExAcquireResourceSharedLite(res, wait)
Definition: env_spec_w32.h:621
PEXT2_GLOBAL Ext2Global
Definition: init.c:16
Unit
Definition: gdiplusenums.h:26
Status
Definition: gdiplustypes.h:25
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
#define Vcb
Definition: cdprocs.h:1415
EXT2_PERF_STATISTICS_V2 PerfStat
Definition: ext2fs.h:582
ERESOURCE Resource
Definition: ext2fs.h:519
EXT2_STAT_ARRAY_V2 Unit
Definition: common.h:131
struct _EXT2_PERF_STATISTICS_V2::@685 Irps[IRP_MJ_MAXIMUM_FUNCTION+1]
EXT2_STAT_ARRAY_V2 Total
Definition: common.h:140
EXT2_STAT_ARRAY_V2 Size
Definition: common.h:137
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by Ext2DeviceControl().

◆ Ext2DeviceControl()

NTSTATUS Ext2DeviceControl ( IN PEXT2_IRP_CONTEXT  IrpContext)

Definition at line 783 of file devctl.c.

784{
785 PIRP Irp;
787 ULONG code;
790
791 ASSERT(IrpContext);
792
793 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
794 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
795
796 Irp = IrpContext->Irp;
797
799
800 code = irpSp->Parameters.DeviceIoControl.IoControlCode;
801 length = irpSp->Parameters.DeviceIoControl.OutputBufferLength;
802
803 switch (code) {
804
807 IrpContext,
808 Irp->AssociatedIrp.SystemBuffer,
809 length
810 );
811 break;
812
815 IrpContext,
816 Irp->AssociatedIrp.SystemBuffer,
817 length
818 );
819 break;
820
823 IrpContext,
824 Irp->AssociatedIrp.SystemBuffer,
825 length
826 );
827 break;
828
829#if EXT2_UNLOAD
830 case IOCTL_PREPARE_TO_UNLOAD:
831 Status = Ext2PrepareToUnload(IrpContext);
832 break;
833#endif
834 default:
835 Status = Ext2DeviceControlNormal(IrpContext);
836 }
837
838 return Status;
839}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
_In_ PIRP Irp
Definition: csq.h:116
#define IOCTL_APP_MOUNT_POINT
Definition: common.h:11
#define IOCTL_APP_VOLUME_PROPERTY
Definition: common.h:5
NTSTATUS Ext2DeviceControlNormal(IN PEXT2_IRP_CONTEXT IrpContext)
Definition: devctl.c:65
NTSTATUS Ext2ProcessUserProperty(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VOLUME_PROPERTY3 Property, IN ULONG Length)
Definition: devctl.c:591
NTSTATUS Ex2ProcessMountPoint(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_MOUNT_POINT MountPoint, IN ULONG Length)
Definition: devctl.c:723
NTSTATUS Ex2ProcessUserPerfStat(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_QUERY_PERFSTAT QueryPerf, IN ULONG Length)
Definition: devctl.c:640
NTSTATUS Ext2PrepareToUnload(IN PEXT2_IRP_CONTEXT IrpContext)
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
Definition: inflate.c:139
uint32_t ULONG
Definition: typedefs.h:59
irpSp
Definition: iofuncs.h:2719

Referenced by Ext2DispatchRequest().

◆ Ext2DeviceControlCompletion()

NTSTATUS Ext2DeviceControlCompletion ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp,
IN PVOID  Context 
)

Definition at line 50 of file devctl.c.

55{
56 if (Irp->PendingReturned) {
58 }
59
60 return STATUS_SUCCESS;
61}
IoMarkIrpPending(Irp)

Referenced by Ext2DeviceControlNormal().

◆ Ext2DeviceControlNormal()

NTSTATUS Ext2DeviceControlNormal ( IN PEXT2_IRP_CONTEXT  IrpContext)

Definition at line 65 of file devctl.c.

66{
70
72
73 PIRP Irp;
75 PIO_STACK_LOCATION NextIrpSp;
76
78
79 _SEH2_TRY {
80
81 ASSERT(IrpContext != NULL);
82
83 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
84 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
85
87
88 DeviceObject = IrpContext->DeviceObject;
89
93 }
94
95 Irp = IrpContext->Irp;
97
98 Vcb = (PEXT2_VCB) IrpSp->FileObject->FsContext;
99
100 if (!((Vcb) && (Vcb->Identifier.Type == EXT2VCB) &&
101 (Vcb->Identifier.Size == sizeof(EXT2_VCB)))) {
104 }
105
106 TargetDeviceObject = Vcb->TargetDeviceObject;
107
108 //
109 // Pass on the IOCTL to the driver below
110 //
111
113
114 NextIrpSp = IoGetNextIrpStackLocation( Irp );
115 *NextIrpSp = *IrpSp;
116
118 Irp,
120 NULL,
121 FALSE,
122 TRUE,
123 TRUE );
124
126
127 } _SEH2_FINALLY {
128
129 if (!IrpContext->ExceptionInProgress) {
130 if (IrpContext) {
131 if (!CompleteRequest) {
132 IrpContext->Irp = NULL;
133 }
134
135 Ext2CompleteIrpContext(IrpContext, Status);
136 }
137 }
138 } _SEH2_END;
139
140 return Status;
141}
NTSTATUS NTAPI CompleteRequest(IN PIRP Irp, IN NTSTATUS Status, IN ULONG_PTR Information)
Definition: dispatch.c:19
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
NTSTATUS Ext2DeviceControlCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
Definition: devctl.c:50
@ EXT2VCB
Definition: ext2fs.h:462
struct _EXT2_VCB * PEXT2_VCB
IN OUT PVCB IN PDEVICE_OBJECT TargetDeviceObject
Definition: fatprocs.h:1674
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:490
if(dx< 0)
Definition: linetemp.h:194
#define IoCallDriver
Definition: irp.c:1225
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695

Referenced by Ext2DeviceControl().

◆ Ext2ProcessGlobalProperty()

NTSTATUS Ext2ProcessGlobalProperty ( IN PDEVICE_OBJECT  DeviceObject,
IN PEXT2_VOLUME_PROPERTY3  Property3,
IN ULONG  Length 
)

Definition at line 240 of file devctl.c.

245{
246 PEXT2_VOLUME_PROPERTY3 Property2 = (PVOID)Property3;
248 struct nls_table * PageTable = NULL;
249
251 BOOLEAN GlobalDataResourceAcquired = FALSE;
252
253 _SEH2_TRY {
254
255 if (Length < 8 || !IsFlagOn(Property->Flags, EXT2_FLAG_VP_SET_GLOBAL)) {
258 }
259
260 /* query Ext2Fsd's version and built date/time*/
261 if (Property->Command == APP_CMD_QUERY_VERSION) {
264
265 if (Length < sizeof(EXT2_VOLUME_PROPERTY_VERSION)) {
268 }
269
270 RtlZeroMemory(&PVPV->Date[0], 0x20);
271 RtlZeroMemory(&PVPV->Time[0], 0x20);
272 RtlZeroMemory(&PVPV->Version[0],0x1C);
273 strncpy(&PVPV->Version[0], gVersion, 0x1B);
274 strncpy(&PVPV->Date[0], gDate, 0x1F);
275 strncpy(&PVPV->Time[0], gTime, 0x1F);
277 }
278
279 /* must be property query/set commands */
280 if (Property->Command == APP_CMD_SET_PROPERTY) {
281 if (Length < sizeof(EXT2_VOLUME_PROPERTY)) {
284 }
285 } else if (Property->Command == APP_CMD_SET_PROPERTY2) {
286 if (Length < sizeof(EXT2_VOLUME_PROPERTY2)) {
289 }
290 } else if (Property->Command == APP_CMD_SET_PROPERTY3) {
291 if (Length < sizeof(EXT2_VOLUME_PROPERTY3)) {
294 }
295 } else {
298 }
299
301 GlobalDataResourceAcquired = TRUE;
302
303
304 switch (Property->Command) {
305
307
308 if (Property3->Flags2 & EXT2_VPROP3_AUTOMOUNT) {
309 if (Property3->AutoMount)
311 else
313 }
314
316
318 if ((Ext2Global->bHidingPrefix = Property2->bHidingPrefix)) {
320 Property2->sHidingPrefix,
321 HIDINGPAT_LEN - 1);
322 }
324 if ((Ext2Global->bHidingSuffix = Property2->bHidingSuffix)) {
326 Property2->sHidingSuffix,
327 HIDINGPAT_LEN - 1);
328 }
329
331
332 if (Property->bReadonly) {
335 } else {
337 if (Property->bExt3Writable) {
339 } else {
341 }
342 }
343
344 PageTable = load_nls(Property->Codepage);
345 if (PageTable) {
346 memcpy(Ext2Global->Codepage.AnsiName, Property->Codepage, CODEPAGE_MAXLEN);
347 Ext2Global->Codepage.PageTable = PageTable;
348 }
349
350 break;
351
352 default:
353 break;
354 }
355
356 } _SEH2_FINALLY {
357
358 if (GlobalDataResourceAcquired) {
360 }
361 } _SEH2_END;
362
363 return Status;
364}
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define APP_CMD_QUERY_VERSION
Definition: common.h:150
#define HIDINGPAT_LEN
Definition: common.h:160
struct _EXT2_VOLUME_PROPERTY_VERSION * PEXT2_VOLUME_PROPERTY_VERSION
#define CODEPAGE_MAXLEN
Definition: common.h:159
#define APP_CMD_SET_PROPERTY2
Definition: common.h:155
#define EXT2_VPROP3_AUTOMOUNT
Definition: common.h:203
#define APP_CMD_SET_PROPERTY3
Definition: common.h:157
#define EXT2_FLAG_VP_SET_GLOBAL
Definition: common.h:148
#define APP_CMD_SET_PROPERTY
Definition: common.h:153
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615
CHAR gDate[]
Definition: init.c:24
CHAR gVersion[]
Definition: init.c:22
CHAR gTime[]
Definition: init.c:23
#define SetLongFlag(_F, _SF)
Definition: ext2fs.h:258
#define ClearLongFlag(_F, _SF)
Definition: ext2fs.h:259
#define EXT2_SUPPORT_WRITING
Definition: ext2fs.h:591
#define EXT2_AUTO_MOUNT
Definition: ext2fs.h:594
#define EXT3_FORCE_WRITING
Definition: ext2fs.h:592
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
struct nls_table * load_nls(char *)
Definition: nls_base.c:218
struct _EXT2_GLOBAL::@688 Codepage
CHAR sHidingSuffix[HIDINGPAT_LEN]
Definition: ext2fs.h:574
BOOLEAN bHidingSuffix
Definition: ext2fs.h:573
ULONG Flags
Definition: ext2fs.h:523
BOOLEAN bHidingPrefix
Definition: ext2fs.h:571
CHAR sHidingPrefix[HIDINGPAT_LEN]
Definition: ext2fs.h:572
static PMEM_HOOK PageTable[TOTAL_PAGES]
Definition: memory.c:43
void * PVOID
Definition: typedefs.h:50
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

Referenced by Ext2ProcessUserProperty().

◆ Ext2ProcessUserProperty()

NTSTATUS Ext2ProcessUserProperty ( IN PEXT2_IRP_CONTEXT  IrpContext,
IN PEXT2_VOLUME_PROPERTY3  Property,
IN ULONG  Length 
)

Definition at line 591 of file devctl.c.

596{
600
601 _SEH2_TRY {
602
603 ASSERT(IrpContext != NULL);
604 ASSERT((IrpContext->Identifier.Type == EXT2ICX) &&
605 (IrpContext->Identifier.Size == sizeof(EXT2_IRP_CONTEXT)));
606
607 if (Property->Magic != EXT2_VOLUME_PROPERTY_MAGIC) {
610 }
611
612 DeviceObject = IrpContext->DeviceObject;
615 } else {
616 Vcb = (PEXT2_VCB) DeviceObject->DeviceExtension;
617 if (!((Vcb) && (Vcb->Identifier.Type == EXT2VCB) &&
618 (Vcb->Identifier.Size == sizeof(EXT2_VCB)))) {
621 }
623 }
624
625 if (NT_SUCCESS(Status)) {
626 IrpContext->Irp->IoStatus.Information = Length;
627 }
628
629 } _SEH2_FINALLY {
630
631 if (!IrpContext->ExceptionInProgress) {
632 Ext2CompleteIrpContext(IrpContext, Status);
633 }
634 } _SEH2_END;
635
636 return Status;
637}
#define EXT2_VOLUME_PROPERTY_MAGIC
Definition: common.h:146
NTSTATUS Ext2ProcessGlobalProperty(IN PDEVICE_OBJECT DeviceObject, IN PEXT2_VOLUME_PROPERTY3 Property3, IN ULONG Length)
Definition: devctl.c:240
NTSTATUS Ext2ProcessVolumeProperty(IN PEXT2_VCB Vcb, IN PEXT2_VOLUME_PROPERTY3 Property3, IN ULONG Length)
Definition: devctl.c:368

Referenced by Ext2DeviceControl().

◆ Ext2ProcessVolumeProperty()

NTSTATUS Ext2ProcessVolumeProperty ( IN PEXT2_VCB  Vcb,
IN PEXT2_VOLUME_PROPERTY3  Property3,
IN ULONG  Length 
)

Definition at line 368 of file devctl.c.

373{
374 struct nls_table * PageTable = NULL;
375 PEXT2_VOLUME_PROPERTY2 Property2 = (PVOID)Property3;
378 BOOLEAN VcbResourceAcquired = FALSE;
379
380 _SEH2_TRY {
381
382 ExAcquireResourceExclusiveLite(&Vcb->MainResource, TRUE);
383 VcbResourceAcquired = TRUE;
384
385 if (Property->Command == APP_CMD_SET_PROPERTY ||
386 Property->Command == APP_CMD_QUERY_PROPERTY) {
387 if (Length < sizeof(EXT2_VOLUME_PROPERTY)) {
390 }
391 } else if (Property->Command == APP_CMD_SET_PROPERTY2 ||
392 Property->Command == APP_CMD_QUERY_PROPERTY2) {
393 if (Length < sizeof(EXT2_VOLUME_PROPERTY2)) {
396 }
397 } else if (Property->Command == APP_CMD_SET_PROPERTY3 ||
398 Property->Command == APP_CMD_QUERY_PROPERTY3) {
399 if (Length < sizeof(EXT2_VOLUME_PROPERTY3)) {
402 }
403 }
404
405 switch (Property->Command) {
406
408
409 if (Property3->Flags2 & EXT2_VPROP3_AUTOMOUNT) {
410 if (Property3->AutoMount)
412 else
414 }
415 if (Property3->Flags2 & EXT2_VPROP3_USERIDS) {
416 SetFlag(Vcb->Flags, VCB_USER_IDS);
417 Vcb->uid = Property3->uid;
418 Vcb->gid = Property3->gid;
419 if (Property3->EIDS) {
420 Vcb->euid = Property3->euid;
421 Vcb->egid = Property3->egid;
422 SetFlag(Vcb->Flags, VCB_USER_EIDS);
423 } else {
424 Vcb->euid = Vcb->egid = 0;
425 ClearFlag(Vcb->Flags, VCB_USER_EIDS);
426 }
427 } else {
428 ClearFlag(Vcb->Flags, VCB_USER_IDS);
429 ClearFlag(Vcb->Flags, VCB_USER_EIDS);
430 Vcb->uid = Vcb->gid = 0;
431 Vcb->euid = Vcb->egid = 0;
432 }
433
435
436 RtlZeroMemory(Vcb->sHidingPrefix, HIDINGPAT_LEN);
437#ifdef __REACTOS__
438 if (Vcb->bHidingPrefix == Property2->bHidingPrefix) {
439#else
440 if (Vcb->bHidingPrefix = Property2->bHidingPrefix) {
441#endif
442 RtlCopyMemory( Vcb->sHidingPrefix,
443 Property2->sHidingPrefix,
444 HIDINGPAT_LEN - 1);
445 }
446
447 RtlZeroMemory(Vcb->sHidingSuffix, HIDINGPAT_LEN);
448#ifdef __REACTOS__
449 if (Vcb->bHidingSuffix == Property2->bHidingSuffix) {
450#else
451 if (Vcb->bHidingSuffix = Property2->bHidingSuffix) {
452#endif
453 RtlCopyMemory( Vcb->sHidingSuffix,
454 Property2->sHidingSuffix,
455 HIDINGPAT_LEN - 1);
456 }
457 Vcb->DrvLetter = Property2->DrvLetter;
458
460
461 if (Property->bReadonly) {
462 if (IsFlagOn(Vcb->Flags, VCB_INITIALIZED)) {
465 }
467
468 } else {
469
470 if (Property->bExt3Writable) {
472 }
473
474 if (!Vcb->IsExt3fs) {
476 } else if (!Property->bExt3Writable) {
478 } else if (IsFlagOn(Vcb->Flags, VCB_JOURNAL_RECOVER)) {
481 if (IsFlagOn(Vcb->Flags, VCB_JOURNAL_RECOVER)) {
483 } else {
485 }
486 } else {
488 }
489 }
490
491 PageTable = load_nls(Property->Codepage);
492 memcpy(Vcb->Codepage.AnsiName, Property->Codepage, CODEPAGE_MAXLEN);
493 Vcb->Codepage.PageTable = PageTable;
494 if (Vcb->Codepage.PageTable) {
495 Ext2InitializeLabel(Vcb, Vcb->SuperBlock);
496 }
497
498 break;
499
501
503 SetFlag(Property3->Flags2, EXT2_VPROP3_AUTOMOUNT);
504 Property3->AutoMount = TRUE;
505 } else {
506 ClearFlag(Property3->Flags2, EXT2_VPROP3_AUTOMOUNT);
507 Property3->AutoMount = FALSE;
508 }
509
510 if (IsFlagOn(Vcb->Flags, VCB_USER_IDS)) {
511 SetFlag(Property3->Flags2, EXT2_VPROP3_USERIDS);
512 Property3->uid = Vcb->uid;
513 Property3->gid = Vcb->gid;
514 if (IsFlagOn(Vcb->Flags, VCB_USER_EIDS)) {
515 Property3->EIDS = TRUE;
516 Property3->euid = Vcb->euid;
517 Property3->egid = Vcb->egid;
518 } else {
519 Property3->EIDS = FALSE;
520 }
521 } else {
522 ClearFlag(Property3->Flags2, EXT2_VPROP3_USERIDS);
523 }
524
526
527 RtlCopyMemory(Property2->UUID, Vcb->SuperBlock->s_uuid, 16);
528 Property2->DrvLetter = Vcb->DrvLetter;
529
530#ifdef __REACTOS__
531 if (Property2->bHidingPrefix == Vcb->bHidingPrefix) {
532#else
533 if (Property2->bHidingPrefix = Vcb->bHidingPrefix) {
534#endif
535 RtlCopyMemory( Property2->sHidingPrefix,
536 Vcb->sHidingPrefix,
538 } else {
539 RtlZeroMemory( Property2->sHidingPrefix,
541 }
542
543#ifdef __REACTOS__
544 if (Property2->bHidingSuffix == Vcb->bHidingSuffix) {
545#else
546 if (Property2->bHidingSuffix = Vcb->bHidingSuffix) {
547#endif
548 RtlCopyMemory( Property2->sHidingSuffix,
549 Vcb->sHidingSuffix,
551 } else {
552 RtlZeroMemory( Property2->sHidingSuffix,
554 }
555
557
558 Property->bExt2 = TRUE;
559 Property->bExt3 = Vcb->IsExt3fs;
560 Property->bReadonly = IsFlagOn(Vcb->Flags, VCB_READ_ONLY);
561 if (!Property->bReadonly && Vcb->IsExt3fs) {
562 Property->bExt3Writable = TRUE;
563 } else {
564 Property->bExt3Writable = FALSE;
565 }
566
568 if (Vcb->Codepage.PageTable) {
569 strncpy(Property->Codepage, Vcb->Codepage.PageTable->charset, CODEPAGE_MAXLEN);
570 } else {
571 strncpy(Property->Codepage, "default", CODEPAGE_MAXLEN);
572 }
573 break;
574
575 default:
577 break;
578 }
579
580 } _SEH2_FINALLY {
581
582 if (VcbResourceAcquired) {
583 ExReleaseResourceLite(&Vcb->MainResource);
584 }
585 } _SEH2_END;
586
587 return Status;
588}
#define APP_CMD_QUERY_PROPERTY2
Definition: common.h:154
#define APP_CMD_QUERY_PROPERTY3
Definition: common.h:156
#define EXT2_VPROP3_USERIDS
Definition: common.h:204
#define APP_CMD_QUERY_PROPERTY
Definition: common.h:152
NTSTATUS Ext2InitializeLabel(IN PEXT2_VCB Vcb, IN PEXT2_SUPER_BLOCK Sb)
Definition: memory.c:2253
#define ClearFlag(_F, _SF)
Definition: ext2fs.h:191
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define VCB_READ_ONLY
Definition: ext2fs.h:804
#define VCB_INITIALIZED
Definition: ext2fs.h:788
#define VCB_JOURNAL_RECOVER
Definition: ext2fs.h:801
INT Ext2RecoverJournal(PEXT2_IRP_CONTEXT IrpContext, PEXT2_VCB Vcb)
Definition: recover.c:95
#define VCB_FORCE_WRITING
Definition: ext2fs.h:799
#define VCB_USER_IDS
Definition: ext2fs.h:794
NTSTATUS Ext2FlushFiles(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN BOOLEAN bShutDown)
Definition: flush.c:112
NTSTATUS Ext2FlushVolume(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN BOOLEAN bShutDown)
Definition: flush.c:43
#define VCB_USER_EIDS
Definition: ext2fs.h:795
BOOLEAN bHidingPrefix
Definition: common.h:192
CHAR sHidingSuffix[HIDINGPAT_LEN]
Definition: common.h:195
BOOLEAN bHidingSuffix
Definition: common.h:193
CHAR sHidingPrefix[HIDINGPAT_LEN]
Definition: common.h:194

Referenced by Ext2PerformRegistryVolumeParams(), and Ext2ProcessUserProperty().

Variable Documentation

◆ Ext2Global

PEXT2_GLOBAL Ext2Global
extern

◆ gDate

CHAR gDate[]
extern

Definition at line 24 of file init.c.

Referenced by Ext2ProcessGlobalProperty().

◆ gTime

CHAR gTime[]
extern

Definition at line 23 of file init.c.

Referenced by Ext2ProcessGlobalProperty().

◆ gVersion

CHAR gVersion[]
extern

Definition at line 22 of file init.c.

Referenced by Ext2ProcessGlobalProperty(), kbd_c(), kbd_h(), and kbd_rc().