MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2ExceptionHandler

Function Ext2ExceptionHandler

Ext4Fsd/except.c:111–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109
110
111NTSTATUS
112Ext2ExceptionHandler (IN PEXT2_IRP_CONTEXT IrpContext)
113{
114 NTSTATUS Status;
115
116 if (IrpContext) {
117
118 if ( (IrpContext->Identifier.Type != EXT2ICX) ||
119 (IrpContext->Identifier.Size != sizeof(EXT2_IRP_CONTEXT))) {
120 DbgBreak();
121 return STATUS_UNSUCCESSFUL;
122 }
123
124 Status = IrpContext->ExceptionCode;
125
126 if (IrpContext->Irp) {
127
128 //
129 // Check if this error is a result of user actions
130 //
131
132 PEXT2_VCB Vcb = NULL;
133 PIRP Irp = IrpContext->Irp;
134 PIO_STACK_LOCATION IrpSp;
135
136 IrpSp = IoGetCurrentIrpStackLocation(Irp);
137 Vcb = (PEXT2_VCB) IrpContext->DeviceObject->DeviceExtension;
138
139 if (NULL == Vcb) {
140 Status = STATUS_INVALID_PARAMETER;
141 } else if (Vcb->Identifier.Type != EXT2VCB) {
142 Status = STATUS_INVALID_PARAMETER;
143 } else if (!IsMounted(Vcb)) {
144 if (IsFlagOn(Vcb->Flags, VCB_DEVICE_REMOVED)) {
145 Status = STATUS_NO_SUCH_DEVICE;
146 } else {
147 Status = STATUS_VOLUME_DISMOUNTED;
148 }
149 } else {
150
151 /* queue it again if our request is at top level */
152 if (IrpContext->IsTopLevel &&
153 ((Status == STATUS_CANT_WAIT) ||
154 ((Status == STATUS_VERIFY_REQUIRED) &&
155 (KeGetCurrentIrql() >= APC_LEVEL)))) {
156
157 Status = Ext2QueueRequest(IrpContext);
158 }
159 }
160
161 if (Status == STATUS_PENDING) {
162 goto errorout;
163 }
164
165 Irp->IoStatus.Status = Status;
166
167 if (IoIsErrorUserInduced(Status)) {
168

Callers 3

Ext2DeQueueRequestFunction · 0.85
Ext2BuildRequestFunction · 0.85
Ext2DeQueueCloseRequestFunction · 0.85

Calls 4

Ext2QueueRequestFunction · 0.85
Ext2CheckDismountFunction · 0.85
Ext2CompleteIrpContextFunction · 0.85
Ext2FreeIrpContextFunction · 0.85

Tested by

no test coverage detected