int FloppyPnp(int DeviceObject , int Irp ) 
{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ;
  int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ;
  int Irp__IoStatus__Information ;
  int Irp__IoStatus__Status ;
  int Irp__CurrentLocation = __VERIFIER_nondet_int() ;
  int disketteExtension__IsRemoved = __VERIFIER_nondet_int() ;
  int disketteExtension__IsStarted = __VERIFIER_nondet_int() ;
  int disketteExtension__TargetObject = __VERIFIER_nondet_int() ;
  int disketteExtension__HoldNewRequests ;
  int disketteExtension__FloppyThread = __VERIFIER_nondet_int() ;
  int disketteExtension__InterfaceString__Buffer = __VERIFIER_nondet_int() ;
  int disketteExtension__InterfaceString = __VERIFIER_nondet_int() ;
  int disketteExtension__ArcName__Length = __VERIFIER_nondet_int() ;
  int disketteExtension__ArcName = __VERIFIER_nondet_int() ;
  int irpSp__MinorFunction = __VERIFIER_nondet_int() ;
  int IoGetConfigurationInformation__FloppyCount = __VERIFIER_nondet_int() ;
  int irpSp ;
  int disketteExtension ;
  int ntStatus ;
  int doneEvent = __VERIFIER_nondet_int() ;
  int irpSp___0 ;
  int nextIrpSp ;
  int nextIrpSp__Control ;
  int irpSp___1 ;
  int irpSp__Context ;
  int irpSp__Control ;
  long __cil_tmp29 ;
  long __cil_tmp30 ;

  {
  ntStatus = 0;
  PagingReferenceCount ++;
  if (PagingReferenceCount == 1) {

  }
  disketteExtension = DeviceObject__DeviceExtension;
  irpSp = Irp__Tail__Overlay__CurrentStackLocation;
  if (disketteExtension__IsRemoved) {
    {
    Irp__IoStatus__Information = 0;
    Irp__IoStatus__Status = -1073741738;
    myStatus = -1073741738;
    IofCompleteRequest(Irp, 0);
    }
    return (-1073741738);
  }
  if (irpSp__MinorFunction == 0) {
    goto switch_0_0;
  } else {
    if (irpSp__MinorFunction == 5) {
      goto switch_0_5;
    } else {
      if (irpSp__MinorFunction == 1) {
        goto switch_0_5;
      } else {
        if (irpSp__MinorFunction == 6) {
          goto switch_0_6;
        } else {
          if (irpSp__MinorFunction == 3) {
            goto switch_0_6;
          } else {
            if (irpSp__MinorFunction == 4) {
              goto switch_0_4;
            } else {
              if (irpSp__MinorFunction == 2) {
                goto switch_0_2;
              } else {
                goto switch_0_default;
                if (0) {
                  switch_0_0: 
                  {
                  ntStatus = FloppyStartDevice(DeviceObject, Irp);
                  }
                  goto switch_0_break;
                  switch_0_5: 
                  if (irpSp__MinorFunction == 5) {

                  }
                  if (! disketteExtension__IsStarted) {
                    if (s == NP) {
                      s = SKIP1;
                    } else {
                      {
                      errorFn();
                      }
                    }
                    {
                    Irp__CurrentLocation ++;
                    Irp__Tail__Overlay__CurrentStackLocation ++;
                    ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                    }
                    return (ntStatus);
                  }
                  {
                  disketteExtension__HoldNewRequests = 1;
                  ntStatus = FlQueueIrpToThread(Irp, disketteExtension);
                  }
                  {
                  __cil_tmp29 = (long )ntStatus;
                  if (__cil_tmp29 == 259L) {
                    {
                    KeWaitForSingleObject(disketteExtension__FloppyThread, Executive,
                                          KernelMode, 0, 0);
                    }
                    if (disketteExtension__FloppyThread != 0) {

                    }
                    disketteExtension__FloppyThread = 0;
                    Irp__IoStatus__Status = 0;
                    myStatus = 0;
                    if (s == NP) {
                      s = SKIP1;
                    } else {
                      {
                      errorFn();
                      }
                    }
                    {
                    Irp__CurrentLocation ++;
                    Irp__Tail__Overlay__CurrentStackLocation ++;
                    ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                    }
                  } else {
                    {
                    ntStatus = -1073741823;
                    Irp__IoStatus__Status = ntStatus;
                    myStatus = ntStatus;
                    Irp__IoStatus__Information = 0;
                    IofCompleteRequest(Irp, 0);
                    }
                  }
                  }
                  goto switch_0_break;
                  switch_0_6: 
                  if (irpSp__MinorFunction == 6) {

                  }
                  if (! disketteExtension__IsStarted) {
                    Irp__IoStatus__Status = 0;
                    myStatus = 0;
                    if (s == NP) {
                      s = SKIP1;
                    } else {
                      {
                      errorFn();
                      }
                    }
                    {
                    Irp__CurrentLocation ++;
                    Irp__Tail__Overlay__CurrentStackLocation ++;
                    ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                    }
                  } else {
                    Irp__IoStatus__Status = 0;
                    myStatus = 0;
                    irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation;
                    nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1;
                    nextIrpSp__Control = 0;
                    if (s != NP) {
                      {
                      errorFn();
                      }
                    } else {
                      if (compRegistered != 0) {
                        {
                        errorFn();
                        }
                      } else {
                        compRegistered = 1;
                      }
                    }
                    {
                    irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1;
                    irpSp__Context = doneEvent;
                    irpSp__Control = 224;
                    ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                    }
                    {
                    __cil_tmp30 = (long )ntStatus;
                    if (__cil_tmp30 == 259L) {
                      {
                      KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0);
                      ntStatus = myStatus;
                      }
                    }
                    }
                    {
                    disketteExtension__HoldNewRequests = 0;
                    Irp__IoStatus__Status = ntStatus;
                    myStatus = ntStatus;
                    Irp__IoStatus__Information = 0;
                    IofCompleteRequest(Irp, 0);
                    }
                  }
                  goto switch_0_break;
                  switch_0_4: 
                  disketteExtension__IsStarted = 0;
                  Irp__IoStatus__Status = 0;
                  myStatus = 0;
                  if (s == NP) {
                    s = SKIP1;
                  } else {
                    {
                    errorFn();
                    }
                  }
                  {
                  Irp__CurrentLocation ++;
                  Irp__Tail__Overlay__CurrentStackLocation ++;
                  ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                  }
                  goto switch_0_break;
                  switch_0_2: 
                  disketteExtension__HoldNewRequests = 0;
                  disketteExtension__IsStarted = 0;
                  disketteExtension__IsRemoved = 1;
                  if (s == NP) {
                    s = SKIP1;
                  } else {
                    {
                    errorFn();
                    }
                  }
                  {
                  Irp__CurrentLocation ++;
                  Irp__Tail__Overlay__CurrentStackLocation ++;
                  Irp__IoStatus__Status = 0;
                  myStatus = 0;
                  ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                  }
                  if (disketteExtension__InterfaceString__Buffer != 0) {
                    {
                    IoSetDeviceInterfaceState(disketteExtension__InterfaceString,
                                              0);
                    }
                  }
                  if (disketteExtension__ArcName__Length != 0) {
                    {
                    IoDeleteSymbolicLink(disketteExtension__ArcName);
                    }
                  }
                  IoGetConfigurationInformation__FloppyCount --;
                  goto switch_0_break;
                  switch_0_default: ;
                  if (s == NP) {
                    s = SKIP1;
                  } else {
                    {
                    errorFn();
                    }
                  }
                  {
                  Irp__CurrentLocation ++;
                  Irp__Tail__Overlay__CurrentStackLocation ++;
                  ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                  }
                } else {
                  switch_0_break: ;
                }
              }
            }
          }
        }
      }
    }
  }
  PagingReferenceCount --;
  if (PagingReferenceCount == 0) {

  }
  return (ntStatus);
}
}
Ejemplo n.º 2
0
int FloppyPnp(int DeviceObject , int Irp ) 
{ int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ;
  int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ;
  int Irp__IoStatus__Information ;
  int Irp__IoStatus__Status ;
  int Irp__CurrentLocation = __VERIFIER_nondet_int() ;
  int disketteExtension__IsRemoved = __VERIFIER_nondet_int() ;
  int disketteExtension__IsStarted = __VERIFIER_nondet_int() ;
  int disketteExtension__TargetObject = __VERIFIER_nondet_int() ;
  int disketteExtension__HoldNewRequests ;
  int disketteExtension__FloppyThread = __VERIFIER_nondet_int() ;
  int disketteExtension__InterfaceString__Buffer = __VERIFIER_nondet_int() ;
  int disketteExtension__InterfaceString = __VERIFIER_nondet_int() ;
  int disketteExtension__ArcName__Length = __VERIFIER_nondet_int() ;
  int disketteExtension__ArcName = __VERIFIER_nondet_int() ;
  int irpSp__MinorFunction = __VERIFIER_nondet_int() ;
  int IoGetConfigurationInformation__FloppyCount = __VERIFIER_nondet_int() ;
  int irpSp ;
  int disketteExtension ;
  int ntStatus ;
  int doneEvent = __VERIFIER_nondet_int() ;
  int irpSp___0 ;
  int nextIrpSp ;
  int nextIrpSp__Control ;
  int irpSp___1 ;
  int irpSp__Context ;
  int irpSp__Control ;
  long __cil_tmp29 ;
  long __cil_tmp30 ;

  {
#line 197
  ntStatus = 0;
#line 198
  PagingReferenceCount ++;
#line 199
  if (PagingReferenceCount == 1) {

  }
#line 204
  disketteExtension = DeviceObject__DeviceExtension;
#line 205
  irpSp = Irp__Tail__Overlay__CurrentStackLocation;
#line 206
  if (disketteExtension__IsRemoved) {
    {
#line 208
    Irp__IoStatus__Information = 0;
#line 209
    Irp__IoStatus__Status = -1073741738;
#line 210
    myStatus = -1073741738;
#line 211
    IofCompleteRequest(Irp, 0);
    }
#line 213
    return (-1073741738);
  }
#line 217
  if (irpSp__MinorFunction == 0) {
    goto switch_0_0;
  } else {
#line 220
    if (irpSp__MinorFunction == 5) {
      goto switch_0_5;
    } else {
#line 223
      if (irpSp__MinorFunction == 1) {
        goto switch_0_5;
      } else {
#line 226
        if (irpSp__MinorFunction == 6) {
          goto switch_0_6;
        } else {
#line 229
          if (irpSp__MinorFunction == 3) {
            goto switch_0_6;
          } else {
#line 232
            if (irpSp__MinorFunction == 4) {
              goto switch_0_4;
            } else {
#line 235
              if (irpSp__MinorFunction == 2) {
                goto switch_0_2;
              } else {
                goto switch_0_default;
#line 240
                if (0) {
                  switch_0_0: 
                  {
#line 243
                  ntStatus = FloppyStartDevice(DeviceObject, Irp);
                  }
                  goto switch_0_break;
                  switch_0_5: 
#line 248
                  if (irpSp__MinorFunction == 5) {

                  }
#line 253
                  if (! disketteExtension__IsStarted) {
#line 254
                    if (s == NP) {
#line 255
                      s = SKIP1;
                    } else {
                      {
#line 258
                      errorFn();
                      }
                    }
                    {
#line 262
                    Irp__CurrentLocation ++;
#line 263
                    Irp__Tail__Overlay__CurrentStackLocation ++;
#line 264
                    ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                    }
#line 266
                    return (ntStatus);
                  }
                  {
#line 271
                  disketteExtension__HoldNewRequests = 1;
#line 272
                  ntStatus = FlQueueIrpToThread(Irp, disketteExtension);
                  }
                  {
#line 274
                  __cil_tmp29 = (long )ntStatus;
#line 274
                  if (__cil_tmp29 == 259L) {
                    {
#line 276
                    KeWaitForSingleObject(disketteExtension__FloppyThread, Executive,
                                          KernelMode, 0, 0);
                    }
#line 279
                    if (disketteExtension__FloppyThread != 0) {

                    }
#line 284
                    disketteExtension__FloppyThread = 0;
#line 285
                    Irp__IoStatus__Status = 0;
#line 286
                    myStatus = 0;
#line 287
                    if (s == NP) {
#line 288
                      s = SKIP1;
                    } else {
                      {
#line 291
                      errorFn();
                      }
                    }
                    {
#line 295
                    Irp__CurrentLocation ++;
#line 296
                    Irp__Tail__Overlay__CurrentStackLocation ++;
#line 297
                    ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                    }
                  } else {
                    {
#line 301
                    ntStatus = -1073741823;
#line 302
                    Irp__IoStatus__Status = ntStatus;
#line 303
                    myStatus = ntStatus;
#line 304
                    Irp__IoStatus__Information = 0;
#line 305
                    IofCompleteRequest(Irp, 0);
                    }
                  }
                  }
                  goto switch_0_break;
                  switch_0_6: 
#line 311
                  if (irpSp__MinorFunction == 6) {

                  }
#line 316
                  if (! disketteExtension__IsStarted) {
#line 317
                    Irp__IoStatus__Status = 0;
#line 318
                    myStatus = 0;
#line 319
                    if (s == NP) {
#line 320
                      s = SKIP1;
                    } else {
                      {
#line 323
                      errorFn();
                      }
                    }
                    {
#line 327
                    Irp__CurrentLocation ++;
#line 328
                    Irp__Tail__Overlay__CurrentStackLocation ++;
#line 329
                    ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                    }
                  } else {
#line 332
                    Irp__IoStatus__Status = 0;
#line 333
                    myStatus = 0;
#line 334
                    irpSp___0 = Irp__Tail__Overlay__CurrentStackLocation;
#line 335
                    nextIrpSp = Irp__Tail__Overlay__CurrentStackLocation - 1;
#line 336
                    nextIrpSp__Control = 0;
#line 337
                    if (s != NP) {
                      {
#line 339
                      errorFn();
                      }
                    } else {
#line 342
                      if (compRegistered != 0) {
                        {
#line 344
                        errorFn();
                        }
                      } else {
#line 347
                        compRegistered = 1;
                      }
                    }
                    {
#line 351
                    irpSp___1 = Irp__Tail__Overlay__CurrentStackLocation - 1;
#line 352
                    irpSp__Context = doneEvent;
#line 353
                    irpSp__Control = 224;
#line 357
                    ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                    }
                    {
#line 359
                    __cil_tmp30 = (long )ntStatus;
#line 359
                    if (__cil_tmp30 == 259L) {
                      {
#line 361
                      KeWaitForSingleObject(doneEvent, Executive, KernelMode, 0, 0);
#line 362
                      ntStatus = myStatus;
                      }
                    }
                    }
                    {
#line 368
                    disketteExtension__HoldNewRequests = 0;
#line 369
                    Irp__IoStatus__Status = ntStatus;
#line 370
                    myStatus = ntStatus;
#line 371
                    Irp__IoStatus__Information = 0;
#line 372
                    IofCompleteRequest(Irp, 0);
                    }
                  }
                  goto switch_0_break;
                  switch_0_4: 
#line 377
                  disketteExtension__IsStarted = 0;
#line 378
                  Irp__IoStatus__Status = 0;
#line 379
                  myStatus = 0;
#line 380
                  if (s == NP) {
#line 381
                    s = SKIP1;
                  } else {
                    {
#line 384
                    errorFn();
                    }
                  }
                  {
#line 388
                  Irp__CurrentLocation ++;
#line 389
                  Irp__Tail__Overlay__CurrentStackLocation ++;
#line 390
                  ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                  }
                  goto switch_0_break;
                  switch_0_2: 
#line 394
                  disketteExtension__HoldNewRequests = 0;
#line 395
                  disketteExtension__IsStarted = 0;
#line 396
                  disketteExtension__IsRemoved = 1;
#line 397
                  if (s == NP) {
#line 398
                    s = SKIP1;
                  } else {
                    {
#line 401
                    errorFn();
                    }
                  }
                  {
#line 405
                  Irp__CurrentLocation ++;
#line 406
                  Irp__Tail__Overlay__CurrentStackLocation ++;
#line 407
                  Irp__IoStatus__Status = 0;
#line 408
                  myStatus = 0;
#line 409
                  ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                  }
#line 411
                  if (disketteExtension__InterfaceString__Buffer != 0) {
                    {
#line 413
                    IoSetDeviceInterfaceState(disketteExtension__InterfaceString,
                                              0);
                    }
                  }
#line 419
                  if (disketteExtension__ArcName__Length != 0) {
                    {
#line 421
                    IoDeleteSymbolicLink(disketteExtension__ArcName);
                    }
                  }
#line 426
                  IoGetConfigurationInformation__FloppyCount --;
                  goto switch_0_break;
                  switch_0_default: ;
#line 429
                  if (s == NP) {
#line 430
                    s = SKIP1;
                  } else {
                    {
#line 433
                    errorFn();
                    }
                  }
                  {
#line 437
                  Irp__CurrentLocation ++;
#line 438
                  Irp__Tail__Overlay__CurrentStackLocation ++;
#line 439
                  ntStatus = IofCallDriver(disketteExtension__TargetObject, Irp);
                  }
                } else {
                  switch_0_break: ;
                }
              }
            }
          }
        }
      }
    }
  }
#line 452
  PagingReferenceCount --;
#line 453
  if (PagingReferenceCount == 0) {

  }
#line 458
  return (ntStatus);
}
}