| 357 | |
| 358 | |
| 359 | NTSTATUS |
| 360 | Ext2ProcessVolumeProperty( |
| 361 | IN PEXT2_VCB Vcb, |
| 362 | IN PEXT2_VOLUME_PROPERTY3 Property3, |
| 363 | IN ULONG Length |
| 364 | ) |
| 365 | { |
| 366 | struct nls_table * PageTable = NULL; |
| 367 | PEXT2_VOLUME_PROPERTY2 Property2 = (PVOID)Property3; |
| 368 | PEXT2_VOLUME_PROPERTY Property = (PVOID)Property3; |
| 369 | NTSTATUS Status = STATUS_SUCCESS; |
| 370 | BOOLEAN VcbResourceAcquired = FALSE; |
| 371 | |
| 372 | __try { |
| 373 | |
| 374 | ExAcquireResourceExclusiveLite(&Vcb->MainResource, TRUE); |
| 375 | VcbResourceAcquired = TRUE; |
| 376 | |
| 377 | if (Property->Command == APP_CMD_SET_PROPERTY || |
| 378 | Property->Command == APP_CMD_QUERY_PROPERTY) { |
| 379 | if (Length < sizeof(EXT2_VOLUME_PROPERTY)) { |
| 380 | Status = STATUS_INVALID_PARAMETER; |
| 381 | __leave; |
| 382 | } |
| 383 | } else if (Property->Command == APP_CMD_SET_PROPERTY2 || |
| 384 | Property->Command == APP_CMD_QUERY_PROPERTY2) { |
| 385 | if (Length < sizeof(EXT2_VOLUME_PROPERTY2)) { |
| 386 | Status = STATUS_INVALID_PARAMETER; |
| 387 | __leave; |
| 388 | } |
| 389 | } else if (Property->Command == APP_CMD_SET_PROPERTY3 || |
| 390 | Property->Command == APP_CMD_QUERY_PROPERTY3) { |
| 391 | if (Length < sizeof(EXT2_VOLUME_PROPERTY3)) { |
| 392 | Status = STATUS_INVALID_PARAMETER; |
| 393 | __leave; |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | switch (Property->Command) { |
| 398 | |
| 399 | case APP_CMD_SET_PROPERTY3: |
| 400 | |
| 401 | if (Property3->Flags2 & EXT2_VPROP3_AUTOMOUNT) { |
| 402 | if (Property3->AutoMount) |
| 403 | SetLongFlag(Ext2Global->Flags, EXT2_AUTO_MOUNT); |
| 404 | else |
| 405 | ClearLongFlag(Ext2Global->Flags, EXT2_AUTO_MOUNT); |
| 406 | } |
| 407 | if (Property3->Flags2 & EXT2_VPROP3_USERIDS) { |
| 408 | SetFlag(Vcb->Flags, VCB_USER_IDS); |
| 409 | Vcb->uid = Property3->uid; |
| 410 | Vcb->gid = Property3->gid; |
| 411 | if (Property3->EIDS) { |
| 412 | Vcb->euid = Property3->euid; |
| 413 | Vcb->egid = Property3->egid; |
| 414 | SetFlag(Vcb->Flags, VCB_USER_EIDS); |
| 415 | } else { |
| 416 | Vcb->euid = Vcb->egid = 0; |
no test coverage detected